Skip to content
This repository was archived by the owner on Dec 10, 2018. It is now read-only.

Commit 20fd0d4

Browse files
committed
Fix 2
1 parent 702799e commit 20fd0d4

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

decrypt.bat

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -282,17 +282,17 @@ for /f "delims=*" %%f in ('cscript //nologo %temp%\getfiles.vbs "%ESD%"') do (
282282
)
283283
del>nul %temp%\getfiles.vbs
284284

285-
if not "!MODE!"=="WIM" if not "!MODE!"=="ESD" call :Exception MODE
285+
if not "!MODE!"=="WIM" if not "!MODE!"=="ESD" set "Exception=MODE" && goto :Exception
286286
for /f "tokens=2 delims==" %%f in ('set ESD[') do (
287-
if not exist "!ESD!" call :Exception ESD_Not_Found
287+
if not exist "!ESD!" set "Exception=ESD_Not_Found" && goto :Exception
288288
)
289289
if not exist "!Output!" mkdir "!Output!"
290-
if not exist "!Output!" call :Exception Output_Not_Valid
290+
if not exist "!Output!" set "Exception=Output_Not_Valid" && goto :Exception
291291

292292
set "wimlib=%~dps0bin\wimlib-imagex.exe"
293293
if %PROCESSOR_ARCHITECTURE%==AMD64 set "wimlib=%~dps0bin\bin64\wimlib-imagex.exe"
294294
if not exist "!wimlib!" (
295-
call :Exception WIMLIB_Notfound
295+
set "Exception=WIMLIB_Notfound" && goto :Exception
296296
)
297297

298298
for /f "tokens=2 delims==" %%f in ('set ESD[') do (
@@ -303,7 +303,7 @@ for /f "tokens=2 delims==" %%f in ('set ESD[') do (
303303
Echo [Info] Checking the current state of the provided ESD File...
304304
"!wimlib!" info "%%f" 4 1>nul 2>nul
305305
IF !ERRORLEVEL! EQU 74 call :DecryptManager "%%f" "!Backup!" "!Key!"
306-
IF !ERRORLEVEL! NEQ 0 call :Exception ESD_Damaged
306+
IF !ERRORLEVEL! NEQ 0 set "Exception=ESD_Damaged" && goto :Exception
307307
call :IsValid "%%f"
308308
)
309309
Echo [Info] Getting Informations from the provided ESD File...
@@ -319,27 +319,27 @@ IF EXIST ISOFOLDER\ rmdir /s /q ISOFOLDER\
319319
mkdir ISOFOLDER
320320
echo.
321321
"!wimlib!" apply "!ESD[1]!" 1 ISOFOLDER\
322-
IF NOT ERRORLEVEL 0 call :Exception Apply
322+
IF NOT ERRORLEVEL 0 set "Exception=Apply" && goto :Exception
323323
Echo.
324324
del ISOFOLDER\MediaMeta.xml 1>nul 2>nul
325325
call :progress 40
326326
echo [Info] Creating boot.wim file...
327327
Echo.
328328
"!wimlib!" export "!ESD[1]!" 2 ISOFOLDER\sources\boot.wim --compress=maximum
329-
IF NOT ERRORLEVEL 0 call :Exception Export
329+
IF NOT ERRORLEVEL 0 set "Exception=Export" && goto :Exception
330330
Echo.
331331
call :progress 50
332332
echo.
333333
"!wimlib!" export "!ESD[1]!" 3 ISOFOLDER\sources\boot.wim --boot
334-
IF NOT ERRORLEVEL 0 call :Exception Export
334+
IF NOT ERRORLEVEL 0 set "Exception=Export" && goto :Exception
335335
echo.
336336
call :progress 60
337337
if "!MODE!"=="WIM" (
338338
echo [Info] Creating install.wim file...
339339
for /f "tokens=2 delims==" %%f in ('set ESD[') do (
340340
Echo.
341341
"!wimlib!" export "%%f" 4 ISOFOLDER\sources\install.wim --compress=maximum
342-
IF NOT ERRORLEVEL 0 call :Exception Export
342+
IF NOT ERRORLEVEL 0 set "Exception=Export" && goto :Exception
343343
Echo.
344344
)
345345
)
@@ -348,7 +348,7 @@ if "!MODE!"=="ESD" (
348348
Echo.
349349
for /f "tokens=2 delims==" %%f in ('set ESD[') do (
350350
"!wimlib!" export "%%f" 4 ISOFOLDER\sources\install.esd
351-
IF NOT ERRORLEVEL 0 call :Exception Export
351+
IF NOT ERRORLEVEL 0 set "Exception=Export" && goto :Exception
352352
Echo.
353353
)
354354
)
@@ -373,7 +373,7 @@ set yyyy=%date:~0,4%
373373
set time=%date:~11,5%
374374
reg copy "HKCU\Control Panel\International-Temp" "HKCU\Control Panel\International" /f >nul
375375
bin\cdimage.exe -bootdata:2#p0,e,b"ISOFOLDER\boot\etfsboot.com"#pEF,e,b"ISOFOLDER\efi\Microsoft\boot\efisys.bin" -o -h -m -u2 -udfver102 -t%mm%/%dd%/%yyyy%,%time%:00 -l%DVDLABEL% ISOFOLDER %Output%\%DVDISO%
376-
IF NOT ERRORLEVEL 0 call :Exception ISO
376+
IF NOT ERRORLEVEL 0 set "Exception=ISO" && goto :Exception
377377
call :progress 90
378378
rmdir /s /q ISOFOLDER\
379379
if "!Backup!"=="YES" (
@@ -407,7 +407,7 @@ if "!Backup_!"=="YES" (
407407
echo [Info] Running Decryption program...
408408
bin\esddecrypt.exe "!ESD_!" 2>"%temp%\esddecrypt.log"&&exit /b
409409
bin\esddecrypt.exe "!ESD_!" "!Key_!" &&exit /b
410-
call :Exception ESD_Decrypt
410+
set "Exception=ESD_Decrypt" && goto :Exception
411411
exit /b
412412

413413
:IsValid <ESD>
@@ -421,7 +421,7 @@ for /f "delims=" %%f in ('!wimlib! info "!ESD_!" --header') do (
421421
set param=!value: =!
422422
set "!param!=!var!"
423423
)
424-
if not "!ImageCount!"=="4" call :Exception ESD_Damaged
424+
if not "!ImageCount!"=="4" set "Exception=ESD_Damaged" && goto :Exception
425425
exit /b
426426

427427
:GETESDINFO <ESD>
@@ -714,32 +714,32 @@ exit /b
714714

715715
:Exception <Exception>
716716
Echo.
717-
Echo ESD-Decrypter has stopped working with an Exception.
717+
Echo :^( ESD-Decrypter has stopped working with an Exception.
718718
Echo.
719-
if %~1==MODE (
719+
if %Exception%==MODE (
720720
Echo The specified Operation Mode is invalid.
721721
Echo Please correct this error with the help of the help documentation by running :
722722
Echo.
723723
Echo %~nx0 /help
724724
)
725-
if %~1==ESD_Not_Found (
725+
if %Exception%==ESD_Not_Found (
726726
Echo The specified ESD File has not been found on your system.
727727
Echo Please correct this error.
728728
)
729-
if %~1==Output_Not_Valid (
729+
if %Exception%==Output_Not_Valid (
730730
Echo The specified Output Directory is invalid.
731731
Echo Please correct your path to be a valid Windows Batch Path.
732732
)
733-
if %~1==ESD_Decrypt (
733+
if %Exception%==ESD_Decrypt (
734734
Echo The following Errors were reported during ESD decryption :
735735
Echo.
736736
type "%temp%\esddecrypt.log"
737737
)
738-
if %~1==ESD_Damaged Echo The specified ESD File is damaged or not a Valid ESD File.
739-
if %~1==WIMLIB_Notfound Echo %PROCESSOR_ARCHITECTURE% wimlib-imagex.exe not found
740-
if %~1==Apply Echo Critical Errors were found after apply.
741-
if %~1==Export Echo Critical Errors were found after export.
742-
if %~1==ISO Echo Critical Errors were found during ISO creation.
738+
if %Exception%==ESD_Damaged Echo The specified ESD File is damaged or not a Valid ESD File.
739+
if %Exception%==WIMLIB_Notfound Echo %PROCESSOR_ARCHITECTURE% wimlib-imagex.exe not found
740+
if %Exception%==Apply Echo Critical Errors were found after apply.
741+
if %Exception%==Export Echo Critical Errors were found after export.
742+
if %Exception%==ISO Echo Critical Errors were found during ISO creation.
743743
Echo.
744744
goto exit
745745

0 commit comments

Comments
 (0)