extended build file to create MSI-Installer packages

added WiX-project for Windows MSI-Installer package
WiX 3.6 needs to be installed to create installer packages
This commit is contained in:
Glatzemann 2011-11-22 09:16:38 +00:00
parent 5fa5c4ed37
commit 765876e0c6
2 changed files with 62 additions and 1 deletions

28
Installer/anx.wxs Normal file
View File

@ -0,0 +1,28 @@
<?xml version='1.0'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Id='{B7ABDA84-7163-4892-9AA1-814C6CDAAF54}' Name='ANX.Framework' Language='1033'
Version='1.0.0.0' Manufacturer='ANX.Framework Developer Team' UpgradeCode='{7A54B375-318B-40B7-ABF7-60BB50689361}' >
<Package Description='My first Windows Installer package'
Comments='This is my first attempt at creating a Windows Installer database'
Manufacturer='Microsoft Corporation' InstallerVersion='200' Compressed='yes' />
<Media Id='1' Cabinet='ANX.Framework.cab' EmbedCab='yes' />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='MyDir' Name='Test Program'>
<Component Id='ANX.Framework' Guid='{8A3AA04E-9325-441E-B16A-731676449C0B}'>
<File Id='license' Name='license.txt' DiskId='1' Source='../doc/license.txt' />
<File Id='anx.framework' Name='ANX.Framework.dll' DiskId='1' Source='../bin/Release/ANX.Framework.dll' />
<File Id='anx.framework.contentpipeline' Name='ANX.Framework.ContentPipeline.dll' DiskId='1' Source='../bin/Release/ANX.Framework.ContentPipeline.dll' />
<File Id='nlog' Name='NLog.dll' DiskId='1' Source='../bin/Release/NLog.dll' />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='ANX.Framework.Core' Title='ANX.Framework core assemblies' Level='1'>
<ComponentRef Id='ANX.Framework' />
</Feature>
</Product>
</Wix>

View File

@ -262,7 +262,7 @@
</exec>
</target>
<target name="create_packages" description="Generate zip package containing binaries" depends="build">
<target name="create_zip_packages" description="Generate zip package containing binaries" depends="build">
<loadfile file="${project.anx.path}/Properties/AssemblyInfo.cs" property="assembly_version_file" />
<regex pattern="AssemblyVersion\(.(?'assembly_version'\d+\.\d+.\d+)" input="${assembly_version_file}" />
<property name="build.output.release_package" value="../package/${project.anx.name}-${build.configuration}-${assembly_version}.zip"/>
@ -276,4 +276,37 @@
</zip>
</target>
<target name="create_msi_package" description="Create the installer package" depends="build">
<loadfile file="${project.anx.path}/Properties/AssemblyInfo.cs" property="assembly_version_file" />
<regex pattern="AssemblyVersion\(.(?'assembly_version'\d+\.\d+.\d+)" input="${assembly_version_file}" />
<property name="build.output.installer_package" value="../package/${project.anx.name}-${build.configuration}-${assembly_version}.msi"/>
<property name="wix.dir" value="${path::combine(environment::get-variable('WIX'), 'bin')}" readonly="true" />
<loadtasks assembly="${wix.dir}\Microsoft.Tools.WindowsInstallerXml.NAntTasks.dll" />
<candle out="${build.dir}/${build.configuration}/installer/" exedir="${wix.dir}">
<sources>
<include name="../Installer/anx.wxs" />
</sources>
</candle>
<light
exedir="${wix.dir}"
out="${build.output.installer_package}"
warningsaserrors="true"
suppressices="ICE57"
cultures="en-us"
extensions="WixUIExtension"
rebuild="true"
suppresspdb="true">
<!-- Specify additional options -->
<arg line="-fv" />
<sources basedir="${build.dir}/${build.configuration}/installer/">
<include name="*.wixobj" />
</sources>
</light>
</target>
</project>