From: <and...@us...> - 2022-12-13 18:10:32
|
Revision: 7377 http://sourceforge.net/p/nsis/code/7377 Author: anders_k Date: 2022-12-13 18:10:31 +0000 (Tue, 13 Dec 2022) Log Message: ----------- Install MultiUser example Modified Paths: -------------- NSIS/trunk/Examples/MultiUser.nsi NSIS/trunk/Examples/SConscript NSIS/trunk/Examples/makensis.nsi Modified: NSIS/trunk/Examples/MultiUser.nsi =================================================================== --- NSIS/trunk/Examples/MultiUser.nsi 2022-12-12 20:36:42 UTC (rev 7376) +++ NSIS/trunk/Examples/MultiUser.nsi 2022-12-13 18:10:31 UTC (rev 7377) @@ -1,11 +1,8 @@ -!define NAME "MultiUser example" +Name "MultiUser example" -Name "${NAME}" - -!define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" +!define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${UNINSTKEY}" !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "CurrentUser" - !define MULTIUSER_INSTALLMODE_INSTDIR "$(^Name)" !define MULTIUSER_INSTALLMODE_COMMANDLINE !define MULTIUSER_EXECUTIONLEVEL Highest @@ -26,23 +23,35 @@ !insertmacro MUI_LANGUAGE "English" Function .onInit - !insertmacro MULTIUSER_INIT + !insertmacro MULTIUSER_INIT FunctionEnd Function un.onInit - !insertmacro MULTIUSER_UNINIT + !insertmacro MULTIUSER_UNINIT FunctionEnd -Section -SetOutPath "$InstDir" -WriteUninstaller "$InstDir\Uninstall.exe" -WriteRegStr ShCtx "${UNINSTKEY}" DisplayName "$(^Name)" -WriteRegStr ShCtx "${UNINSTKEY}" UninstallString '"$InstDir\Uninstall.exe"' -WriteRegStr ShCtx "${UNINSTKEY}" $MultiUser.InstallMode 1 ; Write MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME so the correct context can be detected in the uninstaller. +Section + SetOutPath "$InstDir" + WriteUninstaller "$InstDir\Uninstall.exe" + WriteRegStr ShCtx "${UNINSTKEY}" DisplayName "$(^Name)" + WriteRegStr ShCtx "${UNINSTKEY}" UninstallString '"$InstDir\Uninstall.exe"' + WriteRegStr ShCtx "${UNINSTKEY}" $MultiUser.InstallMode 1 ; Write MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME so the correct context can be detected in the uninstaller. + + !tempfile APP + !makensis '-v2 "-DOUTFILE=${APP}" "-DNAME=NsisMultiUserExample" -DCOMPANY=Nullsoft "AppGen.nsi"' = 0 + File "/oname=$InstDir\MyApp.exe" "${APP}" ; Pretend that we have a real application to install + !delfile "${APP}" SectionEnd +Section "Start Menu shortcut" + CreateShortcut /NoWorkingDir "$SMPrograms\$(^Name).lnk" "$InstDir\MyApp.exe" +SectionEnd + Section "-Uninstall" -DeleteRegKey ShCtx "${UNINSTKEY}" -Delete "$InstDir\Uninstall.exe" -RMDir $InstDir + Delete "$SMPrograms\$(^Name).lnk" + + Delete "$InstDir\MyApp.exe" + Delete "$InstDir\Uninstall.exe" + DeleteRegKey ShCtx "${UNINSTKEY}" + RMDir $InstDir SectionEnd Modified: NSIS/trunk/Examples/SConscript =================================================================== --- NSIS/trunk/Examples/SConscript 2022-12-12 20:36:42 UTC (rev 7376) +++ NSIS/trunk/Examples/SConscript 2022-12-13 18:10:31 UTC (rev 7377) @@ -14,6 +14,7 @@ LogicLib.nsi makensis.nsi Memento.nsi + MultiUser.nsi NSISMenu.nsi one-section.nsi primes.nsi Modified: NSIS/trunk/Examples/makensis.nsi =================================================================== --- NSIS/trunk/Examples/makensis.nsi 2022-12-12 20:36:42 UTC (rev 7376) +++ NSIS/trunk/Examples/makensis.nsi 2022-12-13 18:10:31 UTC (rev 7377) @@ -332,6 +332,7 @@ File ..\Examples\WordFunc.ini File ..\Examples\WordFuncTest.nsi File ..\Examples\Memento.nsi + File ..\Examples\MultiUser.nsi File ..\Examples\unicode.nsi File ..\Examples\NSISMenu.nsi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |