I need to execute a file before uninstallation starts so I put the run program statement in the Uninstall region:
Code: Select all
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
Comment: Uninstall product
Comment: TO-DO: Insert any additional uninstall commands here
Run Program $TARGETDIR$\\bin\\MyInstall.exe /uninstall (WAIT)
Apply Uninstall (get result into variable SUCCESS)
But when I build a new setup and try to install the new one it calls
Code: Select all
Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
I also tried to put “Run Program $TARGETDIR$\\bin\\MyInstall.exe /uninstall (WAIT)” in front of “Install/Remove MSI Package…” like
Code: Select all
[DEFINE REGION: Install Application Pre-Requisites]
…
Display Dialog: progressprereq, use as progress dialog (non-modal)
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
Set Variable REMOVEOLD to
Set Variable ERROROLD to
Run Program $TARGETDIR$\\bin\\MyInstall.exe /uninstall (WAIT)
Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
…
How can I solve this?
Where do I need to put “Run Program $TARGETDIR$\\bin\\MyInstall.exe /uninstall (WAIT)” so that it is called either on Uninstall and on the automatic uninstall when installing a new version?
Greetings
Harry

