Sydney Cloud Projects : Prevent Microsoft Edge from Hijacking PDF extensions

At Peninsula IT Services, our cloud and mobility projects in Sydney often involve deploying Windows 10 VDI systems using Citrix XenDesktop, and Windows Server 2012 r2 and now Windows Server 2016 RDS desktops with Citrix XenApp.  A regular problem we run into relates to the Microsoft Edge browser and its interaction with key file associations such as PDF.   The problem and its workaround is outlined below.

Problem:  Microsoft Edge Hijacks the PDF file association

Windows Edge will unexpectedly take over the ownership of certain file extensions, such as PDF, ZIP, JPEG and HTML, even if you have previously specified the default program within, say Nuance Power PDF, Adobe Reader or Adobe Acrobat Pro.

Background:  Microsoft Edge Hijacks the PDF file association

More recent Windows operating systems handle file associations in a different way in order to make it harder for programs to insert themselves into the default “Open with” option.  Most software vendors have not yet caught up with Microsoft’s new way of doing this, hence Windows 10 will assume that the file association was not set using a supported method (GPO, DISM import XML, or manually via Control Panel) and the system will take the association back and apply a base install application such Edge as the default app (in the case of PDF).

Before Windows 8, applications could set the default handler for a file type/protocol by manipulating the registry, which means we could easily have the application itself, a script, or a group policy manipulating the registry to set the default app. However, in Windows 8 or later, the registry changes are verified by a hash (which is unique per user and app) that basically detects tampering by apps. In the absence of a valid hash, Windows will ignore the default in the registry.

The Hash value is used to prove that the UserChoice ProgId value was set by the user, and not by any other means. Microsoft use an algorithm to generate both the Hash and the mechanism for verifying the ProgId using the Hash. If the value was set by an application with a static value, it will not align with Microsoft’s new mechanism and that’s why the default file association gets reset.

Workaround for Microsoft Edge Hijacking PDF file association

With our Citrix virtual desktop and application projects in Sydney, users will often want to set their own default application for PDF files.  For example, some users may have both Nuance Power PDF installed on their Windows operating system for editing and creating documents, as well as Adobe Reader as part of the base operating system build.  Rather than force the file association, which would not suit everyone due to differing software packages available to different users, we prefer to set some file extensions to “User Choice”.  The following workaround applies to scenarios where we wish to set the file association to “User Choice” for PDF file extensions.

Add these values to the registry:

Key:  HKCU\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
String:  NoOpenWith
Value: (leave blank)
Key:  HKCU\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
String: NoStaticDefaultVerb
Value: (also leave blank)

By setting these registry values, this will:
1) Prevent Microsoft Edge from taking over the ownership of the PDF file extension.
2) Prevent the default program for PDF such as Nuance Power PDF or Adobe Reader from being reset to at a later time.