aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-25 12:24:44 -0400
committerMichael <[email protected]>2017-04-25 12:24:44 -0400
commit91c6b3bf1c709cc392d52391407a70feabc9214b (patch)
treef510ce3ac6963c51c125359758346813fbc71ee3
parentcd29d582d90e0a31a9b21661a813c789b82468cc (diff)
downloadshiftos_thereturn-91c6b3bf1c709cc392d52391407a70feabc9214b.tar.gz
shiftos_thereturn-91c6b3bf1c709cc392d52391407a70feabc9214b.tar.bz2
shiftos_thereturn-91c6b3bf1c709cc392d52391407a70feabc9214b.zip
fix Appscape install bugs
-rw-r--r--ShiftOS.WinForms/Applications/Installer.cs11
-rw-r--r--ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs20
2 files changed, 21 insertions, 10 deletions
diff --git a/ShiftOS.WinForms/Applications/Installer.cs b/ShiftOS.WinForms/Applications/Installer.cs
index 2193f8a..4d8b712 100644
--- a/ShiftOS.WinForms/Applications/Installer.cs
+++ b/ShiftOS.WinForms/Applications/Installer.cs
@@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ShiftOS.Engine;
+using System.Threading;
namespace ShiftOS.WinForms.Applications
{
@@ -29,21 +30,21 @@ namespace ShiftOS.WinForms.Applications
pnlselectfile.Hide();
install.ProgressReported += (p) =>
{
- this.Invoke(new Action(() =>
+ Desktop.InvokeOnWorkerThread(new Action(() =>
{
pginstall.Value = p;
}));
};
install.StatusReported += (s) =>
{
- this.Invoke(new Action(() =>
+ Desktop.InvokeOnWorkerThread(new Action(() =>
{
lbprogress.Text = s;
}));
};
install.InstallCompleted += () =>
{
- this.Invoke(new Action(() =>
+ Desktop.InvokeOnWorkerThread(new Action(() =>
{
lbtitle.Text = "Select file";
pnlselectfile.Show();
@@ -51,6 +52,10 @@ namespace ShiftOS.WinForms.Applications
isInstalling = false;
InstallCompleted?.Invoke();
};
+ while (!this.Visible)
+ {
+
+ }
isInstalling = true;
install.Install();
}
diff --git a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
index 84783e5..691f622 100644
--- a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
+++ b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
@@ -336,22 +336,28 @@ namespace ShiftOS.WinForms.ShiftnetSites
int i = 0;
while (i <= Size)
{
- SetProgress((i / Size) * 100);
- i++;
- Thread.Sleep(100);
+ double progress = ((i / Size) * 100);
+
+ SetProgress((int)progress);
+
+ i += Applications.DownloadManager.GetDownloadSpeed();
+ Thread.Sleep(1000);
}
SetProgress(0);
SetStatus("Installing...");
i = 0;
while (i <= Size)
{
- SetProgress((i / Size) * 100);
- i++;
- Thread.Sleep(50);
+ double progress = ((i / Size) * 100);
+
+ SetProgress((int)progress);
+
+ i+=1024;
+ Thread.Sleep(1000);
}
- Shiftorium.Buy(ShiftoriumId, 0);
Desktop.InvokeOnWorkerThread(() =>
{
+ Shiftorium.Buy(ShiftoriumId, 0);
Infobox.Show("Install complete!", "The installation of " + Name + " has completed.");
SaveSystem.SaveGame();
});