Skip to content

Commit 9ea8045

Browse files
authored
Merge pull request #183 from end2endzone/feature-issue108
Feature issue108 (fixes #108)
2 parents 5ada8a0 + a677788 commit 9ea8045

23 files changed

+583
-111
lines changed

CHANGES

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
Changes for 0.10.0
22

3+
* **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.
4+
* **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.
35
* ShellAnything has a new high-resolution logo icon!
46
* Shellanything now features verbose logging mode and command line arguments debugging tools.
5-
* ShellAnything now packages icons from [icons8/flat-color-icons](https://github.com/icons8/flat-color-icons)
7+
* ShellAnything now packages icons from [icons8/flat-color-icons](https://github.com/icons8/flat-color-icons).
68

9+
Fixes:
710
* Fixed issue #6 : (twice) Right-click on a directory with Windows Explorer in the left panel shows the menus twice.
811
* Fixed issue #31 : (twice) Error in logs for CContextMenu::GetCommandString()
12+
* Fixed issue #108: Separate location for log files ? (and exclusions?)
913
* Fixed issue #109: Implement default and verbose logging.
1014
* Fixed issue #110: Create a simple command line arguments debugging application.
1115
* Fixed issue #148: Can't uninstall.

CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,18 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/shellanything-config-version.cma
373373
configure_file(${CMAKE_SOURCE_DIR}/cmake/shellanything-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/shellanything-config.cmake @ONLY)
374374
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/shellanything-config.cmake DESTINATION ${SHELLANYTHING_INSTALL_CMAKE_DIR})
375375

376-
install(FILES ${CMAKE_SOURCE_DIR}/resources/register.bat
377-
${CMAKE_SOURCE_DIR}/resources/unregister.bat
376+
install(FILES ${CMAKE_SOURCE_DIR}/resources/installer/bin/register.bat
377+
${CMAKE_SOURCE_DIR}/resources/installer/bin/unregister.bat
378378
DESTINATION ${SHELLANYTHING_INSTALL_BIN_DIR})
379379

380380
# Resources
381+
install(DIRECTORY "${CMAKE_SOURCE_DIR}/resources/configurations" DESTINATION ${SHELLANYTHING_INSTALL_RESOURCE_DIR})
381382
install(DIRECTORY "${CMAKE_SOURCE_DIR}/resources/Windows Icon Tables" DESTINATION ${SHELLANYTHING_INSTALL_RESOURCE_DIR})
383+
install(FILES ${CMAKE_SOURCE_DIR}/resources/icons/shellanything.ico
384+
${CMAKE_SOURCE_DIR}/resources/icons/0.1.0.ico
385+
${CMAKE_SOURCE_DIR}/resources/icons/0.2.0.ico
386+
${CMAKE_SOURCE_DIR}/resources/icons/0.2.0-16x16-legacy.ico
387+
DESTINATION ${SHELLANYTHING_INSTALL_RESOURCE_DIR}/icons)
382388

383389
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/shellanything DESTINATION ${SHELLANYTHING_INSTALL_INCLUDE_DIR})
384390
install(FILES ${SHELLANYTHING_EXPORT_HEADER}
@@ -390,7 +396,6 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses DESTINATION ${SHELLANYTHING_INSTA
390396
install(FILES ${CMAKE_SOURCE_DIR}/docs/screenshot_file.png
391397
${CMAKE_SOURCE_DIR}/docs/screenshot_folder.png
392398
${CMAKE_SOURCE_DIR}/docs/ShellAnything-splashscreen.jpg
393-
${CMAKE_SOURCE_DIR}/resources/icons/shellanything.ico
394399
${CMAKE_CURRENT_BINARY_DIR}/sa_plugin_demo.zip
395400
DESTINATION ${SHELLANYTHING_INSTALL_DOC_DIR})
396401

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

472-
set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/resources/wix_license_template.rtf")
477+
set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/resources/installer/wix_license_template.rtf")
473478
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/resources/icons/shellanything.ico")
474479
set(CPACK_WIX_HELP_LINK "https://github.com/end2endzone/ShellAnything")
475480
set(CPACK_WIX_PROGRAM_MENU_FOLDER "${PROJECT_NAME}")

UserManual.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ This manual includes a description of the system functionalities and capabilitie
4646
* [Multi-selection-based properties](#multi-selection-based-properties)
4747
* [Fixed properties](#fixed-properties)
4848
* [Default properties](#default-properties)
49-
* [Environment variables](#environment-variables)
49+
* [Environment Variables options](#environment-variables-options)
5050
* [Tools](#tools)
5151
* [file_explorer_renew](#file_explorer_renew)
5252
* [arguments.debugger](#argumentsdebugger)
@@ -79,6 +79,7 @@ This manual includes a description of the system functionalities and capabilitie
7979
* [Troubleshooting](#troubleshooting)
8080
* [Logging support](#logging-support)
8181
* [Checkout the _Tools_ section](#tools)
82+
* [Change the rendering order of your system's shell extension menus](#change-the-rendering-order-of-your-systems-shell-extension-menus)
8283
* [Missing ampersand character (`&`) in menus](#missing-ampersand-character--in-menus)
8384
* [Reporting bugs](#reporting-bugs)
8485

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

169170
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.
170171

171-
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.
172+
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.
172173

173174
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.
174175

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

177178
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.
178179

180+
**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.
181+
179182

180183

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

17211724
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.
17221725

1723-
By default, this property is set to the value `\r\n` (new line) when the application initialize.
1726+
By default, this property is set to the value `\r\n` (new line) when the application initialize.
1727+
1728+
The property can be modified at any time using a [<property>](#property-action) action or with the [<default>](#default) element to change it globally.
17241729

1725-
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).
1730+
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 :
1731+
```xml
1732+
<?xml version="1.0" encoding="utf-8"?>
1733+
<root>
1734+
<shell>
1735+
<default>
1736+
<property name="selection.multi.separator" value="&quot; &quot;" />
1737+
</default>
1738+
</shell>
1739+
</root>
1740+
```
17261741

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

17321747
**Example #1:**
17331748

1734-
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:
1749+
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:
17351750

17361751
```xml
17371752
<actions>
@@ -1740,13 +1755,15 @@ If an executable must get the list of selected files in a single command line (o
17401755
<property name="selection.multi.separator" value="${line.separator}" />
17411756
</actions>
17421757
```
1758+
17431759
Which result in the following expanded value:
17441760
```
17451761
"C:\Program Files (x86)\Winamp\libFLAC.dll" "C:\Program Files (x86)\Winamp\winamp.exe" "C:\Program Files (x86)\Winamp\zlib.dll"
17461762
```
1763+
17471764
**Example #2:**
17481765

1749-
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:
1766+
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:
17501767
```
17511768
attrib -r -a -s -h "C:\Program Files (x86)\Winamp\libFLAC.dll"
17521769
attrib -r -a -s -h "C:\Program Files (x86)\Winamp\winamp.exe"
@@ -1807,7 +1824,7 @@ For example, the following would define `services.wce.command.start` and `servic
18071824

18081825

18091826

1810-
# Environment variables #
1827+
# Environment Variables options #
18111828

18121829
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.
18131830

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

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

1822-
| Name | Description |
1823-
|--------------------------------|--------------------------------------------------------------------------------------------------------------------|
1824-
| SA_OPTION_LOGGING_VERBOSE | Enables [verbose logging](#verbose-logging) when set to a value that evaluates to [true](#istrue-attribute). |
1825-
1839+
| Name | Description |
1840+
|--------------------------------|----------------------------------------------------------------------------------------------------------------------|
1841+
| SA_OPTION_LOGGING_VERBOSE | Enables [verbose logging](#verbose-logging) when set to a value that evaluates to [true](#istrue-attribute). |
1842+
| SA_OPTION_CONFIGURATIONS_DIR | Set to a custom value to change/override the directory where [Configuration Files](#configuration-files) are stored. |
1843+
| SA_OPTION_LOGS_DIR | Set to a custom value to change/override the directory where [Log Files](#logging-support) are stored. |
18261844

18271845

18281846

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

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

2639-
The log files are stored in `C:\Users\%USERNAME%\ShellAnything\Logs` directory where `%USERNAME%` matches your current login username.
2640-
For example, the user `JohnSmith` can find his own ShellAnything log files in directory `C:\Users\JohnSmith\ShellAnything\Logs`.
2657+
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`.
2658+
2659+
**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.
26412660

26422661

26432662

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

27162735

27172736

2737+
## Change the rendering order of your system's shell extension menus ##
2738+
2739+
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.
2740+
2741+
This behavior can however be altered.
2742+
2743+
**Note:**
2744+
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.
2745+
2746+
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`.
2747+
2748+
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.
2749+
2750+
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.
2751+
2752+
Another downside is that you need to do this for every locations in the registry where ShellAnything is registered as a shell extension:
2753+
2754+
* `*` (star character)
2755+
* `Directory`
2756+
* `Directory\Background`
2757+
* `Folder`
2758+
* `Drive`
2759+
2760+
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`.
2761+
2762+
2763+
27182764
## Missing ampersand character (`&`) in menus ##
27192765

27202766
One might be puzzled as to why his menus do not display ampersand character (`&`) properly.

0 commit comments

Comments
 (0)