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

[PowerToys Run] Update to net5 #12286

Merged

Conversation

mykhailopylyp
Copy link
Contributor

@mykhailopylyp mykhailopylyp commented Jul 8, 2021

Summary of the Pull Request

What is this about:

What is include in the PR:

  • Change TargetFramework to net5 or net5.0-windows10.0.18362.0(in case it uses windows runtime)
  • Upgrade NuGet packages to the latest versions
  • Fix warnings
  • Get rid of Assembly.GlobalAssemblyCache in the unhandled exception handler as it is obsolete and is not actually needed
  • Replace deprecated DesktopNotificationManagerCompat with ToastNotificationManagerCompat

How does someone test / validate:

  • Run all unit tests
  • Build an installer and install it
  • Test PowerToys Run

I have already built an installer and installed it on a clean VM with 19043 windows build.
Take into account that I will fix the remaining warnings, including obsolete BinaryFormatter in future PRs. Also, I will reconsider the Windows Runtime version.

Quality Checklist

Contributor License Agreement (CLA)

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

@mykhailopylyp mykhailopylyp added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label Jul 8, 2021
@github-actions
Copy link

github-actions bot commented Jul 14, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • nullability
  • SYSLIB
Previously acknowledged words that are now absent accessoryapps accountinfo activityhistory Addins addphone addrum adopsinsider advancedgraphics advertisingid airplanemode akamaihd appdiagnostics appmodel appsfeatures appsforwebsites Appwiz assignedaccess asyncwebview automaticfiledownloads autoplay autoupdate backgroundapps batterysaver bluetooth bpmfime broadfilesystemaccess callhistory cangjieime capitalized CECEE chsime CLogo closedcaptioning CMDARG colorfilter connecteddevices CRM crmcustomerinsightsapp crossdevice cursorandpointersize customdevices Dataflows datausage dateandtime Dbg defaultapps deque deviceencryption devicemanagenent DHCP Dialpad directaccess dirname Dns domainlexicon downlevel downloadmaps Draggen DVR dynamiclock EABF EAC EACB EACC EADA EADB EADF EAE EAEE EAEF EAF EAFC EAFD easeofaccess eb EBC EBD EBDA EBE EBEC EBEE EBEF EBF EBFC ECAA ECAB ECAC ECAF ECCA ECCB ECCD ECDC ECDE ECDF ECEB ECED ECEE emailandaccounts eyecontrol findmydevice Fle gamedvr gamemode HGLOBAL highcontrast ICONQUESTION IDNO IDYES Inetcpl keyconfig keyhook launchfaceenrollment launchfingerprintenrollment lockscreen MJPG Mlcfg MLogo MMI Mmsys mobilehotspot moredetails mousetouchpad multithreading navbar netconnections Netcpl nfctransactions nightlight nonwin optin optionalfeatures otheroptions otherusers Phishing phonecalls php phptest powerappscds powersleep quickime quiethours quietmomentsgame quietmomentshome quietmomentspresentation quietmomentsscheduled regionformatting regionlanguage remotedesktop restartoptions RSHIFT rundll savelocations SCOOBE screenrotation SDNS sessioncleanup Shortcutguide Signin signinoptions speechrecognition speechtyping Sticpl storagepolicies storagesense surfacehub Sysdm sz tabletmode talenthrcore talktocortana TASKID trueplay truetype udp uninstallation uninstaller unitconvert usagedetails usb videoplayback voiceactivation Voicemail vpn watsonportal webview Wgpocpl Wifi wificalling wifisettings windowsanywhere windowsapp windowsdefender windowsinsider windowsupdate workflow wostringstream wu wubi xboxnetworking YESNO yourinfo YourUserName zipfolder
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:mykhailopylyp/PowerToys.git repository
on the update-to-net5 branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.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/spell-check/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 \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/microsoft/PowerToys/issues/comments/879967831" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$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;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  
update_files
rm $comment_body
git add -u
If you see a bunch of garbage

If it relates to a ...

well-formed pattern

See if there's a pattern that would match it.

If not, try writing one and adding it to the patterns.txt file.

Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

Note that patterns can't match multiline strings.

binary-ish string

Please add a file path to the excludes.txt file instead of just accepting the garbage.

File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

@mykhailopylyp mykhailopylyp marked this pull request as ready for review July 14, 2021 15:11
@mykhailopylyp
Copy link
Contributor Author

mykhailopylyp commented Jul 14, 2021

Spelling warnings will be fixed in future PRs as they are from suppression messages.

@mykhailopylyp
Copy link
Contributor Author

@jaimecbernardo
Can not add you to the list of reviewers

@jaimecbernardo jaimecbernardo self-requested a review July 14, 2021 18:34
@stefansjfw
Copy link
Collaborator

ColorPicker doesn't work for me with this change.. Does it work for you?

@mykhailopylyp
Copy link
Contributor Author

ColorPicker doesn't work for me with this change.. Does it work for you?

We don't change anything related to the ColorPicker in this PR. I just tested it and the ColorPicker works for me.

@stefansjfw
Copy link
Collaborator

Ok. Everything else works fine on my side

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

Rubberstamp LGTM.
Great work.
I didn't manage to test it in a new VM yet like I wanted, but I'll do that on the future "merge to master" PR once this is all in together.

Copy link
Collaborator

@yuyoyuppe yuyoyuppe left a comment

Choose a reason for hiding this comment

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

Tested on a clean VM - LGTM

@mykhailopylyp mykhailopylyp merged commit ac5cc50 into microsoft:feature/pt-run-net5 Jul 19, 2021
@mykhailopylyp mykhailopylyp deleted the update-to-net5 branch July 19, 2021 11:36
mykhailopylyp added a commit that referenced this pull request Jul 21, 2021
* [Setup] Add support for installing both dotnet 3 and 5 (#12306)

* [PowerToys Run] Update to net5 (#12286)

* Change targets of projects

* Update Microsoft.Toolkit.Uwp.Notifications,

changed TargetFramework for PowerLauncher project in order to resolve an issue with ModernWpf

* Specify windows version in order to fix build errors

* Fixed suppressed warnings

* Updated sdk

* Removed usage of obsolete GlobalAssemblyCache

* Removed obsolete DesktopNotificationManagerCompat

* Update nuget versions

* Update installer

* [PowerToys Run] Obsolete APIs and warnings introduced in .net5 (#12423)

* Change targets of projects

* Update Microsoft.Toolkit.Uwp.Notifications,

changed TargetFramework for PowerLauncher project in order to resolve an issue with ModernWpf

* Fixed suppressed warnings

* Removed obsolete DesktopNotificationManagerCompat

* Get rid of binary formatter

* Update tests

* Don't include new image cache file to the report

* There's no need to call IsOwner as it doesn't make sense

* Fix different nullability exception

* Exclude extra dlls from tests

Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-PowerToys Run Improved app launch PT Run (Win+R) Window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants