cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
maadal
Level 3

Automatic uninstall before installing

Hi!
I have just upgraded from InstallShield 2008 to 2010, but I'm still not able to find a sollution on how to automatic uninstall previous version of my program before installing the new version when I'm using InstallScript project.
I'm aware that this is just an option in a msi-project, where a major upgrade automatically uninstall previous version before installing the new one.

I do not see that this should be such a big problem, I woud believe it was easy for InstallShield to handle this, but I'm not able to find the way to do it.

I do not think conversion to msi is the sollution, as we have quite complicated installations where we are doing a lot of stuff in script code during installation. Like installing other components using LauncAppAndWait, edit registry settings and xml-file settings during install.

Does anyone have any suggestions on what to do?
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

Would calling UninstallApplication in your script do the trick?
0 Kudos
austin2359
Level 6

I have gotten such a methodology to work, but i don't know how to warn the user beforehand. How could one first check to see if a GUID is installed, throw a message box if it is, and then launch the uninstaller?

Perhaps some sort of reference would be helpful. Does anyone have links to all the functions in installscript?
0 Kudos
RobertDickau
Flexera Alumni

In the main help library, Reference > InstallScript Language Reference > Functions and > Built-in Functions should have what you want.
0 Kudos
maadal
Level 3

RobertDickau wrote:
Would calling UninstallApplication in your script do the trick?


Actually, it does uninstall, but I do not get the install to continue installing my product. It is just the same as an ordinary maint installation.
What I want is to uninstall and then install my application as if it was a first time installation.
0 Kudos
maadal
Level 3

austin2359 wrote:
I have gotten such a methodology to work, but i don't know how to warn the user beforehand. How could one first check to see if a GUID is installed, throw a message box if it is, and then launch the uninstaller?

....
When you run your installscript, you enter OnMaintUIBefore or OnUpdateUIBefore if it is a second install, that is, if your application is already installed. If it is not already installed, you enter OnFirstUiBefore, and thus knows if if you have to warn the user.
In OnFirstUIBefore in your script, you do not need to do anything but a normal install.
In OnUpdateUIBefore or OnMaintUIBefore, you can throw a message box warning the user that the program will uninstall.
....

I would appreciate if you would let me know how you did this automatic uninstall and then install without letting you user know....
0 Kudos