Skip to content

Commit

Permalink
Added alternative method of finding Rocksmith Folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamedjo committed May 4, 2014
1 parent 363a4de commit 85d9c80
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion RockSmithTabExplorer/Services/RocksmithLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public static List<string> LibraryFolders()
return folders;
}

public static string Rocksmith2014FolderFromUbisoftKey()
{
RegistryKey ubiKey = Registry.LocalMachine.OpenSubKey(@"Software\Ubisoft\Rocksmith2014") ?? Registry.LocalMachine.OpenSubKey(@"Software\Wow6432Node\Ubisoft\Rocksmith2014");
return ubiKey.GetValue("installdir").ToString();
}

public static string Rocksmith2014Folder()
{
var appFolders = LibraryFolders().Select(x => x + "\\SteamApps\\common");
Expand All @@ -61,7 +67,9 @@ public static string Rocksmith2014Folder()
}

}
return null;

// Couldn't find folder, attempt another method
return Rocksmith2014FolderFromUbisoftKey();
}
}
}
6 changes: 6 additions & 0 deletions RockSmithTabExplorerTests/RockSmithLocatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,11 @@ public void ItFindsRocksmith2014Folder()
{
StringAssert.Matches(RocksmithLocator.Rocksmith2014Folder(), new Regex("Rocksmith2014"));
}

[TestMethod]
public void ItFindsRocksmith2014FolderFromUbisoftKey()
{
StringAssert.Matches(RocksmithLocator.Rocksmith2014FolderFromUbisoftKey(), new Regex("Rocksmith2014"));
}
}
}

0 comments on commit 85d9c80

Please sign in to comment.