Skip to content

Commit 9547608

Browse files
authored
Build Chorus Hub Installer with GHA (#314)
* Build Chorus Hub Installer with GitHub Actions * Update a deprecated WiX attribute * clean up (completes #299) * check out help in a clean location
1 parent 33fd8cf commit 9547608

File tree

6 files changed

+48
-127
lines changed

6 files changed

+48
-127
lines changed

.github/workflows/dotnet.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ jobs:
6969
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
7070
with:
7171
repository: sillsdev/chorushelp
72-
path: lib
73-
clean: false # don't delete other files from lib
72+
path: DistFiles/Help
7473
if: matrix.os == 'windows-latest'
7574

7675
- name: Add msbuild to PATH
@@ -87,7 +86,7 @@ jobs:
8786
run: msbuild src/Installer/ChorusMergeModule.wixproj -t:pack
8887
if: matrix.os == 'windows-latest'
8988

90-
- name: Upload Merge Modules
89+
- name: Upload Merge Module
9190
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
9291
with:
9392
name: chorus-merge-module
@@ -96,6 +95,21 @@ jobs:
9695
output/*.nupkg
9796
if: matrix.os == 'windows-latest'
9897

98+
- name: Build Chorus Hub Installer
99+
run: |
100+
msbuild src/Installer/ChorusHub.wixproj /t:Restore
101+
msbuild src/Installer/ChorusHub.wixproj /t:StampLicenseYear
102+
msbuild src/Installer/ChorusHub.wixproj /t:Build
103+
if: matrix.os == 'windows-latest'
104+
105+
- name: Upload Chorus Hub Installer
106+
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
107+
with:
108+
name: chorus-hub-installer
109+
path: |
110+
output/Release/*.msi
111+
if: matrix.os == 'windows-latest'
112+
99113
- name: Pack
100114
run: dotnet pack --no-restore --no-build -c Release
101115

build/Chorus.proj

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/Installer/ChorusHub.wixproj

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- NB: rather than bothering with GitVersion here, we simply expect the version to be lingering in the environment from previous runs.
3+
This is supported by .github/workflows/dotnet.yml -->
24
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
35
<PropertyGroup>
46
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
57
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6-
<ProductVersion>3.5</ProductVersion>
8+
<ProductVersion>$(GitVersion_AssemblySemVer)</ProductVersion>
79
<ProjectGuid>c1ee5822-e382-11de-8a39-0800200c9a66</ProjectGuid>
810
<SchemaVersion>2.0</SchemaVersion>
911
<OutputName>ChorusHubInstaller</OutputName>
1012
<OutputType>Package</OutputType>
13+
<OutputPath>..\..\output\$(Configuration)\</OutputPath>
1114
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
1215
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
1316
<Name>ChorusHubInstaller</Name>
14-
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
16-
<OutputPath>..\..\output\Debug\</OutputPath>
17-
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
18-
<DefineConstants>Debug</DefineConstants>
19-
<SuppressPdbOutput>True</SuppressPdbOutput>
20-
</PropertyGroup>
21-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
22-
<OutputPath>..\..\output\Release\</OutputPath>
23-
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
17+
<DefineConstants>ProductVersion=$(ProductVersion)</DefineConstants>
18+
<DefineConstants Condition="'$(Configuration)' == 'Debug'">Debug;$(DefineConstants)</DefineConstants>
19+
<DefineSolutionProperties>false</DefineSolutionProperties>
2420
<SuppressPdbOutput>True</SuppressPdbOutput>
2521
</PropertyGroup>
2622
<ItemGroup>
@@ -47,12 +43,22 @@
4743
</WixExtension>
4844
</ItemGroup>
4945
<Import Project="$(WixTargetsPath)" />
50-
<!--
51-
To modify your build process, add your task inside one of the targets below and uncomment it.
52-
Other similar extension points exist, see Wix.targets.
53-
<Target Name="BeforeBuild">
54-
</Target>
55-
<Target Name="AfterBuild">
56-
</Target>
57-
-->
58-
</Project>
46+
47+
<!-- Stamp Years -->
48+
<Import Project="NuGet.targets" />
49+
<PropertyGroup>
50+
<SilBuildTasksVersion>2.5.0</SilBuildTasksVersion>
51+
<SilBuildTasksDll>$(NuGetToolsPath)/packages/SIL.BuildTasks.$(SilBuildTasksVersion)/tools/SIL.BuildTasks.dll</SilBuildTasksDll>
52+
</PropertyGroup>
53+
54+
<UsingTask TaskName="FileUpdate" AssemblyFile="$(SilBuildTasksDll)" Condition="Exists('$(SilBuildTasksDll)')" />
55+
56+
<Target Name="Restore" DependsOnTargets="CheckPrerequisites">
57+
<Exec Command='$(NuGetCommand) install SIL.BuildTasks -version $(SilBuildTasksVersion) -solutionDirectory $(NuGetToolsPath)'
58+
Condition="!Exists('$(SilBuildTasksDll)')" />
59+
</Target>
60+
61+
<Target Name="StampLicenseYear" DependsOnTargets="Restore">
62+
<FileUpdate File="resources\License.rtf" RegEx='COPYRIGHTYEARPLACEHOLDER' ReplacementText="$([System.DateTime]::Now.ToString(yyyy))" />
63+
</Target>
64+
</Project>

src/Installer/ChorusHub.wxs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- These variables define the Windows Installer product version, product code and upgrade code. They -->
3-
<!-- will be used later on in this file. -->
4-
<?define Property_ProductVersion = ".*" ?>
52
<!-- Generate a new one for each installer, since it only uses the major upgrade approach for msi installers.
63
cf: http://wix.sourceforge.net/manual-wix3/major_upgrade.htm
74
and http://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/
@@ -14,9 +11,9 @@ for details on why going the major upgrade route is the right answer for an msi-
1411
http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->
1512

1613
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
17-
<Product Id="$(var.Property_ProductCode)" Name="Chorus Hub $(var.Property_ProductVersion)" Language="1033" Version="$(var.Property_ProductVersion)" Manufacturer="SIL" UpgradeCode="$(var.Property_UpgradeCode)">
14+
<Product Id="$(var.Property_ProductCode)" Name="Chorus Hub $(var.ProductVersion)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="SIL" UpgradeCode="$(var.Property_UpgradeCode)">
1815
<!-- autogenerated package id -->
19-
<Package Id="*" Compressed="yes" InstallerVersion="200" InstallScope="perMachine" />
16+
<Package Id="*" Compressed="yes" InstallerVersion="300" InstallScope="perMachine" />
2017
<WixVariable Id="WixUILicenseRtf" Value="resources\License.rtf" />
2118
<WixVariable Id="WixUIDialogBmp" Value="resources\MSIBackground.bmp" />
2219

@@ -71,7 +68,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->
7168
<!--<fire:FirewallException Id="ChorusHubFireWallException" Name="Chorus Hub Send/Receive Client" Program="[#ChorusHub.exe]" Scope="localSubnet" IgnoreFailure="yes"/> -->
7269
</Component>
7370
<Component Id="RegInstallationDir" Guid="C1EECD52-E382-11DE-8A39-0800200C9A66">
74-
<RegistryKey Id="keyChorusHub.exe" Action="createAndRemoveOnUninstall" Root="HKLM" Key="SOFTWARE\[Manufacturer]\Chorus Hub">
71+
<RegistryKey Id="keyChorusHub.exe" ForceDeleteOnUninstall="yes" Root="HKLM" Key="SOFTWARE\[Manufacturer]\Chorus Hub">
7572
<RegistryValue Id="ChorusHubInstallationDir" Type="string" Value="[INSTALLDIR]" Name="InstallationDir"/>
7673
</RegistryKey>
7774
</Component>
@@ -84,7 +81,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->
8481
<File Id="Autofac.dll" Name="Autofac.dll" KeyPath="yes" Source="..\..\output\Release\net461\Autofac.dll" />
8582
</Component>
8683
<Component Id="chorushelp.chm" Guid="C1EECD56-E382-11DE-8A39-0800200C9A66">
87-
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\lib\Chorus_Help.chm"/>
84+
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\DistFiles\Help\Chorus_Help.chm"/>
8885
</Component>
8986
<!-- used by chorus help -->
9087
<Component Id="Vulcan.Uczniowie.HelpProvider.dll" Guid="C1EEF450-E382-11DE-8A39-0800200C9A66">

src/Installer/ChorusMergeModule.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->
5454
<File Id="chorusmerge.exe" Name="chorusmerge.exe" KeyPath="yes" Source="..\..\output\Release\net461\chorusmerge.exe" />
5555
</Component>
5656
<Component Id="chorushelp.chm" Guid="C1EDBBE9-E382-11DE-8A39-0800200C9A66">
57-
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\lib\Chorus_Help.chm"/>
57+
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\DistFiles\Help\Chorus_Help.chm"/>
5858
</Component>
5959

6060
<!-- used by chorus help -->
5 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)