forked from Rist8/MiSide-UniversalAssetLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_with_assets.bat
99 lines (79 loc) · 2.71 KB
/
build_with_assets.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@echo off
setlocal enabledelayedexpansion
dotnet build Plugin -c Release -o Compiled
for /f "tokens=3" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Valve\Steam" /v InstallPath ^|findstr /ri "REG_SZ"') do set SteamPath=%%a
REM Define input file
set "inputFile=%SteamPath%\steamapps\libraryfolders.vdf"
REM Initialize variables for paths
set "path1="
set "path2="
set "nextIsPath="
REM Loop through each line in the file
for /f "usebackq tokens=1,* delims= " %%A in ("%inputFile%") do (
REM Trim the first token
set "key=%%A"
set "value=%%B"
REM Remove quotes for key and value
set "key=!key:"=!"
set "value=!value:"=!"
REM Detect the start of library entry "1"
if "!key!"=="1" (
set "nextIsPath=1"
)
REM Detect the start of library entry "2"
if "!key!"=="2" (
set "nextIsPath=2"
)
REM If the "path" key is found and a flag is set, extract the path
if "!nextIsPath!" NEQ "" if "!key!"=="path" (
set "path!nextIsPath!=!value!"
set "nextIsPath="
)
)
REM Display extracted paths
if defined path1 (
echo Path 1: !path1!
) else (
echo Path 1 not found.
)
if defined path2 (
echo Path 2: !path2!
) else (
echo Path 2 not found.
)
REM Check for "MiSide Full" folder under each path
if defined path1 (
set "target1=!path1!\steamapps\common\MiSide"
if exist "!target1!" (
set "GameFolder=!target1!"
echo Chose !target1! as game directory
) else (
echo Folder does not exist: !target1!
)
)
if defined path2 (
set "target2=!path2!\steamapps\common\MiSide"
if exist "!target2!" (
set "GameFolder=!target2!"
echo Chose !target2! as game directory
) else (
echo Folder does not exist: !target2!
)
)
copy ".\Dependencies\AssimpNet.dll" ".\Compiled"
copy ".\Dependencies\AssimpNet.pdb" ".\Compiled"
copy ".\Dependencies\Newtonsoft.Json.dll" ".\Compiled"
copy ".\Dependencies\Newtonsoft.Json.pdb" ".\Compiled"
set readme_file=".\Compiled\README.txt"
del %readme_file%
echo WARNING: assimp.dll in game folder right beside MiSide.exe is required for mod to work. You can find it in 'Dependencies/assimp.dll'. >> %readme_file%
echo If you want to load specific assets, edit the 'assets_config.txt' file. >> %readme_file%
echo. - .png, .jpg, .jpeg as texture files >> %readme_file%
echo. - .fbx as mesh files >> %readme_file%
echo. - .ogg as audio files >> %readme_file%
echo. - .mp4 as video files >> %readme_file%
robocopy "./Assets" "./Compiled/Assets" /E /np /nfl /njh /njs /ndl /nc /ns
robocopy ".\Compiled" "%GameFolder%\BepInEx\plugins\UniversalAssetLoader" /E /np /nfl /njh /njs /ndl /nc /ns
if not exist %GameFolder%\assimp.dll (
copy ".\Dependencies\assimp.dll" "%GameFolder%"
)