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

Code before:
                openMenuItem,
                //new("Debug Console", DebugConsole),
                runWhenStarts,
                new("Check for Update...", CheckForUpdate),
                new("Visit GitHub...", VisitGitHub),
                new("About", About),
                new("Exit", Exit),
            });

            trayIcon.MouseDoubleClick += new MouseEventHandler(Open);
            trayIcon.Visible = true;

            var hasUpdateFile = File.Exists("update");

            if (!hasUpdateFile && Directory.Exists("core") && Directory.Exists("node") && Directory.Exists("core/node_modules") && Directory.Exists("core/dist")) {
                // Go go go
                StartProcess();
            } else {
                DownloadFiles();
            }
        }

        void DownloadFiles() {
            if (intranetOnly)
            {
                MessageBox.Show("You have parsed in --intranet so we will not download any files from the internet. If you run into issues remember that the initial run needs to be without --intranet.");
                return;
            }

            var form = new DownloadForm();
            form.Closed += Exit;
            form.Show();
        }

        private void RunWhenStarts(object sender, EventArgs e) {
            if (registryKey == null) {
                MessageBox.Show("Error: Unable to set startup registry key.");
                return;
            }

            if (runWhenStarts.Checked) {
                registryKey.DeleteValue(appName, false);
                runWhenStarts.Checked = false;
            } else {
                registryKey.SetValue(appName, Application.ExecutablePath);
                runWhenStarts.Checked = true;
            }
        }

        void StartProcess() {
            var startInfo = new ProcessStartInfo {

Review comment (suggestion):
`The --intranet argument was provided, so we will not try to access the internet.` should already be in the log => I don't see why logging this again has additional value

```suggestion
```

Code after:
                runWhenStarts,
                new("Check for Update...", CheckForUpdate),
                new("Visit GitHub...", VisitGitHub),
                new("About", About),
                new("Exit", Exit),
            });

            trayIcon.MouseDoubleClick += new MouseEventHandler(Open);
            trayIcon.Visible = true;

            var hasUpdateFile = File.Exists("update");

            if (!hasUpdateFile && Directory.Exists("core") && Directory.Exists("node") && Directory.Exists("core/node_modules") && Directory.Exists("core/dist")) {
                // Go go go
                StartProcess();
            } else {
                DownloadFiles();
            }
        }

        void DownloadFiles() {
            if (intranetOnly) {
                return;
            }

            var form = new DownloadForm();
            form.Closed += Exit;
            form.Show();
        }

        private void RunWhenStarts(object sender, EventArgs e) {
            if (registryKey == null) {
                MessageBox.Show("Error: Unable to set startup registry key.");
                return;
            }

            if (runWhenStarts.Checked) {
                registryKey.DeleteValue(appName, false);
                runWhenStarts.Checked = false;
            } else {
                registryKey.SetValue(appName, Application.ExecutablePath);
                runWhenStarts.Checked = true;
            }
        }

        void StartProcess() {
            var startInfo = new ProcessStartInfo {
                FileName = "node/node.exe",
                Arguments = "server/server.js --data-dir=\"../data/\"",
                RedirectStandardOutput = false,
                RedirectStandardError = false,