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
- :
- LaunchApplication fails to launch *.msi file
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
Aug 05, 2009
01:18 PM
LaunchApplication fails to launch *.msi file
I am using the code snippet below in an attempt to launch an external *.msi installation process from within a basic msi, InstallShield 2009. The code is associated with a custom action, in the UI sequence. I know the CA is firing because I have a MessageBox (not shown in the code below) which shows me the value of szProgram, the path to the *.msi file.
The result is, I see the messagebox, the path is fine (no mispelled words, nothing wrong with the path or file name of the msi), but the result is exactly what you'd get if the msi file did not exist, was misspelled, or the path was wrong. I can launch the *.msi from Start / Run by using the very same path as szProgram has. But the msi will not launch from within the InstallShield basic msi app!!! I've tried using "" for the szDirectory, and also setting it to the same directory where the *.msi is located. Nothing works. Any suggestions? I've been staring at this for hours and have run out of guesses.
The result is, I see the messagebox, the path is fine (no mispelled words, nothing wrong with the path or file name of the msi), but the result is exactly what you'd get if the msi file did not exist, was misspelled, or the path was wrong. I can launch the *.msi from Start / Run by using the very same path as szProgram has. But the msi will not launch from within the InstallShield basic msi app!!! I've tried using "" for the szDirectory, and also setting it to the same directory where the *.msi is located. Nothing works. Any suggestions? I've been staring at this for hours and have run out of guesses.
function LaunchMyProgram(hMSI)
string szProgram, szCmdLine, szDirectory;
string szMsg;
string SETUPEXEDIR;
number nTimeOut;
number nBuffer;
begin
nBuffer = MAX_PATH + 1;
MsiGetProperty(ISMSI_HANDLE, "SETUPEXEDIR", SETUPEXEDIR, nBuffer);
nTimeOut = 2*60*1000; // defines a 2-minute wait period
szProgram = "msiexec.exe /I " + "\"" +
SETUPEXEDIR +
"\\MyDirectory\\MyProgram.msi" + "\"";
szCmdLine = "";
szDirectory = SETUPEXEDIR; // have also tried using szDirectory = ""
LaunchApplication(szProgram,
szCmdLine,
szDirectory,
SW_NORMAL,
nTimeOut,
LAAW_OPTION_WAIT);
end;
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Aug 05, 2009
02:23 PM
The szProgram parameter to LaunchApplication is only intended to take the path/filename of the program to launch and all command line parameters would be passed in szCmdLine (see the CreateProcess doc on MSDN for more information, as these parameters are essentially passed to CreateProcess directly as the first two parameters). Alternately, it should be possible to pass an empty string ("") to szProgram and pass the entire command line to szCmdLine.