Skip to content

Commit

Permalink
Merge pull request #183 from end2endzone/feature-issue108
Browse files Browse the repository at this point in the history
Feature issue108 (fixes #108)
  • Loading branch information
end2endzone authored Oct 27, 2024
2 parents 5ada8a0 + a677788 commit 9ea8045
Show file tree
Hide file tree
Showing 23 changed files with 583 additions and 111 deletions.
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Changes for 0.10.0

* **Breaking change:** The _Configuration Files_ directory has moved from `%USERPROFILE%\ShellAnything` to `%USERPROFILE%\ShellAnything\configurations`. Configuration Files in the old directory will move to the new directory automatically on application first launch. Other files in `%USERPROFILE%\ShellAnything` will not be moved.
* **Breaking change:** The _logs_ directory has moved from `%USERPROFILE%\ShellAnything\Logs` to `%LOCALAPPDATA%\ShellAnything\logs`. The previous logs directory will be removed on application first launch.
* ShellAnything has a new high-resolution logo icon!
* Shellanything now features verbose logging mode and command line arguments debugging tools.
* ShellAnything now packages icons from [icons8/flat-color-icons](https://github.com/icons8/flat-color-icons)
* ShellAnything now packages icons from [icons8/flat-color-icons](https://github.com/icons8/flat-color-icons).

Fixes:
* Fixed issue #6 : (twice) Right-click on a directory with Windows Explorer in the left panel shows the menus twice.
* Fixed issue #31 : (twice) Error in logs for CContextMenu::GetCommandString()
* Fixed issue #108: Separate location for log files ? (and exclusions?)
* Fixed issue #109: Implement default and verbose logging.
* Fixed issue #110: Create a simple command line arguments debugging application.
* Fixed issue #148: Can't uninstall.
Expand Down
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,18 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/shellanything-config-version.cma
configure_file(${CMAKE_SOURCE_DIR}/cmake/shellanything-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/shellanything-config.cmake @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/shellanything-config.cmake DESTINATION ${SHELLANYTHING_INSTALL_CMAKE_DIR})

install(FILES ${CMAKE_SOURCE_DIR}/resources/register.bat
${CMAKE_SOURCE_DIR}/resources/unregister.bat
install(FILES ${CMAKE_SOURCE_DIR}/resources/installer/bin/register.bat
${CMAKE_SOURCE_DIR}/resources/installer/bin/unregister.bat
DESTINATION ${SHELLANYTHING_INSTALL_BIN_DIR})

# Resources
install(DIRECTORY "${CMAKE_SOURCE_DIR}/resources/configurations" DESTINATION ${SHELLANYTHING_INSTALL_RESOURCE_DIR})
install(DIRECTORY "${CMAKE_SOURCE_DIR}/resources/Windows Icon Tables" DESTINATION ${SHELLANYTHING_INSTALL_RESOURCE_DIR})
install(FILES ${CMAKE_SOURCE_DIR}/resources/icons/shellanything.ico
${CMAKE_SOURCE_DIR}/resources/icons/0.1.0.ico
${CMAKE_SOURCE_DIR}/resources/icons/0.2.0.ico
${CMAKE_SOURCE_DIR}/resources/icons/0.2.0-16x16-legacy.ico
DESTINATION ${SHELLANYTHING_INSTALL_RESOURCE_DIR}/icons)

install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/shellanything DESTINATION ${SHELLANYTHING_INSTALL_INCLUDE_DIR})
install(FILES ${SHELLANYTHING_EXPORT_HEADER}
Expand All @@ -390,7 +396,6 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses DESTINATION ${SHELLANYTHING_INSTA
install(FILES ${CMAKE_SOURCE_DIR}/docs/screenshot_file.png
${CMAKE_SOURCE_DIR}/docs/screenshot_folder.png
${CMAKE_SOURCE_DIR}/docs/ShellAnything-splashscreen.jpg
${CMAKE_SOURCE_DIR}/resources/icons/shellanything.ico
${CMAKE_CURRENT_BINARY_DIR}/sa_plugin_demo.zip
DESTINATION ${SHELLANYTHING_INSTALL_DOC_DIR})

Expand Down Expand Up @@ -469,7 +474,7 @@ set(CPACK_PACKAGE_EXECUTABLES
# This is intended behavior for ShellAnything.
set(CPACK_WIX_UPGRADE_GUID "EBEF1698-CA72-480A-9FE3-E8A08E7E03ED") # as per v0.7.0 and older

set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/resources/wix_license_template.rtf")
set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/resources/installer/wix_license_template.rtf")
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/resources/icons/shellanything.ico")
set(CPACK_WIX_HELP_LINK "https://github.com/end2endzone/ShellAnything")
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${PROJECT_NAME}")
Expand Down
72 changes: 59 additions & 13 deletions UserManual.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This manual includes a description of the system functionalities and capabilitie
* [Multi-selection-based properties](#multi-selection-based-properties)
* [Fixed properties](#fixed-properties)
* [Default properties](#default-properties)
* [Environment variables](#environment-variables)
* [Environment Variables options](#environment-variables-options)
* [Tools](#tools)
* [file_explorer_renew](#file_explorer_renew)
* [arguments.debugger](#argumentsdebugger)
Expand Down Expand Up @@ -79,6 +79,7 @@ This manual includes a description of the system functionalities and capabilitie
* [Troubleshooting](#troubleshooting)
* [Logging support](#logging-support)
* [Checkout the _Tools_ section](#tools)
* [Change the rendering order of your system's shell extension menus](#change-the-rendering-order-of-your-systems-shell-extension-menus)
* [Missing ampersand character (`&`) in menus](#missing-ampersand-character--in-menus)
* [Reporting bugs](#reporting-bugs)

Expand Down Expand Up @@ -168,14 +169,16 @@ A *configuration file* contains the definition of all [<menu>](#Menu) elem

When a user right-click on a file in *Windows Explorer*, the application will load all available *configuration files* and display their content into the displayed context menu.

The list of *Configuration Files* is unique for each users of the system. The files are stored in `C:\Users\%USERNAME%\ShellAnything` directory where `%USERNAME%` is your current Windows session *username*. Note that *Windows Explorer* also support copy & pasting `C:\Users\%USERNAME%\ShellAnything` into an *address bar* to quickly jump to the directory.
The list of *Configuration Files* is unique for each users of the system. The files are stored in `C:\Users\%USERNAME%\ShellAnything\configurations` directory where `%USERNAME%` is your current Windows session *username*. Note that you can paste `C:\Users\%USERNAME%\ShellAnything\configurations` into an *address bar* of *Windows Explorer* to quickly jump to the directory.

The application support multiple *configuration files* at the same time. One can add new files in the *configuration directory* and the system will automatically detect and load them.

When a *configuration file* is deleted, the application automatically detect the missing file and properly unload the associated menus which stop displaying their content.

To temporary disable a *configuration file*, one can simply change the file extension from `xml` to `txt`. Change the file extension back to `xml` to re-enable the file.

**Note:** The *Configuration Files* directory can be modified with the `SA_OPTION_CONFIGURATIONS_DIR` environment variable option. See [Environment Variables options](#environment-variables-options) section for details.



## Basic Xml Document ##
Expand Down Expand Up @@ -1720,9 +1723,21 @@ The system will generates the following property values (note the `\r\n` charact

If you need more flexibility when dealing with multiple files, the system defines the property `selection.multi.separator` that allows customizing the separator when combining multiple files.

By default, this property is set to the value `\r\n` (new line) when the application initialize.
By default, this property is set to the value `\r\n` (new line) when the application initialize.

The property can be modified at any time using a [<property>](#property-action) action or with the [<default>](#default) element to change it globally.

The property can be modified at any time using a [<property>](#property-action) action for changing the property when a menu is executed or with the [<default>](#default) element to change the value globally (when the `Configuration File` is loaded).
If you mostly need the opposite of the default behavior (double-quotes instead of CRLF), override the value of the property globally when the `Configuration File` is loaded :
```xml
<?xml version="1.0" encoding="utf-8"?>
<root>
<shell>
<default>
<property name="selection.multi.separator" value="&quot; &quot;" />
</default>
</shell>
</root>
```

To reset the property back to the default value, use the following &lt;property&gt; action:
```xml
Expand All @@ -1731,7 +1746,7 @@ To reset the property back to the default value, use the following &lt;property&

**Example #1:**

If an executable must get the list of selected files in a single command line (one after the other), one can set the property `selection.multi.separator` to `" "` (double quote, space, double quote) and use the string `"${selection.path}"` (including the double quotes) to get the required expanded value:
If an executable must get the list of selected files in a single command line (one after the other), one can temporary set the property `selection.multi.separator` to `" "` (double quote, space, double quote) and use the string `"${selection.path}"` (including the double quotes) to get the required expanded value:

```xml
<actions>
Expand All @@ -1740,13 +1755,15 @@ If an executable must get the list of selected files in a single command line (o
<property name="selection.multi.separator" value="${line.separator}" />
</actions>
```

Which result in the following expanded value:
```
"C:\Program Files (x86)\Winamp\libFLAC.dll" "C:\Program Files (x86)\Winamp\winamp.exe" "C:\Program Files (x86)\Winamp\zlib.dll"
```

**Example #2:**

Assume that you want to run a specific command on each of the selected files (for example reset the files attributes), one can set the property `selection.multi.separator` to `${line.separator}attrib -r -a -s -h "` (including the ending double quote character) and use the string `attrib -r -a -s -h "${selection.filename}"` (including the double quotes) to get the following expanded value:
Assume that you want to run a specific command on each of the selected files (for example reset the files attributes), one can set the property `selection.multi.separator` to `${line.separator}attrib -r -a -s -h "` (including the ending double quote character) and use the string `attrib -r -a -s -h "${selection.filename}"` (including the double quotes) to get the following expanded value:
```
attrib -r -a -s -h "C:\Program Files (x86)\Winamp\libFLAC.dll"
attrib -r -a -s -h "C:\Program Files (x86)\Winamp\winamp.exe"
Expand Down Expand Up @@ -1807,7 +1824,7 @@ For example, the following would define `services.wce.command.start` and `servic



# Environment variables #
# Environment Variables options #

ShellAnything default startup behavior can be modified by setting specific pre-defined environment variables. Some features or configuration options can also be enabled or disabled through environment variables. For example, one can define an environment variables to enable verbose logging.

Expand All @@ -1819,10 +1836,11 @@ All ShellAnything environment variables names are prefixed with `SA_`.

The following table defines the list of pre-defined environment variables for ShellAnything:

| Name | Description |
|--------------------------------|--------------------------------------------------------------------------------------------------------------------|
| SA_OPTION_LOGGING_VERBOSE | Enables [verbose logging](#verbose-logging) when set to a value that evaluates to [true](#istrue-attribute). |

| Name | Description |
|--------------------------------|----------------------------------------------------------------------------------------------------------------------|
| SA_OPTION_LOGGING_VERBOSE | Enables [verbose logging](#verbose-logging) when set to a value that evaluates to [true](#istrue-attribute). |
| SA_OPTION_CONFIGURATIONS_DIR | Set to a custom value to change/override the directory where [Configuration Files](#configuration-files) are stored. |
| SA_OPTION_LOGS_DIR | Set to a custom value to change/override the directory where [Log Files](#logging-support) are stored. |



Expand Down Expand Up @@ -2636,8 +2654,9 @@ ShellAnything provides logging support for troubleshooting and debugging command

The logging directory is unique for each users of the system.

The log files are stored in `C:\Users\%USERNAME%\ShellAnything\Logs` directory where `%USERNAME%` matches your current login username.
For example, the user `JohnSmith` can find his own ShellAnything log files in directory `C:\Users\JohnSmith\ShellAnything\Logs`.
The log files are stored in `%LOCALAPPDATA%\ShellAnything\logs` directory. For example, the user `JohnSmith` can find his own ShellAnything log files in directory `C:\Users\JohnSmith\AppData\Local\ShellAnything\logs`.

**Note:** The logging directory can be modified with the `SA_OPTION_LOGS_DIR` environment variable option. See [Environment Variables options](#environment-variables-options) section for details.



Expand Down Expand Up @@ -2715,6 +2734,33 @@ If no option is specified, verbose mode is disabled.



## Change the rendering order of your system's shell extension menus ##

ShellAnything does not control in which order the system renders all the registered Shell Extensions. Because of this, your ShellAnything menus could be rendered at the top, middle or the end of Window's Context menu.

This behavior can however be altered.

**Note:**
Changing the default order of ShellAnything's menu is not officially supported by ShellAnything. The feature is documented as working on Windows 10 (22H2 or later) and Windows 11. This is basically a hack. The method is added to ShellAnything's documentation because some users have a need for it.

Windows renders the registered Shell Extension alphabetically. For example, to change the rendering order of Shell Extensions for directories, you need to rename the desired shell extension's registry key in `HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shellex\ContextMenuHandlers`.

For example: you could rename the registry key `HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shellex\ContextMenuHandlers\ShellAnything` to change ShellAnything's menu order in a Windows context menu. You can rename the key to `!ShellAnything` to have ShellAnything's menus rendered to the top of the context menu. Or you can rename the registry key to `ΩShellAnything` to move ShellAnything's menus to the bottom of the context menu.

This feature is not officially supported. If you unregister or uninstall ShellAnything, the renamed registry key will not be deleted from your system. If you re-register ShellAnything then two registry keys referencing ShellAnything will be registered on the system (`!ShellAnything` and `ShellAnything`). This could lead to adding the menus twice to the context menu.

Another downside is that you need to do this for every locations in the registry where ShellAnything is registered as a shell extension:

* `*` (star character)
* `Directory`
* `Directory\Background`
* `Folder`
* `Drive`

There is also shell extensions registered under `AllFilesystemObjects` (_HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AllFilesystemObjects\shellex\ContextMenuHandlers_). ShellAnything do not register itself to this file system element. This could create confusion on the rendering order of context menus since `Directory` may (or may not) have priority over `AllFilesystemObjects`.



## Missing ampersand character (`&`) in menus ##

One might be puzzled as to why his menus do not display ampersand character (`&`) properly.
Expand Down
File renamed without changes.
Loading

0 comments on commit 9ea8045

Please sign in to comment.