diff --git a/extra/exe-builder/DownloadForm.cs b/extra/exe-builder/DownloadForm.cs index 5bb88b6d..f16af422 100644 --- a/extra/exe-builder/DownloadForm.cs +++ b/extra/exe-builder/DownloadForm.cs @@ -63,12 +63,6 @@ namespace UptimeKuma { } void npmSetup() { - if (Directory.Exists("core/node_modules")) { - // Application.Restart(); - } - - label.Text = "npm run setup"; - progressBar.Value = 50; labelData.Text = ""; var startInfo = new ProcessStartInfo { @@ -86,10 +80,12 @@ namespace UptimeKuma { process.StartInfo = startInfo; process.EnableRaisingEvents = true; process.Exited += (object _, EventArgs e) => { - // Application.Restart(); - progressBar.Value = 100; + progressBar.Value = 100; if (process.ExitCode == 0) { + Task.Delay(2000).ContinueWith((task) => { + Application.Restart(); + }); label.Text = "Done"; } else { label.Text = "Failed, exit code: " + process.ExitCode; @@ -97,7 +93,12 @@ namespace UptimeKuma { }; process.Start(); - process.StandardInput.WriteLine("\"../node/npm\" run setup"); + label.Text = "Installing dependencies and download dist files"; + progressBar.Value = 50; + + process.StandardInput.WriteLine("\"../node/npm\" ci --production"); + process.StandardInput.WriteLine("\"../node/npm\" run download-dist"); + process.StandardInput.WriteLine("exit"); } void DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { @@ -110,7 +111,7 @@ namespace UptimeKuma { } } - async void DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { + void DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { Extract(currentDownloadItem); DownloadNextFile(); } diff --git a/extra/exe-builder/Program.cs b/extra/exe-builder/Program.cs index 1b78f038..82c76b05 100644 --- a/extra/exe-builder/Program.cs +++ b/extra/exe-builder/Program.cs @@ -45,7 +45,7 @@ namespace UptimeKuma { trayIcon.MouseDoubleClick += new MouseEventHandler(Open); trayIcon.Visible = true; - if (Directory.Exists("core") && Directory.Exists("node") && Directory.Exists("core/node_modules")) { + if (Directory.Exists("core") && Directory.Exists("node") && Directory.Exists("core/node_modules") && Directory.Exists("core/dist")) { // Go go go StartProcess(); } else {