uwpdesktop-bridgeshell-extensionsappxdesktop-app-converter

Install shell extension conditionally


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?


Solution

  • 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