Erste Version

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 17:26:25 +01:00
co-authored by Claude Opus 5.5
commit b69b9638ff
20 changed files with 1863 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
namespace BSO.Launcher;
static class Program
{
[STAThread]
static int Main(string[] args)
{
ApplicationConfiguration.Initialize();
// Deinstallieren (aus "Apps & Features")
if (args.Contains("--uninstall"))
{
Installer.Uninstall(args.Contains("--quiet"));
return 0;
}
// Wie Discord: die heruntergeladene .exe installiert sich selbst und startet dann die installierte Kopie.
// Ist schon dieselbe oder eine neuere Version installiert, wird einfach diese geoeffnet. --portable = ohne Installation.
if (!Installer.RunningInstalled && !args.Contains("--portable"))
{
if (Installer.NeedsInstall()) Application.Run(new InstallForm());
else Installer.StartInstalled();
return 0;
}
// Nur ein Launcher gleichzeitig
using var single = new Mutex(true, "BSO-Launcher-Single", out bool first);
// Nach einem Selbst-Update: die alte Version beendet sich gerade - bis zu 20 s auf sie warten
if (!first && args.Contains(SelfUpdate.AfterUpdateArg))
{
try { first = single.WaitOne(TimeSpan.FromSeconds(20)); }
catch (AbandonedMutexException) { first = true; } // alte Version wurde hart beendet - Sperre gehoert jetzt uns
}
if (!first)
{
MessageBox.Show("Der BSO Launcher laeuft schon.", Installer.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
return 0;
}
SelfUpdate.CleanupOldVersion();
if (Installer.RunningInstalled) Installer.Register(); // Version in "Apps & Features" nach einem Selbst-Update
Application.Run(new MainForm());
return 0;
}
}