-
Notifications
You must be signed in to change notification settings - Fork 12
build: wixv4 msi build (fixes #1) #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,31 @@ | ||
| name: Build the MSI (Installer) | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| build-msi: | ||
| name: 🪟 Build the MSI | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: ⚙️ Setup dotnet | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 7.0.x | ||
|
|
||
| - name: 🔨 Build the MSI | ||
| run: ./msi/build.ps1 | ||
|
|
||
| - name: 📦 Upload the MSI | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: "WSL USB Manager.msi" | ||
| path: "msi/bin/Release/WSL USB Manager.msi" | ||
This file contains hidden or 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,4 @@ | ||
| obj | ||
| .wix | ||
| bin | ||
| staging |
This file contains hidden or 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,108 @@ | ||
| <!-- Copyright (c) 2024 JP Hutchins --> | ||
| <!-- SPDX-License-Identifier: MIT --> | ||
|
|
||
| <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
| xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> | ||
|
|
||
| <Package Name="$(env.PRODUCT_NAME)" | ||
| Manufacturer="$(env.COMPANY_NAME)" | ||
| Version="$(env.VERSION)" | ||
| UpgradeCode="b958955b-2aef-4047-9319-642cb9c57b17" | ||
| ProductCode="*" | ||
| Language="1033" | ||
| Codepage="1252" | ||
| InstallerVersion="450"> | ||
|
|
||
| <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed" /> | ||
|
|
||
| <Media Id="1" | ||
| Cabinet="media1.cab" | ||
| EmbedCab="yes" | ||
| DiskPrompt="CD-ROM #1" /> | ||
| <Property Id="DiskPrompt" | ||
| Value="$(env.PRODUCT_NAME) Installation" /> | ||
|
|
||
| <Icon Id="Icon" | ||
| SourceFile="../resources/wsl-usb-manager.ico" /> | ||
| <Property Id="ARPPRODUCTICON" | ||
| Value="Icon" /> | ||
|
|
||
| <Feature Id="Main" | ||
| Title="$(env.PRODUCT_NAME)" | ||
| Description="Installs all application files." | ||
| Level="1" | ||
| ConfigurableDirectory="APPLICATIONFOLDER" | ||
| AllowAdvertise="no" | ||
| Display="expand" | ||
| AllowAbsent="no"> | ||
|
|
||
| <ComponentGroupRef Id="HarvestedComponents"/> | ||
|
|
||
| <Feature Id="StartMenuFolderFeature" | ||
| Title="Start Menu Folder" | ||
| Description="Add $(env.PRODUCT_NAME) to the Start Menu." | ||
| Level="1"> | ||
| <ComponentRef Id="ProgramMenuShortcuts" /> | ||
| </Feature> | ||
| </Feature> | ||
|
|
||
| <UI> | ||
| <ui:WixUI Id="WixUI_FeatureTree" /> | ||
| <Publish Dialog="WelcomeDlg" | ||
| Control="Next" | ||
| Event="NewDialog" | ||
| Value="CustomizeDlg" | ||
| Order="99" /> | ||
| <Publish Dialog="CustomizeDlg" | ||
| Control="Back" | ||
| Event="NewDialog" | ||
| Value="WelcomeDlg" | ||
| Order="99" /> | ||
| </UI> | ||
|
|
||
| <StandardDirectory Id="ProgramFiles6432Folder"> | ||
| <Directory Id="APPLICATIONFOLDER" | ||
| Name="$(env.PRODUCT_NAME)"> | ||
| </Directory> | ||
| </StandardDirectory> | ||
|
|
||
| <WixVariable Id="WixUIBannerBmp" | ||
| Value="WixUIBannerBmp.png" /> | ||
|
|
||
| <WixVariable Id="WixUIDialogBmp" | ||
| Value="WixUIDialogBmp.png" /> | ||
|
|
||
|
|
||
| <StandardDirectory Id="ProgramMenuFolder"> | ||
| <Directory Id="ProgramMenuDirFolder" | ||
| Name="$(env.PRODUCT_NAME)"> | ||
| <Component Id="ProgramMenuShortcuts" | ||
| Guid="97faee7a-2d17-4394-9869-2c9669ef2afe"> | ||
| <Shortcut Id="UninstallProduct" | ||
| Name="Uninstall $(env.PRODUCT_NAME)" | ||
| Description="Uninstalls $(env.PRODUCT_NAME)" | ||
| Target="[System64Folder]msiexec.exe" | ||
| Arguments="/x [ProductCode]" | ||
| Directory="ProgramMenuDirFolder" | ||
| Show="normal" /> | ||
| <Shortcut Id="Shortcut" | ||
| Name="WSL USB Manager" | ||
| Description="Start WSL USB Manager" | ||
| Target="[APPLICATIONFOLDER]$(env.EXE_NAME)" | ||
| Directory="ProgramMenuDirFolder" | ||
| Show="normal" /> | ||
| <RemoveFolder Id="ProgramMenuDirFolder" | ||
| On="uninstall" /> | ||
| <RegistryValue Root="HKCU" | ||
| Key="Software\[Manufacturer]\[ProductName]" | ||
| Name="installed" | ||
| Type="integer" | ||
| Value="1" | ||
| KeyPath="yes" /> | ||
| </Component> | ||
| </Directory> | ||
| </StandardDirectory> | ||
|
|
||
| </Package> | ||
|
|
||
| </Wix> |
This file contains hidden or 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,7 @@ | ||
| # Create an MSI (Installer) | ||
|
|
||
| From the root of the repository, run the build script: | ||
|
|
||
| ```powershell | ||
| ./msi/build.ps1 | ||
| ``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,26 @@ | ||
| # Copyright (c) 2024 JP Hutchins | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| # Build the release | ||
| cargo build --release | ||
|
|
||
| # Clean the msi directory | ||
| dotnet clean msi | ||
|
|
||
| # mkdir the staging directory if it doesn't exist | ||
| New-Item -ItemType Directory -Path msi/staging -Force | ||
|
|
||
| # Copy the files to the staging directory | ||
| Copy-Item target/release/wsl-usb-manager.exe msi/staging/wsl-usb-manager.exe | ||
| Copy-Item LICENSE.md msi/staging/LICENSE.md | ||
|
|
||
| # Run a dotnet build with some environment variables set | ||
| $env:COMPANY_NAME = "WSL USB Manager" | ||
| $env:PRODUCT_NAME = "WSL USB Manager" | ||
| $env:APP_NAME = "wsl-usb-manager" | ||
| $env:EXE_NAME = "wsl-usb-manager.exe" | ||
| $env:VERSION = (Get-Content Cargo.toml | Select-String -Pattern '^version\s*=\s*"(.*)"' | ForEach-Object { $_.Matches[0].Groups[1].Value }) | ||
| $env:PORTABLE_PATH = "staging" | ||
| $env:MSI_NAME = "WSL USB Manager" | ||
|
|
||
| dotnet build msi --configuration Release |
This file contains hidden or 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,25 @@ | ||
| <!-- Copyright (c) 2024 JP Hutchins --> | ||
| <!-- SPDX-License-Identifier: MIT --> | ||
|
|
||
| <Project Sdk="WixToolset.Sdk/5.0.2"> | ||
| <PropertyGroup> | ||
| <DefineConstants> ApplicationFiles=$(PORTABLE_PATH)/ | ||
| </DefineConstants> | ||
| <OutputName>$(MSI_NAME)</OutputName> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="WixToolset.Heat" Version="5.0.2" /> | ||
| <PackageReference Include="WixToolset.UI.wixext" Version="5.0.2" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <HarvestDirectory Include="$(PORTABLE_PATH)/"> | ||
| <ComponentGroupName>HarvestedComponents</ComponentGroupName> | ||
| <DirectoryRefId>APPLICATIONFOLDER</DirectoryRefId> | ||
| <SuppressRootDirectory>true</SuppressRootDirectory> | ||
| <SuppressRegistry>true</SuppressRegistry> | ||
| <PreprocessorVariable>var.ApplicationFiles</PreprocessorVariable> | ||
| </HarvestDirectory> | ||
| </ItemGroup> | ||
| </Project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.