I've run into an issue that I'm not sure if it is a problem or by design.
When uninstalling, I need to call one of my installed programs to remove a component. This installed program is just a Win32 executable and is also used during the install sequence (after the files are copied to $TARGETDIR$) to add the component as a separate call to Run Program.
Code: Select all
if Variable REMOVE Equals TRUE
Comment: Uninstall product
Comment: TO-DO: Insert any additional uninstall commands here
Run Program $TARGETDIR$\Setups\MyComponentSetup.exe /REMOVE (WAIT)
Apply Uninstall (get result into variable SUCCESS)
Set Variable PROGRESS to 100
else
...
My problem is that on the version upgrade install sequence my separate component was not being removed - the shortcuts, menu items, etc were but not this other piece. I ended up having to add an extra Run Command before the call to Install/Remove MSI Package:
Code: Select all
if Variable NEEDSUPGRADE Equals TRUE
Set Variable REMOVEOLD to
Set Variable ERROROLD to
Run Program $TARGETDIR$\Setups\MyComponentSetup.exe /REMOVE (WAIT)
Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
if Variable REMOVEOLD Equals ERROR
MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
Terminate Installation
end
if Variable REMOVEOLD Equals REBOOT
MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
if Variable REBOOTNOW Equals OK
Reboot Computer and Resume Setup
else
Terminate Installation
end
end
Set Variable MAINTENANCE to FALSE
end
Is this the proper way to do this? I expected the uninstall during the upgrade to run the same code as when I uninstall from add/remove programs.
Thanks,
Sheri

