Reputation: 16901
If I try to install an MSI and it returns with an error code, how do I gracefully rollback or quit the installer?
Upvotes: 0
Views: 1882
Reputation: 214
You can use:
ExecWait 'msiexec /i "$INSTDIR\something.msi"' $0
${If} $0 != '0'
MessageBox MB_OK|MB_ICONSTOP 'Install Failed!'
Abort "Install failed"
${EndIf}
Just like @Anders said you have to take care of the rollback by yourself
Upvotes: 0
Reputation: 101746
There is no automatic rollback, NSIS can't tell which of the operations should be rolled back and how.
You have to deal with this yourself, either by rolling back each operation or starting your uninstaller in silent mode (ExecWait'"$instdir\youruninstaller.exe" /S _?=$instdir'
(You must delete the uninstaller and $instdir after this))
Upvotes: 1