Compare commits

...

4 Commits

@ -11,7 +11,7 @@
!define APP_NAME "UWPHook" !define APP_NAME "UWPHook"
!define COMP_NAME "Briano" !define COMP_NAME "Briano"
!define WEB_SITE "https://briano.dev" !define WEB_SITE "https://briano.dev"
!define VERSION "2.12.00.00" !define VERSION "2.13.00.00"
!define COPYRIGHT "Briano <20> 2020 2021 2022" !define COPYRIGHT "Briano <20> 2020 2021 2022"
!define DESCRIPTION "The easy way to add UWP and XGP games to Steam" !define DESCRIPTION "The easy way to add UWP and XGP games to Steam"
!define LICENSE_TXT "C:\Users\Brian\Documents\GitHub\UWPHook\README.md" !define LICENSE_TXT "C:\Users\Brian\Documents\GitHub\UWPHook\README.md"
@ -44,7 +44,7 @@ OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}" BrandingText "${APP_NAME}"
XPStyle on XPStyle on
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" "" InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
InstallDir "$PROGRAMFILES\Briano\UWPHook" InstallDir "$APPDATA\Briano\UWPHook"
###################################################################### ######################################################################
@ -92,13 +92,15 @@ File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\Crc32.NET.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\MaterialDesignColors.dll" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\MaterialDesignColors.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\MaterialDesignThemes.Wpf.dll" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\MaterialDesignThemes.Wpf.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\Newtonsoft.Json.dll" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\Newtonsoft.Json.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\Serilog.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\Serilog.Sinks.Console.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\Serilog.Sinks.File.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\SharpSteam.dll" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\SharpSteam.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\System.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\System.Management.Automation.dll" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\System.Management.Automation.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\System.Net.Http.Formatting.dll" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\System.Net.Http.Formatting.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\VDFParser.dll"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\UWPHook.exe" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\UWPHook.exe"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\UWPHook.exe.config" File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\UWPHook.exe.config"
File "C:\Users\Brian\Documents\GitHub\UWPHook\UWPHook\bin\Release\VDFParser.dll"
CreateDirectory "$INSTDIR\Resources" CreateDirectory "$INSTDIR\Resources"
SetOutPath "$INSTDIR\Resources" SetOutPath "$INSTDIR\Resources"

@ -284,7 +284,7 @@ namespace UWPHook
{ {
SteamGridDbApi api = new SteamGridDbApi(Properties.Settings.Default.SteamGridDbApiKey); SteamGridDbApi api = new SteamGridDbApi(Properties.Settings.Default.SteamGridDbApiKey);
string tmpGridDirectory = Path.GetTempPath() + "UWPHook\\tmp_grid\\"; string tmpGridDirectory = Path.GetTempPath() + "UWPHook\\tmp_grid\\";
GameResponse[] games; GameResponse[] games = null;
try try
{ {
@ -293,7 +293,6 @@ namespace UWPHook
catch (TaskCanceledException exception) catch (TaskCanceledException exception)
{ {
Log.Error(exception.Message); Log.Error(exception.Message);
throw;
} }
if (games != null) if (games != null)
@ -390,6 +389,8 @@ namespace UWPHook
} }
} }
await Task.WhenAll(gridImagesDownloadTasks);
// Export the selected apps and the downloaded images to each user // Export the selected apps and the downloaded images to each user
// in the steam folder by modifying it's VDF file // in the steam folder by modifying it's VDF file
foreach (var user in users) foreach (var user in users)
@ -415,30 +416,26 @@ namespace UWPHook
{ {
foreach (var app in selected_apps) foreach (var app in selected_apps)
{ {
string icon = ""; try
if (gridImagesDownloadTasks.Count > 0)
{ {
await Task.WhenAll(gridImagesDownloadTasks);
app.Icon = PersistAppIcon(app);
Log.Verbose("Defaulting to app.Icon for app " + app.Name);
}
catch (System.IO.IOException)
{
Log.Verbose("Using backup icon for app " + app.Name);
await Task.Run(() => await Task.Run(() =>
{ {
string tmpGridDirectory = Path.GetTempPath() + "UWPHook\\tmp_grid\\"; string tmpGridDirectory = Path.GetTempPath() + "UWPHook\\tmp_grid\\";
string[] images = Directory.GetFiles(tmpGridDirectory); string[] images = Directory.GetFiles(tmpGridDirectory);
foreach (string image in images) UInt64 gameId = GenerateSteamGridAppId(app.Name, exePath);
{ app.Icon = PersistAppIcon(app, tmpGridDirectory + gameId + "_logo.png");
if (image.EndsWith("_logo.png"))
{
icon = PersistAppIcon(app, image);
break;
}
}
}); });
} }
else
{
icon = PersistAppIcon(app);
}
VDFEntry newApp = new VDFEntry() VDFEntry newApp = new VDFEntry()
{ {
@ -448,7 +445,7 @@ namespace UWPHook
LaunchOptions = app.Aumid + " " + app.Executable, LaunchOptions = app.Aumid + " " + app.Executable,
AllowDesktopConfig = 1, AllowDesktopConfig = 1,
AllowOverlay = 1, AllowOverlay = 1,
Icon = icon, Icon = app.Icon,
Index = shortcuts.Length, Index = shortcuts.Length,
IsHidden = 0, IsHidden = 0,
OpenVR = 0, OpenVR = 0,
@ -537,7 +534,6 @@ namespace UWPHook
// If we do not have an specific icon to copy, copy app.icon, if we do, copy the specified icon // If we do not have an specific icon to copy, copy app.icon, if we do, copy the specified icon
string icon_to_copy = String.IsNullOrEmpty(forcedIcon) ? app.Icon : forcedIcon; string icon_to_copy = String.IsNullOrEmpty(forcedIcon) ? app.Icon : forcedIcon;
if (!Directory.Exists(icons_path)) if (!Directory.Exists(icons_path))
{ {
Directory.CreateDirectory(icons_path); Directory.CreateDirectory(icons_path);
@ -545,17 +541,21 @@ namespace UWPHook
string dest_file = String.Join(String.Empty, icons_path, app.Aumid + Path.GetFileName(icon_to_copy)); string dest_file = String.Join(String.Empty, icons_path, app.Aumid + Path.GetFileName(icon_to_copy));
try try
{
if (File.Exists(icon_to_copy))
{ {
File.Copy(icon_to_copy, dest_file, true); File.Copy(icon_to_copy, dest_file, true);
} }
catch (System.IO.IOException) else
{ {
// This file is most likely encrypted or does not exist, so we return the app.Icon itself
// but this app is now prone to #90 unfortunately, if we return String.empty, Steam will default
// to UWPHook's icon
Log.Warning("File could not be copied: " + icon_to_copy);
dest_file = app.Icon; dest_file = app.Icon;
} }
}
catch (System.IO.IOException e)
{
Log.Warning(e, "Could not copy icon " + app.Icon);
throw e;
}
return dest_file; return dest_file;
} }

@ -51,6 +51,6 @@ using System.Windows;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.12.0.0")] [assembly: AssemblyVersion("2.13.0.0")]
[assembly: AssemblyFileVersion("2.12.0.0")] [assembly: AssemblyFileVersion("2.13.0.0")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]

@ -202,10 +202,10 @@
<Version>1.2.0</Version> <Version>1.2.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="MaterialDesignColors"> <PackageReference Include="MaterialDesignColors">
<Version>2.0.6</Version> <Version>2.0.7</Version>
</PackageReference> </PackageReference>
<PackageReference Include="MaterialDesignThemes"> <PackageReference Include="MaterialDesignThemes">
<Version>4.5.0</Version> <Version>4.6.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.Client"> <PackageReference Include="Microsoft.AspNet.WebApi.Client">
<Version>5.2.9</Version> <Version>5.2.9</Version>
@ -214,7 +214,7 @@
<Version>13.0.1</Version> <Version>13.0.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Serilog"> <PackageReference Include="Serilog">
<Version>2.11.0</Version> <Version>2.12.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Serilog.Sinks.Console"> <PackageReference Include="Serilog.Sinks.Console">
<Version>4.1.0</Version> <Version>4.1.0</Version>

Loading…
Cancel
Save