cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jstockho
Level 2

Uninstall not working for previous versions

I'm really new to InstallShield, but I have to get an installer working ASAP for work. Here's what's going on.

We used to use InstallShield 12 and had a bunch of old versions of software we check for during an installation. The installer should uninstall all old versions. This used to work using the following technique:


sProgram = WINSYSDIR^"rundll32";
uninstallCmd = "\""+COMMONFILES^"\\INSTAL~1\\PROFES~1\\RunTime\\0701\\Intel32\\Ctor.dll\",LaunchSetup \""+PROGRAMFILES+"InstallShield Installation Information\\{GUID}\\setup.exe\" -uninst";

if( LaunchAppAndWait(sProgram, uninstallCmd, WAIT) < 0) then
MessageBox("launch app uninstall " + app + " failed.", WARNING);
endif;



Now that we have a version running with Installshield 2008, this line only works for projects originally built with version 12.

The behavior is that the install waits for the old version to be removed. It doesn't prompt for restart, it just continues when it's done uninstalling.

With the 2008 versions, the uninstall line no longer uses the run32dll stuff.

I have this now:

sProgram = PROGRAMFILES +"InstallShield Installation Information\\{GUID}\\Setup.exe";
uninstallCmd = "-runfromtemp -l0x0009 -removeonly";

if( LaunchAppAndWait(sProgram, uninstallCmd, WAIT) < 0) then
MessageBox("launch app uninstall " + app + " failed.", WARNING);
endif;


This has two problems. The first is that LaunchAppAndWait doesn't wait anymore. It waits until Setup.exe is running and then it continues on (which means my new installation is under way while it's trying to uninstall my old version.)

The second problem is that it prompts to restart at the end of the uninstall.

It didn't used to do either of these things. I can't figure out how to get the original behavior back. It looks like InstallShield stopped using the run32dll stuff, but as I didn't work with the program back then, I'm lost.

Any help would be greatly appreciated.
Labels (1)
0 Kudos
(4) Replies
jstockho
Level 2

OK. Figured out why it's not waiting. It's the -runfromtemp flag.

However, I still can't figure out why it's prompting for reboot. Someone mentioned that it might be a locked file, but I don't get anything in RunOnce or PendingFileRenameOperation.

Any ideas?
0 Kudos
dgilbert
Level 2

You can use the -clone_wait option. This will cause the LaunchAppAndWait to behave properly with -runfromtemp defined. But you still will get the reboot error. As far as I can tell, the parent installer remains running while the child installer does it's thing. Once the child installer comes to the end of its uninstall, it sees that the parent installer is still open and considers it a locked file. If you check c:\program files\InstallShiled Installation Information\\ , you should still see at least one or two setup files in there.

I've been trying to work with tech support, but they have not been able to reproduce the restart problem. This is a big issue for me and I don't know where to go from here.
0 Kudos
L3MAPPS
Level 2

Does anybody found a way that the InstallScript Project stop rebooting for nothing?

With InstallShield 11, I have an InstallScript MSI Project calling the setup of the InstallScript Project to install and uninstall, no problem with the install but with the uninstall it always ask to Reboot at the end.

I've tried:
if (LaunchAppAndWait (ICMgr, szICMgrCmdLine, LAAW_OPTION_NOWAIT|LAAW_OPTION_NO_CHANGEDIRECTORY ) < 0) then
ICMgr = ProgramFilesFolder + "\\InstallShield Installation Information\\{64CF8E82-CD2A-4282-A3FE-C4A19BFC65A6}\\setup.exe";
szICMgrCmdLine = " -runfromtemp -l0x9 -removeonly";


With or without the options (WAIT,NOWAIT, etc..) with or without the runfromtemp, call after the InstallScript MSI Project :SdFinishEx , no chance it always ask the user to reboot! :mad:

Note: Uninstalling the InstallScript Project from the add/remove Programs or by double clicking on the setup.exe worked fine.
0 Kudos
Kelter
Level 10

First, when upgrading a previous version of the product which is also MSI-based, perhaps things would be simpler if you used MSI-style upgrades so the "RemoveExistingProducts" action will do the uninstallation for you.

Otherwise add /NORESTART to the commandline.
0 Kudos