1
0

build_pkg.bat 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. @echo off
  2. @echo Salt Windows Build Package Script
  3. @echo =====================================================================
  4. @echo.
  5. :: Get Passed Parameters
  6. @echo Get Passed Parameters...
  7. @echo ---------------------------------------------------------------------
  8. Set "Version="
  9. Set "Python="
  10. :: First Parameter
  11. if not "%~1"=="" (
  12. echo.%1 | FIND /I "=" > nul && (
  13. :: Named Parameter
  14. set "%~1"
  15. ) || (
  16. :: Positional Parameter
  17. set "Version=%~1"
  18. )
  19. )
  20. :: Second Parameter
  21. if not "%~2"=="" (
  22. echo.%2 | FIND /I "=" > nul && (
  23. :: Named Parameter
  24. set "%~2"
  25. ) || (
  26. :: Positional Parameter
  27. set "Python=%~2"
  28. )
  29. )
  30. :: If Version not defined, Get the version from Git
  31. if "%Version%"=="" (
  32. for /f "delims=" %%a in ('git describe') do @set "Version=%%a"
  33. )
  34. :: If Python not defined, Assume Python 3
  35. if "%Python%"=="" (
  36. set Python=3
  37. )
  38. :: Verify valid Python value (3)
  39. :: We may need to add Python 4 in the future (delims=34)
  40. set "x="
  41. for /f "delims=3" %%i in ("%Python%") do set x=%%i
  42. if Defined x (
  43. echo Invalid Python Version specified. Must be 3. Passed %Python%
  44. goto eof
  45. )
  46. @echo.
  47. :: Define Variables
  48. @echo Defining Variables...
  49. @echo ----------------------------------------------------------------------
  50. if %Python%==3 (
  51. Set "PyDir=C:\Python37"
  52. Set "PyVerMajor=3"
  53. Set "PyVerMinor=7"
  54. ) else (
  55. :: Placeholder for future version
  56. :: Set "PyDir=C:\Python4"
  57. :: Set "PyVerMajor=0"
  58. :: Set "PyVerMinor=0"
  59. )
  60. :: Verify the Python Installation
  61. If not Exist "%PyDir%\python.exe" (
  62. @echo Expected version of Python not found: Python %PyVerMajor%.%PyVerMinor%"
  63. exit /b 1
  64. )
  65. Set "CurDir=%~dp0"
  66. Set "BldDir=%CurDir%buildenv"
  67. Set "BinDir=%CurDir%buildenv\bin"
  68. Set "CnfDir=%CurDir%buildenv\conf"
  69. Set "InsDir=%CurDir%installer"
  70. Set "PreDir=%CurDir%prereqs"
  71. for /f "delims=" %%a in ('git rev-parse --show-toplevel') do @set "SrcDir=%%a"
  72. :: Find the NSIS Installer
  73. If Exist "C:\Program Files\NSIS\" (
  74. Set "NSIS=C:\Program Files\NSIS\"
  75. ) Else (
  76. Set "NSIS=C:\Program Files (x86)\NSIS\"
  77. )
  78. If not Exist "%NSIS%NSIS.exe" (
  79. @echo "NSIS not found in %NSIS%"
  80. exit /b 1
  81. )
  82. :: Add NSIS to the Path
  83. Set "PATH=%NSIS%;%PATH%"
  84. @echo.
  85. :: Check for existing bin directory and remove
  86. If Exist "%BinDir%\" (
  87. @echo Removing %BinDir%
  88. @echo ----------------------------------------------------------------------
  89. rd /S /Q "%BinDir%"
  90. )
  91. :: Copy the contents of the Python Dir to bin
  92. @echo Copying "%PyDir%" to bin...
  93. @echo ----------------------------------------------------------------------
  94. @echo xcopy /E /Q "%PyDir%" "%BinDir%\"
  95. xcopy /E /Q "%PyDir%" "%BinDir%\"
  96. @echo.
  97. :: Copy the default master and minion configs to buildenv\conf
  98. @echo Copying configs to buildenv\conf...
  99. @echo ----------------------------------------------------------------------
  100. @echo xcopy /E /Q "%SrcDir%\conf\master" "%CnfDir%\"
  101. xcopy /Q /Y "%SrcDir%\conf\master" "%CnfDir%\"
  102. @echo xcopy /E /Q "%SrcDir%\conf\minion" "%CnfDir%\"
  103. xcopy /Q /Y "%SrcDir%\conf\minion" "%CnfDir%\"
  104. @echo.
  105. @echo Copying SSM to buildenv
  106. @echo ----------------------------------------------------------------------
  107. :: Set the location of the ssm to download
  108. Set Url64="https://repo.saltstack.com/windows/dependencies/64/ssm-2.24-103-gdee49fc.exe"
  109. Set Url32="https://repo.saltstack.com/windows/dependencies/32/ssm-2.24-103-gdee49fc.exe"
  110. :: Check for 64 bit by finding the Program Files (x86) directory
  111. If Defined ProgramFiles(x86) (
  112. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url "%Url64%" -file "%BinDir%\ssm.exe"
  113. ) Else (
  114. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url "%Url32%" -file "%BinDir%\ssm.exe"
  115. )
  116. @echo.
  117. :: Make sure the "prereq" directory exists and is empty
  118. If Exist "%PreDir%" rd /s /q "%PreDir%"
  119. mkdir "%PreDir%"
  120. :: For PY 3, include KB2999226
  121. @echo Copying KB2999226 to Prerequisites
  122. @echo ----------------------------------------------------------------------
  123. :: 64 bit binaries required for AMD64 and x86
  124. :: Copy down the 64 bit binaries
  125. set Url=http://repo.saltstack.com/windows/dependencies/64/ucrt/Windows6.0-KB2999226-x64.msu
  126. set Name=Windows6.0-KB2999226-x64.msu
  127. @echo - Downloading %Name%
  128. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  129. set Url=http://repo.saltstack.com/windows/dependencies/64/ucrt/Windows6.1-KB2999226-x64.msu
  130. set Name=Windows6.1-KB2999226-x64.msu
  131. @echo - Downloading %Name%
  132. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  133. set Url=http://repo.saltstack.com/windows/dependencies/64/ucrt/Windows8-RT-KB2999226-x64.msu
  134. set Name=Windows8-RT-KB2999226-x64.msu
  135. @echo - Downloading %Name%
  136. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  137. set Url=http://repo.saltstack.com/windows/dependencies/64/ucrt/Windows8.1-KB2999226-x64.msu
  138. set Name=Windows8.1-KB2999226-x64.msu
  139. @echo - Downloading %Name%
  140. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  141. :: 32 bit binaries only needed for x86 installer
  142. :: ProgramFiles(x86) is defined on AMD64 systems
  143. :: If it's defined, skip the x86 binaries
  144. If Defined ProgramFiles(x86) goto vcredist_2013_x64
  145. :: Copy down the 32 bit binaries
  146. set Url=http://repo.saltstack.com/windows/dependencies/32/ucrt/Windows6.0-KB2999226-x86.msu
  147. set Name=Windows6.0-KB2999226-x86.msu
  148. @echo - Downloading %Name%
  149. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  150. set Url=http://repo.saltstack.com/windows/dependencies/32/ucrt/Windows6.1-KB2999226-x86.msu
  151. set Name=Windows6.1-KB2999226-x86.msu
  152. @echo - Downloading %Name%
  153. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  154. set Url=http://repo.saltstack.com/windows/dependencies/32/ucrt/Windows8-RT-KB2999226-x86.msu
  155. set Name=Windows8-RT-KB2999226-x86.msu
  156. @echo - Downloading %Name%
  157. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  158. set Url=http://repo.saltstack.com/windows/dependencies/32/ucrt/Windows8.1-KB2999226-x86.msu
  159. set Name=Windows8.1-KB2999226-x86.msu
  160. @echo - Downloading %Name%
  161. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  162. :vcredist_2013_x86
  163. @echo.
  164. @echo Copying VCRedist 2013 X86 to Prerequisites
  165. @echo ----------------------------------------------------------------------
  166. set Url=http://repo.saltstack.com/windows/dependencies/32/vcredist_x86_2013.exe
  167. set Name=vcredist_x86_2013.exe
  168. @echo - Downloading %Name%
  169. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  170. goto prereq_end
  171. :vcredist_2013_x64
  172. @echo.
  173. @echo Copying VCRedist 2013 X64 to Prerequisites
  174. @echo ----------------------------------------------------------------------
  175. set Url=http://repo.saltstack.com/windows/dependencies/64/vcredist_x64_2013.exe
  176. set Name=vcredist_x64_2013.exe
  177. @echo - Downloading %Name%
  178. powershell -ExecutionPolicy RemoteSigned -File download_url_file.ps1 -url %Url% -file "%PreDir%\%Name%"
  179. :prereq_end
  180. :: Remove the fixed path in .exe files
  181. @echo Removing fixed path from .exe files
  182. @echo ----------------------------------------------------------------------
  183. "%PyDir%\python" "%CurDir%\portable.py" -f "%BinDir%\Scripts\easy_install.exe"
  184. "%PyDir%\python" "%CurDir%\portable.py" -f "%BinDir%\Scripts\easy_install-%PyVerMajor%.%PyVerMinor%.exe"
  185. "%PyDir%\python" "%CurDir%\portable.py" -f "%BinDir%\Scripts\pip.exe"
  186. "%PyDir%\python" "%CurDir%\portable.py" -f "%BinDir%\Scripts\pip%PyVerMajor%.%PyVerMinor%.exe"
  187. "%PyDir%\python" "%CurDir%\portable.py" -f "%BinDir%\Scripts\pip%PyVerMajor%.exe"
  188. "%PyDir%\python" "%CurDir%\portable.py" -f "%BinDir%\Scripts\wheel.exe"
  189. @echo.
  190. @echo Cleaning up unused files and directories...
  191. @echo ----------------------------------------------------------------------
  192. :: Remove all Compiled Python files (.pyc)
  193. del /S /Q "%BinDir%\*.pyc" 1>nul
  194. :: Remove all Compiled HTML Help (.chm)
  195. del /S /Q "%BinDir%\*.chm" 1>nul
  196. :: Remove all empty text files (they are placeholders for git)
  197. del /S /Q "%BinDir%\..\empty.*" 1>nul
  198. :: Delete Unused Docs and Modules
  199. If Exist "%BinDir%\Doc" rd /S /Q "%BinDir%\Doc"
  200. If Exist "%BinDir%\share" rd /S /Q "%BinDir%\share"
  201. If Exist "%BinDir%\tcl" rd /S /Q "%BinDir%\tcl"
  202. If Exist "%BinDir%\Lib\idlelib" rd /S /Q "%BinDir%\Lib\idlelib"
  203. If Exist "%BinDir%\Lib\lib-tk" rd /S /Q "%BinDir%\Lib\lib-tk"
  204. If Exist "%BinDir%\Lib\test" rd /S /Q "%BinDir%\Lib\test"
  205. If Exist "%BinDir%\Lib\unit-test" rd /S /Q "%BinDir%\Lib\unit-test"
  206. :: Delete Unused .dll files
  207. If Exist "%BinDir%\DLLs\tcl85.dll" del /Q "%BinDir%\DLLs\tcl85.dll" 1>nul
  208. If Exist "%BinDir%\DLLs\tclpip85.dll" del /Q "%BinDir%\DLLs\tclpip85.dll" 1>nul
  209. If Exist "%BinDir%\DLLs\tk85.dll" del /Q "%BinDir%\DLLs\tk85.dll" 1>nul
  210. :: Delete Unused .lib files
  211. If Exist "%BinDir%\libs\_tkinter.lib" del /Q "%BinDir%\libs\_tkinter.lib" 1>nul
  212. :: Delete .txt files
  213. If Exist "%BinDir%\NEWS.txt" del /Q "%BinDir%\NEWS.txt" 1>nul
  214. If Exist "%BinDir%\README.txt" del /Q "%BinDir%\README.txt" 1>nul
  215. :: Delete Non-Windows Modules
  216. If Exist "%BinDir%\Lib\site-packages\salt\modules\acme.py"^
  217. del /Q "%BinDir%\Lib\site-packages\salt\modules\acme.*" 1>nul
  218. If Exist "%BinDir%\Lib\site-packages\salt\modules\alternatives.py"^
  219. del /Q "%BinDir%\Lib\site-packages\salt\modules\alternatives.*" 1>nul
  220. If Exist "%BinDir%\Lib\site-packages\salt\modules\apf.py"^
  221. del /Q "%BinDir%\Lib\site-packages\salt\modules\apf.*" 1>nul
  222. If Exist "%BinDir%\Lib\site-packages\salt\modules\aptpkg.py"^
  223. del /Q "%BinDir%\Lib\site-packages\salt\modules\aptpkg.*" 1>nul
  224. If Exist "%BinDir%\Lib\site-packages\salt\modules\at.py"^
  225. del /Q "%BinDir%\Lib\site-packages\salt\modules\at.*" 1>nul
  226. If Exist "%BinDir%\Lib\site-packages\salt\modules\bcache.py"^
  227. del /Q "%BinDir%\Lib\site-packages\salt\modules\bcache.*" 1>nul
  228. If Exist "%BinDir%\Lib\site-packages\salt\modules\blockdev.py"^
  229. del /Q "%BinDir%\Lib\site-packages\salt\modules\blockdev.*" 1>nul
  230. If Exist "%BinDir%\Lib\site-packages\salt\modules\bluez.py"^
  231. del /Q "%BinDir%\Lib\site-packages\salt\modules\bluez.*" 1>nul
  232. If Exist "%BinDir%\Lib\site-packages\salt\modules\bridge.py"^
  233. del /Q "%BinDir%\Lib\site-packages\salt\modules\bridge.*" 1>nul
  234. If Exist "%BinDir%\Lib\site-packages\salt\modules\bsd_shadow.py"^
  235. del /Q "%BinDir%\Lib\site-packages\salt\modules\bsd_shadow.*" 1>nul
  236. If Exist "%BinDir%\Lib\site-packages\salt\modules\btrfs.py"^
  237. del /Q "%BinDir%\Lib\site-packages\salt\modules\btrfs.*" 1>nul
  238. If Exist "%BinDir%\Lib\site-packages\salt\modules\ceph.py"^
  239. del /Q "%BinDir%\Lib\site-packages\salt\modules\ceph.*" 1>nul
  240. If Exist "%BinDir%\Lib\site-packages\salt\modules\container_resource.py"^
  241. del /Q "%BinDir%\Lib\site-packages\salt\modules\container_resource.*" 1>nul
  242. If Exist "%BinDir%\Lib\site-packages\salt\modules\cron.py"^
  243. del /Q "%BinDir%\Lib\site-packages\salt\modules\cron.*" 1>nul
  244. If Exist "%BinDir%\Lib\site-packages\salt\modules\csf.py"^
  245. del /Q "%BinDir%\Lib\site-packages\salt\modules\csf.*" 1>nul
  246. If Exist "%BinDir%\Lib\site-packages\salt\modules\daemontools.py"^
  247. del /Q "%BinDir%\Lib\site-packages\salt\modules\daemontools.*" 1>nul
  248. If Exist "%BinDir%\Lib\site-packages\salt\modules\deb*"^
  249. del /Q "%BinDir%\Lib\site-packages\salt\modules\deb*" 1>nul
  250. If Exist "%BinDir%\Lib\site-packages\salt\modules\devmap.py"^
  251. del /Q "%BinDir%\Lib\site-packages\salt\modules\devmap.*" 1>nul
  252. If Exist "%BinDir%\Lib\site-packages\salt\modules\dpkg.py"^
  253. del /Q "%BinDir%\Lib\site-packages\salt\modules\dpkg.*" 1>nul
  254. If Exist "%BinDir%\Lib\site-packages\salt\modules\ebuild.py"^
  255. del /Q "%BinDir%\Lib\site-packages\salt\modules\ebuild.*" 1>nul
  256. If Exist "%BinDir%\Lib\site-packages\salt\modules\eix.py"^
  257. del /Q "%BinDir%\Lib\site-packages\salt\modules\eix.*" 1>nul
  258. If Exist "%BinDir%\Lib\site-packages\salt\modules\eselect.py"^
  259. del /Q "%BinDir%\Lib\site-packages\salt\modules\eselect.*" 1>nul
  260. If Exist "%BinDir%\Lib\site-packages\salt\modules\ethtool.py"^
  261. del /Q "%BinDir%\Lib\site-packages\salt\modules\ethtool.*" 1>nul
  262. If Exist "%BinDir%\Lib\site-packages\salt\modules\extfs.py"^
  263. del /Q "%BinDir%\Lib\site-packages\salt\modules\extfs.*" 1>nul
  264. If Exist "%BinDir%\Lib\site-packages\salt\modules\firewalld.py"^
  265. del /Q "%BinDir%\Lib\site-packages\salt\modules\firewalld.*" 1>nul
  266. If Exist "%BinDir%\Lib\site-packages\salt\modules\freebsd*"^
  267. del /Q "%BinDir%\Lib\site-packages\salt\modules\freebsd*" 1>nul
  268. If Exist "%BinDir%\Lib\site-packages\salt\modules\genesis.py"^
  269. del /Q "%BinDir%\Lib\site-packages\salt\modules\genesis.*" 1>nul
  270. If Exist "%BinDir%\Lib\site-packages\salt\modules\gentoo*"^
  271. del /Q "%BinDir%\Lib\site-packages\salt\modules\gentoo*" 1>nul
  272. If Exist "%BinDir%\Lib\site-packages\salt\modules\glusterfs.py"^
  273. del /Q "%BinDir%\Lib\site-packages\salt\modules\glusterfs.*" 1>nul
  274. If Exist "%BinDir%\Lib\site-packages\salt\modules\gnomedesktop.py"^
  275. del /Q "%BinDir%\Lib\site-packages\salt\modules\gnomedesktop.*" 1>nul
  276. If Exist "%BinDir%\Lib\site-packages\salt\modules\groupadd.py"^
  277. del /Q "%BinDir%\Lib\site-packages\salt\modules\groupadd.*" 1>nul
  278. If Exist "%BinDir%\Lib\site-packages\salt\modules\grub_legacy.py"^
  279. del /Q "%BinDir%\Lib\site-packages\salt\modules\grub_legacy.*" 1>nul
  280. If Exist "%BinDir%\Lib\site-packages\salt\modules\guestfs.py"^
  281. del /Q "%BinDir%\Lib\site-packages\salt\modules\guestfs.*" 1>nul
  282. If Exist "%BinDir%\Lib\site-packages\salt\modules\htpasswd.py"^
  283. del /Q "%BinDir%\Lib\site-packages\salt\modules\htpasswd.*" 1>nul
  284. If Exist "%BinDir%\Lib\site-packages\salt\modules\ilo.py"^
  285. del /Q "%BinDir%\Lib\site-packages\salt\modules\ilo.*" 1>nul
  286. If Exist "%BinDir%\Lib\site-packages\salt\modules\img.py"^
  287. del /Q "%BinDir%\Lib\site-packages\salt\modules\img.*" 1>nul
  288. If Exist "%BinDir%\Lib\site-packages\salt\modules\incron.py"^
  289. del /Q "%BinDir%\Lib\site-packages\salt\modules\incron.*" 1>nul
  290. If Exist "%BinDir%\Lib\site-packages\salt\modules\inspector.py"^
  291. del /Q "%BinDir%\Lib\site-packages\salt\modules\inspector.*" 1>nul
  292. If Exist "%BinDir%\Lib\site-packages\salt\modules\ipset.py"^
  293. del /Q "%BinDir%\Lib\site-packages\salt\modules\ipset.*" 1>nul
  294. If Exist "%BinDir%\Lib\site-packages\salt\modules\iptables.py"^
  295. del /Q "%BinDir%\Lib\site-packages\salt\modules\iptables.*" 1>nul
  296. If Exist "%BinDir%\Lib\site-packages\salt\modules\iwtools.py"^
  297. del /Q "%BinDir%\Lib\site-packages\salt\modules\iwtools.*" 1>nul
  298. If Exist "%BinDir%\Lib\site-packages\salt\modules\k8s.py"^
  299. del /Q "%BinDir%\Lib\site-packages\salt\modules\k8s.*" 1>nul
  300. If Exist "%BinDir%\Lib\site-packages\salt\modules\kapacitor.py"^
  301. del /Q "%BinDir%\Lib\site-packages\salt\modules\kapacitor.*" 1>nul
  302. If Exist "%BinDir%\Lib\site-packages\salt\modules\keyboard.py"^
  303. del /Q "%BinDir%\Lib\site-packages\salt\modules\keyboard.*" 1>nul
  304. If Exist "%BinDir%\Lib\site-packages\salt\modules\keystone.py"^
  305. del /Q "%BinDir%\Lib\site-packages\salt\modules\keystone.*" 1>nul
  306. If Exist "%BinDir%\Lib\site-packages\salt\modules\kmod.py"^
  307. del /Q "%BinDir%\Lib\site-packages\salt\modules\kmod.*" 1>nul
  308. If Exist "%BinDir%\Lib\site-packages\salt\modules\layman.py"^
  309. del /Q "%BinDir%\Lib\site-packages\salt\modules\layman.*" 1>nul
  310. If Exist "%BinDir%\Lib\site-packages\salt\modules\linux*"^
  311. del /Q "%BinDir%\Lib\site-packages\salt\modules\linux*" 1>nul
  312. If Exist "%BinDir%\Lib\site-packages\salt\modules\localemod.py"^
  313. del /Q "%BinDir%\Lib\site-packages\salt\modules\localemod.*" 1>nul
  314. If Exist "%BinDir%\Lib\site-packages\salt\modules\locate.py"^
  315. del /Q "%BinDir%\Lib\site-packages\salt\modules\locate.*" 1>nul
  316. If Exist "%BinDir%\Lib\site-packages\salt\modules\logadm.py"^
  317. del /Q "%BinDir%\Lib\site-packages\salt\modules\logadm.*" 1>nul
  318. If Exist "%BinDir%\Lib\site-packages\salt\modules\logrotate.py"^
  319. del /Q "%BinDir%\Lib\site-packages\salt\modules\logrotate.*" 1>nul
  320. If Exist "%BinDir%\Lib\site-packages\salt\modules\lvs.py"^
  321. del /Q "%BinDir%\Lib\site-packages\salt\modules\lvs.*" 1>nul
  322. If Exist "%BinDir%\Lib\site-packages\salt\modules\lxc.py"^
  323. del /Q "%BinDir%\Lib\site-packages\salt\modules\lxc.*" 1>nul
  324. If Exist "%BinDir%\Lib\site-packages\salt\modules\mac*"^
  325. del /Q "%BinDir%\Lib\site-packages\salt\modules\mac*" 1>nul
  326. If Exist "%BinDir%\Lib\site-packages\salt\modules\makeconf.py"^
  327. del /Q "%BinDir%\Lib\site-packages\salt\modules\makeconf.*" 1>nul
  328. If Exist "%BinDir%\Lib\site-packages\salt\modules\mdadm.py"^
  329. del /Q "%BinDir%\Lib\site-packages\salt\modules\mdadm.*" 1>nul
  330. If Exist "%BinDir%\Lib\site-packages\salt\modules\mdata.py"^
  331. del /Q "%BinDir%\Lib\site-packages\salt\modules\mdata.*" 1>nul
  332. If Exist "%BinDir%\Lib\site-packages\salt\modules\monit.py"^
  333. del /Q "%BinDir%\Lib\site-packages\salt\modules\monit.*" 1>nul
  334. If Exist "%BinDir%\Lib\site-packages\salt\modules\moosefs.py"^
  335. del /Q "%BinDir%\Lib\site-packages\salt\modules\moosefs.*" 1>nul
  336. If Exist "%BinDir%\Lib\site-packages\salt\modules\mount.py"^
  337. del /Q "%BinDir%\Lib\site-packages\salt\modules\mount.*" 1>nul
  338. If Exist "%BinDir%\Lib\site-packages\salt\modules\napalm*"^
  339. del /Q "%BinDir%\Lib\site-packages\salt\modules\napalm*" 1>nul
  340. If Exist "%BinDir%\Lib\site-packages\salt\modules\netbsd*"^
  341. del /Q "%BinDir%\Lib\site-packages\salt\modules\netbsd*" 1>nul
  342. If Exist "%BinDir%\Lib\site-packages\salt\modules\netscaler.py"^
  343. del /Q "%BinDir%\Lib\site-packages\salt\modules\netscaler.*" 1>nul
  344. If Exist "%BinDir%\Lib\site-packages\salt\modules\neutron.py"^
  345. del /Q "%BinDir%\Lib\site-packages\salt\modules\neutron.*" 1>nul
  346. If Exist "%BinDir%\Lib\site-packages\salt\modules\nfs3.py"^
  347. del /Q "%BinDir%\Lib\site-packages\salt\modules\nfs3.*" 1>nul
  348. If Exist "%BinDir%\Lib\site-packages\salt\modules\nftables.py"^
  349. del /Q "%BinDir%\Lib\site-packages\salt\modules\nftables.*" 1>nul
  350. If Exist "%BinDir%\Lib\site-packages\salt\modules\nova.py"^
  351. del /Q "%BinDir%\Lib\site-packages\salt\modules\nova.*" 1>nul
  352. If Exist "%BinDir%\Lib\site-packages\salt\modules\nspawn.py"^
  353. del /Q "%BinDir%\Lib\site-packages\salt\modules\nspawn.*" 1>nul
  354. If Exist "%BinDir%\Lib\site-packages\salt\modules\openbsd*"^
  355. del /Q "%BinDir%\Lib\site-packages\salt\modules\openbsd*" 1>nul
  356. If Exist "%BinDir%\Lib\site-packages\salt\modules\openstack_mng.py"^
  357. del /Q "%BinDir%\Lib\site-packages\salt\modules\openstack_mng.*" 1>nul
  358. If Exist "%BinDir%\Lib\site-packages\salt\modules\openvswitch.py"^
  359. del /Q "%BinDir%\Lib\site-packages\salt\modules\openvswitch.*" 1>nul
  360. If Exist "%BinDir%\Lib\site-packages\salt\modules\opkg.py"^
  361. del /Q "%BinDir%\Lib\site-packages\salt\modules\opkg.*" 1>nul
  362. If Exist "%BinDir%\Lib\site-packages\salt\modules\pacman.py"^
  363. del /Q "%BinDir%\Lib\site-packages\salt\modules\pacman.*" 1>nul
  364. If Exist "%BinDir%\Lib\site-packages\salt\modules\parallels.py"^
  365. del /Q "%BinDir%\Lib\site-packages\salt\modules\parallels.*" 1>nul
  366. If Exist "%BinDir%\Lib\site-packages\salt\modules\parted.py"^
  367. del /Q "%BinDir%\Lib\site-packages\salt\modules\parted.*" 1>nul
  368. If Exist "%BinDir%\Lib\site-packages\salt\modules\pcs.py"^
  369. del /Q "%BinDir%\Lib\site-packages\salt\modules\pcs.*" 1>nul
  370. If Exist "%BinDir%\Lib\site-packages\salt\modules\pkgin.py"^
  371. del /Q "%BinDir%\Lib\site-packages\salt\modules\pkgin.*" 1>nul
  372. If Exist "%BinDir%\Lib\site-packages\salt\modules\pkgng.py"^
  373. del /Q "%BinDir%\Lib\site-packages\salt\modules\pkgng.*" 1>nul
  374. If Exist "%BinDir%\Lib\site-packages\salt\modules\pkgutil.py"^
  375. del /Q "%BinDir%\Lib\site-packages\salt\modules\pkgutil.*" 1>nul
  376. If Exist "%BinDir%\Lib\site-packages\salt\modules\portage_config.py"^
  377. del /Q "%BinDir%\Lib\site-packages\salt\modules\portage_config.*" 1>nul
  378. If Exist "%BinDir%\Lib\site-packages\salt\modules\postfix.py"^
  379. del /Q "%BinDir%\Lib\site-packages\salt\modules\postfix.*" 1>nul
  380. If Exist "%BinDir%\Lib\site-packages\salt\modules\poudriere.py"^
  381. del /Q "%BinDir%\Lib\site-packages\salt\modules\poudriere.*" 1>nul
  382. If Exist "%BinDir%\Lib\site-packages\salt\modules\powerpath.py"^
  383. del /Q "%BinDir%\Lib\site-packages\salt\modules\powerpath.*" 1>nul
  384. If Exist "%BinDir%\Lib\site-packages\salt\modules\pw_*"^
  385. del /Q "%BinDir%\Lib\site-packages\salt\modules\pw_*" 1>nul
  386. If Exist "%BinDir%\Lib\site-packages\salt\modules\qemu_ndb.py"^
  387. del /Q "%BinDir%\Lib\site-packages\salt\modules\qemu_ndb.*" 1>nul
  388. If Exist "%BinDir%\Lib\site-packages\salt\modules\quota.py"^
  389. del /Q "%BinDir%\Lib\site-packages\salt\modules\quota.*" 1>nul
  390. If Exist "%BinDir%\Lib\site-packages\salt\modules\redismod.py"^
  391. del /Q "%BinDir%\Lib\site-packages\salt\modules\redismod.*" 1>nul
  392. If Exist "%BinDir%\Lib\site-packages\salt\modules\restartcheck.py"^
  393. del /Q "%BinDir%\Lib\site-packages\salt\modules\restartcheck.*" 1>nul
  394. If Exist "%BinDir%\Lib\site-packages\salt\modules\rh_*"^
  395. del /Q "%BinDir%\Lib\site-packages\salt\modules\rh_*" 1>nul
  396. If Exist "%BinDir%\Lib\site-packages\salt\modules\riak.py"^
  397. del /Q "%BinDir%\Lib\site-packages\salt\modules\riak.*" 1>nul
  398. If Exist "%BinDir%\Lib\site-packages\salt\modules\rpm*"^
  399. del /Q "%BinDir%\Lib\site-packages\salt\modules\rpm*" 1>nul
  400. If Exist "%BinDir%\Lib\site-packages\salt\modules\runit.py"^
  401. del /Q "%BinDir%\Lib\site-packages\salt\modules\runit.*" 1>nul
  402. If Exist "%BinDir%\Lib\site-packages\salt\modules\s6.py"^
  403. del /Q "%BinDir%\Lib\site-packages\salt\modules\s6.*" 1>nul
  404. If Exist "%BinDir%\Lib\site-packages\salt\modules\scsi.py"^
  405. del /Q "%BinDir%\Lib\site-packages\salt\modules\scsi.*" 1>nul
  406. If Exist "%BinDir%\Lib\site-packages\salt\modules\seed.py"^
  407. del /Q "%BinDir%\Lib\site-packages\salt\modules\seed.*" 1>nul
  408. If Exist "%BinDir%\Lib\site-packages\salt\modules\sensors.py"^
  409. del /Q "%BinDir%\Lib\site-packages\salt\modules\sensors.*" 1>nul
  410. If Exist "%BinDir%\Lib\site-packages\salt\modules\service.py"^
  411. del /Q "%BinDir%\Lib\site-packages\salt\modules\service.*" 1>nul
  412. If Exist "%BinDir%\Lib\site-packages\salt\modules\shadow.py"^
  413. del /Q "%BinDir%\Lib\site-packages\salt\modules\shadow.*" 1>nul
  414. If Exist "%BinDir%\Lib\site-packages\salt\modules\smartos*"^
  415. del /Q "%BinDir%\Lib\site-packages\salt\modules\smartos*" 1>nul
  416. If Exist "%BinDir%\Lib\site-packages\salt\modules\smf.py"^
  417. del /Q "%BinDir%\Lib\site-packages\salt\modules\smf.*" 1>nul
  418. If Exist "%BinDir%\Lib\site-packages\salt\modules\snapper.py"^
  419. del /Q "%BinDir%\Lib\site-packages\salt\modules\snapper.*" 1>nul
  420. If Exist "%BinDir%\Lib\site-packages\salt\modules\solaris*"^
  421. del /Q "%BinDir%\Lib\site-packages\salt\modules\solaris*" 1>nul
  422. If Exist "%BinDir%\Lib\site-packages\salt\modules\solr.py"^
  423. del /Q "%BinDir%\Lib\site-packages\salt\modules\solr.*" 1>nul
  424. If Exist "%BinDir%\Lib\site-packages\salt\modules\ssh_*"^
  425. del /Q "%BinDir%\Lib\site-packages\salt\modules\ssh_*" 1>nul
  426. If Exist "%BinDir%\Lib\site-packages\salt\modules\supervisord.py"^
  427. del /Q "%BinDir%\Lib\site-packages\salt\modules\supervisord.*" 1>nul
  428. If Exist "%BinDir%\Lib\site-packages\salt\modules\sysbench.py"^
  429. del /Q "%BinDir%\Lib\site-packages\salt\modules\sysbench.*" 1>nul
  430. If Exist "%BinDir%\Lib\site-packages\salt\modules\sysfs.py"^
  431. del /Q "%BinDir%\Lib\site-packages\salt\modules\sysfs.*" 1>nul
  432. If Exist "%BinDir%\Lib\site-packages\salt\modules\sysrc.py"^
  433. del /Q "%BinDir%\Lib\site-packages\salt\modules\sysrc.*" 1>nul
  434. If Exist "%BinDir%\Lib\site-packages\salt\modules\system.py"^
  435. del /Q "%BinDir%\Lib\site-packages\salt\modules\system.*" 1>nul
  436. If Exist "%BinDir%\Lib\site-packages\salt\modules\test_virtual.py"^
  437. del /Q "%BinDir%\Lib\site-packages\salt\modules\test_virtual.*" 1>nul
  438. If Exist "%BinDir%\Lib\site-packages\salt\modules\timezone.py"^
  439. del /Q "%BinDir%\Lib\site-packages\salt\modules\timezone.*" 1>nul
  440. If Exist "%BinDir%\Lib\site-packages\salt\modules\trafficserver.py"^
  441. del /Q "%BinDir%\Lib\site-packages\salt\modules\trafficserver.*" 1>nul
  442. If Exist "%BinDir%\Lib\site-packages\salt\modules\tuned.py"^
  443. del /Q "%BinDir%\Lib\site-packages\salt\modules\tuned.*" 1>nul
  444. If Exist "%BinDir%\Lib\site-packages\salt\modules\udev.py"^
  445. del /Q "%BinDir%\Lib\site-packages\salt\modules\udev.*" 1>nul
  446. If Exist "%BinDir%\Lib\site-packages\salt\modules\upstart.py"^
  447. del /Q "%BinDir%\Lib\site-packages\salt\modules\upstart.*" 1>nul
  448. If Exist "%BinDir%\Lib\site-packages\salt\modules\useradd.py"^
  449. del /Q "%BinDir%\Lib\site-packages\salt\modules\useradd.*" 1>nul
  450. If Exist "%BinDir%\Lib\site-packages\salt\modules\uswgi.py"^
  451. del /Q "%BinDir%\Lib\site-packages\salt\modules\uswgi.*" 1>nul
  452. If Exist "%BinDir%\Lib\site-packages\salt\modules\varnish.py"^
  453. del /Q "%BinDir%\Lib\site-packages\salt\modules\varnish.*" 1>nul
  454. If Exist "%BinDir%\Lib\site-packages\salt\modules\vbox_guest.py"^
  455. del /Q "%BinDir%\Lib\site-packages\salt\modules\vbox_guest.*" 1>nul
  456. If Exist "%BinDir%\Lib\site-packages\salt\modules\vboxmanage.py"^
  457. del /Q "%BinDir%\Lib\site-packages\salt\modules\vboxmanage.*" 1>nul
  458. If Exist "%BinDir%\Lib\site-packages\salt\modules\virt.py"^
  459. del /Q "%BinDir%\Lib\site-packages\salt\modules\virt.*" 1>nul
  460. If Exist "%BinDir%\Lib\site-packages\salt\modules\xapi.py"^
  461. del /Q "%BinDir%\Lib\site-packages\salt\modules\xapi.*" 1>nul
  462. If Exist "%BinDir%\Lib\site-packages\salt\modules\xbpspkg.py"^
  463. del /Q "%BinDir%\Lib\site-packages\salt\modules\xbpspkg.*" 1>nul
  464. If Exist "%BinDir%\Lib\site-packages\salt\modules\xfs.py"^
  465. del /Q "%BinDir%\Lib\site-packages\salt\modules\xfs.*" 1>nul
  466. If Exist "%BinDir%\Lib\site-packages\salt\modules\yumpkg.py"^
  467. del /Q "%BinDir%\Lib\site-packages\salt\modules\yum.*" 1>nul
  468. If Exist "%BinDir%\Lib\site-packages\salt\modules\zfs.py"^
  469. del /Q "%BinDir%\Lib\site-packages\salt\modules\zfs.*" 1>nul
  470. If Exist "%BinDir%\Lib\site-packages\salt\modules\znc.py"^
  471. del /Q "%BinDir%\Lib\site-packages\salt\modules\znc.*" 1>nul
  472. If Exist "%BinDir%\Lib\site-packages\salt\modules\zpool.py"^
  473. del /Q "%BinDir%\Lib\site-packages\salt\modules\zpool.*" 1>nul
  474. If Exist "%BinDir%\Lib\site-packages\salt\modules\zypper.py"^
  475. del /Q "%BinDir%\Lib\site-packages\salt\modules\zypper.*" 1>nul
  476. :: Delete Non-Windows States
  477. If Exist "%BinDir%\Lib\site-packages\salt\states\acme.py"^
  478. del /Q "%BinDir%\Lib\site-packages\salt\states\acme.*" 1>nul
  479. If Exist "%BinDir%\Lib\site-packages\salt\states\alternatives.py"^
  480. del /Q "%BinDir%\Lib\site-packages\salt\states\alternatives.*" 1>nul
  481. If Exist "%BinDir%\Lib\site-packages\salt\states\aptpkg.py"^
  482. del /Q "%BinDir%\Lib\site-packages\salt\states\aptpkg.*" 1>nul
  483. If Exist "%BinDir%\Lib\site-packages\salt\states\at.py"^
  484. del /Q "%BinDir%\Lib\site-packages\salt\states\at.*" 1>nul
  485. If Exist "%BinDir%\Lib\site-packages\salt\states\blockdev.py"^
  486. del /Q "%BinDir%\Lib\site-packages\salt\states\blockdev.*" 1>nul
  487. If Exist "%BinDir%\Lib\site-packages\salt\states\ceph.py"^
  488. del /Q "%BinDir%\Lib\site-packages\salt\states\ceph.*" 1>nul
  489. If Exist "%BinDir%\Lib\site-packages\salt\states\cron.py"^
  490. del /Q "%BinDir%\Lib\site-packages\salt\states\cron.*" 1>nul
  491. If Exist "%BinDir%\Lib\site-packages\salt\states\csf.py"^
  492. del /Q "%BinDir%\Lib\site-packages\salt\states\csf.*" 1>nul
  493. If Exist "%BinDir%\Lib\site-packages\salt\states\debconfmod.py"^
  494. del /Q "%BinDir%\Lib\site-packages\salt\states\debconfmod.*" 1>nul
  495. If Exist "%BinDir%\Lib\site-packages\salt\states\eselect.py"^
  496. del /Q "%BinDir%\Lib\site-packages\salt\states\eselect.*" 1>nul
  497. If Exist "%BinDir%\Lib\site-packages\salt\states\ethtool.py"^
  498. del /Q "%BinDir%\Lib\site-packages\salt\states\ethtool.*" 1>nul
  499. If Exist "%BinDir%\Lib\site-packages\salt\states\firewalld.py"^
  500. del /Q "%BinDir%\Lib\site-packages\salt\states\firewalld.*" 1>nul
  501. If Exist "%BinDir%\Lib\site-packages\salt\states\glusterfs.py"^
  502. del /Q "%BinDir%\Lib\site-packages\salt\states\glusterfs.*" 1>nul
  503. If Exist "%BinDir%\Lib\site-packages\salt\states\gnomedesktop.py"^
  504. del /Q "%BinDir%\Lib\site-packages\salt\states\gnomedesktop.*" 1>nul
  505. If Exist "%BinDir%\Lib\site-packages\salt\states\htpasswd.py"^
  506. del /Q "%BinDir%\Lib\site-packages\salt\states\htpasswd.*" 1>nul
  507. If Exist "%BinDir%\Lib\site-packages\salt\states\incron.py"^
  508. del /Q "%BinDir%\Lib\site-packages\salt\states\incron.*" 1>nul
  509. If Exist "%BinDir%\Lib\site-packages\salt\states\ipset.py"^
  510. del /Q "%BinDir%\Lib\site-packages\salt\states\ipset.*" 1>nul
  511. If Exist "%BinDir%\Lib\site-packages\salt\states\iptables.py"^
  512. del /Q "%BinDir%\Lib\site-packages\salt\states\iptables.*" 1>nul
  513. If Exist "%BinDir%\Lib\site-packages\salt\states\k8s.py"^
  514. del /Q "%BinDir%\Lib\site-packages\salt\states\k8s.*" 1>nul
  515. If Exist "%BinDir%\Lib\site-packages\salt\states\kapacitor.py"^
  516. del /Q "%BinDir%\Lib\site-packages\salt\states\kapacitor.*" 1>nul
  517. If Exist "%BinDir%\Lib\site-packages\salt\states\keyboard.py"^
  518. del /Q "%BinDir%\Lib\site-packages\salt\states\keyboard.*" 1>nul
  519. If Exist "%BinDir%\Lib\site-packages\salt\states\keystone.py"^
  520. del /Q "%BinDir%\Lib\site-packages\salt\states\keystone.*" 1>nul
  521. If Exist "%BinDir%\Lib\site-packages\salt\states\kmod.py"^
  522. del /Q "%BinDir%\Lib\site-packages\salt\states\kmod.*" 1>nul
  523. If Exist "%BinDir%\Lib\site-packages\salt\states\layman.py"^
  524. del /Q "%BinDir%\Lib\site-packages\salt\states\layman.*" 1>nul
  525. If Exist "%BinDir%\Lib\site-packages\salt\states\linux*"^
  526. del /Q "%BinDir%\Lib\site-packages\salt\states\linux*" 1>nul
  527. If Exist "%BinDir%\Lib\site-packages\salt\states\lxc.py"^
  528. del /Q "%BinDir%\Lib\site-packages\salt\states\lxc.*" 1>nul
  529. If Exist "%BinDir%\Lib\site-packages\salt\states\mac_*"^
  530. del /Q "%BinDir%\Lib\site-packages\salt\states\mac_*" 1>nul
  531. If Exist "%BinDir%\Lib\site-packages\salt\states\makeconf.py"^
  532. del /Q "%BinDir%\Lib\site-packages\salt\states\makeconf.*" 1>nul
  533. If Exist "%BinDir%\Lib\site-packages\salt\states\mdadm.py"^
  534. del /Q "%BinDir%\Lib\site-packages\salt\states\mdadm.*" 1>nul
  535. If Exist "%BinDir%\Lib\site-packages\salt\states\monit.py"^
  536. del /Q "%BinDir%\Lib\site-packages\salt\states\monit.*" 1>nul
  537. If Exist "%BinDir%\Lib\site-packages\salt\states\mount.py"^
  538. del /Q "%BinDir%\Lib\site-packages\salt\states\mount.*" 1>nul
  539. If Exist "%BinDir%\Lib\site-packages\salt\states\nftables.py"^
  540. del /Q "%BinDir%\Lib\site-packages\salt\states\nftables.*" 1>nul
  541. If Exist "%BinDir%\Lib\site-packages\salt\states\pcs.py"^
  542. del /Q "%BinDir%\Lib\site-packages\salt\states\pcs.*" 1>nul
  543. If Exist "%BinDir%\Lib\site-packages\salt\states\pkgng.py"^
  544. del /Q "%BinDir%\Lib\site-packages\salt\states\pkgng.*" 1>nul
  545. If Exist "%BinDir%\Lib\site-packages\salt\states\portage_config.py"^
  546. del /Q "%BinDir%\Lib\site-packages\salt\states\portage_config.*" 1>nul
  547. If Exist "%BinDir%\Lib\site-packages\salt\states\powerpath.py"^
  548. del /Q "%BinDir%\Lib\site-packages\salt\states\powerpath.*" 1>nul
  549. If Exist "%BinDir%\Lib\site-packages\salt\states\quota.py"^
  550. del /Q "%BinDir%\Lib\site-packages\salt\states\quota.*" 1>nul
  551. If Exist "%BinDir%\Lib\site-packages\salt\states\redismod.py"^
  552. del /Q "%BinDir%\Lib\site-packages\salt\states\redismod.*" 1>nul
  553. If Exist "%BinDir%\Lib\site-packages\salt\states\smartos.py"^
  554. del /Q "%BinDir%\Lib\site-packages\salt\states\smartos.*" 1>nul
  555. If Exist "%BinDir%\Lib\site-packages\salt\states\snapper.py"^
  556. del /Q "%BinDir%\Lib\site-packages\salt\states\snapper.*" 1>nul
  557. If Exist "%BinDir%\Lib\site-packages\salt\states\ssh_*"^
  558. del /Q "%BinDir%\Lib\site-packages\salt\states\ssh_*" 1>nul
  559. If Exist "%BinDir%\Lib\site-packages\salt\states\supervisord.py"^
  560. del /Q "%BinDir%\Lib\site-packages\salt\states\supervisord.*" 1>nul
  561. If Exist "%BinDir%\Lib\site-packages\salt\states\sysrc.py"^
  562. del /Q "%BinDir%\Lib\site-packages\salt\states\sysrc.*" 1>nul
  563. If Exist "%BinDir%\Lib\site-packages\salt\states\trafficserver.py"^
  564. del /Q "%BinDir%\Lib\site-packages\salt\states\trafficserver.*" 1>nul
  565. If Exist "%BinDir%\Lib\site-packages\salt\states\tuned.py"^
  566. del /Q "%BinDir%\Lib\site-packages\salt\states\tuned.*" 1>nul
  567. If Exist "%BinDir%\Lib\site-packages\salt\states\vbox_guest.py"^
  568. del /Q "%BinDir%\Lib\site-packages\salt\states\vbox_guest.*" 1>nul
  569. If Exist "%BinDir%\Lib\site-packages\salt\states\virt.py"^
  570. del /Q "%BinDir%\Lib\site-packages\salt\states\virt.*" 1>nul
  571. If Exist "%BinDir%\Lib\site-packages\salt\states\zfs.py"^
  572. del /Q "%BinDir%\Lib\site-packages\salt\states\zfs.*" 1>nul
  573. If Exist "%BinDir%\Lib\site-packages\salt\states\zpool.py"^
  574. del /Q "%BinDir%\Lib\site-packages\salt\states\zpool.*" 1>nul
  575. :: Remove Unneeded Components
  576. If Exist "%BinDir%\Lib\site-packages\salt\cloud"^
  577. rd /S /Q "%BinDir%\Lib\site-packages\salt\cloud" 1>nul
  578. If Exist "%BinDir%\Scripts\salt-unity*"^
  579. del /Q "%BinDir%\Scripts\salt-unity*" 1>nul
  580. @echo.
  581. @echo Building the installer...
  582. @echo ----------------------------------------------------------------------
  583. :: Make the Master installer if the nullsoft script exists
  584. If Exist "%InsDir%\Salt-Setup.nsi"^
  585. makensis.exe /DSaltVersion=%Version% /DPythonVersion=%Python% "%InsDir%\Salt-Setup.nsi"
  586. :: Remove files not needed for Salt Minion
  587. :: salt
  588. :: salt has to be removed individually (can't wildcard it)
  589. If Exist "%BinDir%\Scripts\salt"^
  590. del /Q "%BinDir%\Scripts\salt" 1>nul
  591. If Exist "%BinDir%\Scripts\salt.exe"^
  592. del /Q "%BinDir%\Scripts\salt.exe" 1>nul
  593. If Exist "%BldDir%\salt.bat"^
  594. del /Q "%BldDir%\salt.bat" 1>nul
  595. :: salt-key
  596. If Exist "%BinDir%\Scripts\salt-key*"^
  597. del /Q "%BinDir%\Scripts\salt-key*" 1>nul
  598. If Exist "%BldDir%\salt-key.bat"^
  599. del /Q "%BldDir%\salt-key.bat" 1>nul
  600. :: salt-master
  601. If Exist "%BinDir%\Scripts\salt-master*"^
  602. del /Q "%BinDir%\Scripts\salt-master*" 1>nul
  603. If Exist "%BldDir%\salt-master.bat"^
  604. del /Q "%BldDir%\salt-master.bat" 1>nul
  605. :: salt-run
  606. If Exist "%BinDir%\Scripts\salt-run*"^
  607. del /Q "%BinDir%\Scripts\salt-run*" 1>nul
  608. If Exist "%BldDir%\salt-run.bat"^
  609. del /Q "%BldDir%\salt-run.bat" 1>nul
  610. :: Remove the master config file
  611. if Exist "%CnfDir%\master"^
  612. del /Q "%CnfDir%\master" 1>nul
  613. :: Make the Salt Minion Installer
  614. makensis.exe /DSaltVersion=%Version% /DPythonVersion=%Python% "%InsDir%\Salt-Minion-Setup.nsi"
  615. @echo.
  616. @echo.
  617. @echo ======================================================================
  618. @echo Script completed...
  619. @echo ======================================================================
  620. @echo Installation file can be found in the following directory:
  621. @echo %InsDir%
  622. :done
  623. if [%Version%] == [] pause