Postponing Removal of Prior Version
Posted: Tue Apr 25, 2006 5:12 pm
I developed a script, based on the Win32 Script example. In that script, the user is prompted at startup, for permission to remove any older version of the product. If they approve, then the older version is removed before the screens for License, Location, Readme, etc. appear. If they cancel rather than completing the installation, then the application has been removed from their system.
Our users have told us that they would prefer that no changes be made to their system until they have completed all of the dialogs -- that way, if they back out, then the older version is still there.
I assume that the way to accomplish this would be (approximately) to move the entire associated block of code (see below) from the Install Application Pre-Requisites Region, to the Process (Un)Installation Region. What I need to know whether:
a) This is a bad ideal altogether; or
b) There are any dangers to watch out for; or
c) there are any additional adjustments I would need to make to the script.
The block I would move is as follows:
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
Set Variable REMOVEOLD to
Set Variable ERROROLD to
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
Our users have told us that they would prefer that no changes be made to their system until they have completed all of the dialogs -- that way, if they back out, then the older version is still there.
I assume that the way to accomplish this would be (approximately) to move the entire associated block of code (see below) from the Install Application Pre-Requisites Region, to the Process (Un)Installation Region. What I need to know whether:
a) This is a bad ideal altogether; or
b) There are any dangers to watch out for; or
c) there are any additional adjustments I would need to make to the script.
The block I would move is as follows:
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
Set Variable REMOVEOLD to
Set Variable ERROROLD to
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