patch.cmd 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. @echo off
  2. rem ================================================================================
  3. for %%a in ("%~dp0\.") do set "SnPatchVersion=%%~nxa"
  4. rem ================================================================================
  5. rem ‚�ˆŒ€�ˆ…!!! ’¥ªáâ á®®¡é¥­¨© ¤«ï ¢ë¢®¤  ¢ ä ©« ᤥ« ­ ¢ ª®¤¨à®¢ª¥ CP1251!
  6. rem ================================================================================
  7. rem ‘®å࠭塞 ⥪ãéãî ª®¤®¢ãî áâà ­¨æã
  8. for /f "tokens=2 delims=:" %%i in ('chcp') do (set codepage_old=%%i)
  9. set codepage_old=%codepage_old:~1,9%
  10. rem ================================================================================
  11. rem �஢¥àª  ­  ­ «¨ç¨¥ ¯à ¢  ¤¬¨­¨áâà â®à 
  12. if '%1'=='ELEV' (shift /1 & goto Install)
  13. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  14. if %errorlevel% neq 0 (
  15. goto Elevate
  16. )
  17. :Install
  18. rem ================================================================================
  19. rem �ਠ­ «¨ç¨¨ ¯ à ¬¥âà  íâ® ¤®«¦¥­ ¡ëâì ª â «®£ ¤«ï «®£®¢ ãáâ ­®ª¨ ¯ âç 
  20. set log_dir=%~1
  21. if ^"%log_dir%^" neq "" (
  22. set fin=%log_dir:~-1%
  23. if "%fin%" neq "\" (set log_dir=%log_dir%\)
  24. )
  25. rem ================================================================================
  26. rem �®«ã祭¨¥ ¯ã⥩
  27. rem �ãâì ¤«ï á¥à¢¥à  ¡¥§®¯ á­®áâ¨
  28. reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v SecurityServerDir > nul 2> nul
  29. if "%log_dir%" neq "" (
  30. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïîëó÷èòü ïóòü óñòàíîâêè ïðîäóêòà"
  31. ) else (
  32. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯®«ãç¨âì ¯ãâì ãáâ ­®¢ª¨ ¯à®¤ãªâ "
  33. )
  34. FOR /F "usebackq tokens=2,* skip=2" %%L IN (
  35. `reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v SecurityServerDir`
  36. ) DO SET serverpath=%%M
  37. if %serverpath:~-1% EQU \ set serverpath=%serverpath:~0,-1%
  38. rem �ã⨠á¨á⥬­ëå ä ©«®¢
  39. set Sys32=%systemroot%\System32
  40. set SysWOW=%systemroot%\SysWOW64
  41. rem �ãâì ¤à ©¢¥à®¢
  42. rem set SysDrv=%systemroot%\System32\drivers
  43. rem ================================================================================
  44. rem Žá­®¢­ ï à ¡®â  ¯® ãáâ ­®¢ª¥ ¯ âç 
  45. rem Ž¯¥à æ¨ï ¢ § ¢¨á¨¬®á⨠®â à §à來®áâ¨
  46. if "%PROCESSOR_ARCHITECTURE%"=="x86" (
  47. call :PatchX86
  48. ) else (
  49. call :PatchX64
  50. )
  51. rem ================================================================================
  52. if "%log_dir%" neq "" (
  53. chcp 1251 >nul 2>&1
  54. echo Ïàò÷ óñòàíîâëåí óñïåøíî > "%log_dir%success.%computername%.%userdomain%.patch_%SnPatchVersion%.log"
  55. chcp %codepage_old% >nul 2>&1
  56. ) else (
  57. color 0A
  58. echo � âç ãáâ ­®¢«¥­ ãᯥ譮
  59. pause
  60. )
  61. exit /b
  62. rem ================================================================================
  63. :PatchX64
  64. rem ‡ ¬¥­  ä ©«  á á®åà ­¥­¨¥¬ áâ à®© ¢¥àᨨ
  65. Setlocal EnableDelayedExpansion
  66. call :GetVersion "%serverpath%\LacusActivities.dll"
  67. Setlocal DisableDelayedExpansion
  68. ren "%serverpath%\LacusActivities.dll" "LacusActivities.dll%file_old_version%"
  69. if "%log_dir%" neq "" (
  70. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë LacusActivities.dll"
  71. ) else (
  72. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« LacusActivities.dll"
  73. )
  74. copy "%~dp0Module\x64\LacusActivities.dll" "%serverpath%"
  75. if "%log_dir%" neq "" (
  76. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë LacusActivities.dll"
  77. ) else (
  78. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« LacusActivities.dll"
  79. )
  80. ren "%serverpath%\en-US\LacusActivities.dll.mui" "LacusActivities.dll.mui%file_old_version%"
  81. if "%log_dir%" neq "" (
  82. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë en-US\LacusActivities.dll.mui"
  83. ) else (
  84. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« en-US\LacusActivities.dll.mui"
  85. )
  86. copy "%~dp0Module\x64\en-US\LacusActivities.dll.mui" "%serverpath%\en-US"
  87. if "%log_dir%" neq "" (
  88. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë en-US\LacusActivities.dll.mui"
  89. ) else (
  90. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« en-US\LacusActivities.dll.mui"
  91. )
  92. ren "%serverpath%\ru-RU\LacusActivities.dll.mui" "LacusActivities.dll.mui%file_old_version%"
  93. if "%log_dir%" neq "" (
  94. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë ru-RU\LacusActivities.dll.mui"
  95. ) else (
  96. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« ru-RU\LacusActivities.dll.mui"
  97. )
  98. copy "%~dp0Module\x64\ru-RU\LacusActivities.dll.mui" "%serverpath%\ru-RU"
  99. if "%log_dir%" neq "" (
  100. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë ru-RU\LacusActivities.dll.mui"
  101. ) else (
  102. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« ru-RU\LacusActivities.dll.mui"
  103. )
  104. rem ‡ ¬¥­  ä ©«  á á®åà ­¥­¨¥¬ áâ à®© ¢¥àᨨ
  105. Setlocal EnableDelayedExpansion
  106. call :GetVersion "%serverpath%\LacusFramework.dll"
  107. Setlocal DisableDelayedExpansion
  108. ren "%serverpath%\LacusFramework.dll" "LacusFramework.dll%file_old_version%"
  109. if "%log_dir%" neq "" (
  110. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë LacusFramework.dll"
  111. ) else (
  112. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« LacusFramework.dll"
  113. )
  114. copy "%~dp0Module\x64\LacusFramework.dll" "%serverpath%"
  115. if "%log_dir%" neq "" (
  116. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë LacusFramework.dll"
  117. ) else (
  118. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« LacusFramework.dll"
  119. )
  120. ren "%serverpath%\en-US\LacusFramework.dll.mui" "LacusFramework.dll.mui%file_old_version%"
  121. if "%log_dir%" neq "" (
  122. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë en-US\LacusFramework.dll.mui"
  123. ) else (
  124. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« en-US\LacusFramework.dll.mui"
  125. )
  126. copy "%~dp0Module\x64\en-US\LacusFramework.dll.mui" "%serverpath%\en-US"
  127. if "%log_dir%" neq "" (
  128. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë en-US\LacusFramework.dll.mui"
  129. ) else (
  130. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« en-US\LacusFramework.dll.mui"
  131. )
  132. ren "%serverpath%\ru-RU\LacusFramework.dll.mui" "LacusFramework.dll.mui%file_old_version%"
  133. if "%log_dir%" neq "" (
  134. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë ru-RU\LacusFramework.dll.mui"
  135. ) else (
  136. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« ru-RU\LacusFramework.dll.mui"
  137. )
  138. copy "%~dp0Module\x64\ru-RU\LacusFramework.dll.mui" "%serverpath%\ru-RU"
  139. if "%log_dir%" neq "" (
  140. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë ru-RU\LacusFramework.dll.mui"
  141. ) else (
  142. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« ru-RU\LacusFramework.dll.mui"
  143. )
  144. rem ‡ ¬¥­  ä ©«  á á®åà ­¥­¨¥¬ áâ à®© ¢¥àᨨ
  145. Setlocal EnableDelayedExpansion
  146. call :GetVersion "%serverpath%\LacusRuntime.dll"
  147. Setlocal DisableDelayedExpansion
  148. ren "%serverpath%\LacusRuntime.dll" "LacusRuntime.dll%file_old_version%"
  149. if "%log_dir%" neq "" (
  150. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë LacusRuntime.dll"
  151. ) else (
  152. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« LacusRuntime.dll"
  153. )
  154. copy "%~dp0Module\x64\LacusRuntime.dll" "%serverpath%"
  155. if "%log_dir%" neq "" (
  156. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë LacusRuntime.dll"
  157. ) else (
  158. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« LacusRuntime.dll"
  159. )
  160. ren "%serverpath%\en-US\LacusRuntime.dll.mui" "LacusRuntime.dll.mui%file_old_version%"
  161. if "%log_dir%" neq "" (
  162. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë en-US\LacusRuntime.dll.mui"
  163. ) else (
  164. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« en-US\LacusRuntime.dll.mui"
  165. )
  166. copy "%~dp0Module\x64\en-US\LacusRuntime.dll.mui" "%serverpath%\en-US"
  167. if "%log_dir%" neq "" (
  168. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë en-US\LacusRuntime.dll.mui"
  169. ) else (
  170. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« en-US\LacusRuntime.dll.mui"
  171. )
  172. ren "%serverpath%\ru-RU\LacusRuntime.dll.mui" "LacusRuntime.dll.mui%file_old_version%"
  173. if "%log_dir%" neq "" (
  174. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë ru-RU\LacusRuntime.dll.mui"
  175. ) else (
  176. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« ru-RU\LacusRuntime.dll.mui"
  177. )
  178. copy "%~dp0Module\x64\ru-RU\LacusRuntime.dll.mui" "%serverpath%\ru-RU"
  179. if "%log_dir%" neq "" (
  180. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë ru-RU\LacusRuntime.dll.mui"
  181. ) else (
  182. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« ru-RU\LacusRuntime.dll.mui"
  183. )
  184. rem ‡ ¬¥­  ä ©«  á á®åà ­¥­¨¥¬ áâ à®© ¢¥àᨨ
  185. Setlocal EnableDelayedExpansion
  186. call :GetVersion "%serverpath%\LacusServices.dll"
  187. Setlocal DisableDelayedExpansion
  188. ren "%serverpath%\LacusServices.dll" "LacusServices.dll%file_old_version%"
  189. if "%log_dir%" neq "" (
  190. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë LacusServices.dll"
  191. ) else (
  192. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« LacusServices.dll"
  193. )
  194. copy "%~dp0Module\x64\LacusServices.dll" "%serverpath%"
  195. if "%log_dir%" neq "" (
  196. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë LacusServices.dll"
  197. ) else (
  198. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« LacusServices.dll"
  199. )
  200. ren "%serverpath%\en-US\LacusServices.dll.mui" "LacusServices.dll.mui%file_old_version%"
  201. if "%log_dir%" neq "" (
  202. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë en-US\LacusServices.dll.mui"
  203. ) else (
  204. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« en-US\LacusServices.dll.mui"
  205. )
  206. copy "%~dp0Module\x64\en-US\LacusServices.dll.mui" "%serverpath%\en-US"
  207. if "%log_dir%" neq "" (
  208. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë en-US\LacusServices.dll.mui"
  209. ) else (
  210. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« en-US\LacusServices.dll.mui"
  211. )
  212. ren "%serverpath%\ru-RU\LacusServices.dll.mui" "LacusServices.dll.mui%file_old_version%"
  213. if "%log_dir%" neq "" (
  214. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë ru-RU\LacusServices.dll.mui"
  215. ) else (
  216. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« ru-RU\LacusServices.dll.mui"
  217. )
  218. copy "%~dp0Module\x64\ru-RU\LacusServices.dll.mui" "%serverpath%\ru-RU"
  219. if "%log_dir%" neq "" (
  220. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë ru-RU\LacusServices.dll.mui"
  221. ) else (
  222. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« ru-RU\LacusServices.dll.mui"
  223. )
  224. rem ‡ ¬¥­  ä ©«  á á®åà ­¥­¨¥¬ áâ à®© ¢¥àᨨ
  225. Setlocal EnableDelayedExpansion
  226. call :GetVersion "%serverpath%\OmsServer.dll"
  227. Setlocal DisableDelayedExpansion
  228. ren "%serverpath%\OmsServer.dll" "OmsServer.dll%file_old_version%"
  229. if "%log_dir%" neq "" (
  230. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë OmsServer.dll"
  231. ) else (
  232. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« OmsServer.dll"
  233. )
  234. copy "%~dp0Module\x64\OmsServer.dll" "%serverpath%"
  235. if "%log_dir%" neq "" (
  236. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë OmsServer.dll"
  237. ) else (
  238. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« OmsServer.dll"
  239. )
  240. ren "%serverpath%\en-US\OmsServer.dll.mui" "OmsServer.dll.mui%file_old_version%"
  241. if "%log_dir%" neq "" (
  242. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë en-US\OmsServer.dll.mui"
  243. ) else (
  244. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« en-US\OmsServer.dll.mui"
  245. )
  246. copy "%~dp0Module\x64\en-US\OmsServer.dll.mui" "%serverpath%\en-US"
  247. if "%log_dir%" neq "" (
  248. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë en-US\OmsServer.dll.mui"
  249. ) else (
  250. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« en-US\OmsServer.dll.mui"
  251. )
  252. ren "%serverpath%\ru-RU\OmsServer.dll.mui" "OmsServer.dll.mui%file_old_version%"
  253. if "%log_dir%" neq "" (
  254. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ïåðåèìåíîâàòü çàìåíÿåìûé ôàéë ru-RU\OmsServer.dll.mui"
  255. ) else (
  256. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ¯¥à¥¨¬¥­®¢ âì § ¬¥­ï¥¬ë© ä ©« ru-RU\OmsServer.dll.mui"
  257. )
  258. copy "%~dp0Module\x64\ru-RU\OmsServer.dll.mui" "%serverpath%\ru-RU"
  259. if "%log_dir%" neq "" (
  260. call :CheckStatus "[ÎØÈÁÊÀ] Íå óäàëîñü ñêîïèðîâàòü îáíîâë¸ííûé ôàéë ru-RU\OmsServer.dll.mui"
  261. ) else (
  262. call :CheckStatus "[Ž˜ˆ�Š€] �¥ 㤠«®áì ᪮¯¨à®¢ âì ®¡­®¢«ñ­­ë© ä ©« ru-RU\OmsServer.dll.mui"
  263. )
  264. exit /b
  265. rem ================================================================================
  266. :GetVersion
  267. set file_old_version=_
  268. set file_path=%1
  269. set file_double_path=!file_path:\\=\!
  270. set file_double_path=!file_double_path:\=\\!
  271. set file_full_ver=
  272. wmic datafile where name^=!file_double_path! get Version /value >nul 2>&1
  273. for /F "delims=" %%a in ('wmic datafile where name^=!file_double_path! get Version /value') do (
  274. set file_full_ver=!file_full_ver!%%a
  275. )
  276. set file_ver=
  277. for /F "tokens=3 delims=.," %%a in ("!file_full_ver!") do set file_ver=!file_ver!_%%a
  278. for /F "tokens=4 delims=.," %%a in ("!file_full_ver!") do set file_ver=!file_ver!_%%a
  279. set file_old_version=!file_ver!
  280. exit /b
  281. rem ================================================================================
  282. :CheckStatus
  283. if %errorlevel% neq 0 (
  284. if "%log_dir%" neq "" (
  285. chcp 1251 >nul 2>&1
  286. echo %~1 > "%log_dir%fail.%computername%.%userdomain%.patch_%SnPatchVersion%.log"
  287. chcp %codepage_old% >nul 2>&1
  288. ) else (
  289. color 0C
  290. echo.
  291. echo %~1
  292. echo.
  293. pause
  294. )
  295. exit
  296. )
  297. exit /b
  298. rem ================================================================================
  299. rem ‡ ¯ã᪠áªà¨¯â  á ¯®¢ë襭¨¥¬ (UAC)
  300. :Elevate
  301. set "vbsGetPrivileges=%temp%\SNgetPriv_%~n0.vbs"
  302. echo.
  303. echo **************************************
  304. echo Running as administrator
  305. echo **************************************
  306. echo Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
  307. echo args = "ELEV " >> "%vbsGetPrivileges%"
  308. echo For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
  309. echo args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
  310. echo Next >> "%vbsGetPrivileges%"
  311. echo args = "/c """ + "%~f0" + """ " + args >> "%vbsGetPrivileges%"
  312. echo UAC.ShellExecute "%SystemRoot%\system32\cmd.exe", args, "", "runas", 1 >> "%vbsGetPrivileges%"
  313. rem echo UAC.ShellExecute "%~f0", args, "", "runas", 1 >> "%vbsGetPrivileges%"
  314. "%SystemRoot%\system32\WScript.exe" "%vbsGetPrivileges%" %*
  315. exit /b