Repository: louislam/uptime-kuma
File: extra/exe-builder/Program.cs (C#)

Code before:
                var latestVersionObj = JsonConvert.DeserializeObject<Version>(versionJson);

                // Compare version, if the latest version is newer, then update
                if (new System.Version(latestVersionObj.latest).CompareTo(new System.Version(currentVersionObj.latest)) > 0) {
                    var result = MessageBox.Show("A new version is available. Do you want to update?", "Update", MessageBoxButtons.YesNo);
                    if (result == DialogResult.Yes) {
                        // Create a empty file `update`, so the app will download the core files again at startup
                        File.Create("update").Close();

                        trayIcon.Visible = false;
                        process?.Kill();

                        // Restart the app, it will download the core files again at startup
                        Application.Restart();
                    }
                } else {
                    MessageBox.Show("You are using the latest version.");
                }
            }


        }

        void VisitGitHub(object sender, EventArgs e) {
            if (intranetOnly)
            {
                MessageBox.Show("You have parsed in --intranet so we will not try to access the internet.");
                return;
            }

            Process.Start("https://github.com/louislam/uptime-kuma");
        }

        void About(object sender, EventArgs e)
        {
            MessageBox.Show("Uptime Kuma Windows Runtime v1.0.0" + Environment.NewLine + "© 2023 Louis Lam", "Info");
        }

        void Exit(object sender, EventArgs e)
        {
            // Hide tray icon, otherwise it will remain shown until user mouses over it
            trayIcon.Visible = false;
            process?.Kill();
            Application.Exit();
        }

        void ProcessExited(object sender, EventArgs e) {

            if (process.ExitCode != 0) {
                var line = "";
                while (!process.StandardOutput.EndOfStream)

Review comment (suggestion):
```suggestion
            if (intranetOnly) {
```

Code after:
                        // Create a empty file `update`, so the app will download the core files again at startup
                        File.Create("update").Close();

                        trayIcon.Visible = false;
                        process?.Kill();

                        // Restart the app, it will download the core files again at startup
                        Application.Restart();
                    }
                } else {
                    MessageBox.Show("You are using the latest version.");
                }
            }


        }

        void VisitGitHub(object sender, EventArgs e) {
            if (intranetOnly) {
                MessageBox.Show("You have parsed in --intranet so we will not try to access the internet or visit github.com, please go to https://github.com/louislam/uptime-kuma if you want to visit github.");
                return;
            }

            Process.Start("https://github.com/louislam/uptime-kuma");
        }

        void About(object sender, EventArgs e)
        {
            MessageBox.Show("Uptime Kuma Windows Runtime v1.0.0" + Environment.NewLine + "© 2023 Louis Lam", "Info");
        }

        void Exit(object sender, EventArgs e)
        {
            // Hide tray icon, otherwise it will remain shown until user mouses over it
            trayIcon.Visible = false;
            process?.Kill();
            Application.Exit();
        }

        void ProcessExited(object sender, EventArgs e) {

            if (process.ExitCode != 0) {
                var line = "";
                while (!process.StandardOutput.EndOfStream)
                {
                    line += process.StandardOutput.ReadLine();
                }

                MessageBox.Show("Uptime Kuma exited unexpectedly. Exit code: " + process.ExitCode + " " + line);
            }