-
Notifications
You must be signed in to change notification settings - Fork 7
/
CreamAPI_Tool.cmd
464 lines (409 loc) · 12.6 KB
/
CreamAPI_Tool.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
@echo off
cls
rem [### Sorting zone ###]
del /q /f readme.md >nul 2>nul
move /y Backup\Original\"Space Engineers DLC Unlocker - by Lamer87.url" Backup >nul 2>nul
if not exist steam_api64.dll goto dir_wrong
if not exist cream_api.ini goto ini_not_found
if not exist Backup\CreamAPI\steam_api64.dll goto dll_not_found
rem [### CreamAPI update checks ###]
:updatecheck1
echo.
echo ! [43;30m Checking... [0m
echo.
echo N | comp /n=1024 steam_api64.dll Backup\CreamAPI\v4.5.0.0\steam_api64.dll >nul
cls
if errorlevel 1 goto updatecheck2
if errorlevel 0 goto updater
:updatecheck2
echo.
echo ! [43;30m Checking... [0m
echo.
echo N | comp /n=1024 steam_api64.dll Backup\CreamAPI\v5.1.0.0\steam_api64.dll >nul
cls
if errorlevel 1 goto updatecheck3
if errorlevel 0 goto updater
:updatecheck3
echo.
echo ! [43;30m Checking... [0m
echo.
echo N | comp /n=1024 steam_api64.dll Backup\CreamAPI\v5.2.0.0\steam_api64.dll >nul
cls
if errorlevel 1 goto next
if errorlevel 0 goto updater
rem [### Restart point ###]
:restart
rem [### Plugin Launcher presence check ###]
:next
echo.
echo ! [43;30m Checking... [0m
echo.
if exist SpaceEngineersLauncher.exe goto pluginlauncherpresent
rem [### CreamAPI presence check ###]
echo N | comp /n=1024 steam_api64.dll Backup\CreamAPI\steam_api64.dll >nul
cls
if errorlevel 1 goto choice_nocreamapi
if errorlevel 0 goto choice
rem [### Choice zone ###]
:choice
cls
echo.
echo ## [107;30m Space Engineers DLC Unlocker v1.6.1 - CreamAPI - by Lamer87 [0m [102m [107m [101m [0m
echo.
echo.
echo # [92m No game update found[0m. [102;30m CreamAPI is ok! [0m
echo.
echo.
echo - Press "[106;30m R [0m" to remove [1mCreamAPI[0m.
echo.
echo - Press "[44;97m A [0m" or close this window at any time to abort.
echo.
echo.
choice /c:RA
if errorlevel ==2 goto abort
if errorlevel ==1 goto remover
echo.
echo.
pause
exit
:choice_nocreamapi
cls
echo.
echo ## [107;30m Space Engineers DLC Unlocker v1.6.1 - CreamAPI - by Lamer87 [0m [102m [107m [101m [0m
echo.
echo.
echo # [91m Game update found or CreamAPI not installed[0m, do you want to:
echo.
echo [92m make a new backup of original file and install/restore CreamAPI[0m?
echo.
echo.
echo - Press "[102;30m C [0m" to install, or press "[106;30m R [0m" to remove [1mCreamAPI[0m.
echo.
echo - Press "[44;97m A [0m" or close this window at any time to abort.
echo.
echo.
choice /c:CRA
if errorlevel ==3 goto abort
if errorlevel ==2 goto remover_nocreamapi
if errorlevel ==1 goto installer_continue
:installer_continue
echo.
echo ! [43;30m Installing... [0m
echo.
copy /y steam_api64.dll Backup\Original\ >nul
del /q /f steam_api64_o.dll >nul 2>nul
ren steam_api64.dll steam_api64_o.dll
copy /y Backup\CreamAPI\steam_api64.dll steam_api64.dll
echo.
echo # [92m CreamAPI installed/restored[0m.
echo.
echo # [92m New backup of original file created in "[33m...\Bin64\Backup\Original[0m[92m"[0m.
echo.
echo # [102;30m You can play. [0m - [92m Press any key to exit[0m.
echo.
echo.
pause
exit
rem [### Uninstallation zone ###]
:remover
echo.
echo - Press "[106;30m R [0m" to just Restore the backup, disabling [1mCreamAPI[0m but keeping files.
echo.
echo - Press "[101;30m E [0m" to completely ERASE [1mCreamAPI[0m and restore the backup. Don't keep CreamAPI files.
echo.
echo - Press "[107;30m X [0m" to restart the Tool or "[44;97m A [0m" to abort.
echo.
echo.
choice /c:REXA
if errorlevel ==4 goto abort
if errorlevel ==3 goto restart
if errorlevel ==2 goto remover_continue
if errorlevel ==1 goto remover_keep
:remover_continue
echo.
echo ! [43;30m Erasing... [0m
echo.
del /q /f steam_api64.dll
ren steam_api64_o.dll steam_api64.dll >nul 2>nul
copy /y Backup\Original\steam_api64.dll steam_api64.dll 2>nul
del /q /f cream_api.ini
rmdir /q /s Backup
echo.
echo # [92m CreamAPI files erased, original file restored[0m.
echo.
echo.
echo - [102;30m Press any key to delete this file too and exit[0m.
echo.
echo.
pause
del /q /f CreamAPI_Tool.cmd
exit
:remover_keep
echo.
echo ! [43;30m Restoring original file... [0m
echo.
del /q /f steam_api64.dll
ren steam_api64_o.dll steam_api64.dll >nul 2>nul
copy /y Backup\Original\steam_api64.dll steam_api64.dll 2>nul
echo.
echo # [92m Original file restored[0m.
echo.
echo.
echo - [102;30m Press any key to exit[0m.
echo.
echo.
pause
exit
:remover_nocreamapi
echo.
echo - Press "[101;30m E [0m" to completely ERASE [1mCreamAPI[0m. Don't keep CreamAPI files.
echo.
echo - Press "[107;30m X [0m" to restart the Tool or "[44;97m A [0m" to abort.
echo.
echo.
choice /c:EXA
if errorlevel ==3 goto abort
if errorlevel ==2 goto restart
if errorlevel ==1 goto remover_nocreamapi_continue
:remover_nocreamapi_continue
echo.
echo ! [43;30m Erasing... [0m
echo.
del /q /f steam_api64_o.dll >nul 2>nul
del /q /f cream_api.ini
rmdir /q /s Backup
echo.
echo # [92m CreamAPI files removed [0m.
echo.
echo.
echo - [102;30m Press any key to delete this file too and exit[0m.
echo.
echo.
pause
del /q /f CreamAPI_Tool.cmd
exit
rem [### Update zone ###]
:updater
cls
echo.
echo ## [107;30m Space Engineers DLC Unlocker v1.6.1 - CreamAPI - by Lamer87 [0m [102m [107m [101m [0m
echo.
echo.
echo # [91m Old CreamAPI version found![0m What do you want to do?
echo.
echo.
echo - Press "[43;30m U [0m" to [92mupdate CreamAPI[0m to the latest version.
echo.
echo - Press "[106;30m R [0m" to just restore the original file.
echo.
echo - Press "[101;30m E [0m" to completely ERASE [1mCreamAPI[0m.
echo.
echo - Press "[105;97m M [0m" if you want to ERASE all Plugin Launcher files (if installed).
echo.
echo - Press "[44;97m A [0m" or close this window at any time to abort, keeping old CreamAPI files.
echo.
echo.
choice /c:UREMA
if errorlevel ==5 goto abort
if errorlevel ==4 goto PL_erase
if errorlevel ==3 goto remover_continue
if errorlevel ==2 goto remover_keep
if errorlevel ==1 goto updater_continue
:updater_continue
echo.
echo ! [43;30m Updating... [0m
echo.
del /q /f steam_api64.dll >nul 2>nul
copy /y Backup\CreamAPI\steam_api64.dll steam_api64.dll
echo.
echo # [92m CreamAPI updated![0m
echo.
echo # [102;30m You can play. [0m - [92m Press any key to exit[0m.
echo.
echo.
pause
exit
rem [### Plugin Launcher ### Choice zone ###]
:pluginlauncherpresent
echo N | comp /n=1024 steam_api64.dll Backup\CreamAPI\steam_api64.dll >nul
cls
if errorlevel 1 goto PL_choice_nocreamapi
if errorlevel 0 goto PL_choice
:PL_choice
cls
echo.
echo ## [107;30m Space Engineers DLC Unlocker v1.6.1 - CreamAPI - by Lamer87 [0m [102m [107m [101m [0m
echo.
echo.
echo # [102;30mPlugin Launcher[0m [92mpresent. Now works with latest CreamAPI. [0m
echo.
echo # [92m No game update found[0m. [102;30m CreamAPI is ok! [0m
echo.
echo.
echo - Press "[106;30m R [0m" to remove [1mCreamAPI[0m.
echo.
echo - Press "[105;97m M [0m" if you want to ERASE all Plugin Launcher files (keeping CreamAPI).
echo.
echo - Press "[44;97m A [0m" or close this window at any time to abort, keeping CreamAPI files.
echo.
echo.
echo # [33m If you have bugs/crashes using Plugin Launcher, please consider testing the BASE game [0m
echo # [33m WITHOUT Plugin Launcher, using JUST creamapi, before opening an issue on my github page...[92m ;)[0m
echo.
echo.
choice /c:RMA
if errorlevel ==3 goto abort
if errorlevel ==2 goto PL_erase
if errorlevel ==1 goto remover
:PL_choice_nocreamapi
cls
echo.
echo ## [107;30m Space Engineers DLC Unlocker v1.6.1 - CreamAPI - by Lamer87 [0m [102m [107m [101m [0m
echo.
echo.
echo # [102;30mPlugin Launcher[0m [92mpresent. Now works with latest CreamAPI. [0m
echo.
echo # [91m Game update found or CreamAPI not installed[0m, do you want to:
echo.
echo [92m make a new backup of original file and install/restore CreamAPI[0m?
echo.
echo.
echo - Press "[102;30m C [0m" to install, or "[106;30m R [0m" to remove [1mCreamAPI[0m.
echo.
echo - Press "[105;97m M [0m" if you want to ERASE all Plugin Launcher files (keeping CreamAPI).
echo.
echo - Press "[44;97m A [0m" or close this window at any time to abort, keeping CreamAPI files.
echo.
echo.
echo # [33m If you have bugs/crashes using Plugin Launcher, please consider testing the BASE game [0m
echo # [33m WITHOUT Plugin Launcher, using JUST creamapi, before opening an issue on my github page...[92m ;)[0m
echo.
echo.
choice /c:CRMA
if errorlevel ==4 goto abort
if errorlevel ==3 goto PL_erase
if errorlevel ==2 goto remover
if errorlevel ==1 goto installer_continue
rem [### Plugin Launcher ### ERASE zone ###]
:PL_erase
echo.
echo # [91m Are you sure you want to delete all Plugin Launcher files ???[0m
echo.
echo # [33m To also/only delete CreamAPI files, please restart the tool and press "R".[0m
echo.
echo.
echo - Press "[105;97m M [0m" if you want to ERASE all Plugin Launcher files.
echo.
echo - Press "[107;30m X [0m" to restart the Tool or "[44;97m A [0m" to abort.
echo.
echo.
choice /c:MAX
if errorlevel ==3 goto restart
if errorlevel ==2 goto abort
if errorlevel ==1 goto PL_erase_continue
:PL_erase_continue
echo.
echo ! [43;30m Removing Plugin Launcher... [0m
echo.
rmdir /q /s Plugins 2>nul
del /q /f 0Harmony.dll 2>nul
del /q /f Newtonsoft.Json.dll 2>nul
del /q /f NuGet.Common.dll 2>nul
del /q /f NuGet.Configuration.dll 2>nul
del /q /f NuGet.Frameworks.dll 2>nul
del /q /f NuGet.Packaging.dll 2>nul
del /q /f NuGet.Protocol.dll 2>nul
del /q /f NuGet.Resolver.dll 2>nul
del /q /f NuGet.Versioning.dll 2>nul
del /q /f PluginLoader.dll 2>nul
del /q /f steam_appid.txt 2>nul
del /q /f SpaceEngineersLauncher.exe 2>nul
del /q /f SpaceEngineersLauncher.exe.config 2>nul
echo.
echo # [92m Plugin Launcher files removed [0m.
echo.
echo # [33m Restart the tool if you want to remove (or update) CreamAPI files.[0m
echo.
echo.
echo - Press "[107;30m X [0m" to restart the Tool or "[44;97m A [0m" to quit.
echo.
echo.
choice /c:AX
if errorlevel ==2 goto restart
if errorlevel ==1 goto quit
rem [### Abort and Errors zone ###]
:quit
exit
:abort
echo.
echo.
echo # [92m Aborted, exiting[0m.
echo.
timeout /t 2 /nobreak >nul
exit
:dir_wrong
echo.
echo # [91m Something went wrong! [0m
echo.
echo # [91m Please make sure to place files in the RIGHT folder. [0m
echo.
echo # [92m It must be: ...\SpaceEngineers\[102;30mBin64\[0m [92m!!! [0m
echo.
echo # [91m You are in the wrong folder here: [0m
echo.
echo # %~dp0
echo.
echo.
echo # [33m If the folder is correct, please check game files from Steam and then try again. [0m
echo.
echo.
echo - [92m Press any key to remove the extracted files and exit[0m.
echo.
echo.
pause
rmdir /q /s Backup >nul 2>nul
del /q /f cream_api.ini >nul 2>nul
del /q /f CreamAPI_Tool.cmd >nul
exit
:ini_not_found
echo.
echo # [91m Something went wrong! Missing file "creamapi.ini" [0m
echo.
echo # [91m Please extract ALL files AND the "Backup" folder from the zip archive again. [0m
echo.
echo.
echo - [92m Press any key to remove the extracted files and exit[0m.
echo.
echo.
pause
rmdir /q /s Backup >nul 2>nul
del /q /f CreamAPI_Tool.cmd >nul
exit
:dll_not_found
echo.
echo # [91m Something went wrong! [0m
echo.
echo # [91m Missing files in "Backup\CreamAPI": [0m
echo.
echo # [91m there must be the file "steam_api64.dll" and others with same name in subfolders. [0m
echo.
echo # [91m Please extract ALL files AND the "Backup" folder from the zip archive again. [0m
echo.
echo.
echo # [33m If you did everything correctly, your antivirus has blocked CreamAPI files. [0m
echo # [33m Please create an exception in your anitivirus for all the files in "Backup\CreamAPI". [0m
echo.
echo # [33m Some antiviruses delete the files from inside the zip, so it may be necessary to: [0m
echo # [33m disable the antivirus, re-download the archive, extract it to Bin64 folder [0m
echo # [33m and then create an exception of "Backup\CreamAPI\steam_api64.dll" (and same in subfolders), [0m
echo # [33m before re-enabling the antivirus. [0m
echo.
echo.
echo - [92m Press any key to remove the extracted files and exit[0m.
echo.
echo.
pause
rmdir /q /s Backup >nul 2>nul
del /q /f cream_api.ini >nul 2>nul
del /q /f CreamAPI_Tool.cmd >nul
exit