I created bootstrapper,it works but it does not install NET Framework 4.0. After the installation completed my application does not start because no NET Framework 4.0. Why it does not install NETF 4.0?
<ItemGroup>
<BootstrapperFile Include="Microsoft.Windows.Installer.4.5">
<ProductName>Windows Installer 4.5</ProductName>
</BootstrapperFile>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>True</Visible>
<ProductName>.NET Framework 4.0</ProductName>
<Install>True</Install>
<Visible>True</Visible>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="AfterBuild">
<GenerateBootstrapper ApplicationFile="DOGInstaller.msi"
ApplicationName="DOG"
BootstrapperItems="@(BootstrapperFile)"
CopyComponents="True"
ComponentsLocation="HomeSite"
OutputPath="$(OutputPath)\en-us\"
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper"
Culture="en" />
</Target>
In the wixproj file, add the following structure. Note that the <WixTargetsPath>
tags must reside in the the first <PropertyGroup>
node, along with the rest of what's usually there.
<Project>
<PropertyGroup> <!-- This must be the first PropertyGroup node. -->
...
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
...
<ItemGroup>
<BootstrapperFile Include="Microsoft.Windows.Installer.3.1">
<ProductName>Windows Installer 3.1</ProductName>
</BootstrapperFile>
<BootstrapperFile Include=".NETFramework,Version=v4.0">
<ProductName>Microsoft .NET Framework 4.0 (x86 and x64)</ProductName>
</BootstrapperFile>
</ItemGroup>
<PropertyGroup>
<BootstrapperPath>$(ProgramFiles)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\</BootstrapperPath>
</PropertyGroup>
<Target Name="AfterBuild">
<GenerateBootstrapper
ApplicationFile="$(TargetFileName)"
ApplicationName="$(OutputName)"
BootstrapperItems="@(BootstrapperFile)"
ComponentsLocation="Relative"
CopyComponents="True"
OutputPath="$(OutputPath)"
Path="$(BootstrapperPath)" />
</Target>
</Product>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With