Skip to content
⌘ NSIS Forum Archive

launch application before uninstall

3 posts

Babba#

launch application before uninstall

i need to launch a my .net application before uninstall main application. If my application end ok, uninstall process continue, otherwise stop it.

is it possible to do this? any suggestion or piece of code?
AaronLS#
Your app should return 0 for success, and anything else for failure. Then your NSIS script could do this:
Function un.onInit
  ClearErrors
  ExecWait 'C:\ProgramFiles\YourCompany\YourNetApp.exe' $0
  ${If} ${Errors}    
    Abort        ;cancel uninstall 
  ${ElseIf} $0 <> 0
    Abort  ;cancel uninstall
${EndIf}
FunctionEnd