mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
bring back netstandard2.0 target
This commit is contained in:
@@ -11,17 +11,13 @@ This project integrates Velopack into unity by way of a [nuget for Unity](https:
|
|||||||
7. use vpk cli tool to pack your project `vpk pack -u UnityMonoSample -v 0.0.1 -p .\Build -e UnityMonoSample.exe`
|
7. use vpk cli tool to pack your project `vpk pack -u UnityMonoSample -v 0.0.1 -p .\Build -e UnityMonoSample.exe`
|
||||||
|
|
||||||
## Requirements for your project
|
## Requirements for your project
|
||||||
install the nuget package `VelocyPack` in your project
|
install the nuget package `Velopack` in your project
|
||||||
you can use tool like [NuGetForUnity](https://github.com/GlitchEnzo/NuGetForUnity)
|
you can use tool like [NuGetForUnity](https://github.com/GlitchEnzo/NuGetForUnity)
|
||||||
```
|
```
|
||||||
openupm add com.github-glitchenzo.nugetforunity
|
openupm add com.github-glitchenzo.nugetforunity
|
||||||
```
|
```
|
||||||
if your .net runtime is .NET Standard 2.0, you need use Velopack 0.0.359
|
|
||||||
|
|
||||||
for .NET 4.x runtime, you can use the latest version of Velopack
|
|
||||||
|
|
||||||
currently, the Velopack is only support for Unity mono runtime, not support for IL2CPP, due to the following reasons:
|
|
||||||
|
|
||||||
|
Currently, Velopack is only support for Unity mono runtime, it does not support for IL2CPP, due to the following reasons:
|
||||||
|
|
||||||
https://docs.unity3d.com/2022.3/Documentation/Manual/ScriptingRestrictions.html
|
https://docs.unity3d.com/2022.3/Documentation/Manual/ScriptingRestrictions.html
|
||||||
|
|
||||||
@@ -37,16 +33,16 @@ If you still want to use Velopack in IL2CPP, you can use the following workaroun
|
|||||||
1. clone the Velopack repository
|
1. clone the Velopack repository
|
||||||
2. edit the VelopackRuntimeInfo.cs file like this:
|
2. edit the VelopackRuntimeInfo.cs file like this:
|
||||||
```csharp
|
```csharp
|
||||||
static VelopackRuntimeInfo()
|
static VelopackRuntimeInfo()
|
||||||
{
|
{
|
||||||
//delete the following line
|
//delete the following line
|
||||||
//EntryExePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
|
//EntryExePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
|
||||||
EntryExePath = Application.dataPath;
|
EntryExePath = Application.dataPath;
|
||||||
if (!Application.isEditor)
|
if (!Application.isEditor)
|
||||||
{
|
{
|
||||||
EntryExePath = Path.Combine(EntryExePath, "..", Application.productName + ".exe");
|
EntryExePath = Path.Combine(EntryExePath, "..", Application.productName + ".exe");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
3. build the Velopack project
|
3. build the Velopack project
|
||||||
4. replace the Velopack.dll in your project with the new Velopack.dll
|
4. replace the Velopack.dll in your project with the new Velopack.dll
|
||||||
|
|||||||
@@ -39,14 +39,14 @@ namespace Velopack
|
|||||||
: targetPath;
|
: targetPath;
|
||||||
|
|
||||||
if (Directory.Exists(targetPath)) {
|
if (Directory.Exists(targetPath)) {
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK || NETSTANDARD
|
||||||
if (!CreateSymbolicLink(linkPath, finalTarget, SYMBOLIC_LINK_FLAG_DIRECTORY | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE))
|
if (!CreateSymbolicLink(linkPath, finalTarget, SYMBOLIC_LINK_FLAG_DIRECTORY | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE))
|
||||||
ThrowLastWin32Error("Unable to create junction point / symlink.");
|
ThrowLastWin32Error("Unable to create junction point / symlink.");
|
||||||
#else
|
#else
|
||||||
Directory.CreateSymbolicLink(linkPath, finalTarget);
|
Directory.CreateSymbolicLink(linkPath, finalTarget);
|
||||||
#endif
|
#endif
|
||||||
} else if (File.Exists(targetPath)) {
|
} else if (File.Exists(targetPath)) {
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK || NETSTANDARD
|
||||||
if (!CreateSymbolicLink(linkPath, finalTarget, SYMBOLIC_LINK_FLAG_FILE | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE))
|
if (!CreateSymbolicLink(linkPath, finalTarget, SYMBOLIC_LINK_FLAG_FILE | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE))
|
||||||
ThrowLastWin32Error("Unable to create junction point / symlink.");
|
ThrowLastWin32Error("Unable to create junction point / symlink.");
|
||||||
#else
|
#else
|
||||||
@@ -106,7 +106,7 @@ namespace Velopack
|
|||||||
private static string GetUnresolvedTarget(string linkPath)
|
private static string GetUnresolvedTarget(string linkPath)
|
||||||
{
|
{
|
||||||
if (TryGetLinkFsi(linkPath, out var fsi)) {
|
if (TryGetLinkFsi(linkPath, out var fsi)) {
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK || NETSTANDARD
|
||||||
|
|
||||||
return GetTargetWin32(linkPath);
|
return GetTargetWin32(linkPath);
|
||||||
#else
|
#else
|
||||||
@@ -130,7 +130,7 @@ namespace Velopack
|
|||||||
|
|
||||||
private static string GetRelativePath(string relativeTo, string path)
|
private static string GetRelativePath(string relativeTo, string path)
|
||||||
{
|
{
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK || NETSTANDARD
|
||||||
relativeTo = Path.GetFullPath(relativeTo);
|
relativeTo = Path.GetFullPath(relativeTo);
|
||||||
path = Path.GetFullPath(path);
|
path = Path.GetFullPath(path);
|
||||||
return ToggleRelative(relativeTo, path);
|
return ToggleRelative(relativeTo, path);
|
||||||
@@ -139,7 +139,7 @@ namespace Velopack
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETFRAMEWORK
|
#if NETFRAMEWORK || NETSTANDARD
|
||||||
[Flags]
|
[Flags]
|
||||||
private enum EFileAttributes : uint
|
private enum EFileAttributes : uint
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net462;net48;net6.0;net8.0</TargetFrameworks>
|
<TargetFrameworks>netstandard2.0;net462;net48;net6.0;net8.0</TargetFrameworks>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<LangVersion>9</LangVersion>
|
<LangVersion>9</LangVersion>
|
||||||
@@ -28,6 +28,12 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[2.2.0,)" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[2.2.0,)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard2')) ">
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="[13.0.1,)" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[2.2.0,)" />
|
||||||
|
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" $(TargetFramework) == 'net6.0' ">
|
<ItemGroup Condition=" $(TargetFramework) == 'net6.0' ">
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[6.0.0,)" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="[6.0.0,)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.10.4" />
|
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.10.4" />
|
||||||
<PackageReference Include="Microsoft.IO.Redist" Version="6.0.1" />
|
|
||||||
<PackageReference Include="Riok.Mapperly" Version="3.6.0" />
|
<PackageReference Include="Riok.Mapperly" Version="3.6.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user