cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jwreels
Level 5

Uninstall Installscript from Basic MSI

We are in the process of converting our Installscript project to Basic MSI.

Is it possible to update the previous installscript project from the basic msi?

Or can I kick off the installscript uninstaller from the msi and then have the msi continue afterwords? The reasoning for this is that the msi needs to read the currently installed version and run some various scripts accordingly.

Thanks in advance.
Labels (1)
0 Kudos
6 Replies
thepeter
Level 7

you could use the UninstallApplication function in an InstallScript CA http://helpnet.acresso.com/robo/projects/installshield12langref/UninstallApplication.htm
0 Kudos
jwreels
Level 5

This seems to work like I need. Thanks!
0 Kudos
jwreels
Level 5

So I thought I had this figured out but I was wrong. I am having a tough time getting the MSI install to wait for the Installscript Install to Uninstall.

Here is my installscript code.
[CODE]
// set initial buffer size
nLength = MAX_PATH + 1;
MsiGetProperty(hMSI, "SUPPORTDIR", szSupportDir, nLength);

sSupportFile = szSupportDir ^ "remove.iss";


szAdditionalCmdLine = "/s /f1" + "\"" + sSupportFile + "\"";
//MessageBox("AddCmdLine : " + szAdditionalCmdLine, INFORMATION);
szUninstallKey = "{00609589-8D58-466F-A7D0-2C3F56506674}";
nOptions = LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_HIDDEN;
nReturnValue = UninstallApplication ( szUninstallKey, szAdditionalCmdLine, nOptions );
if (nReturnValue < ISERR_SUCCESS) then
xf_RecordInLogFile(hMSI, "[ERROR] Error Uninstalling previous version");
sReturnValue = FormatMessage ( nReturnValue );
xf_RecordInLogFile(hMSI, "[ERROR] Error Message: " + sReturnValue);
MessageBox("Error uninstalling previous version.", SEVERE);
nFuncReturnValue = ERROR_INSTALL_FAILURE;
else
sbIsUpgradeFromPreMSI = "true";

xf_RecordInLogFile(hMSI, "[INFO] Previous version uninstalled successfully");
nFuncReturnValue = ERROR_SUCCESS;
endif; [/CODE]

The Uninstall does execute and works silently but the MSI installer continues as well. How do I get the MSI to wait ? After researching in the forums I tried clone_wait with no success.

I am launching the installscript from a Custom Action in the Execute sequence that occurs just after ISSetupFilesExtract. Any ideas? Thanks.
0 Kudos
jwreels
Level 5

I still haven't been able to find a solution. Anyone have any ideas?
0 Kudos
DebbieL
Level 17

Just a guess: Maybe try changing the value for the custom action's Return Processing setting (in the Custom Actions and Sequences view).
0 Kudos
jwreels
Level 5

Right, I should have thought of that. Works perfectly now...thanks.
0 Kudos