Skip to content

Commit 2752d62

Browse files
committed
ModAPI.Common: add error message for support info writing failure
1 parent ba041da commit 2752d62

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

ModAPI.Common/CommonStrings.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ModAPI.Common/CommonStrings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ If you continue to get this message, or the game is not installed from Steam, th
167167
<data name="SteamDownloadedButNotLaunchedTitle" xml:space="preserve">
168168
<value>Steam installation not completed</value>
169169
</data>
170+
<data name="SupportInfoWriteFailed" xml:space="preserve">
171+
<value>The Launcher Kit failed to write the support information to your disk</value>
172+
</data>
170173
<data name="UpdateCheckDisabledNotice" xml:space="preserve">
171174
<value>The Launcher Kit has been configured to skip checking for updates. You may be missing new features and bug fixes, and may be unable to use newer mods.
172175

ModAPI.Common/Update/UpdateManager.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,16 @@ public static void CheckForUpdates()
6060
// Create appdata folder if it doesn't exist
6161
Directory.CreateDirectory(AppDataPath);
6262

63-
// Write support info file to appdata folder
64-
SupportInfo.WriteSupportInfoFile(Path.Combine(AppDataPath, "support.info"));
63+
// Try to write support info file to appdata folder
64+
try
65+
{
66+
SupportInfo.WriteSupportInfoFile(Path.Combine(AppDataPath, "support.info"));
67+
}
68+
catch (Exception ex)
69+
{
70+
SupportInfo.ShowError(CommonStrings.SupportInfoWriteFailed + "\n\n" + ex.ToString(), CommonStrings.UpdateCheckFailedTitle, false, true);
71+
return;
72+
}
6573

6674
// Make sure game is not running before running any Launcher Kit apps
6775
if ((Process.GetProcessesByName("SporeApp").Length > 0) || (Process.GetProcessesByName("SporeApp_ModAPIFix").Length > 0))

0 commit comments

Comments
 (0)