Skip to content

Commit 3d70785

Browse files
committed
1.0.5
Possibly fixed some issues and errors in the when first installing.
1 parent 60ceb87 commit 3d70785

4 files changed

Lines changed: 62 additions & 50 deletions

File tree

Forms/MainFrm.cs

Lines changed: 37 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -598,17 +598,11 @@ private async void StartupRoutine(bool bInvalidate = false)
598598

599599
if (tempFolder.Exists())
600600
{
601-
// This is to cleanup anything left over by the auto updator/dropper file.
601+
// This is to cleanup anything left over by the auto updator/dropper program.
602602
Directory.Delete(tempFolder.GetPath(), true);
603603
}
604604

605-
if (bInvalidate)
606-
{
607-
Storage.Invalidate(true);
608-
Retrievers.Invalidate();
609-
}
610-
611-
if (!Storage.GetModulePath().Exists())
605+
if (!Storage.HasCoderedRegistry() || !Storage.GetModulePath().Exists())
612606
{
613607
if (await Retrievers.CheckInitialized())
614608
{
@@ -618,60 +612,55 @@ private async void StartupRoutine(bool bInvalidate = false)
618612
{
619613
InstallOfflinePopupCtrl.Show();
620614
}
615+
616+
return;
621617
}
622-
else
618+
619+
if (bInvalidate)
623620
{
624-
Logger.CheckInitialized(); // Create and initialize the log file for the launcher.
621+
Storage.Invalidate(true);
622+
Retrievers.Invalidate();
623+
}
625624

626-
if (Configuration.CheckInitialized())
625+
Logger.CheckInitialized(); // Create and initialize the log file for the launcher.
626+
627+
if (Configuration.CheckInitialized())
628+
{
629+
if (Configuration.ShouldMinimizeOnStartup())
627630
{
628-
if (Configuration.ShouldMinimizeOnStartup())
629-
{
630-
TitleBar_OnMinimized(null, null);
631-
}
631+
TitleBar_OnMinimized(null, null);
632+
}
632633

633-
if (await Retrievers.CheckInitialized())
634-
{
635-
string pingUrl = await Retrievers.GetModuleUrl();
634+
if (await Retrievers.CheckInitialized())
635+
{
636+
string pingUrl = await Retrievers.GetModuleUrl();
636637

637-
if ((await Downloaders.WebsiteOnline(pingUrl)) == false)
638-
{
639-
OfflinePopupCtrl.Show();
640-
}
641-
else
642-
{
643-
ContinueStartup();
644-
}
638+
if ((await Downloaders.WebsiteOnline(pingUrl)) == false)
639+
{
640+
OfflinePopupCtrl.Show();
645641
}
646642
else
647643
{
648-
OfflinePopupCtrl.Show();
644+
ContinueStartup();
649645
}
646+
}
647+
else
648+
{
649+
OfflinePopupCtrl.Show();
650+
}
650651

651-
NewsCtrl.ParseArticles(await Retrievers.GetNewsUrl());
652+
NewsCtrl.ParseArticles(await Retrievers.GetNewsUrl());
653+
}
654+
else
655+
{
656+
if (!Storage.GetLibraryFile().Exists())
657+
{
658+
await Installer.DownloadModule();
659+
StartupRoutine(true);
652660
}
653661
else
654662
{
655-
if (!Storage.GetModulePath().Exists())
656-
{
657-
if (await Retrievers.CheckInitialized())
658-
{
659-
InstallPopupCtrl.Show();
660-
}
661-
else
662-
{
663-
InstallOfflinePopupCtrl.Show();
664-
}
665-
}
666-
else if (!Storage.GetLibraryFile().Exists())
667-
{
668-
await Installer.DownloadModule();
669-
StartupRoutine(true);
670-
}
671-
else
672-
{
673-
ContinueStartup();
674-
}
663+
ContinueStartup();
675664
}
676665
}
677666

Framework/Assembly.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class Assembly
1111
private static readonly string Product = "CodeRedLauncher";
1212
private static readonly string Copyright = "Copyright © CodeRedModding 2022";
1313
private static readonly string License = "MIT License";
14-
private static readonly string Version = "1.0.4";
14+
private static readonly string Version = "1.0.5";
1515

1616
public static string GetTitle() { return Title; }
1717
public static string GetDescription() { return Description; }

Framework/Storage.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ private static bool ParseRegistryKeys()
255255
{
256256
try
257257
{
258+
// This appears to be broken at the moment, if anyone has any ideas on how to get epic's install path please let me know.
259+
258260
RegistryKey epicKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\WOW6432Node\\EpicGames\\Unreal Engine");
259261

260262
if (epicKey != null)
@@ -295,6 +297,27 @@ private static bool ParseRegistryKeys()
295297
return foundInstallDir;
296298
}
297299

300+
public static bool HasCoderedRegistry()
301+
{
302+
bool regkeyValid = false;
303+
RegistryKey coderedKey = Registry.CurrentUser.OpenSubKey("CodeRedModding");
304+
305+
if (coderedKey != null)
306+
{
307+
Object installObject = coderedKey.GetValue("InstallPath");
308+
309+
if (installObject != null)
310+
{
311+
Architecture.Path moduleFolder = new Architecture.Path(installObject.ToString());
312+
regkeyValid = moduleFolder.Exists();
313+
}
314+
315+
coderedKey.Close();
316+
}
317+
318+
return regkeyValid;
319+
}
320+
298321
public static bool FindDirectories()
299322
{
300323
if (!Initialized)

Properties/PublishProfiles/FolderProfile.pubxml.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
44
-->
55
<Project>
66
<PropertyGroup>
7-
<History>True|2022-12-23T01:46:31.3667454Z;True|2022-12-22T20:36:59.8978942-05:00;True|2022-12-22T20:32:40.9627042-05:00;True|2022-12-22T20:27:45.7845417-05:00;True|2022-12-22T20:08:26.4442830-05:00;True|2022-12-22T20:07:06.2254198-05:00;True|2022-12-22T20:01:04.3986967-05:00;True|2022-12-22T19:57:34.6741553-05:00;True|2022-12-22T19:46:09.3566048-05:00;True|2022-12-22T19:45:03.2884935-05:00;True|2022-12-22T19:36:42.2434776-05:00;True|2022-12-22T19:31:21.4738973-05:00;True|2022-12-22T19:27:34.9406205-05:00;False|2022-12-22T19:27:27.7152676-05:00;True|2022-12-22T19:14:05.9421852-05:00;True|2022-12-22T18:02:42.2130135-05:00;</History>
7+
<History>True|2022-12-24T22:58:05.8108440Z;True|2022-12-23T00:36:55.2356565-05:00;True|2022-12-22T20:46:31.3667454-05:00;True|2022-12-22T20:36:59.8978942-05:00;True|2022-12-22T20:32:40.9627042-05:00;True|2022-12-22T20:27:45.7845417-05:00;True|2022-12-22T20:08:26.4442830-05:00;True|2022-12-22T20:07:06.2254198-05:00;True|2022-12-22T20:01:04.3986967-05:00;True|2022-12-22T19:57:34.6741553-05:00;True|2022-12-22T19:46:09.3566048-05:00;True|2022-12-22T19:45:03.2884935-05:00;True|2022-12-22T19:36:42.2434776-05:00;True|2022-12-22T19:31:21.4738973-05:00;True|2022-12-22T19:27:34.9406205-05:00;False|2022-12-22T19:27:27.7152676-05:00;True|2022-12-22T19:14:05.9421852-05:00;True|2022-12-22T18:02:42.2130135-05:00;</History>
88
<LastFailureDetails />
99
</PropertyGroup>
1010
</Project>

0 commit comments

Comments
 (0)