OK, after some lengthy investigation and a lot of trial and error, I was able to achieve my goal of launching a default web browser when some registry entries were not present.
First, I checked the necessary registry entries
<Property Id="NETFRAMEWORK40"> <RegistrySearch Id="NetFramework40" Root="HKLM" Key="Software\Microsoft\NET Framework Setup\NDP\v4\Full" Name="Install" Type="raw" /> </Property> <Property Id="ODCINSTALLED"> <RegistrySearch Id="CheckODCVersion" Root="HKLM" Key="SOFTWARE\Classes\Installer\Products\000021091D0090400000000000F01FEC" Name="Version" Type="raw" /> </Property>
Then I added the WixUtilExtension link for the project and set the following 3 user actions:
<CustomAction Id="SetExec1" Property="WixShellExecTarget" Value="http://go.microsoft.com/fwlink/?LinkID=186913" /> <CustomAction Id="SetExec2" Property="WixShellExecTarget" Value="http://www.microsoft.com/downloads/en/details.aspx?familyid=7554f536-8c28-4598-9b72-ef94e038c891&displaylang=en" /> <CustomAction Id="LaunchBrowser" BinaryKey="WixCA" DllEntry="WixShellExec" Execute="immediate" Return="ignore" />
The first two user actions allow you to set the WixShellExecTarget property, which will be used at different times, the last user action is to launch the default browser using the WixShellExec utility.
Then I installed 2 user dialogs for my installer interface, a total of 2 simple message boxes with a short message and the "Yes" and "No" buttons. Below is just one of the posts, as they are very similar in appearance:
<Dialog Id="NetFRWDlg" Width="260" Height="95" Title="[ProductName] Installation" NoMinimize="yes"> <Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="40"> <Text>This setup requires the .NET Framework version 4.0. Please install the .NET Framework and run this setup again. The .NET Framework can be obtained from the web. Would you like to do this now?</Text> </Control> <Control Id="YesButton" Type="PushButton" X="72" Y="67" Width="56" Height="17" Default="yes" Cancel="yes" Text="[ButtonText_Yes]"> <Publish Event="DoAction" Value="SetExec1" Order="1">1</Publish> <Publish Event="DoAction" Value="LaunchBrowser" Order="2">1</Publish> <Publish Event="EndDialog" Value="Exit" Order="3">1</Publish> </Control> <Control Id="NoButton" Type="PushButton" X="132" Y="67" Width="56" Height="17" Default="no" Cancel="yes" Text="[ButtonText_No]"> <Publish Event="EndDialog" Value="Exit">1</Publish> </Control> <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="Information icon" FixedSize="yes" IconSize="32" Text="[WarningIcon]" /> </Dialog>
Then I added these 2 dialogs to the InstallUISequence table:
<InstallUISequence> <Show Dialog="NetFRWDlg" After="AppSearch"> (NOT Installed) AND (NOT NETFRAMEWORK40) </Show> <Show Dialog="ODCDlg" After="AppSearch"> (NOT Installed) AND (NOT ODCINSTALLED) </Show> <Show Dialog="Install_PAGE1" After="CostFinalize" /> </InstallUISequence>
To give a brief description of how this all comes together when the installer starts, it checks for the necessary registries using the NETFRAMEWORK40 and ODCINSTALLED properties. During installation of InstallUISequence, NetFRWDlg or ODCDlg dialog boxes / messages will be displayed if these registries are missing. Then the user can choose to launch the default browser to view the transferred URLs by clicking the "Yes" button of the dialog / message window. In this case, a sequence of actions is performed to configure the WixShellExecTarget property, launch the default browser and exit the setup program. If the user clicks "No", the installer will simply exit.