{"id":3126,"date":"2020-07-11T08:37:06","date_gmt":"2020-07-11T12:37:06","guid":{"rendered":"https:\/\/www.tmurgent.com\/TmBlog\/?p=3126"},"modified":"2020-07-11T08:37:06","modified_gmt":"2020-07-11T12:37:06","slug":"whats-new-in-the-psf-for-july-2020","status":"publish","type":"post","link":"https:\/\/www.tmurgent.com\/TmBlog\/?p=3126","title":{"rendered":"What&#8217;s new in the PSF for July 2020"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hurray! Another Pull Request of mine has been accepted into the <a rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/microsoft\/MSIX-PackageSupportFramework\/tree\/develop\" target=\"_blank\">Package Support Framework Develop branch<\/a>. This one, PR #150, adds another new registry fixup.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>The Issue<\/strong>:<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The MSIX runtime protects the registry assets of the package from deletion.&nbsp; This can be a problem for applications that assume that they can remove registry keys and items.&nbsp; In the normal Win32 runtime, an application is normally allowed to delete keys and items that are located within the HKEY_CURRENT_USER hive.&nbsp; But under MSIX, the same call will result in ACCESS DENIED.&nbsp; The application might handle the situation properly, or you might get something like this:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"214\" src=\"https:\/\/www.tmurgent.com\/TmBlog\/wp-content\/uploads\/2020\/07\/Fiddler-Error-300x214.png\" alt=\"\" class=\"wp-image-3128\" srcset=\"https:\/\/www.tmurgent.com\/TmBlog\/wp-content\/uploads\/2020\/07\/Fiddler-Error-300x214.png 300w, https:\/\/www.tmurgent.com\/TmBlog\/wp-content\/uploads\/2020\/07\/Fiddler-Error.png 549w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">In this particular case, the exception is generated by the .Net API called by the application.&nbsp; Yes, the developer could have added an exception handler around that call, but this access error would never have occurred before.&nbsp; <\/p>\n\n\n\n<p>If you don&#8217;t have source code for the app and are repackaging into MSIX, the Package Support Framework (PSF) can now solve this issue for you.<\/p>\n<p>Last month I created the new RegLegacyFixups shim to solve issues with Registry Open\/Create calls requesting too many permissions.\u00a0 This shim supports a fix type called &#8220;ModifyKeyAccess&#8221; that looks at attempts to open or create keys with more permissions than MSIX will allow.\u00a0 Fiddler also needs this for other issues, but that fix type doesn&#8217;t address attempts to call various forms of registry deletion.<\/p>\n<h5><strong>The Fix:<\/strong><\/h5>\n<p>So this PR adds a new type called &#8220;FakeDelete&#8221;, which will return success when the delete fails.\u00a0 Of course there is no guarantee the app won&#8217;t have a different issue later on, but if the app was just cleaning up some unneeded items, it probably will solve the issue and won&#8217;t cause any new harm.<\/p>\n<p>Here is the appropriate part of the config.json file I use for Fiddler:<\/p>\n<p>\u00a0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n   \"dll\": \"RegLegacyFixups.dll\",\n   \"config\": &#91;\n      {\n        \"remediation\": &#91;\n          {\n            \"type\": \"ModifyKeyAccess\",\n            \"hive\": \"HKCU\",\n            \"patterns\": &#91;\n              \"^&#91;Ss]&#91;Oo]&#91;Ff]&#91;Tt]&#91;Ww]&#91;Aa]&#91;Rr]&#91;Ee]\\\\\\\\&#91;Mm]icrosoft\\\\\\\\&#91;Ff]iddler2\\\\\\\\.*\"\n            ],\n            \"access\": \"Full2MaxAllowed\"\n          },\n          {\n            \"type\": \"FakeDelete\",\n            \"hive\": \"HKCU\",\n            \"patterns\": &#91;\n              \"^&#91;Ss]&#91;Oo]&#91;Ff]&#91;Tt]&#91;Ww]&#91;Aa]&#91;Rr]&#91;Ee]\\\\\\\\&#91;Mm]icrosoft\\\\\\\\&#91;Ff]iddler2\\\\\\\\.*\"\n            ]\n          }\n        ]\n      }\n    ]\n}<\/code><\/pre>\n\n\n\n<p class=\"has-large-font-size wp-block-paragraph\"><strong>The Future:<\/strong><\/p>\n\n\n\n<p>Version 4.0 of PsfTooling will be released soon, so keep an eye out for that announcement.&nbsp; That version will include the latest changes to the PSF, as well as a rewritten &#8220;simplified&#8221; version of the user interface.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Hurray! Another Pull Request of mine has been accepted into the Package Support Framework Develop branch. This one, PR #150, adds another new registry fixup. The Issue: The MSIX runtime protects the registry assets of the package from deletion.&nbsp; This can be a problem for applications that assume that they can remove registry keys and&hellip; <a class=\"more-link\" href=\"https:\/\/www.tmurgent.com\/TmBlog\/?p=3126\">Continue reading <span class=\"screen-reader-text\">What&#8217;s new in the PSF for July 2020<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[53,57,56],"tags":[52,54],"class_list":["post-3126","post","type-post","status-publish","format-standard","hentry","category-msix","category-packaging","category-psf","tag-msix","tag-psf","entry"],"_links":{"self":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/3126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3126"}],"version-history":[{"count":4,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/3126\/revisions"}],"predecessor-version":[{"id":3132,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=\/wp\/v2\/posts\/3126\/revisions\/3132"}],"wp:attachment":[{"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tmurgent.com\/TmBlog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}