CPack/NSIS: Fix silent NSIS installs
The installer should not put up a message box to confirm uninstall of a previous version for silent installs. Furthermore, when the uninstaller is invoked, do not show its confirmation dialog because either (a) the installer already asked the user or (b) the installer is running in silent mode. Closes: #16328
This commit is contained in:
parent
1a5fddfe6d
commit
cb8db28559
|
@ -905,7 +905,7 @@ Function .onInit
|
||||||
|
|
||||||
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
|
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
|
||||||
"@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
|
"@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
|
||||||
IDYES uninst IDNO inst
|
/SD IDYES IDYES uninst IDNO inst
|
||||||
Abort
|
Abort
|
||||||
|
|
||||||
;Run the uninstaller
|
;Run the uninstaller
|
||||||
|
@ -913,7 +913,7 @@ uninst:
|
||||||
ClearErrors
|
ClearErrors
|
||||||
StrLen $2 "\Uninstall.exe"
|
StrLen $2 "\Uninstall.exe"
|
||||||
StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
|
StrCpy $3 $0 -$2 # remove "\Uninstall.exe" from UninstallString to get path
|
||||||
ExecWait '"$0" _?=$3' ;Do not copy the uninstaller to a temp file
|
ExecWait '"$0" /S _?=$3' ;Do not copy the uninstaller to a temp file
|
||||||
|
|
||||||
IfErrors uninst_failed inst
|
IfErrors uninst_failed inst
|
||||||
uninst_failed:
|
uninst_failed:
|
||||||
|
|
Loading…
Reference in New Issue