Running an EXE from C# using UWP

前端 未结 1 568
别那么骄傲
别那么骄傲 2020-12-28 09:28

I have searched and searched and seem to have hit a brick wall here. I am developing an application that generates an audio fingerprint to automatically search an audio data

相关标签:
1条回答
  • 2020-12-28 10:15

    I've been banging my head against a brick wall all night over this, but after hundreds of pages online I may have come up with a solution to my problem.

    By referencing the "Windows Desktop Extensions For The UWP v10.0.14393.0" under "References > Universal Windows > Extensions" I can use:

    await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
    

    The LaunchFullTrustProcess allows me to launch a trusted application from within my own application. I then modified the Package Manifest XML file and added the following under "capabilities"

    <rescap:Capability
      xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
      Name="runFullTrust" />
    

    I then added the following to "applications" in the XML

    <Extensions
      xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10">
        <desktop:Extension
          Category="windows.fullTrustProcess"
          Executable="fpcalc.exe" />
    </Extensions>
    

    Then I modified the dependencies to make my application run on Windows Desktop machines

    <Dependencies>
        <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
    </Dependencies>
    

    I was then able to launch the application. Once I finish writing the code I will test it and post the correct solution to the issue for future reference.

    0 讨论(0)
提交回复
热议问题