Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 3b851b6

Browse files
committed
Use 7zip instead of Compress-Archive
1 parent 4c029da commit 3b851b6

File tree

2 files changed

+85
-76
lines changed

2 files changed

+85
-76
lines changed
512 Bytes
Binary file not shown.

build.ps1

Lines changed: 85 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,134 @@
11
# ----------- MelonLoader IL2CPP (net6) -----------
2-
dotnet build src\UnityExplorer.sln -c Release_ML_Cpp_net6
2+
dotnet build src/UnityExplorer.sln -c Release_ML_Cpp_net6
33
$Path = "Release\UnityExplorer.MelonLoader.IL2CPP.net6preview"
44
# ILRepack
5-
lib/ILRepack.exe /target:library /lib:lib\net6 /lib:lib\unhollowed /lib:$Path /internalize /out:$Path\UnityExplorer.ML.IL2CPP.net6preview.dll $Path\UnityExplorer.ML.IL2CPP.net6preview.dll $Path\mcs.dll
5+
lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.ML.IL2CPP.net6preview.dll $Path/UnityExplorer.ML.IL2CPP.net6preview.dll $Path/mcs.dll
66
# (cleanup and move files)
7-
Remove-Item $Path\UnityExplorer.ML.IL2CPP.net6preview.deps.json
8-
Remove-Item $Path\Tomlet.dll
9-
Remove-Item $Path\mcs.dll
10-
Remove-Item $Path\Iced.dll
11-
Remove-Item $Path\UnhollowerBaseLib.dll
7+
Remove-Item $Path/UnityExplorer.ML.IL2CPP.net6preview.deps.json
8+
Remove-Item $Path/Tomlet.dll
9+
Remove-Item $Path/mcs.dll
10+
Remove-Item $Path/Iced.dll
11+
Remove-Item $Path/UnhollowerBaseLib.dll
1212
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
13-
Move-Item -Path $Path\UnityExplorer.ML.IL2CPP.net6preview.dll -Destination $Path\Mods -Force
13+
Move-Item -Path $Path/UnityExplorer.ML.IL2CPP.net6preview.dll -Destination $Path/Mods -Force
1414
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
15-
Move-Item -Path $Path\UniverseLib.IL2CPP.dll -Destination $Path\UserLibs -Force
15+
Move-Item -Path $Path/UniverseLib.IL2CPP.dll -Destination $Path/UserLibs -Force
1616
# (create zip archive)
17-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.MelonLoader.IL2CPP.net6preview.zip -Force
17+
Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip -ErrorAction SilentlyContinue
18+
7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.net6preview.zip .\$Path\*
1819

1920
# ----------- MelonLoader IL2CPP (net472) -----------
20-
dotnet build src\UnityExplorer.sln -c Release_ML_Cpp_net472
21-
$Path = "Release\UnityExplorer.MelonLoader.IL2CPP"
21+
dotnet build src/UnityExplorer.sln -c Release_ML_Cpp_net472
22+
$Path = "Release/UnityExplorer.MelonLoader.IL2CPP"
2223
# ILRepack
23-
lib/ILRepack.exe /target:library /lib:lib\net472 /lib:lib\net35 /lib:lib\unhollowed /lib:$Path /internalize /out:$Path\UnityExplorer.ML.IL2CPP.dll $Path\UnityExplorer.ML.IL2CPP.dll $Path\mcs.dll
24+
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/net35 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.ML.IL2CPP.dll $Path/UnityExplorer.ML.IL2CPP.dll $Path/mcs.dll
2425
# (cleanup and move files)
25-
Remove-Item $Path\Tomlet.dll
26-
Remove-Item $Path\mcs.dll
27-
Remove-Item $Path\Iced.dll
28-
Remove-Item $Path\UnhollowerBaseLib.dll
26+
Remove-Item $Path/Tomlet.dll
27+
Remove-Item $Path/mcs.dll
28+
Remove-Item $Path/Iced.dll
29+
Remove-Item $Path/UnhollowerBaseLib.dll
2930
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
30-
Move-Item -Path $Path\UnityExplorer.ML.IL2CPP.dll -Destination $Path\Mods -Force
31+
Move-Item -Path $Path/UnityExplorer.ML.IL2CPP.dll -Destination $Path/Mods -Force
3132
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
32-
Move-Item -Path $Path\UniverseLib.IL2CPP.dll -Destination $Path\UserLibs -Force
33+
Move-Item -Path $Path/UniverseLib.IL2CPP.dll -Destination $Path/UserLibs -Force
3334
# (create zip archive)
34-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.MelonLoader.IL2CPP.zip -Force
35+
Remove-Item $Path/../UnityExplorer.MelonLoader.IL2CPP.zip -ErrorAction SilentlyContinue
36+
7z a $Path/../UnityExplorer.MelonLoader.IL2CPP.zip .\$Path\*
3537

3638
# ----------- MelonLoader Mono -----------
37-
dotnet build src\UnityExplorer.sln -c Release_ML_Mono
38-
$Path = "Release\UnityExplorer.MelonLoader.Mono"
39+
dotnet build src/UnityExplorer.sln -c Release_ML_Mono
40+
$Path = "Release/UnityExplorer.MelonLoader.Mono"
3941
# ILRepack
40-
lib/ILRepack.exe /target:library /lib:lib\net35 /lib:$Path /internalize /out:$Path\UnityExplorer.ML.Mono.dll $Path\UnityExplorer.ML.Mono.dll $Path\mcs.dll
42+
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.ML.Mono.dll $Path/UnityExplorer.ML.Mono.dll $Path/mcs.dll
4143
# (cleanup and move files)
42-
Remove-Item $Path\Tomlet.dll
43-
Remove-Item $Path\mcs.dll
44+
Remove-Item $Path/Tomlet.dll
45+
Remove-Item $Path/mcs.dll
4446
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
45-
Move-Item -Path $Path\UnityExplorer.ML.Mono.dll -Destination $Path\Mods -Force
47+
Move-Item -Path $Path/UnityExplorer.ML.Mono.dll -Destination $Path/Mods -Force
4648
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
47-
Move-Item -Path $Path\UniverseLib.Mono.dll -Destination $Path\UserLibs -Force
49+
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/UserLibs -Force
4850
# (create zip archive)
49-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.MelonLoader.Mono.zip -Force
51+
Remove-Item $Path/../UnityExplorer.MelonLoader.Mono.zip -ErrorAction SilentlyContinue
52+
7z a $Path/../UnityExplorer.MelonLoader.Mono.zip .\$Path\*
5053

5154
# ----------- BepInEx IL2CPP -----------
52-
dotnet build src\UnityExplorer.sln -c Release_BIE_Cpp
53-
$Path = "Release\UnityExplorer.BepInEx.IL2CPP"
55+
dotnet build src/UnityExplorer.sln -c Release_BIE_Cpp
56+
$Path = "Release/UnityExplorer.BepInEx.IL2CPP"
5457
# ILRepack
55-
lib/ILRepack.exe /target:library /lib:lib\net472 /lib:lib\unhollowed /lib:$Path /internalize /out:$Path\UnityExplorer.BIE.IL2CPP.dll $Path\UnityExplorer.BIE.IL2CPP.dll $Path\mcs.dll $Path\Tomlet.dll
58+
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.BIE.IL2CPP.dll $Path/UnityExplorer.BIE.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll
5659
# (cleanup and move files)
57-
Remove-Item $Path\Tomlet.dll
58-
Remove-Item $Path\mcs.dll
59-
Remove-Item $Path\Iced.dll
60-
Remove-Item $Path\UnhollowerBaseLib.dll
60+
Remove-Item $Path/Tomlet.dll
61+
Remove-Item $Path/mcs.dll
62+
Remove-Item $Path/Iced.dll
63+
Remove-Item $Path/UnhollowerBaseLib.dll
6164
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
62-
New-Item -Path "$Path" -Name "plugins\sinai-dev-UnityExplorer" -ItemType "directory" -Force
63-
Move-Item -Path $Path\UnityExplorer.BIE.IL2CPP.dll -Destination $Path\plugins\sinai-dev-UnityExplorer -Force
64-
Move-Item -Path $Path\UniverseLib.IL2CPP.dll -Destination $Path\plugins\sinai-dev-UnityExplorer -Force
65+
New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force
66+
Move-Item -Path $Path/UnityExplorer.BIE.IL2CPP.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
67+
Move-Item -Path $Path/UniverseLib.IL2CPP.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
6568
# (create zip archive)
66-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.BepInEx.IL2CPP.zip -Force
69+
Remove-Item $Path/../UnityExplorer.BepInEx.IL2CPP.zip -ErrorAction SilentlyContinue
70+
7z a $Path/../UnityExplorer.BepInEx.IL2CPP.zip .\$Path\*
6771

6872
# ----------- BepInEx 5 Mono -----------
69-
dotnet build src\UnityExplorer.sln -c Release_BIE5_Mono
70-
$Path = "Release\UnityExplorer.BepInEx5.Mono"
73+
dotnet build src/UnityExplorer.sln -c Release_BIE5_Mono
74+
$Path = "Release/UnityExplorer.BepInEx5.Mono"
7175
# ILRepack
72-
lib/ILRepack.exe /target:library /lib:lib\net35 /lib:$Path /internalize /out:$Path\UnityExplorer.BIE5.Mono.dll $Path\UnityExplorer.BIE5.Mono.dll $Path\mcs.dll $Path\Tomlet.dll
76+
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.BIE5.Mono.dll $Path/UnityExplorer.BIE5.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
7377
# (cleanup and move files)
74-
Remove-Item $Path\Tomlet.dll
75-
Remove-Item $Path\mcs.dll
78+
Remove-Item $Path/Tomlet.dll
79+
Remove-Item $Path/mcs.dll
7680
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
77-
New-Item -Path "$Path" -Name "plugins\sinai-dev-UnityExplorer" -ItemType "directory" -Force
78-
Move-Item -Path $Path\UnityExplorer.BIE5.Mono.dll -Destination $Path\plugins\sinai-dev-UnityExplorer -Force
79-
Move-Item -Path $Path\UniverseLib.Mono.dll -Destination $Path\plugins\sinai-dev-UnityExplorer -Force
81+
New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force
82+
Move-Item -Path $Path/UnityExplorer.BIE5.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
83+
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
8084
# (create zip archive)
81-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.BepInEx5.Mono.zip -Force
85+
Remove-Item $Path/../UnityExplorer.BepInEx5.Mono.zip -ErrorAction SilentlyContinue
86+
7z a $Path/../UnityExplorer.BepInEx5.Mono.zip .\$Path\*
8287

8388
# ----------- BepInEx 6 Mono -----------
84-
dotnet build src\UnityExplorer.sln -c Release_BIE6_Mono
85-
$Path = "Release\UnityExplorer.BepInEx6.Mono"
89+
dotnet build src/UnityExplorer.sln -c Release_BIE6_Mono
90+
$Path = "Release/UnityExplorer.BepInEx6.Mono"
8691
# ILRepack
87-
lib/ILRepack.exe /target:library /lib:lib\net35 /lib:$Path /internalize /out:$Path\UnityExplorer.BIE6.Mono.dll $Path\UnityExplorer.BIE6.Mono.dll $Path\mcs.dll $Path\Tomlet.dll
92+
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.BIE6.Mono.dll $Path/UnityExplorer.BIE6.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
8893
# (cleanup and move files)
89-
Remove-Item $Path\Tomlet.dll
90-
Remove-Item $Path\mcs.dll
94+
Remove-Item $Path/Tomlet.dll
95+
Remove-Item $Path/mcs.dll
9196
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
92-
New-Item -Path "$Path" -Name "plugins\sinai-dev-UnityExplorer" -ItemType "directory" -Force
93-
Move-Item -Path $Path\UnityExplorer.BIE6.Mono.dll -Destination $Path\plugins\sinai-dev-UnityExplorer -Force
94-
Move-Item -Path $Path\UniverseLib.Mono.dll -Destination $Path\plugins\sinai-dev-UnityExplorer -Force
97+
New-Item -Path "$Path" -Name "plugins/sinai-dev-UnityExplorer" -ItemType "directory" -Force
98+
Move-Item -Path $Path/UnityExplorer.BIE6.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
99+
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/sinai-dev-UnityExplorer -Force
95100
# (create zip archive)
96-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.BepInEx6.Mono.zip -Force
101+
Remove-Item $Path/../UnityExplorer.BepInEx6.Mono.zip -ErrorAction SilentlyContinue
102+
7z a $Path/../UnityExplorer.BepInEx6.Mono.zip .\$Path\*
97103

98104
# ----------- Standalone Mono -----------
99-
dotnet build src\UnityExplorer.sln -c Release_STANDALONE_Mono
100-
$Path = "Release\UnityExplorer.Standalone.Mono"
105+
dotnet build src/UnityExplorer.sln -c Release_STANDALONE_Mono
106+
$Path = "Release/UnityExplorer.Standalone.Mono"
101107
# ILRepack
102-
lib/ILRepack.exe /target:library /lib:lib\net35 /lib:$Path /internalize /out:$Path\UnityExplorer.Standalone.Mono.dll $Path\UnityExplorer.Standalone.Mono.dll $Path\mcs.dll $Path\Tomlet.dll
108+
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/UnityExplorer.Standalone.Mono.dll $Path/UnityExplorer.Standalone.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
103109
# (cleanup and move files)
104-
Remove-Item $Path\Tomlet.dll
105-
Remove-Item $Path\mcs.dll
106-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.Standalone.Mono.zip -Force
110+
Remove-Item $Path/Tomlet.dll
111+
Remove-Item $Path/mcs.dll
112+
Remove-Item $Path/../UnityExplorer.Standalone.Mono.zip -ErrorAction SilentlyContinue
113+
7z a $Path/../UnityExplorer.Standalone.Mono.zip .\$Path\*
107114

108115
# ----------- Standalone IL2CPP -----------
109-
dotnet build src\UnityExplorer.sln -c Release_STANDALONE_Cpp
110-
$Path = "Release\UnityExplorer.Standalone.IL2CPP"
116+
dotnet build src/UnityExplorer.sln -c Release_STANDALONE_Cpp
117+
$Path = "Release/UnityExplorer.Standalone.IL2CPP"
111118
# ILRepack
112-
lib/ILRepack.exe /target:library /lib:lib\net472 /lib:lib\unhollowed /lib:$Path /internalize /out:$Path\UnityExplorer.Standalone.IL2CPP.dll $Path\UnityExplorer.Standalone.IL2CPP.dll $Path\mcs.dll $Path\Tomlet.dll
119+
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/UnityExplorer.Standalone.IL2CPP.dll $Path/UnityExplorer.Standalone.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll
113120
# (cleanup and move files)
114-
Remove-Item $Path\Tomlet.dll
115-
Remove-Item $Path\mcs.dll
116-
Remove-Item $Path\Iced.dll
117-
Remove-Item $Path\UnhollowerBaseLib.dll
118-
Compress-Archive -Path $Path\* -CompressionLevel Fastest -DestinationPath $Path\..\UnityExplorer.Standalone.IL2CPP.zip -Force
121+
Remove-Item $Path/Tomlet.dll
122+
Remove-Item $Path/mcs.dll
123+
Remove-Item $Path/Iced.dll
124+
Remove-Item $Path/UnhollowerBaseLib.dll
125+
Remove-Item $Path/../UnityExplorer.Standalone.IL2CPP.zip -ErrorAction SilentlyContinue
126+
7z a $Path/../UnityExplorer.Standalone.IL2CPP.zip .\$Path\*
119127

120128
# ----------- Editor (mono) -----------
121-
$Path1 = "Release\UnityExplorer.Standalone.Mono"
122-
$Path2 = "UnityEditorPackage\Runtime"
123-
Copy-Item $Path1\UnityExplorer.STANDALONE.Mono.dll -Destination $Path2
124-
Copy-Item $Path1\UniverseLib.Mono.dll -Destination $Path2
125-
Compress-Archive -Path UnityEditorPackage\* -CompressionLevel Fastest -DestinationPath Release\UnityExplorer.Editor.zip -Force
129+
$Path1 = "Release/UnityExplorer.Standalone.Mono"
130+
$Path2 = "UnityEditorPackage/Runtime"
131+
Copy-Item $Path1/UnityExplorer.STANDALONE.Mono.dll -Destination $Path2
132+
Copy-Item $Path1/UniverseLib.Mono.dll -Destination $Path2
133+
Remove-Item Release/UnityExplorer.Editor.zip -ErrorAction SilentlyContinue
134+
7z a Release/UnityExplorer.Editor.zip .\UnityEditorPackage\*

0 commit comments

Comments
 (0)