InstallShield Tips and Techniques

April 5, 2010

Launching a webpage on final dialog

Filed under: Reference Materials — shieldmaster @ 9:37 pm

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.

Regards

ShieldMaster

 

Advertisements

4 Comments »

  1. I am trying to create a basic MSI project, where I want to launch another exe file during the installation. You may think of a third party tool, or some other indipendent application. But the problem is, when I use custom action to launch the other exe… it is launched but stucks somewhere between and hangs my system. Can you help me in this??

    Comment by amit — April 19, 2010 @ 6:40 am

    • Sounds like the Exe is awaiting some response. Have you tried running the exe in a command line to observe its behavior? Might give you a clue as to what is happening. When running 3rd Party apps, sometimes you have to change directories first to ensure the Current Directory is available to the exe. I doubt if MSI logging would be of benefit – it won’t show any issue with the hanging app. Can you contact the vendor?
      Charles

      Comment by shieldmaster — April 19, 2010 @ 11:41 am

  2. I also have the quite similar problem. In fact my third party exe is working fine with command prompt as well as from my application at the time of Installation.
    And I Installed third party exe silently by using ‘/q /s /norestart’ parameters.

    Now actual problem is what whenever user cancel the installation of my application then after third party application is getting installed. Its not getting rolled back like my application.

    Please give me some hint to resolve this issue.

    Comment by Mohit Patel — November 11, 2011 @ 1:42 am

    • If I understand your issue, your installation successfully installs the 3rd party app, and while the installation continues – it is cancelled by the user. The rollback is successful, but the 3rd Party app is still installed.

      In that situation, you would need to create a special Rollback Custom Action to remove the 3rd party app – typically scripting Custom Actions are not added to the automatic rollback scripts. OR you could leave it installed – and when your Custom Action attempts to install the 3rd Party app, it can check first that it is not installed before launching the 3rd Party app.
      Hope this helps!
      Shieldmaster

      Comment by shieldmaster — November 11, 2011 @ 1:55 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: