Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing shell extension using Desktop Bridge

My Win32 application needs to install a Windows Explorer Shell extension.

I've used Desktop App Converter to generate AppX for my application. But the converter ignored the shell extension installed by a legacy installer of the application.

While it captured the Classes\Directory\shellex key to Registry.dat, the key entries point to CLSID that was not captured. And even if it did capture the referenced CLSID, it points to a path, where legacy installer installs the application, not to a real location where AppX will be installed.


I was thinking about registering the extension by the application itself on the first run. But the installation location in C:\Program Files\WindowsApps has restricted permissions, so regsvr32 fails.

The module "C:\Program Files\WindowsApps\WinSCP_5.14.0.0_x86__2dz6xbp7ps3z2\DragExt64.dll" failed to load.

Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.

Access is denied.


The permissions do allow the file to be copied elsewhere though. So I could copy the .dll to for example user profile (C:\Users\...) and register it from there. But that would leave the .dll behind, when the AppX is uninstalled.

Is there any better solution?

like image 468
Martin Prikryl Avatar asked Mar 07 '23 09:03

Martin Prikryl


1 Answers

The design principle for packaged Win32 apps on Windows 10 (Desktop Bridge apps) is that they integrate with the Shell in a declarative way via the appxmanifest (not via registry). To facilitate this we have added Shell extensions to the manifest scheme. The system will run those extensions out-of-proc with the Shell (unlike classic in-proc extensions), to allow seamless app updates and to prevent apps from the crashing the Windows Shell/Explorer.

See here for documentation: https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extensions

EDIT Note that not all existing Shell extensions are supported today. To help us prioritize any that are still missing, please log them on UserVoice: https://wpdev.uservoice.com/forums/110705-universal-windows-platform

like image 50
Stefan Wick MSFT Avatar answered May 09 '23 04:05

Stefan Wick MSFT