More touches for 2.0, updated readme.

Separated README and LICENSE.
More documenting.
Small design tweaks.
UWPTest
Brian Lima 8 years ago
parent b55f023e24
commit 993dacfb5e

@ -0,0 +1,6 @@
**#This software is licensed under the MIT license #**
----------
The MIT License (MIT) Copyright © 2014
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -4,95 +4,45 @@
Small project to link UWP games to Steam
If you want to add Windows Store Games to Steam to show up on your Status you need to do a bit of a warkaround because Steam can't see UWP apps, this program aims to simplify a little bit the process where it is possible by automating the scripting and launching.
If you want to add Windows Store Games to Steamyou need to do a bit of a warkaround because Steam can't see UWP apps, and there's a chance Steam won't show it on your "Currently playing" status. This app aims to simplify a little bit the process where it is possible by automating the scripting and launching of Windows Store apps and games.
# To add UWP games to Steam #
Download UWPHook, it's files and store them somewhere on your PC.
[Download the latest version of UWPHook](https://github.com/BrianLima/UWPHook/releases) and store it somewhere on your PC.
![](http://i.imgur.com/sH61SYT.png)
![](http://i.imgur.com/wOV8QwD.png)
Create a shortcut to UWPHook on the same directory where you installed it, by right clicking it and choosing "Create Shortcut" and name it something simple that resembles the game you want to add to Steam.
Click "load installed UWP Apps", we will find every UWP app installed on your PC.
![](http://i.imgur.com/mPWKhkt.png)
![](http://i.imgur.com/ppivtS5.png)
![](http://i.imgur.com/FnXYTQH.png)
Select every app you want to add to Steam, change the name by doubleclicking the "name" collumn, press "Export selected apps to Steam" and boom, every app you selected will be added to Steam.
Go to Steam and click "Add non-Steam Game to Steam
![](http://i.imgur.com/QyJIdnr.png)
Click Browse, find where you extracted UWPHook.exe and select it.
![](http://i.imgur.com/drbwhyK.png)
Click "Add Selected Programs"
Find UWPHook at your Library, right click it, change the name from UWPHook to the name of the game you want, change target to the name of the shortcut you created
![](http://imgur.com/QmsTPpA.png)
![](http://imgur.com/03aEp3Z.png)
Click "Set Launch Options" and write the alias of the game you want to play, you can find it in the column "Alias" on UWPHook
![](http://imgur.com/FtGqaiR.png)
Click Play and enjoy your UWP game showing up on your Steam Status, UWPHook will run on the background checking every 5 seconds if your game is running and close it self automatically if the game is not running.
Close UWPHook, restart Steam, click play on your UWP game, and Steam will show your current game on your status as long as you are playing it!
----------
# Adding or Removing Games from UWPHook #
If you want to play a game that is not included by default on UWPHook, then follow these steps:
Open UWPHook, type the alias of the game in the alias textbox
## Finding the game URL ##
Go to "C:\Users\<user>\AppData\Local\Packages"
Find the App you want to add, copy the whole folder name and add "!App" to the end on UWPHook, should look like this:
![](http://imgur.com/NMx9IAR.png)
![](http://imgur.com/2RlKi1X.png)
Repeat previous steps to add the game to Steam.
If you can't find the app, there's a easier way to determine its folder name:
Press "Windows+R" and type "shell:appsfolder", you will be taken to a folder containing every metro app and other things on your PC
![](http://imgur.com/W1kH0R4.png)
Find the game you want, right click it and create shortcut, Windows will place a shortcut on your desktop.
![](http://imgur.com/Z9p80Hy.png)
Right click the shortcut, on targettype will be the app's folder name, making it easier to find the game on Packages folder.
![](http://imgur.com/HU3I2NU.png)
To remove a game form the list, double click the desired game
# Troubleshooting #
- **I added the game's url to UWPHook but it won't start whatsoever**
- Some games use another string at the end besides "!App" like Forza Motorsport 6: Apex for example, if you can't figure it out, someone at our subreddit might help you.
- **Steam's Overlay isn't working!**
- Unfortunately, it's a Steam limitation, Valve has to update it in order to work properly with UWP, DXTory is a recommended overlay for UWP games.
- **Steam Link launches the game but input doesn't work!**
- Unfortunately, another limitation by Steam, i have some ideas as to why it isn't working, but i can't give an ETA for when i can fix this, or even if it's fixable on my end, since Valve didn't released the Link in Brazil and i can't get one to test.
- **Steam Big Picture Mode isn't working!**
- Unfortunately, it's a Steam limitation and no overlays work yet with UWP games.
- **Steam Controller isn't working**
- Another limitation by Steam, some people reported it works with "Desktop Mode" configuration, but i can't verify this.
- **My question isn't listed here!**
- Drop by our subreddit and ask a question over there, maybe someone will help you, i surely will as soon as i can
**[https://www.reddit.com/r/uwphook](https://www.reddit.com/r/uwphook)**
----------
# About #
**#This software is licensed under the MIT license #**
----------
The MIT License (MIT) Copyright © 2014
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This software is open-source under the MIT License.
If you like what i did with it and want to suport me, you can cheer me up at my [Twitter](http://www.twitter.com/brianostorm "Twitter") or [pay me a coffee via Paypal, it will help me to continue to build amazing open source tools for you!"](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9YPV3FHEFRAUQ")
Thanks for your support, and game on!

@ -9,22 +9,25 @@ using System.Runtime.InteropServices;
namespace UWPHook
{
/// <summary>
/// Functions to manage UWP apps
/// </summary>
static class AppManager
{
private static int id;
/// <summary>
/// Launch a UWP App using a shell command and sets a internal id, to it's proccess id
/// Launch a UWP App using a ApplicationActivationManager and sets a internal id to launched proccess id
/// </summary>
/// <param name="uri"></param>
public static void LaunchUWPApp(string uri)
/// <param name="aumid">The AUMID of the app to launch</param>
public static void LaunchUWPApp(string aumid)
{
var mgr = new ApplicationActivationManager();
uint processId;
try
{
mgr.ActivateApplication(uri, null, ActivateOptions.None, out processId);
mgr.ActivateApplication(aumid, null, ActivateOptions.None, out processId);
}
catch (Exception e)
{
@ -37,9 +40,10 @@ namespace UWPHook
/// <summary>
/// Checks if the launched app is running
/// </summary>
/// <returns></returns>
/// <returns>True if the perviously launched app is running, false otherwise</returns>
public static Boolean IsRunning()
{
//If 0, no app was launched most probably
if (id == 0)
{
return false;
@ -64,15 +68,23 @@ namespace UWPHook
{
List<String> result = null;
var assembly = Assembly.GetExecutingAssembly();
//Load the powershell script to get installed apps
var resourceName = "UWPHook.Resources.GetAUMIDScript.txt";
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
try
{
using (StreamReader reader = new StreamReader(stream))
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
{
result = ScriptManager.RunScript(reader.ReadToEnd()).Split(';').ToList<string>();
using (StreamReader reader = new StreamReader(stream))
{
//Every entry is listed separated by ;
result = ScriptManager.RunScript(reader.ReadToEnd()).Split(';').ToList<string>();
}
}
}
catch (Exception e)
{
throw new Exception("Error trying to get installed apps on your PC " + Environment.NewLine + e.Message, e.InnerException);
}
return result;
}

@ -39,7 +39,7 @@ namespace UWPHook
private void Launcher()
{
this.Title = "UWPHook: Playing a game";
//Hide the window so the app is launched seamless and UWPHook runs in the background without bothering the user
//Hide the window so the app is launched seamless making UWPHook run in the background without bothering the user
this.Hide();
string currentLanguage = CultureInfo.CurrentCulture.ToString();
@ -87,7 +87,15 @@ namespace UWPHook
var selected_apps = Apps.Entries.Where(app => app.Selected);
foreach (var user in users)
{
VDFEntry[] shortcuts = SteamManager.ReadShortcuts(user);
VDFEntry[] shortcuts;
try
{
shortcuts = SteamManager.ReadShortcuts(user);
}
catch (Exception ex)
{
throw new Exception("Error trying to load existing Steam shortcuts." + Environment.NewLine + ex.Message);
}
//TODO: Figure out what to do when user has no shortcuts whatsoever
if (shortcuts != null && shortcuts.Length > 0)
@ -113,8 +121,16 @@ namespace UWPHook
shortcuts[shortcuts.Length - 1] = newApp;
}
//Write the file with all the shortcuts
File.WriteAllBytes(user + @"\\config\\shortcuts.vdf", VDFSerializer.Serialize(shortcuts));
try
{
//Write the file with all the shortcuts
File.WriteAllBytes(user + @"\\config\\shortcuts.vdf", VDFSerializer.Serialize(shortcuts));
}
catch (Exception ex)
{
throw new Exception("Error while trying to write your Steam shortcuts" + Environment.NewLine + ex.Message);
}
}
}
}
@ -143,20 +159,27 @@ namespace UWPHook
private void Bwr_DoWork(object sender, DoWorkEventArgs e)
{
var installedApps = AppManager.GetInstalledApps();
foreach (var app in installedApps)
try
{
//Remove end lines from the String and split both values
var valor = app.Replace("\r\n", "").Split('|');
if (!String.IsNullOrEmpty(valor[0]))
var installedApps = AppManager.GetInstalledApps();
foreach (var app in installedApps)
{
Application.Current.Dispatcher.BeginInvoke((Action)delegate ()
//Remove end lines from the String and split both values, I split the appname and the AUMID using |
//I hope no apps have that in their name. Ever.
var valor = app.Replace("\r\n", "").Split('|');
if (!String.IsNullOrEmpty(valor[0]))
{
Apps.Entries.Add(new AppEntry() { Name = valor[0], Aumid = valor[1], Selected = false });
});
Application.Current.Dispatcher.BeginInvoke((Action)delegate ()
{
Apps.Entries.Add(new AppEntry() { Name = valor[0], Aumid = valor[1], Selected = false });
});
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "UWPHook", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
private void HelpButton_Click(object sender, RoutedEventArgs e)

@ -5,6 +5,9 @@ using System.Text;
namespace UWPHook
{
/// <summary>
/// Functions related to Windows powershell
/// </summary>
static class ScriptManager
{
public static string RunScript(string scriptText)

@ -47,10 +47,17 @@
<Button x:Name="help_button" Click="help_button_Click" Content="Get help at our Reddit" Grid.Column="2" Margin="8,0,0,10" Grid.Row="1" VerticalAlignment="Bottom" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="163"/>
</Grid>
<Grid Margin="10,10,10,0" Grid.Column="1" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="278*"/>
<RowDefinition Height="47*"/>
<RowDefinition Height="49*"/>
<RowDefinition Height="47*"/>
<RowDefinition Height="59*"/>
</Grid.RowDefinitions>
<materialDesign:Chip Content="Projects @ GitHub"
IconBackground="{DynamicResource PrimaryHueDarkBrush}"
IconForeground="{DynamicResource PrimaryHueDarkForegroundBrush}"
Margin="71,281,51,159" Click="Chip1_Click" HorizontalAlignment="Stretch" Height="Auto">
Margin="71,3,51,4" Click="Chip1_Click" HorizontalAlignment="Stretch" Height="Auto" Grid.Row="1">
<materialDesign:Chip.Icon>
<materialDesign:PackIcon Kind="GithubCircle"></materialDesign:PackIcon>
</materialDesign:Chip.Icon>
@ -58,7 +65,7 @@
<materialDesign:Chip Content="Paypal donate"
IconBackground="{DynamicResource PrimaryHueDarkBrush}"
IconForeground="{DynamicResource PrimaryHueDarkForegroundBrush}"
Margin="71,329,51,111" Click="Chip2_Click" HorizontalAlignment="Stretch" Height="Auto">
Margin="71,4,51,5" Click="Chip2_Click" HorizontalAlignment="Stretch" Height="Auto" Grid.Row="2">
<materialDesign:Chip.Icon>
<materialDesign:PackIcon Kind="Coffee"></materialDesign:PackIcon>
</materialDesign:Chip.Icon>
@ -66,17 +73,17 @@
<materialDesign:Chip Content="@brianostorm"
IconBackground="{DynamicResource PrimaryHueDarkBrush}"
IconForeground="{DynamicResource PrimaryHueDarkForegroundBrush}"
Margin="71,378,51,62" Click="Chip_Click" HorizontalAlignment="Stretch" Height="Auto">
Margin="71,4,51,3" Click="Chip_Click" HorizontalAlignment="Stretch" Height="Auto" Grid.Row="3">
<materialDesign:Chip.Icon>
<materialDesign:PackIcon Kind="Twitter" />
</materialDesign:Chip.Icon>
</materialDesign:Chip>
<TextBlock TextWrapping="WrapWithOverflow" x:Name="textBlock" Margin="0,185,0,0" VerticalAlignment="Top" Height="91" Text="Developed by Brian Lima, @brianostorm, if you like my work cheer me up at my Twitter or pay me a coffee via Paypal, this way i can keep building amazing open-source tools for you!" HorizontalAlignment="Left" Width="286" TextAlignment="Justify"/>
<TextBlock TextWrapping="WrapWithOverflow" x:Name="textBlock" Margin="0,185,0,0" Text="Developed by Brian Lima, @brianostorm, if you like my work cheer me up at my Twitter or pay me a coffee via Paypal, this way i can keep building amazing open-source tools for you!" TextAlignment="Justify" Height="91" VerticalAlignment="Top"/>
<materialDesign:ColorZone Padding="16" materialDesign:ShadowAssist.ShadowDepth="Depth2" Mode="PrimaryMid" VerticalAlignment="Top" Height="27">
<Label Content="About" HorizontalAlignment="Left" Margin="-10,-15,0,-17" VerticalAlignment="Top" FontFamily="Segoe UI Semibold" FontSize="14" Height="32" Foreground="#DDFFFFFF"/>
</materialDesign:ColorZone>
<Image x:Name="image2" Height="150" VerticalAlignment="Top" Source="Resources/briano.png" Stretch="UniformToFill" Margin="71,32,0,0" HorizontalAlignment="Left" Width="150"/>
<TextBlock TextWrapping="WrapWithOverflow" x:Name="textBlock_Copy" Margin="0,421,0,0" VerticalAlignment="Top" Height="59" Text="This project uses the MaterialDesignXAMLToolkit. Special thanks to /r/Forza community at Reddit" HorizontalAlignment="Left" Width="286" TextAlignment="Justify"/>
<TextBlock TextWrapping="WrapWithOverflow" x:Name="textBlock_Copy" VerticalAlignment="Top" Height="59" Text="This project uses the MaterialDesignXAMLToolkit. Special thanks to /r/Forza community at Reddit." TextAlignment="Justify" Grid.Row="4"/>
</Grid>
</Grid>
</Window>

Loading…
Cancel
Save