Skip to content

Commit 5889b97

Browse files
committed
- Created VERSION.TXT file in root installation directory to easily identify current version.
- Created property `application.version` which is set to the current version. - Created property `application.install.directory` which is set to the path where the application was installed. - Removed WinDirStat.xml configuration from "hardcoded installed configurations."
1 parent 73d2757 commit 5889b97

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ set(SHELLANYTHING_CONFIG_HEADER ${CMAKE_BINARY_DIR}/include/shellanything/config
124124
message("Generating ${SHELLANYTHING_CONFIG_HEADER}...")
125125
configure_file( ${CMAKE_SOURCE_DIR}/src/config.h.in ${SHELLANYTHING_CONFIG_HEADER} )
126126

127+
# VERSION.TXT file
128+
set(SHELLANYTHING_VERSION_TXT ${CMAKE_BINARY_DIR}/VERSION.TXT)
129+
message("Generating ${SHELLANYTHING_VERSION_TXT}...")
130+
configure_file( ${CMAKE_SOURCE_DIR}/src/VERSION.TXT.in ${SHELLANYTHING_VERSION_TXT} )
131+
127132
# Define installation directories
128133
set(SHELLANYTHING_INSTALL_ROOT_DIR "/")
129134
set(SHELLANYTHING_INSTALL_BIN_DIR "bin")
@@ -358,6 +363,7 @@ install(FILES ${CMAKE_SOURCE_DIR}/README.md
358363
${CMAKE_BINARY_DIR}/${AUTHOR_FILENAME}
359364
${CMAKE_BINARY_DIR}/${CHANGES_FILENAME}
360365
${CMAKE_BINARY_DIR}/${LICENSE_FILENAME}
366+
${SHELLANYTHING_VERSION_TXT}
361367
DESTINATION ${SHELLANYTHING_INSTALL_ROOT_DIR})
362368

363369
if (SHELLANYTHING_BUILD_DOC AND DOXYGEN_FOUND)

resources/configurations/shellanything.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@
105105
</menu>
106106

107107
</menu>
108+
109+
<menu name="More configurations files...">
110+
<icon path="C:\Windows\system32\shell32.dll" index="69" />
111+
<actions>
112+
<open path="${application.directory}\configurations" />
113+
</actions>
114+
</menu>
115+
116+
<menu name="Version ${application.version}">
117+
<icon path="${application.path}" index="0" />
118+
</menu>
119+
108120
</menu>
109121

110122
<menu separator="true" />

src/VERSION.TXT.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@SHELLANYTHING_VERSION@

src/core/PropertyManager.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include "SaUtils.h"
2727
#include "SelectionContext.h"
2828

29+
#include "shellanything/version.h"
30+
2931
#include "rapidassist/environment_utf8.h"
3032
#include "rapidassist/filesystem_utf8.h"
3133

@@ -275,6 +277,7 @@ namespace shellanything
275277
//define global properties
276278
std::string prop_core_module_path = GetCurrentModulePathUtf8();
277279
std::string prop_application_directory = ra::filesystem::GetParentPath(prop_core_module_path);
280+
std::string prop_install_directory = ra::filesystem::GetParentPath(prop_application_directory);
278281
std::string prop_path_separator = ra::filesystem::GetPathSeparatorStr();
279282
std::string prop_line_separator = ra::environment::GetLineSeparator();
280283

@@ -288,6 +291,8 @@ namespace shellanything
288291

289292
SetProperty("application.path", prop_application_path);
290293
SetProperty("application.directory", prop_application_directory);
294+
SetProperty("application.install.directory", prop_install_directory);
295+
SetProperty("application.version", SHELLANYTHING_VERSION);
291296
SetProperty("path.separator", prop_path_separator);
292297
SetProperty("line.separator", prop_line_separator);
293298
SetProperty("newline", prop_line_separator);

src/shellextension/shellext.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ void InstallDefaultConfigurations(const std::string& config_dir)
262262
"Microsoft Office 2013.xml",
263263
"Microsoft Office 2016.xml",
264264
"shellanything.xml",
265-
"WinDirStat.xml",
266265
};
267266
static const size_t num_files = sizeof(default_files) / sizeof(default_files[0]);
268267

0 commit comments

Comments
 (0)