This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: LaunchApplication
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2012
09:49 AM
LaunchApplication
Hi,
I've problem to use LaunchApplication command - I have not found yet the exact flags with them I have to run the command.
I want to run msiexec command to uninstall third party application and WAIT until the uninstallion process will be completed.
I'm using the following code:
Please help me to understand what is wrong in my command.
Thanks,
I've problem to use LaunchApplication command - I have not found yet the exact flags with them I have to run the command.
I want to run msiexec command to uninstall third party application and WAIT until the uninstallion process will be completed.
I'm using the following code:
uninstallParams = "/q /x {10277218-0100-0904-9ABB-000BDB5CF35D} " + sLogParam;
if ( LaunchApplication ("msiexec", uninstallParams, "", SW_HIDE, INFINITE,LAAW_OPTION_USE_SHELLEXECUTE|LAAW_OPTION_WAIT) < ISERR_SUCCESS ) then
else
endif;
if ( LaunchApplication ("msiexec", uninstallParams, "", SW_HIDE, INFINITE,LAAW_OPTION_USE_SHELLEXECUTE|LAAW_OPTION_WAIT) < ISERR_SUCCESS ) then
Message = "Error while third party uninstall";
MessageBox(Message,SEVERE);
MessageBox(Message,SEVERE);
else
Message = "Third party complitly uninstalled";
MessageBox(Message,SEVERE);
MessageBox(Message,SEVERE);
endif;
Please help me to understand what is wrong in my command.
Thanks,
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2012
03:31 PM
A .msi can only uninstall a separate app IF the .msi installed it. This is a nested installation.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2012
03:47 PM
We would recommend passing WINSYSDIR ^ "msiexec.exe" in the program parameter so that an explicit path is provided on where to launch msiexec from.
If an executable fails to launch with LaunchApplication, it is recommended that the LAAW_PARAMETERS.nLaunchResult value be checked to determine what system error was returned while trying to launch the EXE.
Also, since the sLogParam value is unknown based on the posted code, please ensure this parameter to msiexec is correct. If it is not, msiexec will run and then exit immediately with an error.
If an executable fails to launch with LaunchApplication, it is recommended that the LAAW_PARAMETERS.nLaunchResult value be checked to determine what system error was returned while trying to launch the EXE.
Also, since the sLogParam value is unknown based on the posted code, please ensure this parameter to msiexec is correct. If it is not, msiexec will run and then exit immediately with an error.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 23, 2012
01:27 AM
I Run Setup.exe to perform silent uninstall and i didn't found the suitable LaunchApplication command to uninstall the Third-Party program.
I need to launce the uninstall command and WAIT until it finish! Only after the uninstalling command ended check the return code and if it's OK then continue the program.
Currently my program print the OK message without launch the command even not to the background.
My code is:
I checked successfully the Third-Party uninstall command by print it to message box cut and run it from command line.
Please advice
I need to launce the uninstall command and WAIT until it finish! Only after the uninstalling command ended check the return code and if it's OK then continue the program.
Currently my program print the OK message without launch the command even not to the background.
My code is:
uninstallParams = "/q /x {10277218-0100-0904-9ABB-000BDB5CF35D} c:\temp\test.log"
ret = LaunchApplication(WINSYSDIR^"msiexec.exe", uninstallParams, "", SW_HIDE, INFINITE, LAAW_OPTION_USE_SHELLEXECUTE | LAAW_OPTION_WAIT_INCL_CHILD );
if (ret < 0 ) then
else
endif;
ret = LaunchApplication(WINSYSDIR^"msiexec.exe", uninstallParams, "", SW_HIDE, INFINITE, LAAW_OPTION_USE_SHELLEXECUTE | LAAW_OPTION_WAIT_INCL_CHILD );
if (ret < 0 ) then
Message = "Error while third party uninstall";
MessageBox(Message,SEVERE);
MessageBox(Message,SEVERE);
else
Message = "Third party completely uninstalled";
MessageBox(Message,SEVERE);
MessageBox(Message,SEVERE);
endif;
I checked successfully the Third-Party uninstall command by print it to message box cut and run it from command line.
Please advice
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 24, 2012
02:26 AM
Your uninstallParams variable contains a incorrect escape sequence for the log file path. \\ inserts a backslash.
Try this code:
Info:
You should note that you may need elevated privileges to perform the uninstallation. If you trigger the script as a custom action from within MSI based setup you can only run the uninstall during the UI sequence.
(SprintfMsiLog does not work from custom actions launched through DoAction events.)
Try this code:
function UninstallThirdParty(hMSI)
STRING szApp, szParams;
STRING szTempPath;
STRING szLogFilePath;
STRING Message;
begin
GetEnvVar ( "TEMP", szTempPath );
szLogFilePath = szTempPath ^ "test.log";
szApp = WINSYSDIR^"msiexec.exe";
LongPathToQuote (szApp, TRUE);
szParams = "/x {10277218-0100-0904-9ABB-000BDB5CF35D} /qn /lv* " + szLogFilePath;
if (ISERR_SUCCESS == LaunchApplication(szApp, szParams, "", SW_NORMAL, LAAW_PARAMETERS.nTimeOut, LAAW_OPTION_USE_SHELLEXECUTE|LAAW_OPTION_WAIT|LAAW_OPTION_SHOW_HOURGLASS)) then
if (0 == LAAW_PARAMETERS.nLaunchResult) then
Message = "Third party completely uninstalled";
MessageBox(Message,SEVERE);
else
SprintfMsiLog("### LaunchApplication failed: %d", LAAW_PARAMETERS.nLaunchResult );
Message = "Error while third party uninstall";
MessageBox(Message,SEVERE);
endif;
else
SprintfMsiLog("LaunchApplication failed");
endif;
end;
Info:
You should note that you may need elevated privileges to perform the uninstallation. If you trigger the script as a custom action from within MSI based setup you can only run the uninstall during the UI sequence.
(SprintfMsiLog does not work from custom actions launched through DoAction events.)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 26, 2012
08:39 AM
Why can i run the uninstall process during the UI only?
Currently i launch it as Execute action and it failed with error 1618.
1618: ERROR_INSTALL_ALREADY_RUNNING -Another installation is in progress. Only one installation at a time can run actions in the InstallExecuteSequence, AdminExecuteSequence, or AdvtExecuteSequence tables.
I don't understand the problem - Please explain.
Remember i run the uninstall process by setup.exe file which launch msiexec to uninstall the third-party
Thanks
Currently i launch it as Execute action and it failed with error 1618.
1618: ERROR_INSTALL_ALREADY_RUNNING -Another installation is in progress. Only one installation at a time can run actions in the InstallExecuteSequence, AdminExecuteSequence, or AdvtExecuteSequence tables.
I don't understand the problem - Please explain.
Remember i run the uninstall process by setup.exe file which launch msiexec to uninstall the third-party
Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 27, 2012
01:20 AM
Please follow up on this thread, with regard to error 1618 and LaunchApplication.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 27, 2012
02:12 AM
I not really understand How it can uninstall Third-Parties with msiexec in UI mode (ARP), and not do the same in silent mode?