Skip to content

Commit 2078a7c

Browse files
committed
Implement exe-launcher for Click Action
1 parent c041dba commit 2078a7c

File tree

6 files changed

+42
-41
lines changed

6 files changed

+42
-41
lines changed

Files.csproj

Lines changed: 2 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.17763.0</TargetPlatformVersion>
14+
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18327.0</TargetPlatformVersion>
1515
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
1616
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
1717
<FileAlignment>512</FileAlignment>
@@ -290,7 +290,7 @@
290290
<None Include="Files_TemporaryKey.pfx" />
291291
</ItemGroup>
292292
<ItemGroup>
293-
<SDKReference Include="WindowsDesktop, Version=10.0.17763.0">
293+
<SDKReference Include="WindowsDesktop, Version=10.0.18327.0">
294294
<Name>Windows Desktop Extensions for the UWP</Name>
295295
</SDKReference>
296296
</ItemGroup>

FilesUwp.Package/FilesUwp.Package.wapproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
3939
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
4040
<DefaultLanguage>en-US</DefaultLanguage>
41-
<PackageCertificateKeyFile>FilesUwp.Package_TemporaryKey.pfx</PackageCertificateKeyFile>
41+
<PackageCertificateKeyFile>Files_TemporaryKey.pfx</PackageCertificateKeyFile>
4242
<EntryPointProjectUniqueName>..\Files.csproj</EntryPointProjectUniqueName>
43+
<PackageCertificateThumbprint>28AE037A1F13461E0372E31085451A86570D5A1B</PackageCertificateThumbprint>
4344
</PropertyGroup>
4445
<ItemGroup>
4546
<AppxManifest Include="Package.appxmanifest">
@@ -48,6 +49,7 @@
4849
<None Include="FilesUwp.Package_TemporaryKey.pfx" />
4950
</ItemGroup>
5051
<ItemGroup>
52+
<None Include="Files_TemporaryKey.pfx" />
5153
<Content Include="Images\LockScreenLogo.scale-200.png" />
5254
<Content Include="Images\Square150x150Logo.scale-200.png" />
5355
<Content Include="Images\Square44x44Logo.scale-200.png" />

FilesUwp.Package/Package.appxmanifest

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" IgnorableNamespaces="uap mp rescap desktop">
3-
<Identity Name="85bc74fc-1b61-4232-97b5-1ed702381499" Publisher="CN=asalim" Version="1.0.0.0" />
3+
<Identity Name="85bc74fc-1b61-4232-97b5-1ed702381499" Publisher="CN=lukeb" Version="0.4.7.0" />
44
<Properties>
5-
<DisplayName>FilesUwp.Package</DisplayName>
6-
<PublisherDisplayName>FilesUwpDeveloper</PublisherDisplayName>
5+
<DisplayName>Files</DisplayName>
6+
<PublisherDisplayName>Luke Blevins</PublisherDisplayName>
77
<Logo>Images\StoreLogo.png</Logo>
88
</Properties>
99
<Dependencies>
@@ -14,18 +14,17 @@
1414
<Resource Language="x-generate" />
1515
</Resources>
1616
<Applications>
17-
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
18-
<uap:VisualElements DisplayName="FilesUwp.Package" Description="FilesUwp.Package" BackgroundColor="transparent" Square150x150Logo="Images\Square150x150Logo.png" Square44x44Logo="Images\Square44x44Logo.png">
19-
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png">
20-
</uap:DefaultTile>
21-
</uap:VisualElements>
22-
<Extensions>
23-
<desktop:Extension Category="windows.fullTrustProcess" Executable="Launcher/Launcher.exe" />
24-
<!--<uap:Extension Category="windows.appService" EntryPoint="MyAppService.ExeNameProvider">
25-
<uap3:AppService Name="com.placeholder.here" uap4:SupportsMultipleInstances="true"/>
26-
</uap:Extension>-->
27-
</Extensions>
28-
</Application>
17+
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
18+
<uap:VisualElements DisplayName="Files" Description="Meet Files, a free and open-source File Manager for Windows 10. Created from the ground up to look and feel amazing, Files is built to replace the dated Windows File Explorer." BackgroundColor="transparent" Square150x150Logo="Images\Square150x150Logo.png" Square44x44Logo="Images\Square44x44Logo.png">
19+
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png">
20+
21+
</uap:DefaultTile>
22+
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="black" />
23+
</uap:VisualElements>
24+
<Extensions>
25+
<desktop:Extension Category="windows.fullTrustProcess" Executable="Launcher/Launcher.exe" />
26+
</Extensions>
27+
</Application>
2928
</Applications>
3029
<Capabilities>
3130
<Capability Name="internetClient" />

Interacts/Interaction.cs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using Files.Filesystem;
1616
using Files.Navigation;
1717
using Microsoft.Toolkit.Uwp.UI.Controls;
18+
using System.Threading.Tasks;
19+
using Windows.ApplicationModel;
1820

1921
namespace Files.Interacts
2022
{
@@ -170,11 +172,13 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
170172
}
171173
else if (clickedOnItem.FileExtension == "Executable")
172174
{
173-
message = new MessageDialog("We noticed you’re trying to run an executable file. This type of file may be a security risk to your device, and is not supported by the Universal Windows Platform. If you're not sure what this means, check out the Microsoft Store for a large selection of secure apps, games, and more.");
174-
message.Title = "Unsupported Functionality";
175-
message.Commands.Add(new UICommand("Continue...", new UICommandInvokedHandler(Interaction.CommandInvokedHandler)));
176-
message.Commands.Add(new UICommand("Cancel"));
177-
await message.ShowAsync();
175+
//message = new MessageDialog("We noticed you’re trying to run an executable file. This type of file may be a security risk to your device, and is not supported by the Universal Windows Platform. If you're not sure what this means, check out the Microsoft Store for a large selection of secure apps, games, and more.");
176+
//message.Title = "Unsupported Functionality";
177+
//message.Commands.Add(new UICommand("Continue...", new UICommandInvokedHandler(Interaction.CommandInvokedHandler)));
178+
//message.Commands.Add(new UICommand("Cancel"));
179+
//await message.ShowAsync();
180+
await LaunchExe(clickedOnItem.FilePath);
181+
178182
}
179183
else
180184
{
@@ -316,11 +320,12 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
316320
}
317321
else if (clickedOnItem.FileExtension == "Executable")
318322
{
319-
Interaction.message = new MessageDialog("We noticed you’re trying to run an executable file. This type of file may be a security risk to your device, and is not supported by the Universal Windows Platform. If you're not sure what this means, check out the Microsoft Store for a large selection of secure apps, games, and more.");
320-
Interaction.message.Title = "Unsupported Functionality";
321-
Interaction.message.Commands.Add(new UICommand("Continue...", new UICommandInvokedHandler(Interaction.CommandInvokedHandler)));
322-
Interaction.message.Commands.Add(new UICommand("Cancel"));
323-
await Interaction.message.ShowAsync();
323+
//Interaction.message = new MessageDialog("We noticed you’re trying to run an executable file. This type of file may be a security risk to your device, and is not supported by the Universal Windows Platform. If you're not sure what this means, check out the Microsoft Store for a large selection of secure apps, games, and more.");
324+
//Interaction.message.Title = "Unsupported Functionality";
325+
//Interaction.message.Commands.Add(new UICommand("Continue...", new UICommandInvokedHandler(Interaction.CommandInvokedHandler)));
326+
//Interaction.message.Commands.Add(new UICommand("Cancel"));
327+
//await Interaction.message.ShowAsync();
328+
await LaunchExe(clickedOnItem.FilePath);
324329

325330
}
326331
else
@@ -339,6 +344,13 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
339344

340345
}
341346

347+
348+
public static async Task LaunchExe(string executablePath)
349+
{
350+
ApplicationData.Current.LocalSettings.Values["executable"] = executablePath;
351+
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
352+
}
353+
342354
public static async void CommandInvokedHandler(IUICommand command)
343355
{
344356
await Launcher.LaunchUriAsync(new Uri("ms-windows-store://home"));

MainPage.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,6 @@ private void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sende
226226

227227
}
228228

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

Package.appxmanifest

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</Resources>
1616
<Applications>
1717
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Files.App" desktop4:SupportsMultipleInstances="true">
18-
<uap:VisualElements DisplayName="Files" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Meet Files, a free and open-sourced File Manager for Windows 10. Created from the ground up to look and feel amazing, Files is built to replace the dated Windows File Explorer." BackgroundColor="transparent">
18+
<uap:VisualElements DisplayName="Files" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Meet Files, a free and open-source File Manager for Windows 10. Created from the ground up to look and feel amazing, Files is built to replace the dated Windows File Explorer." BackgroundColor="transparent">
1919
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
2020
<uap:ShowNameOnTiles>
2121
<uap:ShowOn Tile="square150x150Logo" />
@@ -25,18 +25,11 @@
2525
</uap:DefaultTile>
2626
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="black" />
2727
</uap:VisualElements>
28-
<!--<Extensions>
29-
<desktop:Extension Category="windows.fullTrustProcess" Executable="LegacyLauncher.exe"/>
30-
<uap:Extension Category="windows.appService" EntryPoint="MyAppService.ExeNameProvider">
31-
<uap3:AppService Name="com.placeholder.here" uap4:SupportsMultipleInstances="true"/>
32-
</uap:Extension>
33-
</Extensions>-->
3428
</Application>
3529
</Applications>
3630
<Capabilities>
3731
<Capability Name="internetClient" />
3832
<uap:Capability Name="removableStorage" />
39-
<!--<rescap:Capability Name="runFullTrust"/>-->
4033
<rescap:Capability Name="broadFileSystemAccess" />
4134
</Capabilities>
4235
</Package>

0 commit comments

Comments
 (0)