source: oni2aslpt/o2aslpt.bat@ 1158

Last change on this file since 1158 was 1140, checked in by iritscen, 4 years ago

Updated o2aslpt.bat, as apparently the output of the MD5 tool changed at some point. Adjusted read-me formatting to be Windows-friendly.

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1@echo off
2
3set MD5_VANILLA="7d96ffd6da21cc3f419e42f7227642fd"
4set MD5_FIRST63="50374bed7f84c51bdcdcefd6300ddb84"
5set MD5_LAST32="c5e46781d21cd4414e92d91502512500"
6
7echo Welcome to the Oni 2 (Angel Studios) Layout Patch Tool.
8
9if "%~1" == "" (
10 echo You need to pass me the path to your ISO of Oni 2. Exiting.
11 exit /b
12)
13
14if not exist "%~1" (
15 echo Hmm, there doesn't seem to be any file at the path you passed me. Exiting.
16 exit /b
17)
18
19echo Verifying checksum...
20
21setlocal enableDelayedExpansion
22set count=1
23for /f "tokens=* USEBACKQ" %%L in (`CertUtil -hashfile %~1 MD5`) do (
24 if !count! == 2 set MD5_INPUT=%%L
25 set /a count=!count!+1
26)
27
28if not "!MD5_INPUT!" == !MD5_VANILLA! (
29 if "!MD5_INPUT!" == !MD5_FIRST! (
30 echo This version is already patched to enabled the first 63 layouts! You should see them in the Load Game menu.
31 ) else if "!MD5_INPUT!" == !MD5_LAST32! (
32 echo This version is already patched to enabled the last 32 layouts! You should see them in the Load Game menu.
33 ) else (
34 echo Unknown checksum! Sorry, this ISO isn't what I expected.
35 )
36
37 echo Exiting
38 exit /b
39)
40
41echo You have supplied an unmodified ISO of Oni 2. Do you wish to create a patched
42echo copy that enables the first 63 layouts or the last 32? Enter a number from
43echo this menu:
44echo ^(1^) First 63.
45echo ^(2^) Last 32.
46echo ^(anything else^) I changed my mind, please exit.
47set /p the_answer=
48if !the_answer! == 1 (
49 echo Creating patched version...
50 xdelta3win.exe -ds "%~1" patchFromVanTo63.xd3 oni2dev_ps2_first63layouts.iso
51 echo Verifying checksum....
52 set count=1
53 for /f "tokens=* USEBACKQ" %%L in (`CertUtil -hashfile oni2dev_ps2_first63layouts.iso MD5`) do (
54 if !count! == 2 set MD5_OUTPUT=%%L
55 set /a count=!count!+1
56 )
57 if not "!MD5_OUTPUT!" == !MD5_FIRST63! (
58 echo Uh-oh, something went wrong^! Patch failed. Exiting.
59 exit /b
60 )
61) else if !the_answer! == 2 (
62 echo Creating patched version...
63 xdelta3win.exe -ds "%~1" patchFromVanTo32.xd3 oni2dev_ps2_last32layouts.iso
64 echo Verifying checksum....
65 set count=1
66 for /f "tokens=* USEBACKQ" %%L in (`CertUtil -hashfile oni2dev_ps2_last32layouts.iso MD5`) do (
67 if !count! == 2 set MD5_OUTPUT=%%L
68 set /a count=!count!+1
69 )
70 if not "!MD5_OUTPUT!" == !MD5_LAST32! (
71 echo Uh-oh, something went wrong^~ Patch failed. Exiting.
72 exit /b
73 )
74)
75
76echo Goodbye.
77endlocal
Note: See TracBrowser for help on using the repository browser.