-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
418 additions
and
448 deletions.
There are no files selected for viewing
21 changes: 7 additions & 14 deletions
21
...er.Plugins.SHLoadIndirectStringList/CurvaLauncher.Plugins.SHLoadIndirectStringList.fsproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="..\..\Plugins\Plugin.props" /> | ||
|
||
<PropertyGroup> | ||
<OutputType>Library</OutputType> | ||
<TargetFramework>net8.0-windows</TargetFramework> | ||
|
||
<!-- 自动复制NuGet包到输出目录 --> | ||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> | ||
<GenerateDependencyFile>false</GenerateDependencyFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="SHLoadIndirectStringList.fs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\CurvaLauncher.Plugins\CurvaLauncher.Plugins.csproj" /> | ||
<Content Include="Manifest.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Update="FSharp.Core" Version="8.0.101" /> | ||
</ItemGroup> | ||
|
||
|
||
<Target Name="CopyFSharpCore" AfterTargets="Build"> | ||
<Copy SourceFiles="$(OutDir)\FSharp.Core.dll" DestinationFiles="..\..\CurvaLauncher\bin\$(Configuration)\$(TargetFramework)\Libraries\FSharp.Core.dll"></Copy> | ||
</Target> | ||
|
||
<Target Name="CopyOutputDebug" AfterTargets="Build" Condition="'$(Configuration)'=='Debug'"> | ||
<Copy SourceFiles="$(OutDir)\$(MSBuildProjectName).dll" DestinationFiles="..\..\CurvaLauncher\bin\$(Configuration)\$(TargetFramework)\Plugins\$(MSBuildProjectName).dll"></Copy> | ||
<Copy SourceFiles="$(OutDir)\$(MSBuildProjectName).pdb" DestinationFiles="..\..\CurvaLauncher\bin\$(Configuration)\$(TargetFramework)\Plugins\$(MSBuildProjectName).pdb"></Copy> | ||
</Target> | ||
|
||
<Target Name="CopyOutputRelease" AfterTargets="Build" Condition="'$(Configuration)'=='Release'"> | ||
<Copy SourceFiles="$(OutDir)\$(MSBuildProjectName).dll" DestinationFiles="..\..\CurvaLauncher\bin\$(Configuration)\$(TargetFramework)\AdditionalPlugins\$(MSBuildProjectName).dll"></Copy> | ||
</Target> | ||
<Import Project="..\..\Plugins\PackAfterBuild.targets" /> | ||
|
||
</Project> |
4 changes: 4 additions & 0 deletions
4
src/AdditionalPlugins/CurvaLauncher.Plugins.SHLoadIndirectStringList/Manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"ID": "SHLoadIndirectStringList", | ||
"Assembly": "CurvaLauncher.Plugins.SHLoadIndirectStringList.dll" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Runtime.Loader; | ||
|
||
namespace CurvaLauncher.Plugins; | ||
|
||
public sealed class PluginAssemblyLoadContext : AssemblyLoadContext | ||
{ | ||
private readonly AssemblyDependencyResolver resolver; | ||
|
||
public PluginAssemblyLoadContext(string pluginID, string dllPath) | ||
: base($"ZipPlugin ALC - {pluginID}") | ||
{ | ||
resolver = new(dllPath); | ||
} | ||
|
||
protected override Assembly? Load(AssemblyName assemblyName) | ||
{ | ||
string? resolvedPath = resolver.ResolveAssemblyToPath(assemblyName); | ||
return resolvedPath is not null ? LoadFromAssemblyPath(resolvedPath) : null; | ||
} | ||
|
||
protected override nint LoadUnmanagedDll(string unmanagedDllName) | ||
{ | ||
string? resolvedPath = resolver.ResolveUnmanagedDllToPath(unmanagedDllName); | ||
return resolvedPath is not null ? LoadUnmanagedDllFromPath(resolvedPath) : IntPtr.Zero; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace CurvaLauncher.Plugins; | ||
|
||
public sealed record PluginManifest(string ID, string Assembly); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace CurvaLauncher.Plugins; | ||
|
||
[AttributeUsage(AttributeTargets.Assembly)] | ||
public sealed class PluginTypeAttribute : Attribute | ||
{ | ||
public Type PluginType { get; private set; } | ||
|
||
public PluginTypeAttribute(Type pluginType) | ||
{ | ||
PluginType = pluginType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project> | ||
|
||
<Target Name="CopyOutput" AfterTargets="Build"> | ||
<ItemGroup> | ||
<_CompileOutput Include="$(OutputPath)\**"/> | ||
</ItemGroup> | ||
|
||
<Copy SourceFiles="@(_CompileOutput)" | ||
DestinationFolder="..\..\CurvaLauncher\bin\$(Configuration)\$(TargetFramework)\Plugins\%(RecursiveDir)" | ||
SkipUnchangedFiles="true"/> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using CurvaLauncher.Plugins; | ||
using CurvaLauncher.Plugins.Calculator; | ||
|
||
[assembly: PluginType(typeof(CalculatorPlugin))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using CurvaLauncher.Plugins; | ||
using CurvaLauncher.Plugins.Everything; | ||
|
||
[assembly: PluginType(typeof(EverythingPlugin))] |
Oops, something went wrong.