Skip to content

Commit c3e5719

Browse files
committed
add exe launch function
1 parent fa8265a commit c3e5719

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Files.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<AssemblyName>Files</AssemblyName>
1212
<DefaultLanguage>en-US</DefaultLanguage>
1313
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
14-
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18327.0</TargetPlatformVersion>
14+
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17763.0</TargetPlatformVersion>
1515
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
1616
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
1717
<FileAlignment>512</FileAlignment>
@@ -289,7 +289,11 @@
289289
<ItemGroup>
290290
<None Include="Files_TemporaryKey.pfx" />
291291
</ItemGroup>
292-
<ItemGroup />
292+
<ItemGroup>
293+
<SDKReference Include="WindowsDesktop, Version=10.0.17763.0">
294+
<Name>Windows Desktop Extensions for the UWP</Name>
295+
</SDKReference>
296+
</ItemGroup>
293297
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
294298
<VisualStudioVersion>14.0</VisualStudioVersion>
295299
</PropertyGroup>

MainPage.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using System.Diagnostics;
66
using System.IO;
77
using System.Linq;
8+
using System.Threading.Tasks;
9+
using Windows.ApplicationModel;
810
using Windows.ApplicationModel.Core;
911
using Windows.Devices.Enumeration;
1012
using Windows.Devices.Usb;
@@ -224,6 +226,11 @@ private void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sende
224226

225227
}
226228

229+
public static async Task LaunchExe(string executablePath)
230+
{
231+
ApplicationData.Current.LocalSettings.Values["executable"] = executablePath;
232+
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
233+
}
227234
}
228235
public class SelectItem : INotifyPropertyChanged
229236
{

0 commit comments

Comments
 (0)