-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from otakulan/feature/tgh/msi-installer
Create MSI installer for deployment
- Loading branch information
Showing
10 changed files
with
245 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This workflow will build a .NET project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | ||
|
||
name: .NET | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Cache NuGet packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}-${{ hashFiles('**/*.wixproj') }} | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Build application | ||
run: dotnet build --no-restore --verbosity normal Lanpartyseating.Desktop --configuration Release | ||
- name: Test | ||
run: dotnet test --no-restore --verbosity normal Lanpartyseating.Desktop.Tests --configuration Release | ||
- name: Build | ||
run: dotnet build LanpartySeating.Desktop.Installer/LanpartySeating.Desktop.Installer.wixproj --configuration Release --property:Version=1.0.20 | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: LanpartySeating.Desktop.Installer | ||
path: | | ||
LanpartySeating.Desktop.Installer/bin/Release/LanpartySeating.Desktop.Installer.msi | ||
LanpartySeating.Desktop.Installer/bin/Release/LanpartySeating.Desktop.Installer.wixpdb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"> | ||
<xsl:output method="xml" indent="yes"/> | ||
|
||
<!-- Identity transformation: copy all content by default --> | ||
<xsl:template match="@*|node()"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@*|node()"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<!-- Remove the executable, we reference it in the service installation --> | ||
<xsl:key | ||
name="FilesToRemove" | ||
match="wix:Component[wix:File[contains(@Source, 'Lanpartyseating.Desktop.exe')]]" | ||
use="@Id" | ||
/> | ||
|
||
<!-- Remove the configuration files, they should be provided by the user --> | ||
<xsl:key | ||
name="FilesToRemove" | ||
match="wix:Component[wix:File[contains(@Source, 'appsettings.json')]]" | ||
use="@Id" | ||
/> | ||
<xsl:key | ||
name="FilesToRemove" | ||
match="wix:Component[wix:File[contains(@Source, 'appsettings.Development.json')]]" | ||
use="@Id" | ||
/> | ||
|
||
<!-- ...but if the element has the "FilesToRemove" key then don't render anything (i.e. removing it from the output) --> | ||
<xsl:template match="wix:ComponentRef[ key( 'FilesToRemove', @Id ) ]" /> | ||
<xsl:template match="wix:Component[ key( 'FilesToRemove', @Id ) ]" /> | ||
</xsl:stylesheet> |
27 changes: 27 additions & 0 deletions
27
LanpartySeating.Desktop.Installer/Lanpartyseating.Desktop.Installer.wixproj
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<Project Sdk="WixToolset.Sdk/4.0.2"> | ||
<PropertyGroup> | ||
<!-- Default to Version 1.0.0 if not specified via /p:Version=x.x.x from cli --> | ||
<Version Condition=" '$(Version)' == '' ">1.0.0</Version> | ||
<!-- Propagate version information from msbuild to the WiX project --> | ||
<DefineConstants>$(DefineConstants);Version=$(Version)</DefineConstants> | ||
<OutputType>package</OutputType> | ||
<TargetFramework>net7.0-windows</TargetFramework> | ||
<InstallerPlatform>x64</InstallerPlatform> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<HarvestDirectory Include="..\Lanpartyseating.Desktop\bin\$(Configuration)\net7.0-windows\"> | ||
<DirectoryRefId>INSTALLFOLDER</DirectoryRefId> | ||
<ComponentGroupName>ApplicationFilesComponentGroup</ComponentGroupName> | ||
<KeepEmptyDirectories>true</KeepEmptyDirectories> | ||
<SuppressRootDirectory>true</SuppressRootDirectory> | ||
<Transforms>ExcludeFiles.xslt</Transforms> | ||
</HarvestDirectory> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Lanpartyseating.Desktop\Lanpartyseating.Desktop.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="WixToolset.Heat" Version="4.0.2" /> | ||
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.2" /> | ||
</ItemGroup> | ||
</Project> |
101 changes: 101 additions & 0 deletions
101
LanpartySeating.Desktop.Installer/Lanpartyseating.Desktop.Installer.wxs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?define Name = "Lanparty Seating Desktop Client" ?> | ||
<?define FolderName = "Lanparty Seating" ?> | ||
<?define Manufacturer = "Otakuthon PC Gaming" ?> | ||
<?define UpgradeCode = "{B7277C09-B011-4D40-8995-2093303E9F28}" ?> | ||
|
||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util"> | ||
<Package Name="$(Name)" | ||
Manufacturer="$(Manufacturer)" | ||
Version="$(Version)" | ||
UpgradeCode="$(UpgradeCode)" | ||
Compressed="true"> | ||
|
||
<Media Id="1" Cabinet="application.cab" EmbedCab="yes" /> | ||
|
||
<Feature Id="MainApplication" Title="Lanpartyseating.Desktop Application" Level="1"> | ||
<!-- Reference the component group inside the feature. --> | ||
<ComponentGroupRef Id="ApplicationFilesComponentGroup" /> | ||
<ComponentRef Id="ConfigPermissions" /> | ||
</Feature> | ||
|
||
<!-- Allow upgrades and prevent downgrades --> | ||
<MajorUpgrade DowngradeErrorMessage="A later version of $(Name) is already installed. Setup will now exit." /> | ||
|
||
<!-- Define the ProgramFiles64Folder directory --> | ||
<StandardDirectory Id="ProgramFiles64Folder"> | ||
<Directory Id="INSTALLFOLDER" Name="$(FolderName)" /> | ||
</StandardDirectory> | ||
<!-- Define the ProgramData directory --> | ||
<StandardDirectory Id="CommonAppDataFolder"> | ||
<Directory Id="CONFIGFOLDER" Name="$(FolderName)" /> | ||
</StandardDirectory> | ||
|
||
<DirectoryRef Id="CONFIGFOLDER"> | ||
<!-- Create config folder to store appsettings.json --> | ||
<!-- Make sure regular users can't read the config file because it contains credentials --> | ||
<Component Id="ConfigPermissions" Guid="16b25c34-404e-47d5-9fd5-b88eb507216d"> | ||
<CreateFolder> | ||
<!-- Deny read access to Everyone --> | ||
<util:PermissionEx User="Users" | ||
GenericRead="no" | ||
Read="no" | ||
GenericExecute="no" | ||
Domain="[LOCAL_MACHINE]" /> | ||
|
||
<util:PermissionEx User="Administrators" | ||
GenericAll="yes" | ||
GenericWrite="yes" | ||
Delete="yes" | ||
Domain="[LOCAL_MACHINE]" /> | ||
|
||
<util:PermissionEx User="LocalService" | ||
GenericRead="yes" | ||
GenericWrite="yes" | ||
Delete="yes" | ||
Domain="[LOCAL_MACHINE]" /> | ||
</CreateFolder> | ||
</Component> | ||
</DirectoryRef> | ||
|
||
<!-- The files inside this DirectoryRef are linked to | ||
the Lanpartyseating.Desktop directory via INSTALLFOLDER --> | ||
<DirectoryRef Id="INSTALLFOLDER"> | ||
|
||
<!-- Create a single component which is the Lanpartyseating.Desktop.exe file --> | ||
<Component Id="ServiceExecutable" Bitness="always64" Guid="3bcec0f5-8bfa-4fd0-98e8-2ebe0371efa4"> | ||
|
||
<File Source="..\Lanpartyseating.Desktop\bin\$(Configuration)\net7.0-windows\Lanpartyseating.Desktop.exe" /> | ||
|
||
<!-- Remove all files from the INSTALLFOLDER on uninstall --> | ||
<RemoveFile Id="ALLFILES" Name="*.*" On="both" /> | ||
|
||
<!-- Tell WiX to install the Service --> | ||
<ServiceInstall Id="ServiceInstaller" | ||
Type="ownProcess" | ||
Name="Lanpartyseating.Desktop" | ||
DisplayName="Lanparty Seating Desktop Client" | ||
Description="A desktop client for the Lanparty Seating System" | ||
Start="auto" | ||
Account="LocalSystem" | ||
Interactive="no" | ||
ErrorControl="normal" /> | ||
|
||
<!-- Tell WiX not to start the service on install but to stop it on uninstall --> | ||
<ServiceControl Id="StartService" | ||
Start="none" | ||
Stop="both" | ||
Remove="uninstall" | ||
Name="Lanpartyseating.Desktop" | ||
Wait="true" /> | ||
</Component> | ||
</DirectoryRef> | ||
|
||
<!-- Tell WiX to install the service --> | ||
<Feature Id="Service" Title="Lanpartyseating.Desktop Service" Level="1"> | ||
<ComponentRef Id="ServiceExecutable" /> | ||
</Feature> | ||
|
||
</Package> | ||
</Wix> |
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
3 changes: 2 additions & 1 deletion
3
Lanpartyseating.Desktop/Business/PhoenixChannelReactorService.cs
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Lanpartyseating.Desktop; | ||
namespace Lanpartyseating.Desktop.Config; | ||
|
||
public class SeatingOptions | ||
{ | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
{ | ||
"profiles": { | ||
"Lanpartyseating.Desktop": { | ||
"Debug": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"environmentVariables": { | ||
"DOTNET_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"Release": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true | ||
} | ||
} | ||
} |
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