summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-05-01 13:35:45 -0400
committerLouie S <louie@example.com>2024-05-01 13:42:26 -0400
commit444342d141111a47937496bfb3dee2589b57ae94 (patch)
tree4df5c5c96abc3f0b44646ef51e26c605f935860a
parent3b6a943241953ead88d3a8b5994adf37e7aee521 (diff)
Install StartMenu Shortcut NSIS
-rw-r--r--CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6c0bbe..6af8fb9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -147,8 +147,15 @@ set(CPACK_PACKAGE_CONTACT "Louie Shprung <lshprung@tutanota.com>")
set(CPACK_SOURCE_IGNORE_FILES "/\.git.*;/\.cache;/build;/compile_commands\.json$;/config\.h$;/data/assignment-list\.desktop$")
# CPack NSIS configuration
-# TODO provide option to create desktop shortcut
+# Allow regular users to run installer
set(CPACK_NSIS_DEFINES "RequestExecutionLevel user")
+# Install a StartMenu Shortcut
+set(CPACK_NSIS_CREATE_ICONS_EXTRA
+ "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_TITLE}.lnk' '$INSTDIR\\\\assignment-list.exe'"
+)
+set(CPACK_NSIS_DELETE_ICONS_EXTRA
+ "Delete '$SMPROGRAMS\\\\$START_MENU\\\\${PROJECT_TITLE}.lnk'"
+)
# Based on https://stackoverflow.com/q/69139412
if(CMAKE_SYSTEM MATCHES "Windows*")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_TITLE})