Wix - launch the browser in the .Net download URL when the .NET environment is not installed

I have an installer built from an installation project and built using MSBuild using the method found here . While I was setting up the build process to create the .msi file, I was not setting up the project itself. One of the launch conditions for the installation project is to check the version of the .Net framework version 4, and if it is not installed on the target machine, a window will be displayed to the user indicating whether they want to visit the URL to download the .Net framework. If the user selects yes in the message box, the browser launches and loads the URL. Nice. The installation design also verifies another prerequisite required by our product and does the same.

I am currently rewriting the installer using Wix, and so far I have managed to overcome a few minor problems (given that I am still at an early stage of the installation as a whole). I was able to recreate the check for the .NET Framework v4.0 and other necessary software. I was also able to show a window informing me if he wants to launch the browser for the URL to download other necessary software using the wix custom action.

Problem

Wanting to do the same for the .Net Framework, as the old installer does, I wrote another custom action to launch the browser in the download URL of the .NET platform. I compiled the user actions and the installer and removed the .NET environment from my test machine. I ran the installer on my test computer, and the user actions did not work, this is because the .Net Framework is no longer installed on the test machine!

Question

Is there a way to recreate the way the original installation project was able to validate the .Net infrastructure, show the user a message box, and then launch the browser at the download URL if the user decides to do this? I was already able to install, if the infrastructure is not installed, just need to show the message box, launch the browser at a specific URL, if the user selects and does not allow the installer to continue.

or

Is there a way to start user actions on a computer that does not have the .Net infrastructure installed? (I assume that the answer to this question will not be!)

as always, thanks in advance

+7
source share
3 answers

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 that indicates whether .Net framework 4.0 is currently installed--> <Property Id="NETFRAMEWORK40"> <RegistrySearch Id="NetFramework40" Root="HKLM" Key="Software\Microsoft\NET Framework Setup\NDP\v4\Full" Name="Install" Type="raw" /> </Property> <!--Property that indicates whether 2007 Office Data Connectivity is currently installed--> <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&amp;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.

+11
source

As ZFE mentioned, perhaps the easiest way to do this is with the bootloader.

Once you have a managed download application, all you have to do is add .Net 4.0 as a prerequisite ..

a) Add a link to the WixNetFxExtension.dll file to the Bootstrapper / Managed Bootstrapper application project

b) Add the following as the first element in the chain.

 <PackageGroupRef Id="NetFx40Web"/> 

It really is!

NB The above will download .net 4 over the Internet, so an Internet connection is required. More information and options here: wixnetfxextension documentation

+2
source

What you have described can be done using boot machines. When they are created, the necessary software will be automatically installed. Some packages are already included in the Windows SDK (C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Bootstrapper \ Packages, for example), and you can use them, for example, from msbuild. Take a look at

GenerateBootstrapper

the task of creating the bootstrapper executable file (first you create your msi, then create a boot file for it).

I hope you find this helpful.

0
source

All Articles