Skip to content

Commit

Permalink
Update windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Sep 28, 2024
1 parent 8212736 commit a166148
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 80 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,13 @@ jobs:
uses: dawidd6/action-get-tag@v1
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
- uses: taiki-e/install-action@v2
with:
global-json-file: build/windows/installer/global.json
- name: Build release
run: |
cargo build --release
tool: just
- name: Build
run: cargo build --release
- name: Create Installer
run: dotnet build -c Release build/windows/installer/PortalInstaller.wixproj --output installer
run: just build-windows-installer
- name: Zip release
uses: vimtor/action-zip@v1
with:
Expand All @@ -128,7 +127,7 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: installer/en-US/portal-installer.msi
file: target/windows-installer/portal-installer.msi
asset_name: ${{ env.EXECUTABLE_NAME }}_${{ steps.tag.outputs.tag }}_windows.msi
tag: ${{ github.ref }}
overwrite: true
15 changes: 15 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set windows-shell := ["powershell"]

default:
just --list

build-windows-installer:
dotnet tool install --global wix --version 5.0.1
wix extension add WixToolset.UI.wixext/5.0.1 --global
wix build \
build/windows/installer/Package.wxs \
build/windows/installer/WixUI_InstallDir.wxs \
build/windows/installer/Package.en-us.wxl \
-ext WixToolset.UI.wixext \
-o target/windows-installer/portal-installer \
-bindpath build/windows/installer
2 changes: 0 additions & 2 deletions build/windows/installer/.gitignore

This file was deleted.

6 changes: 3 additions & 3 deletions build/windows/installer/Package.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
<MediaTemplate EmbedCab="yes"/>

<!-- Installer Icon -->
<Icon Id="icon.ico" SourceFile="..\..\..\target\icon.ico"/>
<Icon Id="icon.ico" SourceFile="..\portal.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />

<!-- Sets the default installation folder -->
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="!(bind.Property.ProductName)" />
</StandardDirectory>

<!-- Shows a UI that allows customizing the install location -->
<ui:WixUI Id="WixUI_CustomInstallDir" InstallDirectory="INSTALLFOLDER" />
<!-- Shows a UI that allows customizing the install location -->
<ui:WixUI Id="WixUI_InstallDir_NoLicense" InstallDirectory="INSTALLFOLDER" />

<Feature Id="Main">
<ComponentGroupRef Id="MainComponent" />
Expand Down
40 changes: 0 additions & 40 deletions build/windows/installer/PortalInstaller.sln

This file was deleted.

10 changes: 0 additions & 10 deletions build/windows/installer/PortalInstaller.wixproj

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copied from https://github.com/wixtoolset/wix/blob/dd2fe20d9fe58719445411524bd730495140d02f/src/ext/UI/wixlib/WixUI_InstallDir.wxs
with the license step removed.
See https://wixtoolset.org/docs/tools/wixext/wixui/#addingremovingdialogs for a tutorial. -->
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->

<!--
First-time install dialog sequence:
- WixUI_WelcomeDlg
- WixUI_LicenseAgreementDlg
- WixUI_InstallDirDlg
- WixUI_VerifyReadyDlg
- WixUI_DiskCostDlg
Maintenance dialog sequence:
- WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_InstallDirDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<!-- Copied from https://github.com/wixtoolset/wix4/blob/6f2511f58f60e63a15357a2fe37f83343dea3090/src/ext/UI/wixlib/WixUI_InstallDir.wxs#L9
but with the license dialog disabled.
See: https://wixtoolset.org/docs/v3/wixui/wixui_customizations/#changing-the-ui-sequence-of-a-built-in-dialog-set. -->
<?foreach WIXUIARCH in X86;X64;A64 ?>
<Fragment>
<UI Id="WixUI_CustomInstallDir">
<UI Id="WixUI_InstallDir_NoLicense_$(WIXUIARCH)">
<Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" />
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" />
</UI>

<UIRef Id="WixUI_InstallDir_NoLicense" />
</Fragment>
<?endforeach?>

<Fragment>
<UI Id="file WixUI_InstallDir_NoLicense">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
Expand Down Expand Up @@ -49,12 +83,4 @@

<UIRef Id="WixUI_Common" />
</Fragment>
<?foreach WIXUIARCH in X86;X64;A64 ?>
<Fragment>
<UI Id="WixUI_CustomInstallDir_$(WIXUIARCH)">
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(WIXUIARCH)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" />
</UI>
</Fragment>
<?endforeach?>
</Wix>
6 changes: 0 additions & 6 deletions build/windows/installer/global.json

This file was deleted.

0 comments on commit a166148

Please sign in to comment.