Skip to content
Snippets Groups Projects
Commit a8acc718 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

msi-installer: deploy VC CRT files locally with the application

This avoids merge modules which may crush system runtimes files. We've had several issues packaging vc_redist binaries also, so this seems to a better option for now.

Gitlab: #1865
Change-Id: I9ac3d3a1945136d7f78cf5be2de5d05cf377e126
parent eaf409d6
No related branches found
No related tags found
No related merge requests found
/obj /obj
/bin /bin
Components.wxs AppComponents.wxs
CrtComponents.wxs
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0"
DefaultTargets="Build"
InitialTargets="EnsureWixToolsetInstalled"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x64</Platform> <Platform Condition=" '$(Platform)' == '' ">x64</Platform>
...@@ -16,7 +19,7 @@ ...@@ -16,7 +19,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>bin\$(Configuration)\</OutputPath> <OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>HarvestPath=..\x64\Release</DefineConstants> <DefineConstants>AppHarvestPath=..\x64\Release;CrtHarvestPath=$(VC_CRT_Dir)</DefineConstants>
<SuppressPdbOutput>True</SuppressPdbOutput> <SuppressPdbOutput>True</SuppressPdbOutput>
<CompilerAdditionalOptions> <CompilerAdditionalOptions>
</CompilerAdditionalOptions> </CompilerAdditionalOptions>
...@@ -26,7 +29,7 @@ ...@@ -26,7 +29,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Beta|x64' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Beta|x64' ">
<OutputPath>bin\$(Configuration)\</OutputPath> <OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>HarvestPath=..\x64\Beta</DefineConstants> <DefineConstants>AppHarvestPath=..\x64\Beta;CrtHarvestPath=$(VC_CRT_Dir)</DefineConstants>
<SuppressPdbOutput>True</SuppressPdbOutput> <SuppressPdbOutput>True</SuppressPdbOutput>
<CompilerAdditionalOptions> <CompilerAdditionalOptions>
</CompilerAdditionalOptions> </CompilerAdditionalOptions>
...@@ -35,7 +38,8 @@ ...@@ -35,7 +38,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Product.wxs" /> <Compile Include="Product.wxs" />
<Compile Include="Components.wxs" /> <Compile Include="AppComponents.wxs" />
<Compile Include="CrtComponents.wxs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Config.wxi" /> <Content Include="Config.wxi" />
...@@ -57,13 +61,36 @@ ...@@ -57,13 +61,36 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Localization.wxl" /> <EmbeddedResource Include="Localization.wxl" />
</ItemGroup> </ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " /> <Import Project="$(WixTargetsPath)"
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " /> Condition=" '$(WixTargetsPath)' != '' " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' "> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets"
Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled"
Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" /> <Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target> </Target>
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
<HeatDirectory Directory="..\x64\$(Configuration)" PreprocessorVariable="var.HarvestPath" OutputFile="Components.wxs" ComponentGroupName="HeatGenerated" DirectoryRefId="APPLICATIONFOLDER" AutogenerateGuids="true" ToolPath="$(WixToolPath)" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" Transforms="HarvestFilter.xslt" /> <HeatDirectory Directory="..\x64\$(Configuration)"
PreprocessorVariable="var.AppHarvestPath"
OutputFile="AppComponents.wxs"
ComponentGroupName="AppHeatGenerated"
DirectoryRefId="APPLICATIONFOLDER"
AutogenerateGuids="true"
ToolPath="$(WixToolPath)"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true"
Transforms="HarvestFilter.xslt" />
<HeatDirectory Directory="$(VC_CRT_Dir)"
PreprocessorVariable="var.CrtHarvestPath"
OutputFile="CrtComponents.wxs"
ComponentGroupName="CrtHeatGenerated"
DirectoryRefId="APPLICATIONFOLDER"
AutogenerateGuids="true"
ToolPath="$(WixToolPath)"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true" />
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
......
...@@ -39,28 +39,14 @@ ...@@ -39,28 +39,14 @@
Absent="disallow"> Absent="disallow">
<ComponentGroupRef Id="MainExecutable" <ComponentGroupRef Id="MainExecutable"
Primary="yes" /> Primary="yes" />
<ComponentGroupRef Id="HeatGenerated" /> <ComponentGroupRef Id="AppHeatGenerated" />
<ComponentGroupRef Id="CrtHeatGenerated" />
<ComponentRef Id="ApplicationShortcutDesktop" /> <ComponentRef Id="ApplicationShortcutDesktop" />
<ComponentRef Id="ApplicationShortcutStartMenu" /> <ComponentRef Id="ApplicationShortcutStartMenu" />
<ComponentRef Id="RegistryEntries" /> <ComponentRef Id="RegistryEntries" />
<ComponentRef Id="URLProtocolRegistryEntries" /> <ComponentRef Id="URLProtocolRegistryEntries" />
</Feature> </Feature>
<!--Visual C++ Redist merge module-->
<DirectoryRef Id="TARGETDIR">
<Merge Id="VCRedist"
SourceFile="$(env.VCRedistMergeModule)"
DiskId="1"
Language="0" />
</DirectoryRef>
<Feature Id="VCRedist"
Title="Visual C++ Runtime"
AllowAdvertise="no"
Display="hidden"
Level="1">
<MergeRef Id="VCRedist"/>
</Feature>
<SetProperty After="FindRelatedProducts" <SetProperty After="FindRelatedProducts"
Id="FirstInstall" Id="FirstInstall"
Value="true"> Value="true">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment