1

Reference: Integrate a packaged desktop app with File Explorer https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/integrate-packaged-app-with-file-explorer

I now know how to install a shell extension custom menu item in the File Explorer for my win32 packaged desktop app. But I want to give a choice to the user whether he really wants the shell extension. Is there a way to do that in Appx manifest?

user173399
  • 464
  • 5
  • 21
  • You can use https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-iexplorercommandstate https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-iexplorercommandstate – Simon Mourier Feb 07 '22 at 07:19
  • I was able to use this work around successfully. Please add this as answer so that I can accept it. – user173399 Feb 08 '22 at 19:22

2 Answers2

1

Microsoft removed the option to customize the install GUI of an MSIX, this means you cannot create a custom option where your users choose if they want the shell extension or not.

Therefore, the appxmanifest schema does not support the conditional installation of the shell extension, from what I know of.

Microsoft recommends moving all options configurations inside your application, including EULA and license registration procedures. So, theoretically you could try to add the shell registration from your application - I never tried this but maybe the links above from Simon Mourier will help.

Bogdan Mitrache
  • 10,536
  • 19
  • 34
1

You can work around that issue if you implement the IExplorerCommandState interface which has the IExplorerCommandState::GetState method

Implement this interface when you need to determine the command state dynamically (for instance, based on an item's properties). This interface provides the same functionality as IExplorerCommand::GetState, without the overhead of that interface's additional methods. Implement IExplorerCommandState when you only need to compute the command state

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298