Removed console and unnecessary dependencies

This commit is contained in:
2026-02-02 12:42:16 +01:00
parent d8a50f4dbc
commit 36e2b6cec5
6 changed files with 77 additions and 36 deletions

View File

@@ -0,0 +1,6 @@
@echo off
REM Location of your SpaceEngineers.exe
mklink /J Bin64 "C:\Users\Lunar\Games\Steam\steamapps\common\SpaceEngineers\Bin64"
pause

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using VRage.Plugins;
using SpaceEngineers;
using System.IO;
using DTLib.Demystifier;
using System.Reflection;
namespace UplinkLauncher;
@@ -14,9 +14,6 @@ internal static class UplinkLauncher
{
try
{
Console.WriteLine("Starting Uplink SE");
Console.WriteLine(new string('-', Console.WindowWidth));
List<string> plugins = new List<string>();
if (!Directory.Exists(PluginsLocalDir))
@@ -26,30 +23,35 @@ internal static class UplinkLauncher
foreach (string plugin in localPlugins)
{
Console.WriteLine("Adding plugin: " + plugin);
plugins.Add(Path.GetFullPath(plugin));
}
MyPlugins.RegisterUserAssemblyFiles(plugins);
// why this file isn't created automatically?
// how game handles this without this magnificent launcher???
string appIdFile = "steam_appid.txt";
if (!File.Exists(appIdFile))
{
Console.WriteLine($"Could not find '{appIdFile}', creating new file");
File.WriteAllText(appIdFile, "244850");
}
// finally start ze game!!!
MyProgram.Main(args);
//Абсолютно великий код который делает чтобы Аплинк скопировал себе .config от инжей. Я не знаю, что такое .config, но там какие-то зависимости некие и настройки
string UplinkConfig = Path.GetFileName(Assembly.GetExecutingAssembly().Location) + ".config";
if (File.Exists("SpaceEngineers.exe.config"))
{
File.Copy("SpaceEngineers.exe.config", UplinkConfig, true);
}
StartSpaceEngineers(args);
}
catch (Exception e)
{
Console.WriteLine("Crashed with exception:");
Console.WriteLine(e.ToStringDemystified());
Console.WriteLine("\nPress enter to exit...");
Console.ReadLine();
}
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
private static void StartSpaceEngineers(string[] args)
{
MyProgram.Main(args);
}
}

View File

@@ -1,36 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net48</TargetFramework>
<OutputType>WinExe</OutputType>
<TargetFramework>net481</TargetFramework>
<Configurations>Release;Debug</Configurations>
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>latest</LangVersion>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>..\UplinkSE_logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DTLib.Demystifier" Version="1.1.1" />
<PackageReference Include="Lib.Harmony" Version="2.4.2" />
<PackageReference Include="Lib.Harmony" Version="2.4.2">
<TreatAsUsed>true</TreatAsUsed>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="..\Bin64\Sandbox.Game.dll">
<Private>false</Private>
</Reference>
<Reference Include="..\Bin64\SpaceEngineers.exe">
<Private>false</Private>
</Reference>
<Reference Include="..\Bin64\SpaceEngineers.Game.dll">
<Private>false</Private>
</Reference>
<Reference Include="..\Bin64\VRage.dll">
<Private>false</Private>
</Reference>

View File

@@ -10,32 +10,35 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{F9D624C2-7460-4672-AA31-1E8887084041}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
build.sh = build.sh
install.sh = install.sh
launch.sh = launch.sh
README.md = README.md
UplinkSE_logo.ico = UplinkSE_logo.ico
UplinkSE_logo.png = UplinkSE_logo.png
install.sh = install.sh
launch.sh = launch.sh
build.sh = build.sh
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|x64 = Release|x64
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|x64.ActiveCfg = Release|x64
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|x64.Build.0 = Release|x64
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|x64.ActiveCfg = Debug|x64
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|x64.Build.0 = Debug|x64
{28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|x64.ActiveCfg = Release|x64
{28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|x64.Build.0 = Release|x64
{28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Debug|x64.ActiveCfg = Debug|x64
{28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Debug|x64.Build.0 = Debug|x64
{28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|x64.ActiveCfg = Release|x64
{28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Release|x64.Build.0 = Release|x64
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|x64.ActiveCfg = Debug|x64
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Debug|x64.Build.0 = Debug|x64
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|x64.ActiveCfg = Release|x64
{2534AAEB-1F27-43F9-86C5-A1726DACB98D}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2534AAEB-1F27-43F9-86C5-A1726DACB98D} = {F9D624C2-7460-4672-AA31-1E8887084041}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BCA57FA1-2E0B-4DEA-9C70-E3A9914D76C7}
EndGlobalSection

View File

@@ -7,6 +7,7 @@
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>latest</LangVersion>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>

34
deploy.ps1 Normal file
View File

@@ -0,0 +1,34 @@
$SE_PATH = ""
#DETECT SE INSTALLATION
function DetectGamepath{
#CHECK FOR STEAM INSTALLATION
if(Test-Path -Path HKLM:\SOFTWARE\WOW6432Node\Valve\Steam)
{
#GET STEAM PATH FROM REGISTRY
$SteamInstallPath = Get-ItemPropertyValue -Path HKLM:\SOFTWARE\WOW6432Node\Valve\Steam -Name InstallPath
#READ .vdf WITH GAME DRIVE LOCATIONS
$libraryfolders = ("{`n" + ((Get-Content -Path $SteamInstallPath'\steamapps\libraryfolders.vdf' | Out-String) `
<#COMMIT REGEXAGE TO CONVERT VALVE FORMAT TO JSON#> `
-replace '"\t\t"', '": "' <# "KEY": "VALUE" #> `
-replace '"\r\n\s*{', '": {' <# "OBJECT": { #> `
-replace '"\r\n', "`",`n" <# "VALUE", #> `
-replace '",\n(\t+)\}', "`"`n`$1}" <# "VALUE" #> `
-replace '}(\r\n\s*")','},$1') <# }, #> `
+ "}" | ConvertFrom-Json).libraryfolders
#FIND A DRIVE THAT CONTAINS APPID OF 244850 WHICH IS SPACE ENGINEERS AS WE ALL KNOW
foreach ($drive in $libraryfolders.psobject.Properties)
{
if($drive.Value.apps.PSobject.Properties.name -contains "244850")
{
$SE_PATH = $drive.Value.path + '\steamapps\common\SpaceEngineers\Bin64'
}
}
ValidateGamepath
}else{
#STEAM LIKELY NOT INSTALLED
Write-Output "Steam not detected"
}
}
Copy-Item