More progress towards automating exporting games.

UWPTest
Brian Lima 8 years ago
parent 5963ee9e60
commit 512a38022e

@ -1,4 +1,6 @@
using System.ComponentModel; using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace UWPHook namespace UWPHook

@ -14,6 +14,7 @@ using System.Windows.Shapes;
using VDFParser; using VDFParser;
using VDFParser.Models; using VDFParser.Models;
using SharpSteam; using SharpSteam;
using System.IO;
namespace UWPHook namespace UWPHook
{ {
@ -29,21 +30,30 @@ namespace UWPHook
InitializeComponent(); InitializeComponent();
Apps = new AppEntryModel(); Apps = new AppEntryModel();
listGames.ItemsSource = Apps.Entries; listGames.ItemsSource = Apps.Entries;
this.Title = string.Join(";", Environment.GetCommandLineArgs());
} }
private void ExportButton_Click(object sender, RoutedEventArgs e) private void ExportButton_Click(object sender, RoutedEventArgs e)
{ {
string steam_folder = SteamManager.GetSteamFolder(); string steam_folder = SteamManager.GetSteamFolder();
var users = SteamManager.GetUsers(steam_folder); if (!String.IsNullOrEmpty(steam_folder))
foreach (var user in users)
{ {
var shortcuts = SteamManager.ReadShortcuts(user); var users = SteamManager.GetUsers(steam_folder);
if (shortcuts != null) var selected_apps = from app in Apps.Entries
where app.Selected = true
select new AppEntry() { Aumid = app.Aumid, Name = app.Name, Selected = app.Selected };
foreach (var user in users)
{ {
//foreach (var item in Apps.Entries.Select<) VDFEntry[] shortcuts = SteamManager.ReadShortcuts(user);
//{ if (shortcuts != null)
// {
//} foreach (var app in selected_apps)
{
//Resize this array so it fits the new entries
// Array.Resize(ref shortcuts, shortcuts.Length);
}
}
} }
} }
} }
@ -67,7 +77,6 @@ namespace UWPHook
private void HelpButton_Click(object sender, RoutedEventArgs e) private void HelpButton_Click(object sender, RoutedEventArgs e)
{ {
} }
} }
} }

@ -9,6 +9,39 @@ using System.Threading.Tasks;
namespace UWPHook namespace UWPHook
{ {
class AppManager
{
private int id;
public void LaunchUWPApp(string uri)
{
var mgr = new ApplicationActivationManager();
uint processId;
mgr.ActivateApplication(uri, null, ActivateOptions.None, out processId);
id = (int)processId;
}
public Boolean IsRunning()
{
if (id == 0)
{
return false;
}
try
{
Process.GetProcessById(id);
}
catch (Exception)
{
return false;
}
return true;
}
}
public enum ActivateOptions public enum ActivateOptions
{ {
None = 0x00000000, // No flags set None = 0x00000000, // No flags set
@ -56,30 +89,4 @@ namespace UWPHook
interface IShellItemArray interface IShellItemArray
{ {
} }
}
class ProcessManager
{
int StartProccess(string uri)
{
var mgr = new ApplicationActivationManager();
uint processId;
var name = "Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe!App";
mgr.ActivateApplication(name, null, ActivateOptions.None, out processId);
return ((int)processId);
}
Boolean ProcessIsRunning(int id)
{
try
{
Process.
}
catch (Exception)
{
throw;
}
}
}
}

@ -68,7 +68,7 @@ namespace UWPHook.Properties {
///{ ///{
///    foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id) ///    foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
///    { ///    {
///        $aumidList += $app.packagefamilyname + &quot;!&quot; + $id ///        $aumidList += $app.name + &quot;|&quot; + $app.packagefamilyname + &quot;!&quot; + $id + &quot;;&quot;
///    } ///    }
///} ///}
/// ///
@ -79,5 +79,15 @@ namespace UWPHook.Properties {
return ResourceManager.GetString("GetAUMIDScript", resourceCulture); return ResourceManager.GetString("GetAUMIDScript", resourceCulture);
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
public static System.Drawing.Icon hook_icon {
get {
object obj = ResourceManager.GetObject("hook_icon", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
} }
} }

@ -121,4 +121,7 @@
<data name="GetAUMIDScript" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="GetAUMIDScript" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GetAUMIDScript.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> <value>..\Resources\GetAUMIDScript.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data> </data>
<data name="hook_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\hook_icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

@ -151,7 +151,7 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\hook_icon.ico" /> <EmbeddedResource Include="Resources\hook_icon.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Resources\delete.png" /> <None Include="Resources\delete.png" />
@ -192,6 +192,17 @@
<Resource Include="Resources\4.png" /> <Resource Include="Resources\4.png" />
<Resource Include="Resources\5.png" /> <Resource Include="Resources\5.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary">
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

Loading…
Cancel
Save