-
-
Save YounesCheikh/73f182355943b313413c409b55ce1da3 to your computer and use it in GitHub Desktop.
Demo wix project to publish a self-contained .NET Core app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | |
<ProductVersion>3.10</ProductVersion> | |
<ProjectGuid>91e4dc15-312a-4e90-bc1c-01de5dc99447</ProjectGuid> | |
<SchemaVersion>2.0</SchemaVersion> | |
<OutputName>CoreConsoleAppSetup</OutputName> | |
<OutputType>Package</OutputType> | |
<DefineSolutionProperties>false</DefineSolutionProperties> | |
<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> | |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | |
<OutputPath>bin\$(Configuration)\</OutputPath> | |
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> | |
<DefineConstants>Debug</DefineConstants> | |
</PropertyGroup> | |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> | |
<OutputPath>bin\$(Configuration)\</OutputPath> | |
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath> | |
</PropertyGroup> | |
<ItemGroup> | |
<Compile Include="Product.wxs" /> | |
</ItemGroup> | |
<ItemGroup> | |
<ProjectReference Include="..\src\CoreConsoleApp\CoreConsoleApp.xproj"> | |
<Name>CoreConsoleApp</Name> | |
<Project>{d6d08e89-e6ed-47bd-bf04-c149d2057970}</Project> | |
<Private>True</Private> | |
<DoNotHarvest>True</DoNotHarvest> | |
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups> | |
<RefTargetDir>INSTALLFOLDER</RefTargetDir> | |
<IsDotnetSDKProject>True</IsDotnetSDKProject> | |
<TargetFrameworkIdentifier>netcoreapp1.0</TargetFrameworkIdentifier> | |
<Runtime>win7-x64</Runtime> | |
</ProjectReference> | |
</ItemGroup> | |
<Import Project="$(WixTargetsPath)" /> | |
<Target Name="BeforeBuild"> | |
<Exec WorkingDirectory="%(ProjectReference.RootDir)%(ProjectReference.Directory)" Command="dotnet publish -c $(Configuration) -f %(ProjectReference.TargetFrameworkIdentifier) -r %(ProjectReference.Runtime)" Condition="'%(ProjectReference.IsDotnetSDKProject)' == 'True'" /> | |
<ItemGroup> | |
<LinkerBindInputPaths Include="%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Configuration)\%(ProjectReference.TargetFrameworkIdentifier)\%(ProjectReference.Runtime)\publish" /> | |
</ItemGroup> | |
<HeatDirectory | |
DirectoryRefId="INSTALLFOLDER" | |
OutputFile="obj\$(Configuration)\%(ProjectReference.Name).wxs" | |
Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Configuration)\%(ProjectReference.TargetFrameworkIdentifier)\%(ProjectReference.Runtime)\publish" | |
ComponentGroupName="SourceComponentGroup" | |
ToolPath="$(WixToolPath)" | |
AutogenerateGuids="true" | |
SuppressCom="True" | |
SuppressRegistry="True" | |
SuppressFragments="true" | |
SuppressRootDirectory="true" | |
Condition="'%(ProjectReference.IsDotnetSDKProject)' == 'True'"/> | |
<ItemGroup> | |
<Compile Include="obj\$(Configuration)\%(ProjectReference.Name).wxs" Condition="'%(ProjectReference.IsDotnetSDKProject)' == 'True'" /> | |
</ItemGroup> | |
</Target> | |
<!-- | |
To modify your build process, add your task inside one of the targets below and uncomment it. | |
Other similar extension points exist, see Wix.targets. | |
<Target Name="AfterBuild"> | |
</Target> | |
--> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |
<Product Id="*" Name="CoreConsoleAppSetup" Language="1033" Version="1.0.0.0" Manufacturer="Martin" UpgradeCode="5f5ea8c6-7584-4bf7-a935-1ec77a688106"> | |
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> | |
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | |
<MediaTemplate EmbedCab="yes" /> | |
<Feature Id="ProductFeature" Title="CoreConsoleAppSetup" Level="1"> | |
<ComponentGroupRef Id="ProductComponents" /> | |
</Feature> | |
</Product> | |
<Fragment> | |
<Directory Id="TARGETDIR" Name="SourceDir"> | |
<Directory Id="ProgramFilesFolder"> | |
<Directory Id="INSTALLFOLDER" Name="CoreConsoleAppSetup" /> | |
</Directory> | |
</Directory> | |
</Fragment> | |
<Fragment> | |
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | |
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> | |
<!-- <Component Id="ProductComponent"> --> | |
<!-- TODO: Insert files, registry keys, and other resources here. --> | |
<!-- </Component> --> | |
<ComponentGroupRef Id="SourceComponentGroup" /> | |
</ComponentGroup> | |
</Fragment> | |
</Wix> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment