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

Launch .htm after install (basic msi)

I need to launch a .htm page that was installed with my project after the install is complete.

I used the project assistant to give the the user the option to launch the program after install. However, if I point it to my .htm file it doesn't launch.

How can I run this page after install?

Thanks.
Labels (1)
0 Kudos
(12) Replies
jwreels
Level 5

Alright I figured it out. This is what I did. I made a vbscript custom action (type 102). I assigned it to the button click event at the SetupCompleteSuccess action.

Here is my vbscript:
Dim objShell
Set objShell = CreateObject("WScript.Shell")

objShell.Run "file:///C:/Program%20Files/GoFigure/Training%20and%20Documentation/index.htm"


Anyone foresee any problems?
0 Kudos
Inabus
Level 6

How will you handle silent installations or isnt it a consideration?

Paul
0 Kudos
RobertDickau
Flexera Alumni

Something else to consider is that virus scanners often intercept VBScript code that launches processes or touches the target system, unlike, say, DLLs and InstallScript code. Please search these forums and the KB for more approaches to launching an HTML file at the end of the installation...
0 Kudos
jwreels
Level 5

Ah, point taken. I will look into that. I was belief that I couldn't run installscript code on SetupCompletesSuccess since the installscript engine was no longer available?

So the only option other than the VBScript would be a call to a dll that kicks off the html page?
0 Kudos
RobertDickau
Flexera Alumni

I think that was an issue pre-InstallShield 12, when a big architecture change took place, but I believe you now can launch InstallScript code from SetupCompleteSuccess...
0 Kudos
jwreels
Level 5

So I created an installscript custom action that I kick off from the SetupCompleteSuccess dialog. However I can't get it to work. I can see in the log where it started the custom action but none of my installscript code is executed. Any ideas?
0 Kudos
RobertDickau
Flexera Alumni

What is the action code? The action properties? How are you launching it? Does an action with just a MessageBox call work?
0 Kudos
jwreels
Level 5

So this is what I did:
Custom Actions -> InstallScript Custom Action.
Says MSI Type 65600.
Synchronous (Ignore Exit Code)
Immediate Execution

It is not scheduled in a sequence. In the SetupCompleteSuccess dialog behavior for the OK button there is a DoAction with the name of my custom action as the Argument. Condition is based on LAUNCHPROGRAM which I set to 1 and confirmed with the verbose logging.

If I put a messagebox at the start of the script the messagebox will show. I can see in the logs that the CA is started and ends with a return value of 1.

ideas?
0 Kudos
RobertDickau
Flexera Alumni

So it's just that the HTML page isn't being launched? What does that code look like? Does launching any executable work?
0 Kudos
loralynne
Level 6

You can use a "Launch an executable" custom action with Location set to Stored in the Directory table. Create a DoAction event in a dialog for UI installs and insert it in the execution sequence for silent installs. This is how I do it, and it works like a champ.

Working Directory:
Filename & Command line: "[SystemFolder]cmd.exe" /C start
Return Processing: Asynchronous (No wait for completion)
In-Script Execution: Immediate Execution
Execution Scheduling: Always execute.

The MSI type number should be 226.

-loralynne
0 Kudos
RobertDickau
Flexera Alumni

For a quick InstallScript test, this seems to work; same action settings except for using Asynch + wait for exit code:
export prototype CallMeFromSetupCompleteSuccess(HWND);

function CallMeFromSetupCompleteSuccess(hInstall)
begin
// TO DO: get rid of hard-coded file path
LaunchApplication(
"C:\\Sources\\HtmlPanel\\sample.html", "",
"", SW_NORMAL, 0,
LAAW_OPTION_USE_SHELLEXECUTE | LAAW_OPTION_NOWAIT);

return ERROR_SUCCESS;
end;
0 Kudos
jwreels
Level 5

Thanks, that worked perfectly. The only thing I was doing differently was I was setting it to Synchronous and ignoring the exit code. Changing it to Asynch + waiting for the exit code works nicely. Thanks again.
0 Kudos