1
0
mirror of https://github.com/originalnicodr/CinematicUnityExplorer.git synced 2025-07-18 17:38:01 +08:00
Files
CinematicUnityExplorer/build.ps1

220 lines
13 KiB
PowerShell
Raw Normal View History

cd UniverseLib
.\build.ps1
cd ..
IGCS Support for CUE (#72) * Initial work on supporting IGCS * feat: Added callback when starting session, adding missing func. * chore: tidy up math and cleanup. * chore: tidy up some verbose code * Added more callbacks, fixed math. * fix: use queue command system instead of directly writing to the camera. * lock camera while igcsdof is active. * build system shenanigans Now we can build the project just fine by building separately the C project and the C# project. * small syntax changes. learning c# and stuff * Refactor executeCameraCommand and improve thread-safety in FreeCamPanel * woops, correct order of arguments for MessageBoxA * fix: move the ourCamera check where it's actually needed. * chore: formatting c file * rewrite: move all igcsdof logic to its own class. Since CUE *must* work without igcsdof, I thought it would be convenient to handle all the logic regarding igcsdof in its own class. The initialization is a bit of a mess because since most of what it's on FreeCam is static I had to do some trickery. I wanted to specifically avoid calling LoadLibrary every time so I thought on only initializing one and having an internal flag either the thing loaded correctly or not (`isValid`). * fix: Pin callbacks to avoid garbage collection * chore: removed unused code * chore: fix typo. * nit: more idiomatic C# usage. Just applied what rider suggested =) * fix: remove unnecesary GCHandle, store delegates. * feat: Update IGCS dof camera status accordingly. Before, we just left igcsdof always enabled, now we handle the cases properly, avoiding the posibility of the user using igcsdof with the freecam disabled. * nit: fix comments and added some to UnityIGCSConnector. * feat: Get the transform reference earlier for perf:tm: * fix: Properly handle an initialization error. * chore: remove overly verbose debugging * fix: make sure we start with a clear queue after we end a session. This was what maybe was causing the misaligning after you cancel a session since we never checked if the queue was emptied by the code. * fix: properly cast a function pointer to use what it returns.
2024-05-04 19:05:12 -04:00
# ----------- Build UnityIGCSConnector ------------
msbuild.exe UnityIGCSConnector/UnityIGCSConnector.sln -p:Configuration=Release
# ----------- MelonLoader IL2CPP (net6) -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_net6preview
$Path = "Release\CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.dll $Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.dll $Path/mcs.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
Remove-Item $Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.deps.json
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.ML.IL2CPP.net6preview.dll -Destination $Path/Mods -Force
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
2022-06-23 06:03:58 +10:00
Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force
2022-04-12 00:29:02 +10:00
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.net6preview.zip
2022-04-12 00:29:02 +10:00
# ----------- MelonLoader IL2CPP CoreCLR (net6) -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_CoreCLR
$Path = "Release\CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR"
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net6 /lib:lib/interop /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll $Path/mcs.dll
# (cleanup and move files)
Remove-Item $Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.deps.json
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/Il2CppInterop.Common.dll
Remove-Item $Path/Il2CppInterop.Runtime.dll
Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.ML.IL2CPP.CoreCLR.dll -Destination $Path/Mods -Force
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
Move-Item -Path $Path/UniverseLib.ML.IL2CPP.Interop.dll -Destination $Path/UserLibs -Force
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.CoreCLR.zip
2022-04-27 20:13:17 +10:00
# ----------- MelonLoader IL2CPP (net472) -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Cpp_net472
$Path = "Release/CinematicUnityExplorer.MelonLoader.IL2CPP"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/net35 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.IL2CPP.dll $Path/CinematicUnityExplorer.ML.IL2CPP.dll $Path/mcs.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.ML.IL2CPP.dll -Destination $Path/Mods -Force
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
2022-06-23 06:03:58 +10:00
Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/UserLibs -Force
2022-04-12 00:29:02 +10:00
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.IL2CPP.zip
2022-04-12 00:29:02 +10:00
2022-04-27 20:13:17 +10:00
# ----------- MelonLoader Mono -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_ML_Mono
$Path = "Release/CinematicUnityExplorer.MelonLoader.Mono"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.ML.Mono.dll $Path/CinematicUnityExplorer.ML.Mono.dll $Path/mcs.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "Mods" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.ML.Mono.dll -Destination $Path/Mods -Force
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "UserLibs" -ItemType "directory" -Force
2022-05-13 17:11:25 +10:00
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/UserLibs -Force
2022-04-12 00:29:02 +10:00
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.MelonLoader.Mono.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.MelonLoader.Mono.zip
2022-04-12 00:29:02 +10:00
2022-04-27 20:13:17 +10:00
# ----------- BepInEx IL2CPP -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_Cpp
$Path = "Release/CinematicUnityExplorer.BepInEx.IL2CPP"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build423~577 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE.IL2CPP.dll $Path/CinematicUnityExplorer.BIE.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.BIE.IL2CPP.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
Move-Item -Path $Path/UniverseLib.IL2CPP.Unhollower.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
2022-04-12 00:29:02 +10:00
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.zip
2022-04-12 00:29:02 +10:00
2022-06-23 06:03:58 +10:00
# ----------- BepInEx IL2CPP CoreCLR -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_CoreCLR
$Path = "Release/CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR"
2022-06-23 06:03:58 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build423~577 /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll
2022-06-23 06:03:58 +10:00
# (cleanup and move files)
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/Il2CppInterop.Common.dll
Remove-Item $Path/Il2CppInterop.Runtime.dll
Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll
Remove-Item $Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.deps.json
2022-06-23 06:03:58 +10:00
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.BIE.IL2CPP.CoreCLR.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
Move-Item -Path $Path/UniverseLib.BIE.IL2CPP.Interop.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
2022-06-23 06:03:58 +10:00
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx.IL2CPP.CoreCLR.zip
# ----------- BepInEx Unity IL2CPP CoreCLR -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_BIE_Unity_Cpp
$Path = "Release/CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR"
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net472/BepInEx/build647+ /lib:lib/net6/ /lib:lib/interop/ /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll $Path/mcs.dll $Path/Tomlet.dll
# (cleanup and move files)
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/Il2CppInterop.Common.dll
Remove-Item $Path/Il2CppInterop.Runtime.dll
Remove-Item $Path/Microsoft.Extensions.Logging.Abstractions.dll
Remove-Item $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.deps.json
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.BIE.Unity.IL2CPP.CoreCLR.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
Move-Item -Path $Path/UniverseLib.BIE.IL2CPP.Interop.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx.Unity.IL2CPP.CoreCLR.zip
2022-06-23 06:03:58 +10:00
2022-04-27 20:13:17 +10:00
# ----------- BepInEx 5 Mono -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_BIE5_Mono
$Path = "Release/CinematicUnityExplorer.BepInEx5.Mono"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:lib/net35/BepInEx /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE5.Mono.dll $Path/CinematicUnityExplorer.BIE5.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.BIE5.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
2022-04-12 00:29:02 +10:00
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.BepInEx5.Mono.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx5.Mono.zip
2022-04-12 00:29:02 +10:00
2022-04-27 20:13:17 +10:00
# ----------- BepInEx 6 Mono -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_BIE6_Mono
$Path = "Release/CinematicUnityExplorer.BepInEx6.Mono"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:lib/net35/BepInEx/build423~577 /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE6.Mono.dll $Path/CinematicUnityExplorer.BIE6.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
2022-04-12 00:29:02 +10:00
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.BIE6.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
2022-04-12 00:29:02 +10:00
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.BepInEx6.Mono.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx6.Mono.zip
# ----------- BepInEx 6 Unity Mono -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_BIE6_Unity_Mono
$Path = "Release/CinematicUnityExplorer.BepInEx6.Unity.Mono"
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:lib/net35/BepInEx/build647+ /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.BIE6.Unity.Mono.dll $Path/CinematicUnityExplorer.BIE6.Unity.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
# (cleanup and move files)
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
New-Item -Path "$Path" -Name "plugins" -ItemType "directory" -Force
New-Item -Path "$Path" -Name "plugins/CinematicUnityExplorer" -ItemType "directory" -Force
Move-Item -Path $Path/CinematicUnityExplorer.BIE6.Unity.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
Move-Item -Path $Path/UniverseLib.Mono.dll -Destination $Path/plugins/CinematicUnityExplorer -Force
# (create zip archive)
Remove-Item $Path/../CinematicUnityExplorer.BepInEx6.Unity.Mono.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.BepInEx6.Unity.Mono.zip
2022-04-12 00:29:02 +10:00
2022-04-27 20:13:17 +10:00
# ----------- Standalone Mono -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_STANDALONE_Mono
$Path = "Release/CinematicUnityExplorer.Standalone.Mono"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net35 /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.Standalone.Mono.dll $Path/CinematicUnityExplorer.Standalone.Mono.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/../CinematicUnityExplorer.Standalone.Mono.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.Standalone.Mono.zip
2022-04-12 00:29:02 +10:00
2022-04-27 20:13:17 +10:00
# ----------- Standalone IL2CPP -----------
dotnet build src/CinematicUnityExplorer.sln -c Release_STANDALONE_Cpp
$Path = "Release/CinematicUnityExplorer.Standalone.IL2CPP"
2022-04-27 20:13:17 +10:00
# ILRepack
lib/ILRepack.exe /target:library /lib:lib/net472 /lib:lib/unhollowed /lib:$Path /internalize /out:$Path/CinematicUnityExplorer.Standalone.IL2CPP.dll $Path/CinematicUnityExplorer.Standalone.IL2CPP.dll $Path/mcs.dll $Path/Tomlet.dll
2022-04-27 20:13:17 +10:00
# (cleanup and move files)
2022-05-13 17:11:25 +10:00
Remove-Item $Path/Tomlet.dll
Remove-Item $Path/mcs.dll
Remove-Item $Path/Iced.dll
Remove-Item $Path/UnhollowerBaseLib.dll
Remove-Item $Path/../CinematicUnityExplorer.Standalone.IL2CPP.zip -ErrorAction SilentlyContinue
compress-archive .\$Path\* $Path/../CinematicUnityExplorer.Standalone.IL2CPP.zip
2022-04-12 00:29:02 +10:00
2022-04-27 20:13:17 +10:00
# ----------- Editor (mono) -----------
$Path1 = "Release/CinematicUnityExplorer.Standalone.Mono"
2022-05-13 17:11:25 +10:00
$Path2 = "UnityEditorPackage/Runtime"
Copy-Item $Path1/CinematicUnityExplorer.STANDALONE.Mono.dll -Destination $Path2
2022-05-13 17:11:25 +10:00
Copy-Item $Path1/UniverseLib.Mono.dll -Destination $Path2
Remove-Item Release/CinematicUnityExplorer.Editor.zip -ErrorAction SilentlyContinue
compress-archive .\UnityEditorPackage\* Release/CinematicUnityExplorer.Editor.zip