Skip to content
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

[Setup] Use WiX bootstrapper instead of a custom one #15050

Merged
merged 29 commits into from
Jan 5, 2022

Conversation

yuyoyuppe
Copy link
Collaborator

Summary of the Pull Request

What is this about:

  • remove custom bootstrapper and use wix's built-in one
  • switch explorer addons to per user
  • don't install VCM filter during setup
  • bug fixes
  • dotnet framework is now downloading using wix framework
    What is included in the PR:

How does someone test / validate:

  • build the installer and verify that VCM and file explorer modules still work

Quality Checklist

  • Linked issue: #xxx
  • Communication: I've discussed this with core contributors in the issue.
  • Tests: Added/updated and all pass
  • Installer: Added/updated and all pass
  • Localization: All end user facing strings can be localized
  • Docs: Added/ updated
  • Binaries: Any new files are added to WXS / YML

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for doing this! Glad to see vision become reality. Couple questions!

src/settings-ui/Settings.UI/App.xaml Outdated Show resolved Hide resolved
installer/PowerToysSetup/Product.wxs Outdated Show resolved Hide resolved
<Import Project="..\..\src\Version.props" />
<PropertyGroup>
<DefineConstants>Version=$(Version)</DefineConstants>
<Name>PowerToysInstaller</Name>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file got totally reformatted to change newlines; view the diff with "Hide Whitespace Changes" to see the actual two lines of change 😄

@htcfreek
Copy link
Collaborator

Does this have any impact on the existing installer parameters? Is it possible to run an admin install with special parameters or do I have to run the setup for every user on the computer? What is the default install directory/path?

@crutkas
Copy link
Member

crutkas commented Dec 18, 2021

@DHowett i flagged the default install DIR. this will get around UAC for elevation but feels icky for a win32

@DHowett
Copy link
Member

DHowett commented Dec 18, 2021

@DHowett i flagged the default install DIR. this will get around UAC for elevation but feels icky for a win32

Hmm here's a Q: do we have to make the move to user dir at the same time as WiX Bundle? It seems fine if we do, we just have to drive down all the install differences.

@crutkas
Copy link
Member

crutkas commented Dec 18, 2021

Yes. This will be that tipping shift.

@stefansjfw

This comment has been minimized.

@stefansjfw
Copy link
Collaborator

stefansjfw commented Dec 20, 2021

Tested the new installer, PowerPreview and VCM seems to work correctly

@stefansjfw

This comment has been minimized.

@Aaron-Junker

This comment has been minimized.

@SeraphimaZykova
Copy link
Collaborator

Tested, VCM and PowerPreview work well.

@yuyoyuppe
Copy link
Collaborator Author

Does this have any impact on the existing installer parameters? Is it possible to run an admin install with special parameters or do I have to run the setup for every user on the computer? What is the default install directory/path?

Existing bootstrapper parameters will no longer work (btw, how do we change https://docs.microsoft.com/en-us/windows/powertoys/install#installer-arguments @crutkas), however WiX bootstrapper has a similar set of parameters. The most important one which couldn't be supported out of the box is --extract_msi, but this feature is supported by WiX tool called dark:

"C:\Program Files (x86)\WiX Toolset v3.11\bin\dark.exe" -x msi S:\Programming\utilities\PowerToys\installer\PowerToysSetup\x64\Release\PowerToysSetup-0.53.1-x64.exe

Currently investigating the issue brought up by @stefansjfw.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, as of the merge with main you'll need to update release.yml in the bootstrapper phase :) this looks excellent though! Thanks!

@yuyoyuppe
Copy link
Collaborator Author

Updated release.yml (I think it needs double-checking though!) and fixed missing icon issue :)

@DHowett
Copy link
Member

DHowett commented Dec 20, 2021

I've queued a test build on the Release pipeline -- here's hoping!

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More to Clint's point; I think that line 148 in release.yml needs updating if we aren't building the custom actions any longer. :)

@DHowett
Copy link
Member

DHowett commented Dec 20, 2021

Actually yeah, I'm confused about why this is an error. Huh. Did we change a project name?

@crutkas
Copy link
Member

crutkas commented Dec 20, 2021

that still exists in the buddy.yml command: '.pipelines\build-installer-PTCustomActions.cmd' and was unchanged

@yuyoyuppe
Copy link
Collaborator Author

We still need to build PTCustomActions separately to be able to sign in, right? Event though it's embedded into .msi installer. Logs show this error:

error MSB4057: The target "PowerToysSetupCustomActions" does not exist in the project.

Still not sure what's causing this, but I've made PowerToysSetupCustomActions' project name to be more consistent.

@crutkas
Copy link
Member

crutkas commented Dec 20, 2021

  1. Prompted a UAC.
  2. failed to install,
[8090:5764][2021-12-20T11:30:51]i009: Command Line: '-burn.clean.room=C:\Users\crutkas\AppData\Local\Temp\MicrosoftEdgeDownloads\81de4abd-6f35-430e-8eda-c5d4840f66b2\PowerToysSetup-0.0.1-x64.exe -burn.filehandle.attached=764 -burn.filehandle.self=592'
[8090:5764][2021-12-20T11:30:51]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\crutkas\AppData\Local\Temp\MicrosoftEdgeDownloads\81de4abd-6f35-430e-8eda-c5d4840f66b2\PowerToysSetup-0.0.1-x64.exe'
[8090:5764][2021-12-20T11:30:51]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\crutkas\AppData\Local\Temp\MicrosoftEdgeDownloads\81de4abd-6f35-430e-8eda-c5d4840f66b2\'
[8090:5764][2021-12-20T11:30:51]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\crutkas\AppData\Local\Temp\PowerToys_(Preview)_x64_20211220113051.log'
[8090:5764][2021-12-20T11:30:51]i000: Setting string variable 'WixBundleName' to value 'PowerToys (Preview) x64'
[8090:5764][2021-12-20T11:30:51]i000: Setting string variable 'WixBundleManufacturer' to value 'Microsoft Corporation'
[8090:63B0][2021-12-20T11:30:51]i000: Setting numeric variable 'WixStdBALanguageId' to value 1033
[8090:63B0][2021-12-20T11:30:51]i000: Setting version variable 'WixBundleFileVersion' to value '0.0.1.0'
[8090:5764][2021-12-20T11:30:51]i100: Detect begin, 2 packages
[8090:5764][2021-12-20T11:30:51]i000: Setting numeric variable 'HasDotnet3122' to value 1
[8090:5764][2021-12-20T11:30:51]i052: Condition 'HasDotnet3122' evaluates to true.
[8090:5764][2021-12-20T11:30:51]i101: Detected package: DotnetRuntime, state: Present, cached: None
[8090:5764][2021-12-20T11:30:51]i101: Detected package: PowerToysSetup_0.0.1_x64.msi, state: Absent, cached: None
[8090:5764][2021-12-20T11:30:51]i199: Detect complete, result: 0x0
[8090:63B0][2021-12-20T11:30:57]i000: Setting numeric variable 'EulaAcceptCheckbox' to value 1
[8090:5764][2021-12-20T11:30:57]i200: Plan begin, 2 packages, action: Install
[8090:5764][2021-12-20T11:30:57]w321: Skipping dependency registration on package with no dependency providers: DotnetRuntime
[8090:5764][2021-12-20T11:30:57]i000: Setting string variable 'WixBundleRollbackLog_PowerToysSetup_0.0.1_x64.msi' to value 'C:\Users\crutkas\AppData\Local\Temp\PowerToys_(Preview)_x64_20211220113051_000_PowerToysSetup_0.0.1_x64.msi_rollback.log'
[8090:5764][2021-12-20T11:30:57]i000: Setting string variable 'WixBundleLog_PowerToysSetup_0.0.1_x64.msi' to value 'C:\Users\crutkas\AppData\Local\Temp\PowerToys_(Preview)_x64_20211220113051_000_PowerToysSetup_0.0.1_x64.msi.log'
[8090:5764][2021-12-20T11:30:57]i201: Planned package: DotnetRuntime, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[8090:5764][2021-12-20T11:30:57]i201: Planned package: PowerToysSetup_0.0.1_x64.msi, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[8090:5764][2021-12-20T11:30:57]i299: Plan complete, result: 0x0
[8090:5764][2021-12-20T11:30:57]i300: Apply begin
[8090:5764][2021-12-20T11:30:57]i010: Launching elevated engine process.
[8090:5764][2021-12-20T11:31:20]i011: Launched elevated engine process.
[8090:5764][2021-12-20T11:31:20]i012: Connected to elevated engine.
[42D0:5718][2021-12-20T11:31:21]i358: Pausing automatic updates.
[42D0:5718][2021-12-20T11:31:21]i359: Paused automatic updates.
[42D0:5718][2021-12-20T11:31:21]i360: Creating a system restore point.
[42D0:5718][2021-12-20T11:31:37]i361: Created a system restore point.
[42D0:5718][2021-12-20T11:31:37]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{59b11f12-87f8-4876-b11a-6a62fe56a21b}, options: 0x7, disable resume: No
[42D0:5718][2021-12-20T11:31:38]i000: Caching bundle from: 'C:\Users\crutkas\AppData\Local\Temp\{6536B340-F9F0-4383-93F1-77D0EFA52385}\.be\PowerToysSetup-0.0.1-x64.exe' to: 'C:\ProgramData\Package Cache\{59b11f12-87f8-4876-b11a-6a62fe56a21b}\PowerToysSetup-0.0.1-x64.exe'
[42D0:5718][2021-12-20T11:31:38]i320: Registering bundle dependency provider: {59b11f12-87f8-4876-b11a-6a62fe56a21b}, version: 0.0.1.0
[42D0:5718][2021-12-20T11:31:38]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{59b11f12-87f8-4876-b11a-6a62fe56a21b}, resume: Active, restart initiated: No, disable resume: No
[8090:8BFC][2021-12-20T11:31:38]i336: Acquiring container: WixAttachedContainer, copy from: C:\Users\crutkas\AppData\Local\Temp\MicrosoftEdgeDownloads\81de4abd-6f35-430e-8eda-c5d4840f66b2\PowerToysSetup-0.0.1-x64.exe
[8090:8BFC][2021-12-20T11:31:38]i000: Setting string variable 'WixBundleLastUsedSource' to value 'C:\Users\crutkas\AppData\Local\Temp\MicrosoftEdgeDownloads\81de4abd-6f35-430e-8eda-c5d4840f66b2\'
[8090:8C8C][2021-12-20T11:31:38]e000: Error 0x80070001: Failed to extract all files from container, erf: 1:2:0
[8090:8BFC][2021-12-20T11:31:38]e000: Error 0x80070001: Failed to wait for operation complete.
[8090:8BFC][2021-12-20T11:31:38]e000: Error 0x80070001: Failed to open container.
[8090:8BFC][2021-12-20T11:31:38]e000: Error 0x80070001: Failed to open container: WixAttachedContainer.
[8090:8BFC][2021-12-20T11:31:38]e312: Failed to extract payloads from container: WixAttachedContainer to working path: C:\Users\crutkas\AppData\Local\Temp\{6536B340-F9F0-4383-93F1-77D0EFA52385}\64C734420CFD72A9DA8FFEDE86EA41818D660714, error: 0x80070001.
[8090:5764][2021-12-20T11:31:38]e000: Error 0x80070001: Failed while caching, aborting execution.
[42D0:5718][2021-12-20T11:31:38]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{59b11f12-87f8-4876-b11a-6a62fe56a21b}, resume: None, restart: None, disable resume: No
[42D0:5718][2021-12-20T11:31:38]i330: Removed bundle dependency provider: {59b11f12-87f8-4876-b11a-6a62fe56a21b}
[42D0:5718][2021-12-20T11:31:38]i352: Removing cached bundle: {59b11f12-87f8-4876-b11a-6a62fe56a21b}, from path: C:\ProgramData\Package Cache\{59b11f12-87f8-4876-b11a-6a62fe56a21b}\
[42D0:5718][2021-12-20T11:31:39]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{59b11f12-87f8-4876-b11a-6a62fe56a21b}, resume: None, restart initiated: No, disable resume: No
[8090:5764][2021-12-20T11:31:40]i399: Apply complete, result: 0x80070001, restart: None, ba requested restart:  No

@DHowett
Copy link
Member

DHowett commented Jan 3, 2022

So, this is interesting! I tried to install this 0.0.2 build over 0.51! It "succeeded" instantly, but it didn't install over 0.51. The message indicating that we can't downgrade was never displayed... and I think the powertoys MSI was never launched!

On second launch, my only option was uninstall. It "uninstalled" something ... and I think it was also an empty uninstaller.

@jaimecbernardo
Copy link
Collaborator

So, this is interesting! I tried to install this 0.0.2 build over 0.51! It "succeeded" instantly, but it didn't install over 0.51. The message indicating that we can't downgrade was never displayed... and I think the powertoys MSI was never launched!

On second launch, my only option was uninstall. It "uninstalled" something ... and I think it was also an empty uninstaller.

It's installing a bundle of both the .net runtime and PowerToys. PowerToys already has a higher version so this isn't needed ... I think we might have to detect this manually.

https://stackoverflow.com/a/36209806/4594761

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I tested the new install path:

image

  • It requires admin access,
  • but it installs in the user's appdata folder,
  • and shows up in all installed programs for all users

installer/PowerToysSetup/PowerToys.wxs Outdated Show resolved Hide resolved
installer/PowerToysSetup/Product.wxs Outdated Show resolved Hide resolved
installer/PowerToysSetup/PowerToys.wxs Show resolved Hide resolved
installer/PowerToysSetup/Product.wxs Outdated Show resolved Hide resolved
@jaimecbernardo
Copy link
Collaborator

Added a commit to block the downgrade scenarios.

@jaimecbernardo
Copy link
Collaborator

The installer ... installed!!!

  1. Context menu items don't seem to want to execute. Tried Both Rename and Image Resizer

I've reverted registry changes to HKLM instead of HKCU for the installer. At least PowerRename seems to need that when installed in Programs Folder.

Will take a closer look at the thumbnails/preview pane.

@DHowett
Copy link
Member

DHowett commented Jan 4, 2022

Alright! Let's fix up those conflicts and GO GO GO

@jaimecbernardo
Copy link
Collaborator

Alright! Let's fix up those conflicts and GO GO GO

@DHowett

There are still some unsolved issues:

  • The install folder option is shown on upgrade, but the value gets ignored. I couldn't find a way to fix this yet, still investigating. One option would be to leave it unfixed and just ignore it on upgrade for now. Other would be to show the original MSI UI instead, since that handles that case well enough, but it seems to have been decided against earlier.
  • It seems there are some dangling files when updating as well. For example when trying to install on top of an older build it leaves files from the old version undeleted in the install folder. I still have to look closesly at this but it looks like the upgrade scenario is broken, currently.

@jaimecbernardo
Copy link
Collaborator

It seems there are some dangling files when updating as well. For example when trying to install on top of an older build it leaves files from the old version undeleted in the install folder. I still have to look closesly at this but it looks like the upgrade scenario is broken, currently.

Re-evaluated this. It no longer occurs. Must have fixed it by setting the keys to HKLM instead of HKCU instead. Behavior seems good now on upgrade.

@github-actions
Copy link

github-actions bot commented Jan 4, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

Pdb
Toolset

Previously acknowledged words that are now absent appcontainer azurecr binskim buildcommand buildtools cdpxwin CPPARM CPPx CTLCOLORSTATIC defaultcommand dupenv DUSTIN efgh errc errorlevel estdir etcore Firefox Gamebar Grayscale iccex ICONINFORMATION INITCOMMONCONTROLSEX INSTALLLOGATTRIBUTES INSTALLLOGMODE INSTALLUILEVEL LASTEXITCODE LEQ linkid MAINICON MAKELPARAM Minimizeallwindows mkdir moderncop msiexec MSIINSTALLER namings NATIVEFNTCTL neq nocache npm pdb policheck popd pushd rexit robocopy SETRANGE SETSTEP SHAREIMAGELISTS spamming spdth sregex STEPIT Switchbetweenvirtualdesktops SYSTEMASTERISK toolset UITo umd vse vsix WDK wdksetup wdkvsix We'd webclient webpack WINMSAPP
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the wix_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/whitelist.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1005082577" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u

@github-actions
Copy link

github-actions bot commented Jan 4, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

Pdb
Toolset

Previously acknowledged words that are now absent appcontainer azurecr binskim buildcommand buildtools cdpxwin CPPARM CPPx CTLCOLORSTATIC defaultcommand dupenv DUSTIN efgh errc errorlevel estdir etcore Firefox Gamebar Grayscale iccex ICONINFORMATION INITCOMMONCONTROLSEX INSTALLLOGATTRIBUTES INSTALLLOGMODE INSTALLUILEVEL LASTEXITCODE LEQ linkid MAINICON MAKELPARAM Minimizeallwindows mkdir moderncop msiexec MSIINSTALLER namings NATIVEFNTCTL neq nocache npm pdb policheck popd pushd rexit robocopy SETRANGE SETSTEP SHAREIMAGELISTS spamming spdth sregex STEPIT Switchbetweenvirtualdesktops SYSTEMASTERISK toolset UITo umd vse vsix WDK wdksetup wdkvsix We'd webclient webpack WINMSAPP
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the wix_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/whitelist.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1005085734" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u

This reverts commit f582b4d.
@github-actions
Copy link

github-actions bot commented Jan 4, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

Pdb
Toolset

Previously acknowledged words that are now absent appcontainer azurecr binskim buildcommand buildtools cdpxwin CPPARM CPPx CTLCOLORSTATIC defaultcommand dupenv DUSTIN efgh errc errorlevel estdir etcore Firefox Gamebar Grayscale iccex ICONINFORMATION INITCOMMONCONTROLSEX INSTALLLOGATTRIBUTES INSTALLLOGMODE INSTALLUILEVEL LASTEXITCODE LEQ linkid MAINICON MAKELPARAM Minimizeallwindows mkdir moderncop msiexec MSIINSTALLER namings NATIVEFNTCTL neq nocache npm pdb policheck popd pushd rexit robocopy SETRANGE SETSTEP SHAREIMAGELISTS spamming spdth sregex STEPIT Switchbetweenvirtualdesktops SYSTEMASTERISK toolset UITo umd vse vsix WDK wdksetup wdkvsix We'd webclient webpack WINMSAPP
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the wix_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/whitelist.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1005090871" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (6)

BOOTSTRAPPERINSTALLFOLDER
DEFAULTBOOTSTRAPPERINSTALLFOLDER
INSTALLFOLDERTOBOOTSTRAPPERINSTALLFOLDER
INSTALLFOLDERTOPREVIOUSINSTALLFOLDER
Overridable
PREVIOUSINSTALLFOLDER

Previously acknowledged words that are now absent CTLCOLORSTATIC efgh errc iccex ICONINFORMATION INITCOMMONCONTROLSEX INSTALLLOGATTRIBUTES INSTALLLOGMODE INSTALLUILEVEL MAINICON MAKELPARAM msiexec MSIINSTALLER NATIVEFNTCTL rexit SETRANGE SETSTEP sregex STEPIT UITo We'd
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the wix_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/whitelist.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1005848817" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants