Skip to content

Commit 8bdccf3

Browse files
committed
Spore ModAPI Launcher: detect SporeModLoader
1 parent 56a9316 commit 8bdccf3

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

Spore ModAPI Launcher/Program.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,27 @@ void Execute()
8787
return;
8888
}
8989

90+
// check if SporeModLoader is installed
91+
try
92+
{
93+
string sporeModLoaderPath = Path.Combine(this.SporebinPath, "dinput8.dll");
94+
string originalFileName = "SporeModLoader.dll";
95+
if (File.Exists(sporeModLoaderPath))
96+
{
97+
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(sporeModLoaderPath);
98+
if (fileVersionInfo.InternalName == originalFileName ||
99+
fileVersionInfo.OriginalFilename == originalFileName)
100+
{
101+
MessageBox.Show(Strings.SporeModLoaderDetected.Replace("$PATH$", sporeModLoaderPath), Strings.SporeModLoaderDetectedTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
102+
return;
103+
}
104+
}
105+
}
106+
catch (Exception)
107+
{
108+
// ignore exception, SporeModLoader is likely not installed
109+
}
110+
90111
// get the correct executable path
91112
this.ExecutablePath = Path.Combine(this.SporebinPath, GameVersion.ExecutableNames[(int)this._executableType]);
92113
if (!File.Exists(this.ExecutablePath))

Spore ModAPI Launcher/Strings.resx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,15 @@ or
188188
<data name="CannotApplySteamFixTitle" xml:space="preserve">
189189
<value>Could not apply the Steam fix</value>
190190
</data>
191+
<data name="SporeModLoaderDetected" xml:space="preserve">
192+
<value>SporeModLoader has been detected, running the Launcher Kit alongside SporeModLoader is unsupported.
193+
194+
You have the the following options:
195+
- Remove SporeModLoader to use the Launcher Kit by removing $PATH$
196+
- Use SporeModLoader instead of the Launcher Kit
197+
</value>
198+
</data>
199+
<data name="SporeModLoaderDetectedTitle" xml:space="preserve">
200+
<value>SporeModLoader detected</value>
201+
</data>
191202
</root>

Spore ModAPI Launcher/Strings1.Designer.cs

Lines changed: 33 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)