Skip to content

Commit

Permalink
UPlay support
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed Jan 13, 2016
1 parent a5a141f commit a456e4f
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 4 deletions.
61 changes: 61 additions & 0 deletions SteamCleaner/Clients/Uplay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;

namespace SteamCleaner.Clients
{
class Uplay
{

public static bool Exist()
{
var regPath = "";
var is64Bit = Environment.Is64BitOperatingSystem;
if (is64Bit)
{
Console.WriteLine("64 Bit operating system detected");
regPath = @"Software\Wow6432Node\Ubisoft\Launcher";
}
else
{
Console.WriteLine("32 Bit operating system detected");
regPath = @"Software\Ubisoft\Launcher";
}

var key = Registry.LocalMachine.OpenSubKey(regPath);
return key?.GetValue("InstallDir") != null;
}

public static List<string> GetGames()
{
var paths = new List<string>();
var regPath = "";
var is64Bit = Environment.Is64BitOperatingSystem;
if (is64Bit)
{
Console.WriteLine("64 Bit operating system detected");
regPath = @"SOFTWARE\Wow6432Node\Ubisoft\Launcher\Installs";
}
else
{
Console.WriteLine("32 Bit operating system detected");
regPath = @"SOFTWARE\Ubisoft\Launcher\Installs";
}

var root = Registry.LocalMachine.OpenSubKey(regPath);
if (root != null)
paths.AddRange(
root.GetSubKeyNames()
.Select(keyname => root.OpenSubKey(keyname))
.Where(key => key != null)
.Select(key => key.GetValue("InstallDir"))
.Select(o => o?.ToString())
.Where(Directory.Exists));
return paths;
}
}
}
4 changes: 4 additions & 0 deletions SteamCleaner/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ private void RunRefresh()
{
_pathsInternal.Add("Origin Games Detected");
}
if (Uplay.Exist())
{
_pathsInternal.Add("Uplay Games Detected");
}

_filesInternal.Clear();
foreach (
Expand Down
4 changes: 2 additions & 2 deletions SteamCleaner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
1 change: 1 addition & 0 deletions SteamCleaner/SteamCleaner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Clients\Origin.cs" />
<Compile Include="Clients\Uplay.cs" />
<Compile Include="ConfirmationDialog.xaml.cs">
<DependentUpon>ConfirmationDialog.xaml</DependentUpon>
</Compile>
Expand Down
5 changes: 4 additions & 1 deletion SteamCleaner/Utilities/CleanerUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ public static List<Redistributables> FindRedistributables()
{
gameDirs.AddRange(Origin.GetGames());
}

if (Uplay.Exist())
{
gameDirs.AddRange(Uplay.GetGames());
}
//Probably a better way to detect if some retarded publisher nested their package in a folder, but atm capcom is the only one i've seen do it.
foreach (
var nestedGameFolder in
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<steamcleaner>
<version>1.6</version>
<version>1.7</version>
<url>https://github.com/Codeusa/SteamCleaner/releases/latest</url>
</steamcleaner>

0 comments on commit a456e4f

Please sign in to comment.