mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 18:32:45 +00:00
add qsb patcher
This commit is contained in:
parent
419bb833d7
commit
367b1b8e8d
8
QSB.sln
8
QSB.sln
@ -29,7 +29,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mirror", "Mirror", "{851AB4
|
||||
Mirror\Telepathy.dll = Mirror\Telepathy.dll
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APITestMod", "APITestMod\APITestMod.csproj", "{0A10143E-6C00-409B-B3A5-C54C1B01599D}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APITestMod", "APITestMod\APITestMod.csproj", "{0A10143E-6C00-409B-B3A5-C54C1B01599D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QSBPatcher", "QSBPatcher\QSBPatcher.csproj", "{CA4CBA2B-54D5-4C4B-9B51-957BC6D77D6B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -57,6 +59,10 @@ Global
|
||||
{0A10143E-6C00-409B-B3A5-C54C1B01599D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0A10143E-6C00-409B-B3A5-C54C1B01599D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0A10143E-6C00-409B-B3A5-C54C1B01599D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CA4CBA2B-54D5-4C4B-9B51-957BC6D77D6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CA4CBA2B-54D5-4C4B-9B51-957BC6D77D6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CA4CBA2B-54D5-4C4B-9B51-957BC6D77D6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CA4CBA2B-54D5-4C4B-9B51-957BC6D77D6B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -12,5 +12,6 @@
|
||||
"owmlVersion": "2.9.8",
|
||||
"dependencies": [ "_nebula.MenuFramework", "JohnCorby.VanillaFix" ],
|
||||
"pathsToPreserve": [ "debugsettings.json" ],
|
||||
"requireLatestVersion": true
|
||||
"requireLatestVersion": true,
|
||||
"patcher": "QSBPatcher.exe"
|
||||
}
|
||||
|
45
QSBPatcher/QSBPatcher.cs
Normal file
45
QSBPatcher/QSBPatcher.cs
Normal file
@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace QSBPatcher;
|
||||
|
||||
public static class QSBPatcher
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var basePath = args.Length > 0 ? args[0] : ".";
|
||||
var gamePath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
|
||||
var steamDLLPath = Path.Combine(basePath, "com.rlabrecque.steamworks.net.dll");
|
||||
|
||||
var managedPath = Path.Combine(gamePath, GetDataPath(gamePath), "Managed");
|
||||
|
||||
File.Copy(steamDLLPath, Path.Combine(managedPath, "com.rlabrecque.steamworks.net.dll"), true);
|
||||
}
|
||||
|
||||
private static string GetDataDirectoryName()
|
||||
{
|
||||
var gamePath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
return $"{GetExecutableName(gamePath)}_Data";
|
||||
}
|
||||
|
||||
private static string GetDataPath(string gamePath)
|
||||
{
|
||||
return Path.Combine(gamePath, $"{GetDataDirectoryName()}");
|
||||
}
|
||||
|
||||
private static string GetExecutableName(string gamePath)
|
||||
{
|
||||
var executableNames = new[] { "Outer Wilds.exe", "OuterWilds.exe" };
|
||||
foreach (var executableName in executableNames)
|
||||
{
|
||||
var executablePath = Path.Combine(gamePath, executableName);
|
||||
if (File.Exists(executablePath))
|
||||
{
|
||||
return Path.GetFileNameWithoutExtension(executablePath);
|
||||
}
|
||||
}
|
||||
|
||||
throw new FileNotFoundException($"Outer Wilds exe file not found in {gamePath}");
|
||||
}
|
||||
}
|
12
QSBPatcher/QSBPatcher.csproj
Normal file
12
QSBPatcher/QSBPatcher.csproj
Normal file
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net48</TargetFramework>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
|
||||
<OutputPath Condition="Exists('$(OwmlDir)')">$(OwmlDir)\Mods\Raicuparta.QuantumSpaceBuddies</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user