change wix install method from perMachine to perUser (#12720)

# Description

This PR:
* Updates to the latest cargo-wix
* Changes install method from perMachine to perUser
* Updates HKCU Path vs HKLM Path
* Updates Windows Terminal Fragment Json to be compatible with [their
spec](https://learn.microsoft.com/en-us/windows/terminal/json-fragment-extensions).
* Updates License year from 2022 to 2024

The result of these changes makes our Windows installer no longer prompt
with a UAC dialog and installs the binaries into
`%LocalAppData%\Programs\nu\bin`.

All of this is an attempt to make WinGet releases less error prone.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
This commit is contained in:
Darren Schroeder 2024-05-01 18:31:16 -04:00 committed by GitHub
parent 2970d48d41
commit bc18cc12d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 8 deletions

View File

@ -192,7 +192,7 @@ if $os in ['macos-latest'] or $USE_UBUNTU {
# Wix need the binaries be stored in target/release/ # Wix need the binaries be stored in target/release/
cp -r ($'($dist)/*' | into glob) target/release/ cp -r ($'($dist)/*' | into glob) target/release/
ls target/release/* | print ls target/release/* | print
cargo install cargo-wix --version 0.3.4 cargo install cargo-wix --version 0.3.8
cargo wix --no-build --nocapture --package nu --output $wixRelease cargo wix --no-build --nocapture --package nu --output $wixRelease
# Workaround for https://github.com/softprops/action-gh-release/issues/280 # Workaround for https://github.com/softprops/action-gh-release/issues/280
let archive = ($wixRelease | str replace --all '\' '/') let archive = ($wixRelease | str replace --all '\' '/')

Binary file not shown.

View File

@ -47,7 +47,7 @@
InstallerVersion='450' InstallerVersion='450'
Languages='1033' Languages='1033'
Compressed='yes' Compressed='yes'
InstallScope='perMachine' InstallScope='perUser'
SummaryCodepage='1252' SummaryCodepage='1252'
Platform='$(var.Platform)'/> Platform='$(var.Platform)'/>
@ -57,6 +57,8 @@
<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/> <Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
<Property Id='DiskPrompt' Value='nu Installation'/> <Property Id='DiskPrompt' Value='nu Installation'/>
<Property Id="ALLUSERS" Secure="yes" Value="2" />
<Property Id="MSIINSTALLPERUSER" Secure="yes" Value="1" />
<Directory Id='TARGETDIR' Name='SourceDir'> <Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'> <Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
@ -94,7 +96,7 @@
Permanent='no' Permanent='no'
Part='last' Part='last'
Action='set' Action='set'
System='yes'/> System='no'/>
</Component> </Component>
<Component Id='binary0' Guid='*' Win64='$(var.Win64)'> <Component Id='binary0' Guid='*' Win64='$(var.Win64)'>
<File <File
@ -303,18 +305,25 @@
</Directory> </Directory>
</Directory> </Directory>
<Directory Id='CommonAppDataFolder'> <Directory Id='LocalAppDataFolder'>
<Directory Id='AppDataMicrosoftFolder' Name='Microsoft'> <Directory Id='AppDataMicrosoftFolder' Name='Microsoft'>
<Directory Id='AppDataWindowsTerminalFolder' Name='Windows Terminal'> <Directory Id='AppDataWindowsTerminalFolder' Name='Windows Terminal'>
<Directory Id='WindowsTerminalProfileFolder' Name='Fragments'> <Directory Id='WindowsTerminalProfileFolder' Name='Fragments'>
<Directory Id='WindowsTerminalProfileAppFolder' Name='nu'> <Directory Id='WindowsTerminalProfileAppFolder' Name='nu'>
<Component Id='WindowsTerminalProfile' Guid='*' Win64='$(var.Win64)'> <Component Id='WindowsTerminalProfile' Guid='957239F4-7B87-4399-9F91-7DF2ABE5ED8B' Win64='$(var.Win64)'>
<File <File
Id='WindowsTerminalProfileFile' Id='WindowsTerminalProfileFile'
Name='nu.json' Name='nu.json'
DiskId='1' DiskId='1'
Source='wix\windows-terminal-profile.json' Source='wix\windows-terminal-profile.json'
KeyPath='yes'/> System='no'/>
<RegistryKey Root='HKCU' Key='Software\nu'>
<RegistryValue Name='WindowsTerminalProfile' Value='1' Type='integer' KeyPath='yes'/>
</RegistryKey>
<RemoveFolder Id='RemoveWindowsTerminalProfileFolder1' Directory='WindowsTerminalProfileAppFolder' On='uninstall'/>
<RemoveFolder Id='RemoveWindowsTerminalProfileFolder2' Directory='WindowsTerminalProfileFolder' On='uninstall'/>
<RemoveFolder Id='RemoveWindowsTerminalProfileFolder3' Directory='AppDataWindowsTerminalFolder' On='uninstall'/>
<RemoveFolder Id='RemoveWindowsTerminalProfileFolder4' Directory='AppDataMicrosoftFolder' On='uninstall'/>
</Component> </Component>
</Directory> </Directory>
</Directory> </Directory>
@ -404,7 +413,7 @@
DllEntry="CAQuietExec" DllEntry="CAQuietExec"
Execute="deferred" Execute="deferred"
Return="check" Return="check"
Impersonate="no"/> Impersonate="yes"/>
<InstallExecuteSequence> <InstallExecuteSequence>
<Custom Action='ReplacePathsInWindowsTerminalProfile' Before='InstallFinalize'> <Custom Action='ReplacePathsInWindowsTerminalProfile' Before='InstallFinalize'>
<!-- Run the custom action if the feature is enabled --> <!-- Run the custom action if the feature is enabled -->

View File

@ -1,7 +1,7 @@
{ {
"profiles": [ "profiles": [
{ {
"guid": "{aab79973-318f-43b6-a9bc-b4096493753f}", "guid": "{47302f9c-1ac4-566c-aa3e-8cf29889d6ab}",
"name": "Nushell", "name": "Nushell",
"commandline": "nu.exe", "commandline": "nu.exe",
"icon": "nu.ico", "icon": "nu.ico",