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/
cp -r ($'($dist)/*' | into glob) target/release/
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
# Workaround for https://github.com/softprops/action-gh-release/issues/280
let archive = ($wixRelease | str replace --all '\' '/')

Binary file not shown.

View File

@ -47,7 +47,7 @@
InstallerVersion='450'
Languages='1033'
Compressed='yes'
InstallScope='perMachine'
InstallScope='perUser'
SummaryCodepage='1252'
Platform='$(var.Platform)'/>
@ -57,6 +57,8 @@
<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
<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='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
@ -94,7 +96,7 @@
Permanent='no'
Part='last'
Action='set'
System='yes'/>
System='no'/>
</Component>
<Component Id='binary0' Guid='*' Win64='$(var.Win64)'>
<File
@ -303,18 +305,25 @@
</Directory>
</Directory>
<Directory Id='CommonAppDataFolder'>
<Directory Id='LocalAppDataFolder'>
<Directory Id='AppDataMicrosoftFolder' Name='Microsoft'>
<Directory Id='AppDataWindowsTerminalFolder' Name='Windows Terminal'>
<Directory Id='WindowsTerminalProfileFolder' Name='Fragments'>
<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
Id='WindowsTerminalProfileFile'
Name='nu.json'
DiskId='1'
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>
</Directory>
</Directory>
@ -404,7 +413,7 @@
DllEntry="CAQuietExec"
Execute="deferred"
Return="check"
Impersonate="no"/>
Impersonate="yes"/>
<InstallExecuteSequence>
<Custom Action='ReplacePathsInWindowsTerminalProfile' Before='InstallFinalize'>
<!-- Run the custom action if the feature is enabled -->

View File

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