Advertisement
Guest User

Restoration Patch Batch Script

a guest
Jul 16th, 2013
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. @echo off
  2. :: BatchGotAdmin
  3. :-------------------------------------
  4. :AdminCheck
  5. REM --> Check for permissions
  6. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  7.  
  8. REM --> If error flag set, we do not have admin.
  9. if '%errorlevel%' NEQ '0' (
  10. echo Requesting administrative privileges...
  11. goto UACPrompt
  12. ) else ( goto gotAdmin )
  13.  
  14. :UACPrompt
  15. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  16. echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
  17.  
  18. "%temp%\getadmin.vbs"
  19. exit /B
  20.  
  21. :gotAdmin
  22. if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
  23. pushd "%CD%"
  24. CD /D "%~dp0"
  25. :--------------------------------------
  26.  
  27. IF "%CD%"=="C:\Windows\system32" (
  28. goto admin abort
  29. ) ELSE (
  30. goto Locale Check
  31. )
  32.  
  33. :Locale Check
  34. echo %CD%
  35. systeminfo | find "System Locale" > locale
  36. set /p locale= < locale
  37. del locale
  38. IF "%locale%"=="System Locale: ja;Japanese" (
  39. goto ARCH Check
  40. ) ELSE (
  41. goto locale abort
  42. )
  43.  
  44.  
  45. :ARCH Check
  46. set extension=bkp
  47. set AMD64=%ProgramFiles(x86)%\MoeNovel\IF MY HEART HAD WINGS\
  48. set x86=%ProgramFiles%\MoeNovel\IF MY HEART HAD WINGS\
  49. IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
  50. goto 64-bit Re-Install Check
  51. ) ELSE (
  52. goto 32-bit Re-Install Check
  53. )
  54.  
  55. :64-bit Re-Install Check
  56. IF EXIST "%AMD64%"*."%extension%" (
  57. goto Re-Install Abort
  58. ) ELSE (
  59. echo "Running 64-bit Install"
  60. xcopy .\* "%AMD64%"
  61. cd "%AMD64%"
  62. goto Install
  63. )
  64.  
  65. :32-bit Re-Install Check
  66. IF EXIST "%x86%"*."%extension%" (
  67. goto Re-Install Abort
  68. ) ELSE (
  69. echo "Running 32-bit Install"
  70. xcopy .\* "%x86%"
  71. cd "%x86%"
  72. goto Install
  73. )
  74.  
  75. :Install
  76. @echo on
  77. xdelta3.exe -d -s CHIP4.arc Chip4.arc.diff chip4.arc.new
  78. ren CHIP4.arc CHIP4.arc.bkp
  79. ren chip4.arc.new CHIP4.arc
  80. xdelta3.exe -d -s Chip1.arc chip1.arc.diff chip1.arc.new
  81. ren Chip1.arc Chip1.arc.bkp
  82. ren chip1.arc.new Chip1.arc
  83. xdelta3.exe -d -s CHIP2.arc chip2.arc.diff chip2.arc.new
  84. ren CHIP2.arc CHIP2.arc.bkp
  85. ren chip2.arc.new CHIP2.arc
  86. xdelta3.exe -d -s CHIP3.arc Chip3.arc.diff chip3.arc.new
  87. ren CHIP3.arc CHIP3.arc.bkp
  88. ren chip3.arc.new CHIP3.arc
  89. xdelta3.exe -d -s CHIP5.arc Chip5.arc.diff chip5.arc.new
  90. ren CHIP5.arc CHIP5.arc.bkp
  91. ren chip5.arc.new CHIP5.arc
  92. xdelta3.exe -d -s CHIP6.arc Chip6.arc.diff chip6.arc.new
  93. ren CHIP6.arc CHIP6.arc.bkp
  94. ren chip6.arc.new CHIP6.arc
  95. xdelta3.exe -d -s Graphic.arc graphic.arc.diff graphic.arc.new
  96. ren Graphic.arc Graphic.arc.bkp
  97. ren graphic.arc.new Graphic.arc
  98. xdelta3.exe -d -s Voice.arc voice.arc.diff voice.arc.new
  99. ren Voice.arc Voice.arc.bkp
  100. ren voice.arc.new Voice.arc
  101. ren Rio.arc Rio.arc.bkp
  102. ren Rio.arc.new Rio.arc
  103. %pause
  104. exit
  105.  
  106. :Re-Install Abort
  107. msg * You have already installed the Restoration Patch
  108. exit
  109.  
  110. :locale abort
  111. msg * Set locale to Japanese.
  112. exit
  113.  
  114. :admin abort
  115. msg * Running in System32 Directory Aborting
  116. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement