Postponing Removal of Prior Version

Got a problem you cannot solve? Try here.
fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postponing Removal of Prior Version

Postby fletcherjames » 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
Fletcher James

CandiceJones
Posts: 904
Joined: Thu Dec 22, 2005 7:03 pm
Contact:

Postby CandiceJones » Tue Apr 25, 2006 6:08 pm

Sure, this is a sound idea! We do have customers who have done this and its working great for them. What you do want to be careful with is:

1) Make sure you don't break the compiler variable if/end statements. Right now you are taking a compiler variable if and leaving its end orphaned up above.

2) If a reboot occurs, setup will re-present the same dialogs again - you may want to work around that with scripting or by suppressing reboot.

3) Remove the "Previous Version Uninstallation" item from the prereqs section that updates the prereqs dialog.

4) Review your final code and test on clean and production machines to be sure it works as expected under all circumstances.
Candice Jones
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

IanM
Posts: 42
Joined: Tue Mar 08, 2005 1:23 pm

Postby IanM » Wed Apr 26, 2006 10:55 am

I can confirm this works fine. I wonder if IW would consider changing the way that the wizard creates new scripts so that the uninstall is the last activity. I can't see any good reason for the current process where as you say, they can end up indavertantly un-installing the erxisting application if they back out later.

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Wed Apr 26, 2006 11:03 am

Thanks, all...

I made the change, and it seemed fine in the preliminary testing. For safety's sake, I ended up leaving a half-dozen lines of code in the original location, to set the starting state of 3 variables, and then moved the rest (including duplicated If test) to just before the main installation.
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Apr 26, 2006 2:36 pm

We believe that uninstalling products and installing technologies such as the .NET framework are major changes which the end-user should be made aware of prior to initiating (and hence, consenting) with the main installation.

What you can do is update the built in template projects so your newly created projects would exhibit your desired behavior. That's the beauty of the InstallAware scripting language. No other setup environment provides you with TOTAL CONTROL over the entire installation experience. Your setup script is fully customizable and spells everything out. Build custom dialogs, change the prereq installation order and mechanism - do it all any way you like!

We'd also love it if you could post your new template projects in this forum, so others who are similarly inclined can benefit from your efforts!
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 241 guests