Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Unbork AssemblyName on headless build
Browse files Browse the repository at this point in the history
1. AssemblyName is now ALWAYS NeosModLoader, because apparently Windows requires this?
2. Adds some extra logging for what nml_libs get loaded
  • Loading branch information
zkxs committed Jul 2, 2022
1 parent 0bd2f08 commit ea7286e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
9 changes: 8 additions & 1 deletion NeosModLoader/ExecutionHook.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using FrooxEngine;
using System;
using System.Linq;

namespace NeosModLoader
{
Expand All @@ -17,7 +18,13 @@ static ExecutionHook()
try
{
SplashChanger.SetCustom("Loading libraries");
AssemblyLoader.LoadAssembliesFromDir("nml_libs");
AssemblyFile[] loadedAssemblies = AssemblyLoader.LoadAssembliesFromDir("nml_libs");
if (loadedAssemblies.Length != 0)
{
string loadedAssemblyList = string.Join("\n", loadedAssemblies.Select(a => a.Assembly.FullName));
Logger.MsgInternal($"Loaded libraries from nml_libs:\n{loadedAssemblyList}");
}

SplashChanger.SetCustom("Initializing");
DebugInfo.Log();
NeosVersionReset.Initialize();
Expand Down
2 changes: 1 addition & 1 deletion NeosModLoader/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace NeosModLoader
{
public class ModLoader
{
internal const string VERSION_CONSTANT = "1.11.1";
internal const string VERSION_CONSTANT = "1.11.2";
/// <summary>
/// NeosModLoader's version
/// </summary>
Expand Down
14 changes: 7 additions & 7 deletions NeosModLoader/NeosModLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>NeosModLoader</RootNamespace>
<Headless Condition="'$(Headless)'!='true'">false</Headless>
<AssemblyName Condition="'$(Headless)'=='false'">NeosModLoader</AssemblyName>
<AssemblyName Condition="'$(Headless)'=='true'">NeosModLoaderHeadless</AssemblyName>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<AssemblyName>NeosModLoader</AssemblyName>
<AssemblyTitle Condition="'$(Headless)'=='false'">NeosModLoader</AssemblyTitle>
<AssemblyTitle Condition="'$(Headless)'=='true'">NeosModLoaderHeadless</AssemblyTitle>
<AssemblyFileName>$(AssemblyTitle).dll</AssemblyFileName>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TargetFramework>net462</TargetFramework>
<FileAlignment>512</FileAlignment>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<Deterministic>true</Deterministic>
<CopyToLibraries Condition="'$(CopyToLibraries)'=='' And '$(Headless)'=='false'">true</CopyToLibraries>
<CopyToLibraries Condition="'$(CopyToLibraries)'=='' And '$(Headless)'=='true'">false</CopyToLibraries>
<CopyToLibraries Condition="'$(CopyToLibraries)'==''">true</CopyToLibraries>
<DebugSymbols Condition="'$(Configuration)'=='Release'">false</DebugSymbols>
<DebugType Condition="'$(Configuration)'=='Release'">None</DebugType>
</PropertyGroup>
Expand All @@ -42,8 +42,8 @@
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(CopyToLibraries)'=='true'">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(NeosPath)Libraries" />
<Message Text="Copied $(TargetFileName) to $(NeosPath)Libraries" Importance="high" />
<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFiles="$(NeosPath)Libraries\$(AssemblyFileName)" />
<Message Text="Copied $(TargetFileName) to $(NeosPath)Libraries\$(AssemblyFileName)" Importance="high" />
</Target>

</Project>

0 comments on commit ea7286e

Please sign in to comment.