diff --git a/MarseyLoader.sln b/MarseyLoader.sln index 13dd0bb..14d8a49 100644 --- a/MarseyLoader.sln +++ b/MarseyLoader.sln @@ -7,7 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SS14.Launcher", "SS14.Launc EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SS14.Launcher.Tests", "SS14.Launcher.Tests\SS14.Launcher.Tests.csproj", "{AC4AA63C-DFC5-4C8A-B802-8135956BCAD9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SS14.Launcher.Bootstrap", "SS14.Launcher.Bootstrap\SS14.Launcher.Bootstrap.csproj", "{505C4E21-0B62-4F1E-82C6-8FDBA914757A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SS14.Launcher.Strap", "SS14.Launcher.Strap\SS14.Launcher.Strap.csproj", "{505C4E21-0B62-4F1E-82C6-8FDBA914757A}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{12BB41B7-34BA-44EF-9ECA-434A276D83BD}" ProjectSection(SolutionItems) = preProject diff --git a/SS14.Launcher.Bootstrap/Program.cs b/SS14.Launcher.Bootstrap/Program.cs deleted file mode 100644 index 7d745d5..0000000 --- a/SS14.Launcher.Bootstrap/Program.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using Microsoft.Win32; - -namespace SS14.Launcher.Bootstrap -{ - internal static class Program - { - public static void Main(string[] args) - { - UnfuckDotnetRoot(); - - var path = typeof(Program).Assembly.Location; - var ourDir = Path.GetDirectoryName(path); - Debug.Assert(ourDir != null); - - var dotnetDir = Path.Combine(ourDir, "dotnet"); - var exeDir = Path.Combine(ourDir, "bin", "SS14.Launcher.exe"); - - Environment.SetEnvironmentVariable("DOTNET_ROOT", dotnetDir); - Process.Start(new ProcessStartInfo(exeDir)); - } - - private static void UnfuckDotnetRoot() - { - // - // We ship a simple console.bat script that runs the game with cmd prompt logging, - // in a worst-case of needing logging. - // - // Well it turns out I dared copy paste "SETX" from StackOverflow instead of "SET". - // The former permanently alters the user's registry to set the environment variable - // - // WHY THE FUCK IS THAT SO EASY TO DO??? - // AND WHY ARE PEOPLE ON STACKOVERFLOW POSTING SOMETHING SO DANGEROUS WITHOUT ASTERISK??? - // - // Anyways, we have to fix our goddamn mess now. Ugh. - // Try to clear that registry key if somebody previously ran console.bat and it corrupted their system. - // - - try - { - using var envKey = Registry.CurrentUser.OpenSubKey("Environment", true); - var val = envKey?.GetValue("DOTNET_ROOT"); - if (val is not string s) - return; - - if (!s.Contains("Space Station 14") && !s.Contains("SS14.Launcher")) - return; - - envKey.DeleteValue("DOTNET_ROOT"); - } - catch (Exception e) - { - Console.WriteLine($"Error while trying to fix DOTNET_ROOT env var: {e}"); - } - } - } -} diff --git a/SS14.Launcher.Strap/Program.cs b/SS14.Launcher.Strap/Program.cs new file mode 100644 index 0000000..88c8e6b --- /dev/null +++ b/SS14.Launcher.Strap/Program.cs @@ -0,0 +1,34 @@ +using System; +using System.Diagnostics; +using System.IO; + +namespace SS14.Launcher.Strap; + +public static class Program +{ + public static void Main(string[] args) + { + string ourDir = GetAssemblyDirectory(); + string dotnetDir = Path.Combine(ourDir, "dotnet"); + string exeDir = Path.Combine(ourDir, "bin", "SS14.Launcher.exe"); + + SetEnvironmentVariable("DOTNET_ROOT", dotnetDir); + StartProcess(exeDir); + } + + private static string GetAssemblyDirectory() + { + string path = typeof(Program).Assembly.Location; + return Path.GetDirectoryName(path); + } + + private static void SetEnvironmentVariable(string variable, string value) + { + Environment.SetEnvironmentVariable(variable, value); + } + + private static void StartProcess(string filePath) + { + Process.Start(new ProcessStartInfo(filePath)); + } +} diff --git a/SS14.Launcher.Bootstrap/SS14.Launcher.Bootstrap.csproj b/SS14.Launcher.Strap/SS14.Launcher.Strap.csproj similarity index 85% rename from SS14.Launcher.Bootstrap/SS14.Launcher.Bootstrap.csproj rename to SS14.Launcher.Strap/SS14.Launcher.Strap.csproj index 3ee16f3..649d882 100644 --- a/SS14.Launcher.Bootstrap/SS14.Launcher.Bootstrap.csproj +++ b/SS14.Launcher.Strap/SS14.Launcher.Strap.csproj @@ -4,9 +4,10 @@ <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net45</TargetFramework> - <TargetName>Space Station 14 Launcher</TargetName> + <TargetName>Marseyloader</TargetName> <ApplicationIcon>../SS14.Launcher/Assets/icon.ico</ApplicationIcon> <LangVersion>11</LangVersion> + <RootNamespace>SS14.Launcher.Strap</RootNamespace> </PropertyGroup> <ItemGroup> diff --git a/SS14.Launcher.Bootstrap/console.bat b/SS14.Launcher.Strap/console.bat similarity index 100% rename from SS14.Launcher.Bootstrap/console.bat rename to SS14.Launcher.Strap/console.bat diff --git a/SS14.Launcher/ConfigConstants.cs b/SS14.Launcher/ConfigConstants.cs index 450aa47..82716f7 100644 --- a/SS14.Launcher/ConfigConstants.cs +++ b/SS14.Launcher/ConfigConstants.cs @@ -28,7 +28,7 @@ public static class ConfigConstants public static readonly string AuthUrl = "https://auth.spacestation14.com/"; public static readonly Uri[] DefaultHubUrls = { new("https://cdn.spacestationmultiverse.com/wizden-hub-mirror/") }; - public const string DiscordUrl = "https://discord.ss14.io/"; + public const string DiscordUrl = "https://discord.gg/xHtZXybKeh"; public const string AccountBaseUrl = "https://account.spacestation14.com/Identity/Account/"; public const string AccountManagementUrl = $"{AccountBaseUrl}Manage"; public const string AccountRegisterUrl = $"{AccountBaseUrl}Register"; diff --git a/publish_windows.sh b/publish_windows.sh index 2e61aec..9af611b 100755 --- a/publish_windows.sh +++ b/publish_windows.sh @@ -23,8 +23,8 @@ mkdir -p bin/publish/Windows/Marsey/Mods mkdir -p bin/publish/Windows/Marsey/ResourcePacks cp -r Dependencies/dotnet/windows/* bin/publish/Windows/dotnet -cp "SS14.Launcher.Bootstrap/bin/Release/net45/publish/Space Station 14 Launcher.exe" bin/publish/Windows -cp "SS14.Launcher.Bootstrap/console.bat" bin/publish/Windows +cp "SS14.Launcher.Strap/bin/Release/net45/publish/Marseyloader.exe" bin/publish/Windows +cp "SS14.Launcher.Strap/console.bat" bin/publish/Windows cp SS14.Launcher/bin/Release/net8.0/win-x64/publish/* bin/publish/Windows/bin cp SS14.Loader/bin/Release/net8.0/win-x64/publish/* bin/publish/Windows/bin/loader