Recently, I had a customer want to launch a webpage when the final installation dialog was presented.
Obviously the original request was for a traditional web page link shown by the traditional underscored phrase. No version of InstallShield supports this feature – although in the Release Notes for InstallShield 2010, there is a mention of being able to embed a hyperlink within a dialog. For for all of you who are not up-to-date with the latest IS version, here are the steps that I took to handle this request.
I modified the existing link that enabled you to "Launch a program" that is built into the final dialog "SetupCompleteSuccess". The important parts of the dialog are:
- CheckLaunchProgram – this is the CheckBox field
- LaunchProgramText – this is the text that accompanies the CheckBox field, relatively small
- UpdateTextLine2 – this is another text field that I commandeered to provide more accomplanying text than what was available.
Step 1:
Ensure all fields have the same launch conditions. The one I grabbed had a different launch conditions – so ensure the conditions are the same - alter the SHOW Condition
"SHOWLAUNCHPROGRAM="-1″ And PROGRAMFILETOLAUNCHATEND <> "" And NOT Installed And NOT ISENABLEDWUSFINISHDIALOG
This allows all of the fields to show on the dialog that you are working with.
Step 2:
Alter the wording on the Text fields to your requirements. Then reshift the TOP and LEFT values so that it lines up on the screen. The original locations tend to bunch up near the top screen. Suggestion – if you have a massive installation project, you won't be able to view the changes easily – I used a "testbed" project with no files to get the look and feel of the dialog to my likeing before I injected the changes into the final project.
Step 3:
Add the properties that control the visibility of the new fields into the Property Manager. These are:
IE_EXPLORER_PATH (no value needed for this one)
LAUNCHPROGRAM="1″
SHOWLAUNCHPROGRAM="-1″
PROGRAMFILETOLAUNCHATEND="-1″
Note that the last two properties have "-1″ – this matches up with the Launch Conditions.
Step 4:
Now create the new InstallShield Custom Action that will be triggered by the checkbox. I named my Custom Action "ISI_LaunchURL" and when using the Custom Action Wizard, it was a "New EXE" that had a "Path in Property Value". Since its execution is from a DOACTION, there is no sequencing required. Since you want the installation to finish while the URL is being launched, specify for the Return Processing property – Asynchronous (Don't wait for completion). The property that holds the path is "IE_EXPLORER_PATH" and will be created next via a System Search function. The command line will be something like this:
[WEB_ADDRESS]/Docs/Help.aspx#ServiceInstallation
Now, the [WEB_ADDRESS] is a MSI Property that comes across within one of the Dialogs - the customer had entered that value, so I know that the value contains Http://www.XXXX.com – if the format was not correct, then I would need to append/prepend the required values. Warning: Be aware that if the customer enters a space at the end of the WEB_ADDRESS field, then that space would be incorrectly carried forward to this URL – so you may need to edit the field after the entry was made in the dialog.
Step 5:
Now create the new System Search entry. Use the Wizard and choose "Registry – File Path as specified by a reg entry" On the next screen, enter "HKEY_LOCAL_MACHINE" for the Registry Root entry and enter "SOFTWARE¥Microsoft¥Windows¥CurrentVersion¥App Paths¥IEXPLORE.EXE" and leave the remaining fields blank. On the MSI Property, enter "IE_EXPLORER_PATH". This System Search will kick off at the very beginning of the install and will retrieve the path entry of the Internet explorer and put the value in the MSI Property "IE_EXPLORER_PATH", which should be like this "C:¥Program Files¥Internet Explorer¥IEXPLORE.EXE"
Step 6:
Now we need to modify the dialog "SetupCompleteSuccess" and have it launch the web page URL when the button is checked. Navigate to the dialog, and select the dialog's "Behavior" section. Find the OK button and enter the following condition: DOACTION as the Event, then select from the Argument dropdown "ISI_LAUNCHURL" and finally put in the condition LAUNCHPROGRAM="1″
Now you must move that Event up to be in front of the EndDialog EXIT event!
Step 7:
Now Test / evaluate your finished work. Note that when the final dialog is displayed, the checkbox will automatically be checked. This is because the MSI Property was present within the Property Manager. You had to put it there to be able to reference it within the above steps. If you now remove it from the Property Manager, the default action is that the box is unchecked. When testing, you can check the box, hit FINISH button and the URL should be launched.
More