Advertisement
Guest User

Kono Sora Improved Batch Script

a guest
Jul 17th, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. @echo off
  2.  
  3. :: BatchGotAdmin
  4. :-------------------------------------
  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 Aborting
  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 Checking Locale please wait
  35. systeminfo | find "System Locale" > locale
  36. set /p locale= < locale
  37. del locale
  38. echo System Locale set to "%locale%"
  39. IF "%locale%"=="System Locale: ja;Japanese" (
  40. goto ARCH Check
  41. ) ELSE (
  42. goto locale abort
  43. )
  44.  
  45. :ARCH Check
  46. set extension=bkp
  47. IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
  48. goto 64-bit Install Path
  49. ) ELSE (
  50. goto 32-bit Install Path
  51. )
  52.  
  53. :64-bit Install Path
  54. cls
  55. echo CaSe SeNsItIvE
  56. echo Default Installation Path is "C:\Program Files (x86)\MoeNovel\IF MY HEART HAD WINGS\"
  57. set /p selection="Is IF MY HEART HAD WINGS installed in the default location(Y/N): "
  58. IF "%selection%"=="Y" (
  59. set "install=C:\Program Files (x86)\MoeNovel\IF MY HEART HAD WINGS\"
  60. goto 64-bit Confirm
  61. ) ELSE IF "%selection%"=="N" (
  62. cls
  63. set /p install="Please Input Install Path: "
  64. goto 64-bit Confirm
  65. ) ELSE (
  66. goto ARCH Check
  67. )
  68.  
  69.  
  70. :64-bit Confirm
  71. cls
  72. echo CaSe SeNsItIvE
  73. set /p confirm="Is this the correct install path "%install%" (Y/N): "
  74. echo "%confirm%"
  75. IF "%confirm%"=="Y" (
  76. goto 64-bit Re-Install Check
  77. ) ELSE IF "%confirm%"=="N" (
  78. goto 64-bit Install Path
  79. ) ELSE (
  80. goto 64-bit Confirm Retry
  81. )
  82.  
  83. :64-bit Re-Install Check
  84. IF EXIST "%install%"*."%extension%" (
  85. goto Re-Install Abort
  86. ) ELSE (
  87. echo "Running 64-bit Install"
  88. xcopy .\* "%install%"
  89. cd "%install%"
  90. goto Install
  91. )
  92.  
  93. :32-bit Install Path
  94. cls
  95. echo CaSe SeNsItIvE
  96. echo Default Installation Path is "C:\Program Files\MoeNovel\IF MY HEART HAD WINGS\"
  97. set /p selection="Is IF MY HEART HAD WINGS installed in the default location(Y/N): "
  98. IF "%selection%"=="Y" (
  99. set "install=C:\Program Files\MoeNovel\IF MY HEART HAD WINGS\"
  100. goto 32-bit Confirm
  101. ) ELSE IF "%selection%"=="N" (
  102. cls
  103. set /p install="Please Input Install Path: "
  104. goto 32-bit Confirm
  105. ) ELSE (
  106. goto ARCH Check
  107. )
  108.  
  109. :32-bit Confirm
  110. cls
  111. echo CaSe SeNsItIvE
  112. set /p confirm="Is this the correct install path "%install%" (Y/N): "
  113. echo "%confirm%"
  114. IF "%confirm%"=="Y" (
  115. goto 32-bit Re-Install Check
  116. ) ELSE IF "%confirm%"=="N" (
  117. goto 32-bit Install Path
  118. ) ELSE (
  119. goto 32-bit Install Path
  120. )
  121.  
  122. :32-bit Re-Install Check
  123. IF EXIST "%install%"*."%extension%" (
  124. goto Re-Install Abort
  125. ) ELSE (
  126. echo "Running 64-bit Install"
  127. xcopy .\* "%install%"
  128. cd "%install%"
  129. goto Install
  130. )
  131.  
  132. :Install
  133. @echo on
  134. xdelta3.exe -d -s CHIP4.arc Chip4.arc.diff chip4.arc.new
  135. ren CHIP4.arc CHIP4.arc.bkp
  136. ren chip4.arc.new CHIP4.arc
  137. xdelta3.exe -d -s Chip1.arc chip1.arc.diff chip1.arc.new
  138. ren Chip1.arc Chip1.arc.bkp
  139. ren chip1.arc.new Chip1.arc
  140. xdelta3.exe -d -s CHIP2.arc chip2.arc.diff chip2.arc.new
  141. ren CHIP2.arc CHIP2.arc.bkp
  142. ren chip2.arc.new CHIP2.arc
  143. xdelta3.exe -d -s CHIP3.arc Chip3.arc.diff chip3.arc.new
  144. ren CHIP3.arc CHIP3.arc.bkp
  145. ren chip3.arc.new CHIP3.arc
  146. xdelta3.exe -d -s CHIP5.arc Chip5.arc.diff chip5.arc.new
  147. ren CHIP5.arc CHIP5.arc.bkp
  148. ren chip5.arc.new CHIP5.arc
  149. xdelta3.exe -d -s CHIP6.arc Chip6.arc.diff chip6.arc.new
  150. ren CHIP6.arc CHIP6.arc.bkp
  151. ren chip6.arc.new CHIP6.arc
  152.  
  153. xdelta3.exe -d -s Graphic.arc graphic.arc.diff graphic.arc.new
  154. ren Graphic.arc Graphic.arc.bkp
  155. ren graphic.arc.new Graphic.arc
  156. xdelta3.exe -d -s Voice.arc voice.arc.diff voice.arc.new
  157. ren Voice.arc Voice.arc.bkp
  158. ren voice.arc.new Voice.arc
  159. ren Rio.arc Rio.arc.bkp
  160. ren Rio.arc.new Rio.arc
  161. %pause
  162. exit
  163.  
  164. :Re-Install Abort
  165. msg * You have already installed the Restoration Patch
  166. exit
  167.  
  168. :locale abort
  169. msg * Set locale to Japanese.
  170. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement