Skip to content

Fix for the issue where PT Run was preventing UWP apps from building in VS#5109

Merged
alekhyareddy28 merged 5 commits intomicrosoft:masterfrom
alekhyareddy28:FixUWPAppUninstallingError
Jul 21, 2020
Merged

Fix for the issue where PT Run was preventing UWP apps from building in VS#5109
alekhyareddy28 merged 5 commits intomicrosoft:masterfrom
alekhyareddy28:FixUWPAppUninstallingError

Conversation

@alekhyareddy28
Copy link
Contributor

Summary of the Pull Request

  • This PR ensures that PT Run does not deny UWP apps from being built in visual studio.
  • There was another issue which had to be fixed to be able to reproduce the above error. As we have added the package wrapper for UWP applications, the exceptions are being thrown in the constructor and not all of them were being handled there. One such exception that was being thrown was the Argument Exception.
    image
  • Once the Argument exception was handled, this error was reproducable while building UWP apps.
    image

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

  • An Argument Exception was being thrown when when package.InstalledLocation.Path was being accessed. It threw a value is not found in the expected range exception.
  • That exception is not of type ArgumentNullException or ArgumentOutOfRangeException so other than catching the exception, no other check could be performed.
  • While reading the app manifest file, it was being read with deny_write STGM constant which prevented any other process from modifying it. This was causing all the appxmanifest.xml files to be locked by PowerToys run. Changing it to deny_none fixed this issue. Ref - https://docs.microsoft.com/en-us/windows/win32/stg/stgm-constants. We will not face an issue where we would try to read an incompletely installed packaged app because we proceed only if the installation is complete (using args.IsComplete).
  • There was a similar issue while loading the img icon into a bitmap Image format. Once the image was loaded it could not be deleted, throwing this error -
    image
  • To fix this, instead of passing the uri directly, passing the file as a memory stream fixed the issue. Ref - https://stackoverflow.com/questions/542217/load-a-bitmapsource-and-save-using-the-same-name-in-wpf-ioexception.

Validation Steps Performed

  • Manually validated that none of those errors are hit while building UWP apps.

@alekhyareddy28 alekhyareddy28 requested a review from a team July 20, 2020 19:29
@alekhyareddy28 alekhyareddy28 added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label Jul 20, 2020
Copy link
Contributor

@ryanbodrug-microsoft ryanbodrug-microsoft left a comment

Choose a reason for hiding this comment

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

LGTM Thanks

@alekhyareddy28 alekhyareddy28 merged commit b31d976 into microsoft:master Jul 21, 2020
VictoriousRaptor added a commit to VictoriousRaptor/Flow.Launcher that referenced this pull request Oct 21, 2022
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.

3 participants