Use the digitalxero/go-msix library to create a MSIX package.
Install Chocolatey.
choco install -y msys2 --params="'/NoPath'"
choco install -y goExecute the following commands in a MSYS2 bash session.
Install the dependencies:
winget install --exact --id MichalTrojnara.osslsigncodeTo use the updated PATH environment variable, which will now include the
newly installed applications, exit the shell session, and open a new one.
Build the application, the example code signing certificate, and the MSIX:
go generate ./...
CGO_ENABLED=0 GOAMD64=v3 go build -trimpath -ldflags "-s -w"
./create-example-code-signing-certificate.sh
./use-go-msix.exe build-msixInstall the unsigned MSIX, show information about it, execute it, and finally uninstall it:
unzip -l use-go-msix-unsigned.msix
unzip -p use-go-msix-unsigned.msix AppxManifest.xml
pwsh -Command 'Add-AppxPackage use-go-msix-unsigned.msix -AllowUnsigned'
pwsh -Command 'Get-AppxPackage -Name UseGoMsix'
pwsh -Command '&"$((Get-AppxPackage -Name UseGoMsix).InstallLocation)\use-go-msix.exe"'
pwsh -Command 'Start-Process "shell:AppsFolder\$((Get-AppxPackage -Name UseGoMsix).PackageFamilyName)!App"'
pwsh -Command 'Get-AppxPackage -Name UseGoMsix | Remove-AppxPackage'Install the signed MSIX, show information about it, execute it, and finally uninstall it:
NB The signature verification will fail when your host does not trust the
example-code-signing CA.
unzip -l use-go-msix.msix
unzip -p use-go-msix.msix AppxManifest.xml
osslsigncode verify -in use-go-msix.msix -CAfile example-code-signing-ca-crt.pem
pwsh -Command 'Import-Certificate example-code-signing-ca-crt.pem -CertStoreLocation Cert:/LocalMachine/Root'
pwsh -Command 'Get-AuthenticodeSignature use-go-msix.msix | Format-List'
pwsh -Command 'Add-AppxPackage use-go-msix.msix'
pwsh -Command 'Get-AppxPackage -Name UseGoMsix'
pwsh -Command '&"$((Get-AppxPackage -Name UseGoMsix).InstallLocation)\use-go-msix.exe"'
pwsh -Command 'Start-Process "shell:AppsFolder\$((Get-AppxPackage -Name UseGoMsix).PackageFamilyName)!App"'
pwsh -Command 'Get-AppxPackage -Name UseGoMsix | Remove-AppxPackage'
pwsh -Command 'Remove-Item -Path "Cert:/LocalMachine/Root/$(([System.Security.Cryptography.X509Certificates.X509Certificate2]::new([System.IO.File]::ReadAllBytes("example-code-signing-ca-crt.pem"))).Thumbprint)"'- https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/package-identity-overview
- https://learn.microsoft.com/en-us/windows/msix/package/unsigned-package
- https://devblogs.microsoft.com/insidemsix/is-this-a-packaged-process/
- https://github.com/digitalxero/go-msix
- https://thesvg.org/icon/gopher