2019-11-09 13:51:51 +00:00
|
|
|
|
using System.Collections.Generic;
|
2019-09-29 00:22:25 +00:00
|
|
|
|
using System.Linq;
|
2019-10-03 03:23:11 +00:00
|
|
|
|
using Alphaleonis.Win32.Filesystem;
|
2019-09-29 00:22:25 +00:00
|
|
|
|
using Microsoft.Win32;
|
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Common
|
|
|
|
|
{
|
|
|
|
|
public enum Game {
|
2019-11-05 13:03:56 +00:00
|
|
|
|
//MO2 GAMES
|
2019-10-19 10:55:05 +00:00
|
|
|
|
Morrowind,
|
2019-09-29 00:22:25 +00:00
|
|
|
|
Oblivion,
|
|
|
|
|
Fallout3,
|
|
|
|
|
FalloutNewVegas,
|
|
|
|
|
Skyrim,
|
|
|
|
|
SkyrimSpecialEdition,
|
2019-10-01 22:39:25 +00:00
|
|
|
|
Fallout4,
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SkyrimVR,
|
|
|
|
|
//VORTEX GAMES
|
2019-11-09 20:26:33 +00:00
|
|
|
|
DarkestDungeon,
|
2019-11-14 22:58:29 +00:00
|
|
|
|
DivinityOriginalSin2,
|
|
|
|
|
DivinityOriginalSin2DE, //definitive edition has its own nexus page but same Steam/GOG ids
|
2019-11-14 19:02:08 +00:00
|
|
|
|
Starbound,
|
|
|
|
|
SWKOTOR,
|
2019-11-14 19:11:05 +00:00
|
|
|
|
SWKOTOR2,
|
|
|
|
|
WITCHER,
|
|
|
|
|
WITCHER2,
|
|
|
|
|
WITCHER3
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
public ModManager SupportedModManager { get; internal set; }
|
2019-09-29 00:22:25 +00:00
|
|
|
|
public string MO2ArchiveName { get; internal set; }
|
|
|
|
|
public Game Game { get; internal set; }
|
|
|
|
|
public string NexusName { get; internal set; }
|
|
|
|
|
public string MO2Name { get; internal set; }
|
|
|
|
|
public string GameLocationRegistryKey { get; internal set; }
|
2019-11-14 19:02:08 +00:00
|
|
|
|
// to get steam ids: https://steamdb.info
|
2019-11-05 13:10:42 +00:00
|
|
|
|
public List<int> SteamIDs { get; internal set; }
|
2019-11-14 19:02:08 +00:00
|
|
|
|
// to get gog ids: https://www.gogdb.org
|
2019-11-14 19:07:43 +00:00
|
|
|
|
public List<int> GOGIDs { get; internal set; }
|
2019-11-14 19:02:08 +00:00
|
|
|
|
// these are additional folders when a game installs mods outside the game folder
|
2019-11-09 20:34:44 +00:00
|
|
|
|
public List<string> AdditionalFolders { get; internal set; }
|
2019-09-29 00:22:25 +00:00
|
|
|
|
|
2019-10-03 03:23:11 +00:00
|
|
|
|
public string GameLocation
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (Consts.TestMode)
|
|
|
|
|
return Directory.GetCurrentDirectory();
|
|
|
|
|
|
|
|
|
|
return (string) Registry.GetValue(GameLocationRegistryKey, "installed path", null)
|
|
|
|
|
??
|
|
|
|
|
(string) Registry.GetValue(
|
|
|
|
|
GameLocationRegistryKey.Replace(@"HKEY_LOCAL_MACHINE\SOFTWARE\",
|
|
|
|
|
@"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\"), "installed path", null);
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class GameRegistry
|
|
|
|
|
{
|
|
|
|
|
public static GameMetaData GetByMO2ArchiveName(string gameName)
|
|
|
|
|
{
|
|
|
|
|
var gamename = gameName.ToLower();
|
2019-11-09 14:40:50 +00:00
|
|
|
|
return Games.Values.FirstOrDefault(g => g.MO2ArchiveName?.ToLower() == gamename);
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-11-09 14:10:28 +00:00
|
|
|
|
public static GameMetaData GetByNexusName(string gameName)
|
|
|
|
|
{
|
|
|
|
|
return Games.Values.FirstOrDefault(g => g.NexusName == gameName.ToLower());
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-15 05:43:58 +00:00
|
|
|
|
public static IReadOnlyDictionary<Game, GameMetaData> Games = new Dictionary<Game, GameMetaData>
|
2019-09-29 00:22:25 +00:00
|
|
|
|
{
|
2019-11-09 14:40:14 +00:00
|
|
|
|
/*{
|
2019-10-19 10:55:05 +00:00
|
|
|
|
Game.Morrowind, new GameMetaData()
|
2019-11-09 14:40:14 +00:00
|
|
|
|
},*/
|
2019-09-29 00:22:25 +00:00
|
|
|
|
{
|
|
|
|
|
Game.Oblivion, new GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SupportedModManager = ModManager.MO2,
|
2019-09-29 00:22:25 +00:00
|
|
|
|
Game = Game.Oblivion,
|
|
|
|
|
NexusName = "oblivion",
|
2019-10-02 22:45:42 +00:00
|
|
|
|
MO2Name = "Oblivion",
|
2019-11-09 14:21:31 +00:00
|
|
|
|
MO2ArchiveName = "oblivion",
|
2019-11-05 13:10:42 +00:00
|
|
|
|
GameLocationRegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Bethesda Softworks\Oblivion",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {22330}
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
Game.Fallout3, new GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SupportedModManager = ModManager.MO2,
|
2019-09-29 00:22:25 +00:00
|
|
|
|
Game = Game.Fallout3,
|
|
|
|
|
NexusName = "fallout3",
|
|
|
|
|
MO2Name = "fallout3",
|
|
|
|
|
MO2ArchiveName = "fallout3",
|
2019-11-05 13:10:42 +00:00
|
|
|
|
GameLocationRegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Bethesda Softworks\Fallout3",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {22300, 22370} // base game and GotY
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.FalloutNewVegas, new GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SupportedModManager = ModManager.MO2,
|
2019-09-29 00:22:25 +00:00
|
|
|
|
Game = Game.FalloutNewVegas,
|
|
|
|
|
NexusName = "newvegas",
|
|
|
|
|
MO2Name = "New Vegas",
|
|
|
|
|
MO2ArchiveName = "falloutnv",
|
2019-11-05 13:10:42 +00:00
|
|
|
|
GameLocationRegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Bethesda Softworks\falloutnv",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {22380}
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.Skyrim, new GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SupportedModManager = ModManager.MO2,
|
2019-09-29 00:22:25 +00:00
|
|
|
|
Game = Game.Skyrim,
|
|
|
|
|
NexusName = "skyrim",
|
|
|
|
|
MO2Name = "Skyrim",
|
|
|
|
|
MO2ArchiveName = "skyrim",
|
2019-11-05 13:10:42 +00:00
|
|
|
|
GameLocationRegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Bethesda Softworks\skyrim",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {72850}
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.SkyrimSpecialEdition, new GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SupportedModManager = ModManager.MO2,
|
2019-09-29 00:22:25 +00:00
|
|
|
|
Game = Game.SkyrimSpecialEdition,
|
|
|
|
|
NexusName = "skyrimspecialedition",
|
|
|
|
|
MO2Name = "Skyrim Special Edition",
|
|
|
|
|
MO2ArchiveName = "skyrimse",
|
2019-11-05 13:10:42 +00:00
|
|
|
|
GameLocationRegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Bethesda Softworks\Skyrim Special Edition",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {489830}
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.Fallout4, new GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SupportedModManager = ModManager.MO2,
|
2019-09-29 00:22:25 +00:00
|
|
|
|
Game = Game.Fallout4,
|
|
|
|
|
NexusName = "fallout4",
|
|
|
|
|
MO2Name = "Fallout 4",
|
|
|
|
|
MO2ArchiveName = "fallout4",
|
2019-11-05 13:10:42 +00:00
|
|
|
|
GameLocationRegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Bethesda Softworks\Fallout4",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {377160}
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
2019-10-01 22:39:25 +00:00
|
|
|
|
},
|
2019-11-05 13:10:42 +00:00
|
|
|
|
/*{
|
|
|
|
|
Game.Fallout4VR, new GameMetaData
|
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.MO2,
|
|
|
|
|
Game = Game.Fallout4VR,
|
|
|
|
|
NexusName = "fallout4",
|
|
|
|
|
MO2Name = "Fallout 4",
|
|
|
|
|
MO2ArchiveName = "fallout4",
|
|
|
|
|
SteamIDs = new List<int>{611660}
|
|
|
|
|
}
|
|
|
|
|
},*/
|
2019-10-01 22:39:25 +00:00
|
|
|
|
{
|
|
|
|
|
Game.SkyrimVR, new GameMetaData
|
|
|
|
|
{
|
2019-11-05 13:03:56 +00:00
|
|
|
|
SupportedModManager = ModManager.MO2,
|
2019-10-01 22:39:25 +00:00
|
|
|
|
Game = Game.SkyrimVR,
|
|
|
|
|
NexusName = "skyrimspecialedition",
|
|
|
|
|
MO2Name = "Skyrim VR",
|
|
|
|
|
MO2ArchiveName = "skyrimse",
|
2019-11-05 13:10:42 +00:00
|
|
|
|
GameLocationRegistryKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\Bethesda Softworks\Skyrim VR",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {611670}
|
2019-10-01 22:39:25 +00:00
|
|
|
|
}
|
2019-11-05 13:03:56 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
2019-11-05 14:51:52 +00:00
|
|
|
|
Game.DarkestDungeon, new GameMetaData
|
2019-11-05 13:03:56 +00:00
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
|
|
|
|
Game = Game.DarkestDungeon,
|
2019-11-05 13:10:42 +00:00
|
|
|
|
NexusName = "darkestdungeon",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {262060},
|
2019-11-14 19:07:43 +00:00
|
|
|
|
GOGIDs = new List<int>{1450711444}
|
2019-11-05 13:03:56 +00:00
|
|
|
|
}
|
2019-11-09 20:26:33 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
2019-11-14 22:58:29 +00:00
|
|
|
|
Game.DivinityOriginalSin2, new GameMetaData
|
2019-11-09 20:26:33 +00:00
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
2019-11-14 22:58:29 +00:00
|
|
|
|
Game = Game.DivinityOriginalSin2,
|
|
|
|
|
NexusName = "divinityoriginalsin2",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
SteamIDs = new List<int> {435150},
|
2019-11-14 19:07:43 +00:00
|
|
|
|
GOGIDs = new List<int>{1584823040},
|
2019-11-09 20:34:44 +00:00
|
|
|
|
AdditionalFolders = new List<string>
|
|
|
|
|
{
|
|
|
|
|
"%documents%\\Larian Studios\\Divinity Original Sin 2\\Mods\\",
|
2019-11-14 17:52:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2019-11-14 22:58:29 +00:00
|
|
|
|
Game.DivinityOriginalSin2DE, new GameMetaData
|
2019-11-14 17:52:00 +00:00
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
2019-11-14 22:58:29 +00:00
|
|
|
|
Game = Game.DivinityOriginalSin2DE,
|
2019-11-14 17:52:00 +00:00
|
|
|
|
NexusName = "divinityoriginalsin2definitiveedition",
|
|
|
|
|
SteamIDs = new List<int> {435150},
|
2019-11-14 19:07:43 +00:00
|
|
|
|
GOGIDs = new List<int>{1584823040},
|
2019-11-14 17:52:00 +00:00
|
|
|
|
AdditionalFolders = new List<string>
|
|
|
|
|
{
|
2019-11-09 20:34:44 +00:00
|
|
|
|
"%documents%\\Larian Studios\\Divinity Original Sin 2 Definitive Edition\\Mods\\"
|
|
|
|
|
}
|
2019-11-09 20:26:33 +00:00
|
|
|
|
}
|
2019-11-14 18:57:45 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.Starbound, new GameMetaData
|
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
|
|
|
|
Game = Game.Starbound,
|
|
|
|
|
NexusName = "starbound",
|
|
|
|
|
SteamIDs = new List<int>{211820},
|
2019-11-14 19:07:43 +00:00
|
|
|
|
GOGIDs = new List<int>{1452598881}
|
2019-11-14 18:57:45 +00:00
|
|
|
|
}
|
2019-11-14 19:02:08 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.SWKOTOR, new GameMetaData
|
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
|
|
|
|
Game = Game.SWKOTOR,
|
|
|
|
|
NexusName = "kotor",
|
|
|
|
|
SteamIDs = new List<int>{32370},
|
2019-11-14 19:07:43 +00:00
|
|
|
|
GOGIDs = new List<int>{1207666283}
|
2019-11-14 19:02:08 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.SWKOTOR2, new GameMetaData
|
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
|
|
|
|
Game = Game.SWKOTOR2,
|
|
|
|
|
NexusName = "kotor2",
|
|
|
|
|
SteamIDs = new List<int>{208580},
|
2019-11-14 19:07:43 +00:00
|
|
|
|
GOGIDs = new List<int>{1421404581}
|
2019-11-14 19:02:08 +00:00
|
|
|
|
}
|
2019-11-14 19:11:05 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.WITCHER, new GameMetaData
|
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
|
|
|
|
Game = Game.WITCHER,
|
|
|
|
|
NexusName = "witcher",
|
|
|
|
|
SteamIDs = new List<int>{20900},
|
|
|
|
|
GOGIDs = new List<int>{1207658924}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.WITCHER2, new GameMetaData
|
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
|
|
|
|
Game = Game.WITCHER2,
|
|
|
|
|
NexusName = "witcher2",
|
|
|
|
|
SteamIDs = new List<int>{20920},
|
|
|
|
|
GOGIDs = new List<int>{1207658930}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Game.WITCHER3, new GameMetaData
|
|
|
|
|
{
|
|
|
|
|
SupportedModManager = ModManager.Vortex,
|
|
|
|
|
Game = Game.WITCHER3,
|
|
|
|
|
NexusName = "witcher3",
|
|
|
|
|
SteamIDs = new List<int>{292030, 499450}, // normal and GotY
|
|
|
|
|
GOGIDs = new List<int>{1207664643, 1495134320, 1207664663, 1640424747} // normal, GotY and both in packages
|
|
|
|
|
}
|
2019-09-29 00:22:25 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|