diff --git a/nsis/src/plugin-resources/remove-shortcuts.nsh b/nsis/src/plugin-resources/remove-shortcuts.nsh new file mode 100644 index 00000000..54a5fdf2 --- /dev/null +++ b/nsis/src/plugin-resources/remove-shortcuts.nsh @@ -0,0 +1,3 @@ + ; remove shortcuts, if any. + Delete "$${PROJECT_STARTMENU_FOLDER}\*.*" + RMDir "$${PROJECT_STARTMENU_FOLDER}" \ No newline at end of file diff --git a/nsis/src/plugin-resources/templates/setup.jelly b/nsis/src/plugin-resources/templates/setup.jelly index e88605eb..85f7f70e 100644 --- a/nsis/src/plugin-resources/templates/setup.jelly +++ b/nsis/src/plugin-resources/templates/setup.jelly @@ -46,7 +46,7 @@ ; macro to check if the jdk is installed !include "JDK.nsh" -; Fonctions to set/remove environment variables +; Functions to set/remove environment variables !include "Environment.nsh" ; include project specific details @@ -152,9 +152,7 @@ Section "Uninstall" ; MUST REMOVE UNINSTALLER, too Delete $$INSTDIR\Uninst.exe - ; remove shortcuts, if any. - Delete "$${PROJECT_STARTMENU_FOLDER}\*.*" - RMDir "$${PROJECT_STARTMENU_FOLDER}" + !include "remove-shortcuts.nsh" ; Recursively remove files and directories used ; this should also take care of the installer diff --git a/nsis/xdocs/changes.xml b/nsis/xdocs/changes.xml index 0196a634..3ad9d81f 100644 --- a/nsis/xdocs/changes.xml +++ b/nsis/xdocs/changes.xml @@ -24,6 +24,7 @@ + The script "remove-shortcuts.nsh" can be used to remove shortcuts created in "startmenu-shortcuts.nsh" and "desktop-shortcuts.nsh". Set compress options (force/lzma). NSIS plugin does not support silent uninstall. Remove the final dialog box. diff --git a/nsis/xdocs/customizing.xml b/nsis/xdocs/customizing.xml index 5b91973a..b20628fe 100644 --- a/nsis/xdocs/customizing.xml +++ b/nsis/xdocs/customizing.xml @@ -160,6 +160,10 @@ registry-uninstall.nsh Allow customization of environment variables and registry entries to be removed on uninstall + + remove-shortcuts.nsh + Allow customization of shortcuts deletion. The default script removes everything in ${PROJECT_STARTMENU_FOLDER}. + startmenu-shortcuts.nsh Allow start menu shortcuts to be added