cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
anom217
Level 8

LaunchAppAndWait not executing?

I have an InstallScript Custom Action in a Basic MSI project that calls the LaunchAppAndWait function to execute 7zip to extract a file. The zipped file is already on the target machine. The install runs successfully, but it doesn't extract the zipped file.

Here is the message when I output the szApp and szCmd parameters from LaunchAppAndWait during the install:

C:\Program Files\7zip\7za.exe" e "C:\Program Files\OC4J\oc4j.zip" "-oC:\Program Files\OC4J"

I also print out the error code using LAAW_PARAMETERS.nLaunchResult. It returns 0, which is no error for 7zip, however the command doesn't seem to have done anything.

I have the message dialog popping up immediately after calling LaunchAppAndWait, so it stops the installation until I hit the OK button. When the dialog is up, I execute the exact same command from the DOS prompt, and it works fine. I don't understand why it isn't working in InstallShield. Can anybody shed some light on what is going wrong?
Labels (1)
0 Kudos
(7) Replies
RobertDickau
Flexera Alumni

I don't know anything about that executable, but does it work if you launch 7zip.exe with no arguments (show a splash screen or error message, for example)? And then start adding command-line switches one at a time, if possible?
0 Kudos
anom217
Level 8

7zip is an extraction and zipping tool. If I launched 7zip by itself nothing would happen, it needs arguments so it knows what to extract. As I've already stated, I get the error code back from launching 7zip to see if the execute call was successful. It returns 0, which means no error. I launch the exact same command from the command-line and it executes fine. But for some reason it isn't doing the extracting when InstallShield performs it. I'm not sure what the problem with InstallShield is.
0 Kudos
MarkusLatz
Level 8

Have you tried to use "LongPathToQuote" ?

regards

Markus
0 Kudos
anom217
Level 8

Yes, I have been using LongPathToQuote. I discovered the 7zip command fails without quotes because of the space between Program Files.

"C:\Program Files\7zip\7za.exe" e "C:\Program Files\OC4J\oc4j.zip" "-oC:\Program Files\OC4J"

In the command I have each argument surrounded with quotes. During installation I have a dialog pop up showing the command about to be executed. I open up the DOS command line, type in the exact same command, and it executes properly. But for some reason InstallShield fails to do this, even though the error code returned indicates a successful call.

I have the Custom Action executing after Write Environment Strings, so I believe there shouldn't be any problems there. And the files and locations I'm using in the command are already on the system anyway. I don't understand what's wrong.
0 Kudos
rguggisberg
Level 13

1. Remove the LAAW_OPTION_HIDDEN option so that you can see the
window.
2. Specify the full path. On my machine 7z is not in the path.
3. Are you sure it is 7a.exe? Mine is 7z.exe.
4. Try executing the command from a command prompt.
5. As Robert suggested... you should be able to do 7z.exe with no arguments and see a help screen. Try that from the command line and see.
Good Luck!
0 Kudos
ericpaul
Level 6

Looking at the command line "C:\Program Files\7zip\7za.exe" e "C:\Program Files\OC4J\oc4j.zip" "-oC:\Program Files\OC4J" I notice that the -o is also inside the quotes.

Shouldn't you have to specify the following: "C:\Program Files\7zip\7za.exe" e "C:\Program Files\OC4J\oc4j.zip" -o"C:\Program Files\OC4J"

That is, -o"C:... instead of "-oC:... ?
0 Kudos
anom217
Level 8

I eventually got this to work, although I'm not sure what was going wrong in the first place.

Yes, the -o can be placed inside the quotes, or outside. I was having problems with it at first when it was outside the quotes, but now that everything is worked, I moved the -o outside and it works fine too.
0 Kudos