Home > Blockchain >  Is there a way to check if the current application is a misx application
Is there a way to check if the current application is a misx application

Time:11-10

I am converting a C#/WPF application that is currently deployed with ClickOnce to MSIX. I would like to check in code, if the current execution is from within an MSIX package or if just the .exe is executed, similar to the ApplicationDeployment.IsNetWorkDeployed Property of ClickOnce. As a workaround at the moment I use a try catch block trying to access Package.Current.Displayname and set an isMsix Property in the catch block, but I wondered if there is a better way using some methode or property?

CodePudding user response:

Detect package identity and runtime context

https://docs.microsoft.com/en-us/windows/msix/detect-package-identity

Use IsRunningAsUwp() from the DesktopBridge.Helpers.

https://github.com/qmatteoq/DesktopBridgeHelpers/

https://nicksnettravels.builttoroam.com/sparse-package/

  • Related