From 444342d141111a47937496bfb3dee2589b57ae94 Mon Sep 17 00:00:00 2001 From: Louie S Date: Wed, 1 May 2024 13:35:45 -0400 Subject: Install StartMenu Shortcut NSIS --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') 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 ") 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}) -- cgit