forked from salutesh/DayZ-Expansion-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PerformDiff.cmd
164 lines (114 loc) · 3.96 KB
/
PerformDiff.cmd
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
@echo off
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
echo ///////////////////////////////////////////////////////////////////
echo DayZ-Git-Diff - Credits Mikero, Jacob_Mango and Cleetus.
echo ///////////////////////////////////////////////////////////////////
echo Searching for Mikeros Awesome Tools!
for /F "Tokens=2* skip=2" %%A In ('REG QUERY "HKCU\SOFTWARE\Mikero\depbo" /v "path" 2^>nul') do (set _MIKEDLL=%%B)
if defined _MIKEDLL goto mikefound
for /F "Tokens=2* skip=2" %%A In ('REG QUERY "HKLM\SOFTWARE\Mikero\depbo" /v "path" 2^>nul') do (set _MIKEDLL=%%B)
if defined _MIKEDLL goto mikefound
echo DePBO found!
goto err
:mikefound
set _MIKEDLL=%_MIKEDLL%\bin
echo %_MIKEDLL%
if exist "%_MIKEDLL%\extractpbodos.exe" goto foundextract
echo Extract PBO not found!
goto err
:foundextract
if exist "%_MIKEDLL%\derap.exe" goto finddayz
echo DeRAP not found!
goto err
:finddayz
echo searching registry for the dayz path
for /F "Tokens=2* skip=2" %%A In ('REG QUERY "HKLM\SOFTWARE\Wow6432Node\Bohemia Interactive\Dayz" /v "main" 2^>nul') do (set _DAYZPATH=%%B)
if defined _DAYZPATH (
set _DZ_EXPANSION=%_DAYZPATH%\..\..\workshop\content\221100\2116151222
set _DZ_EXPANSION_LICENSED=%_DAYZPATH%\..\..\workshop\content\221100\2116157322
goto findexpansion
)
echo No reg keys found, make sure you have launched your game at least once (via the official launcher).
pause
exit
:findexpansion
echo searching for expansion
if exist "%_DZ_EXPANSION%" goto findexpansionlicensed
echo DayZ Expansion not found in the workshop folder
pause
exit
:findexpansionlicensed
echo searching for expansion licensed
if exist "%_DZ_EXPANSION_LICENSED%" goto extractaddons
echo DayZ Expansion Licensed not found in the workshop folder
pause
exit
:extractaddons
echo DayZ might be installed in %_DAYZPATH%
echo DayZ Expansion might be installed in %_DZ_EXPANSION%
echo DayZ Expansion Licensed might be installed in %_DZ_EXPANSION_LICENSED%
echo removing folders. Expect this to take some time......
call (exit /b 0)
echo removing DZEXPANSION....
if exist "P:\DZEXPANSION" (rmdir /s/q "P:\DZEXPANSION")
if ERRORLEVEL 1 goto err
echo removing DZEXPANSIONLICENSED....
if exist "P:\DZEXPANSIONLICENSED" (rmdir /s/q "P:\DZEXPANSIONLICENSED")
if ERRORLEVEL 1 goto err
echo extracting DayZ Expansion addons....
extractpbodos -p "%_DZ_EXPANSION%\Addons" P:\DZEXPANSION
pause
if ERRORLEVEL 1 goto err
echo extracting DayZ Expansion Licensed addons....
extractpbodos -p "%_DZ_EXPANSION_LICENSED%\Addons" P:\DZEXPANSIONLICENSED
if ERRORLEVEL 1 goto err
echo Removing old folders.
del /S /Q "%0\..\DayZExpansion" >nul
echo Folder Removal Complete...
P:
cd DZEXPANSION
for /R %%D in ( config.cpp ) do (
IF EXIST "%%D" (
set _CONFIG=%%~fD
set _PREFIX=%%~pD
set _PREFIX=!_PREFIX:\DZEXPANSION=!
mkdir %0\..\!_PREFIX!
Powershell -ExecutionPolicy ByPass -command "&'%0\..\HandleConfig.ps1'" "!_CONFIG!"
xcopy /Y !_CONFIG! %0\..\!_PREFIX!
)
)
cd ../DZEXPANSIONLICENSED
for /R %%D in ( config.cpp ) do (
IF EXIST "%%D" (
set _CONFIG=%%~fD
set _PREFIX=%%~pD
set _PREFIX=!_PREFIX:\DZEXPANSIONLICENSED=!
mkdir %0\..\!_PREFIX!
Powershell -ExecutionPolicy ByPass -command "&'%0\..\HandleConfig.ps1'" "!_CONFIG!"
xcopy /Y !_CONFIG! %0\..\!_PREFIX!
)
)
echo Addons done... Moving onto dta...
xcopy /S /Q "P:\DZEXPANSION\DayZExpansion\Scripts" "%0\..\DayZExpansion\Scripts\"
xcopy /S /Q "P:\DZEXPANSION\DayZExpansion\GUI" "%0\..\DayZExpansion\GUI\"
echo /////////////////////////////////////
echo Files successfully moved... Cleaning up!
echo /////////////////////////////////////
:done
echo All tasks completed successfully
pause
:noprompt
endlocal
@exit /B 0
:err
echo failed
choice /c k /m "This tool WILL NOT WORK until you fix this error!"
endlocal
@exit /B 1
:process_line
for /F usebackq^ tokens^=3*^ delims^=^" %%1 in ('%the_line%') do (
set folder=%%2
set folder=!folder:"=!
set folder=!folder:\\=\!
)