Skip to content

Commit

Permalink
Put preloader patcher into correct folder in release ZIPs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorsington committed Oct 17, 2021
1 parent 570c826 commit 1c24ace
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ else {
$dir = $PSScriptRoot + "\bin\"
}

$copy = $dir + "\copy\BepInEx\plugins"
# These DLLs are preloader patchers and should be put into a different folder
$patchers = @("CtorShotgun.dll", "DemystifyExceptions.dll", "MirrorInternalLogs.dll", "StartupProfiler.dll")
function GetCopyPath($pluginFile)
{
if ($patchers.Contains($pluginFile)) {
return $dir + "\copy\BepInEx\patchers";
}
return $dir + "\copy\BepInEx\plugins";
}

$plugins = $dir + "\Release"

# Create releases ---------
function CreateZip ($pluginFile)
{
$copy = GetCopyPath($pluginFile.Name)
Remove-Item -Force -Path ($dir + "\copy") -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $copy

Expand Down Expand Up @@ -41,7 +51,7 @@ Remove-Item -Force -Path ($dir + "\copy") -Recurse
# Create Starup profiler release
$profilerdir = $dir + "\..\src\SimpleProfiler\bin"

Get-ChildItem -Path ($profilerdir) | Where{$_.Name -Match "^MonoProfiler(32|64)\.(?!dll)"} | Remove-Item
Get-ChildItem -Path ($profilerdir) | Where-Object{$_.Name -Match "^MonoProfiler(32|64)\.(?!dll)"} | Remove-Item

$ver = (Get-ChildItem -Path $profilerdir -Filter "MonoProfilerController.dll" -Recurse -Force)[0].VersionInfo.FileVersion.ToString() -replace "^([\d+\.]+?\d+)[\.0]*$", '${1}'

Expand Down

0 comments on commit 1c24ace

Please sign in to comment.