Setup Project versus Bootstrapper Project for chec

2019-06-27 05:16发布

问题:

Here is my situation:

  • I create a normal WiX Setup project.
  • Then I try to check some prerequisites like if the .NET framework is installed or not.
  • It seems that I am not able to do this from a WiX Setup project. So I create WiX Bootstrapper project and am able to check for and install those prerequisites.
  • I try to use the WiX Bootstrapper in the WiX Setup project but can not. The examples I see was, the WiX Bootstrapper project uses the Setup project with the MsiPackage tag.

It seems strange to me to start setup project from Bootstrapper project. Instead I prefer to start prerequisites check and installation from Setup project (maybe calling out to the bootstrapper project from the setup project).

So here are my questions:

  1. Is it possible to check for and install some prerequisites the .NET framework in Wix Setup project? If so, how?
  2. Is it okay to start the application from the WiX Bootstrapper and call the WiX setup project from it? Is that the general convention?

回答1:

  1. It is possible to check for Dotnet from the wix setup. But you cannot install pre requisites from the setup. So you can pop a message asking to install dotnet before installing.

This is how to check for dotnet 4.0 using wix.

<Property Id="DOTNET40">
    <RegistrySearch Id="NetFramework40"
                    Root="HKLM"
                    Key="Software\Microsoft\NET Framework Setup\NDP\v4"
             Name="Install"
                    Type="raw" />
</Property>


<Condition Message="Please install the .NET Framework 4.0 and run this installer again.">
    <![CDATA[Installed OR DOTNET40]]>
</Condition>
  1. Checking for pre requisites and installing them using the bootstrapper is the general convention. The main reason to use a bootstrapper is to install the pre requisites and then install your setup.