Skip to content

Commit f7d79be

Browse files
committed
v1.4.0
- Added more detailed info to the update window when installing updates. - Changed some error messages and logs to provide better info if something is blocking the launchers permissions.
1 parent 88e9aaa commit f7d79be

3 files changed

Lines changed: 42 additions & 17 deletions

File tree

Controls/CRUpdate.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ public enum UpdateLayouts : byte
1010
{
1111
None,
1212
Running,
13-
Downloading,
14-
Installing,
13+
DownloadingModule,
14+
DownloadingLauncher,
15+
InstallingModule,
16+
InstallingLauncher,
1517
Module,
1618
Launcher,
1719
Both,
@@ -176,17 +178,33 @@ public void UpdateTheme()
176178
DenyBtn.Visible = false;
177179
GameBtn.Visible = true;
178180
}
179-
else if (UpdateType == UpdateLayouts.Downloading)
181+
else if (UpdateType == UpdateLayouts.DownloadingModule)
180182
{
181-
DescriptionLbl.Text = "Downloading latest version, please wait...";
183+
DescriptionLbl.Text = "Downloading latest module version, please wait...";
182184
m_buttonsEnabled = false;
183185
AcceptBtn.Visible = true;
184186
DenyBtn.Visible = true;
185187
GameBtn.Visible = false;
186188
}
187-
else if (UpdateType == UpdateLayouts.Installing)
189+
else if (UpdateType == UpdateLayouts.InstallingModule)
188190
{
189-
DescriptionLbl.Text = "Download complete, installing files...";
191+
DescriptionLbl.Text = "Download complete, installing module...";
192+
m_buttonsEnabled = false;
193+
AcceptBtn.Visible = true;
194+
DenyBtn.Visible = true;
195+
GameBtn.Visible = false;
196+
}
197+
else if (UpdateType == UpdateLayouts.DownloadingLauncher)
198+
{
199+
DescriptionLbl.Text = "Downloading latest launcher version, please wait...";
200+
m_buttonsEnabled = false;
201+
AcceptBtn.Visible = true;
202+
DenyBtn.Visible = true;
203+
GameBtn.Visible = false;
204+
}
205+
else if (UpdateType == UpdateLayouts.InstallingLauncher)
206+
{
207+
DescriptionLbl.Text = "Download complete, installing launcher...";
190208
m_buttonsEnabled = false;
191209
AcceptBtn.Visible = true;
192210
DenyBtn.Visible = true;

Forms/MainFrm.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,6 @@ private async void UpdatePopup_ButtonClickAccept(object sender, EventArgs e)
12951295
{
12961296
this.TopMost = false;
12971297
UpdatePopup.ButtonsEnabled = false;
1298-
UpdatePopup.UpdateType = CRUpdate.UpdateLayouts.Downloading;
12991298
UpdateStatusCtrl.DisplayType = StatusTypes.Version_Downloading;
13001299

13011300
Retrievers.Invalidate();

Framework/Updator.cs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ enum UpdatorStatus : byte
1212
{
1313
Idle,
1414
Preparing,
15-
Downloading,
16-
Installing
15+
DownloadingModule,
16+
DownloadingLauncher,
17+
InstallingModule,
18+
InstallingLauncher
1719
}
1820

1921
public static class Updator
@@ -42,11 +44,17 @@ private static void SetStatus(UpdatorStatus status)
4244
{
4345
switch (status)
4446
{
45-
case UpdatorStatus.Downloading:
46-
m_updateCtrl.UpdateType = Controls.CRUpdate.UpdateLayouts.Downloading;
47+
case UpdatorStatus.DownloadingModule:
48+
m_updateCtrl.UpdateType = Controls.CRUpdate.UpdateLayouts.DownloadingModule;
4749
break;
48-
case UpdatorStatus.Installing:
49-
m_updateCtrl.UpdateType = Controls.CRUpdate.UpdateLayouts.Installing;
50+
case UpdatorStatus.DownloadingLauncher:
51+
m_updateCtrl.UpdateType = Controls.CRUpdate.UpdateLayouts.DownloadingLauncher;
52+
break;
53+
case UpdatorStatus.InstallingModule:
54+
m_updateCtrl.UpdateType = Controls.CRUpdate.UpdateLayouts.InstallingModule;
55+
break;
56+
case UpdatorStatus.InstallingLauncher:
57+
m_updateCtrl.UpdateType = Controls.CRUpdate.UpdateLayouts.InstallingLauncher;
5058
break;
5159
default:
5260
break;
@@ -140,7 +148,7 @@ private static async Task<Result> InstallModule(bool bForceInstall)
140148
{
141149
Logger.Write("Downloading module archive...");
142150
Architecture.Path downloadedFile = (tempFolder / "CodeRedModule.zip");
143-
SetStatus(UpdatorStatus.Downloading);
151+
SetStatus(UpdatorStatus.DownloadingModule);
144152

145153
if (await Downloaders.DownloadFile(moduleUrl, tempFolder, "CodeRedModule.zip"))
146154
{
@@ -154,7 +162,7 @@ private static async Task<Result> InstallModule(bool bForceInstall)
154162
}
155163

156164
Logger.Write("Extracting file from archive...");
157-
SetStatus(UpdatorStatus.Installing);
165+
SetStatus(UpdatorStatus.InstallingModule);
158166
await Task.Delay(1500);
159167

160168
using (ZipArchive zipArchive = ZipFile.OpenRead(downloadedFile.GetPath()))
@@ -262,7 +270,7 @@ private static async Task<Result> InstallLauncher(bool bForceInstall)
262270
Architecture.Path dropperExe = (tempFolder / "CodeRedDropper.exe");
263271

264272
Logger.Write("Downloading launcher archive...");
265-
SetStatus(UpdatorStatus.Downloading);
273+
SetStatus(UpdatorStatus.DownloadingLauncher);
266274

267275
if (await Downloaders.DownloadFile(launcherUrl, tempFolder, "CodeRedLauncher.zip"))
268276
{
@@ -291,7 +299,7 @@ private static async Task<Result> InstallLauncher(bool bForceInstall)
291299
if (dropperArchive.Exists())
292300
{
293301
Logger.Write("Extracting file from archive...");
294-
SetStatus(UpdatorStatus.Installing);
302+
SetStatus(UpdatorStatus.InstallingLauncher);
295303
await Task.Delay(1500);
296304

297305
using (ZipArchive zipArchive = ZipFile.OpenRead(dropperArchive.GetPath()))

0 commit comments

Comments
 (0)