0

I am trying to set up an AppxManifest.xml to launch a Win32 application as a full trust application. Using the snippet below, I am able to Add-AppxPackage -Register AppxManifest.xml and then use Debug > Other Debugging Tools > Debug Installed Application to debug the application in Visual Studio 2017.

However, I want to pass some arguments to the application when launching it. How can I acomplish this? I don't mind listing them in the AppxManifest.xml if that is easiest, I just need to know how.

...
<Applications>
    <Application Id="App" Executable="SomeExecutable.exe" EntryPoint="Windows.FullTrustApplication">
      <uap:VisualElements DisplayName="Wrap" Description="Wrap" BackgroundColor="transparent" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png">
        <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
      </uap:VisualElements>
    </Application>
  </Applications>
...
Rag
  • 195
  • 1
  • 13
  • Possible duplicate of [How to launch a full-trust (desktop bridge) app from UWP with arbitrary parameters](https://stackoverflow.com/questions/46008948/how-to-launch-a-full-trust-desktop-bridge-app-from-uwp-with-arbitrary-paramete) – Xie Steven Mar 12 '19 at 08:28

1 Answers1

-1

Protocol associations is what you look for:

Protocol associations can enable other programs and system components to interoperate with your packaged app. When your packaged application is started by using a protocol, you can specify specific parameters to pass to its activation event arguments so it can behave accordingly. Parameters are supported only for packaged, full-trust apps.

<Package
  xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
  xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
  IgnorableNamespaces="uap3, desktop">
  <Applications>
    <Application>
      <Extensions>
        <uap3:Extension
          Category="windows.protocol">
          <uap3:Protocol
            Name="myapp-cmd"
            Parameters="/p " />
        </uap3:Extension>
      </Extensions>
    </Application>
  </Applications>
</Package>
magicandre1981
  • 27,895
  • 5
  • 86
  • 127