Removed console and unnecessary dependencies
This commit is contained in:
6
Edit-and-run-before-opening-solution.bat
Normal file
6
Edit-and-run-before-opening-solution.bat
Normal 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
|
||||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using VRage.Plugins;
|
using VRage.Plugins;
|
||||||
using SpaceEngineers;
|
using SpaceEngineers;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using DTLib.Demystifier;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace UplinkLauncher;
|
namespace UplinkLauncher;
|
||||||
|
|
||||||
@@ -14,11 +14,8 @@ internal static class UplinkLauncher
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine("Starting Uplink SE");
|
|
||||||
Console.WriteLine(new string('-', Console.WindowWidth));
|
|
||||||
|
|
||||||
List<string> plugins = new List<string>();
|
List<string> plugins = new List<string>();
|
||||||
|
|
||||||
if (!Directory.Exists(PluginsLocalDir))
|
if (!Directory.Exists(PluginsLocalDir))
|
||||||
Directory.CreateDirectory(PluginsLocalDir);
|
Directory.CreateDirectory(PluginsLocalDir);
|
||||||
string[] localPlugins = Directory.GetFiles(
|
string[] localPlugins = Directory.GetFiles(
|
||||||
@@ -26,30 +23,35 @@ internal static class UplinkLauncher
|
|||||||
|
|
||||||
foreach (string plugin in localPlugins)
|
foreach (string plugin in localPlugins)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Adding plugin: " + plugin);
|
|
||||||
plugins.Add(Path.GetFullPath(plugin));
|
plugins.Add(Path.GetFullPath(plugin));
|
||||||
}
|
}
|
||||||
|
|
||||||
MyPlugins.RegisterUserAssemblyFiles(plugins);
|
MyPlugins.RegisterUserAssemblyFiles(plugins);
|
||||||
|
|
||||||
// why this file isn't created automatically?
|
|
||||||
// how game handles this without this magnificent launcher???
|
|
||||||
string appIdFile = "steam_appid.txt";
|
string appIdFile = "steam_appid.txt";
|
||||||
if (!File.Exists(appIdFile))
|
if (!File.Exists(appIdFile))
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Could not find '{appIdFile}', creating new file");
|
|
||||||
File.WriteAllText(appIdFile, "244850");
|
File.WriteAllText(appIdFile, "244850");
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally start ze game!!!
|
//Абсолютно великий код который делает чтобы Аплинк скопировал себе .config от инжей. Я не знаю, что такое .config, но там какие-то зависимости некие и настройки
|
||||||
MyProgram.Main(args);
|
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)
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,36 +1,31 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net48</TargetFramework>
|
<TargetFramework>net481</TargetFramework>
|
||||||
<Configurations>Release;Debug</Configurations>
|
<Configurations>Release;Debug</Configurations>
|
||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
|
||||||
<ApplicationIcon>..\UplinkSE_logo.ico</ApplicationIcon>
|
<ApplicationIcon>..\UplinkSE_logo.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<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>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="..\Bin64\Sandbox.Game.dll">
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="..\Bin64\SpaceEngineers.exe">
|
<Reference Include="..\Bin64\SpaceEngineers.exe">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="..\Bin64\SpaceEngineers.Game.dll">
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="..\Bin64\VRage.dll">
|
<Reference Include="..\Bin64\VRage.dll">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
23
UplinkSE.sln
23
UplinkSE.sln
@@ -10,32 +10,35 @@ EndProject
|
|||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{F9D624C2-7460-4672-AA31-1E8887084041}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{F9D624C2-7460-4672-AA31-1E8887084041}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.gitignore = .gitignore
|
.gitignore = .gitignore
|
||||||
|
build.sh = build.sh
|
||||||
|
install.sh = install.sh
|
||||||
|
launch.sh = launch.sh
|
||||||
README.md = README.md
|
README.md = README.md
|
||||||
UplinkSE_logo.ico = UplinkSE_logo.ico
|
UplinkSE_logo.ico = UplinkSE_logo.ico
|
||||||
UplinkSE_logo.png = UplinkSE_logo.png
|
UplinkSE_logo.png = UplinkSE_logo.png
|
||||||
install.sh = install.sh
|
|
||||||
launch.sh = launch.sh
|
|
||||||
build.sh = build.sh
|
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Release|x64 = Release|x64
|
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
|
Release|x64 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
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.ActiveCfg = Debug|x64
|
||||||
{28965A64-C9EC-4168-82E2-AE66B5D8A29F}.Debug|x64.Build.0 = 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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{2534AAEB-1F27-43F9-86C5-A1726DACB98D} = {F9D624C2-7460-4672-AA31-1E8887084041}
|
||||||
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {BCA57FA1-2E0B-4DEA-9C70-E3A9914D76C7}
|
SolutionGuid = {BCA57FA1-2E0B-4DEA-9C70-E3A9914D76C7}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<Platforms>x64</Platforms>
|
<Platforms>x64</Platforms>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
|
||||||
<ImplicitUsings>disable</ImplicitUsings>
|
<ImplicitUsings>disable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
|
|||||||
34
deploy.ps1
Normal file
34
deploy.ps1
Normal 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
|
||||||
Reference in New Issue
Block a user