Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed launcher build to put dll dependencies in lib folder #1212

Merged
merged 1 commit into from
Aug 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Nitrox.Bootloader/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private static Assembly CurrentDomainOnAssemblyResolve(object sender, ResolveEve
}

// Load DLLs where Nitrox launcher is first, if not found, use Subnautica's DLLs.
string dllPath = Path.Combine(nitroxLauncherDir.Value, dllFileName);
string dllPath = Path.Combine(nitroxLauncherDir.Value, "lib", dllFileName);
if (!File.Exists(dllPath))
{
dllPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), dllFileName);
Expand Down
2 changes: 1 addition & 1 deletion NitroxLauncher/LauncherLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ internal async Task StartMultiplayerAsync()
string bootloaderName = "Nitrox.Bootloader.dll";
try
{
File.Copy(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), bootloaderName), Path.Combine(subnauticaPath, "Subnautica_Data", "Managed", bootloaderName), true);
File.Copy(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lib", bootloaderName), Path.Combine(subnauticaPath, "Subnautica_Data", "Managed", bootloaderName), true);
}
catch (IOException)
{
Expand Down
16 changes: 14 additions & 2 deletions NitroxLauncher/NitroxLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,22 @@
TODO: Try fix this as a project reference to Nitrox.Subnautica.Assets that will copy the files on build automatically. -->
<Target Name="MoveNitroxAssetsToLauncherOutput" AfterTargets="Build" Condition="'$(OS)' == 'Windows_NT'">
<ItemGroup>
<NitroxSubnauticaAssets Include="..\Nitrox.Subnautica.Assets\**\*.dll" />
<NitroxSubnauticaAssets Include="..\Nitrox.Subnautica.Assets\**\*." />
</ItemGroup>
<ItemGroup>
<NitroxSubnauticaStaticDlls Include="..\Nitrox.Subnautica.Assets\**\*.dll" />
</ItemGroup>
<Copy SourceFiles="@(NitroxSubnauticaAssets)" DestinationFolder="$(TargetDir)\%(RecursiveDir)" />
<Copy SourceFiles="@(NitroxSubnauticaStaticDlls)" DestinationFolder="$(TargetDir)\lib\%(RecursiveDir)" />
</Target>
<Target Name="MoveDependenciesToLib" AfterTargets="Build">
<ItemGroup>
<AllDependencies Include="$(TargetDir)*.dll" />
<AllDependencies Include="$(TargetDir)*.pdb" />
<AllDependencies Include="$(TargetDir)*.dll.config" />
<AllDependencies Include="$(TargetDir)*.xml" />
</ItemGroup>
<Move SourceFiles="@(AllDependencies)" DestinationFolder="$(TargetDir)lib" />
</Target>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="'$(OS)' == 'Windows_NT'" />
</Project>
</Project>
1 change: 1 addition & 0 deletions NitroxServer-Subnautica/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib" />
<dependentAssembly>
<assemblyIdentity name="Mono.Cecil" publicKeyToken="50cebf1cceb9d05e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.11.2.0" newVersion="0.11.2.0" />
Expand Down
2 changes: 1 addition & 1 deletion NitroxServer-Subnautica/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private static Assembly CurrentDomainOnAssemblyResolve(object sender, ResolveEve
}

// Load DLLs where this program (exe) is located
string dllPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), dllFileName);
string dllPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "lib", dllFileName);
if (!File.Exists(dllPath))
{
// Try find game managed libraries
Expand Down