Add /NoUninstaller parameter for Windows installer

This commit is contained in:
Kenneth Chew 2022-05-20 17:09:42 -04:00
parent 2bc6da038d
commit 12cadf3af0
No known key found for this signature in database
GPG Key ID: F17D3E14A07739DA

View File

@ -1,4 +1,5 @@
!include "FileFunc.nsh"
!include "LogicLib.nsh"
!include "MUI2.nsh"
Unicode true
@ -119,6 +120,9 @@ Section "PolyMC"
WriteRegStr HKCU Software\PolyMC "InstallDir" "$INSTDIR"
; Write the uninstall keys for Windows
${GetParameters} $R0
${GetOptions} $R0 "/NoUninstaller" $R1
${If} ${Errors}
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\PolyMC"
WriteRegStr HKCU "${UNINST_KEY}" "DisplayName" "PolyMC"
WriteRegStr HKCU "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\polymc.exe"
@ -133,6 +137,7 @@ Section "PolyMC"
WriteRegDWORD HKCU "${UNINST_KEY}" "NoModify" 1
WriteRegDWORD HKCU "${UNINST_KEY}" "NoRepair" 1
WriteUninstaller "$INSTDIR\uninstall.exe"
${EndIf}
SectionEnd