salt/pkg/windows/clean_env.bat

92 lines
2.8 KiB
Batchfile
Raw Normal View History

echo off
echo =====================================================================
echo Salt Windows Clean Script
echo =====================================================================
echo.
rem Make sure the script is run as Admin
echo Administrative permissions required. Detecting permissions...
echo ---------------------------------------------------------------------
2016-08-09 19:53:55 +00:00
net session >nul 2>&1
if %errorLevel%==0 (
echo Success: Administrative permissions confirmed.
) else (
echo Failure: This script must be run as Administrator
goto eof
)
echo.
2016-08-09 19:53:55 +00:00
2017-08-31 20:15:06 +00:00
:CheckPython2
if exist "\Python27" goto RemovePython2
2017-08-31 20:15:06 +00:00
goto CheckPython3
:RemovePython2
rem Uninstall Python 2.7
echo %0 :: Uninstalling Python 2 ...
echo ---------------------------------------------------------------------
echo %0 :: - 2.7.12 (32 bit)
2016-08-09 21:09:36 +00:00
MsiExec.exe /X {9DA28CE5-0AA5-429E-86D8-686ED898C665} /QN
echo %0 :: - 2.7.12 (64 bit)
MsiExec.exe /X {9DA28CE5-0AA5-429E-86D8-686ED898C666} /QN
echo %0 :: - 2.7.13 (32 bit)
MsiExec.exe /X {4A656C6C-D24A-473F-9747-3A8D00907A03} /QN
echo %0 :: - 2.7.13 (64 bit)
MsiExec.exe /X {4A656C6C-D24A-473F-9747-3A8D00907A04} /QN
2017-12-06 15:59:23 +00:00
echo %0 :: - 2.7.14 (32 bit)
MsiExec.exe /X {0398A685-FD8D-46B3-9816-C47319B0CF5E} /QN
echo %0 :: - 2.7.14 (64 bit)
MsiExec.exe /X {0398A685-FD8D-46B3-9816-C47319B0CF5F} /QN
2016-08-09 19:53:55 +00:00
echo.
2017-03-10 21:52:38 +00:00
rem Wipe the Python directory
echo %0 :: Removing the C:\Python27 Directory ...
echo ---------------------------------------------------------------------
rd /s /q C:\Python27
if %errorLevel%==0 (
echo Successful
) else (
echo Failed, please remove manually
)
2017-03-10 21:52:38 +00:00
goto eof
2017-08-31 20:15:06 +00:00
:CheckPython3
if exist "\Python35" goto RemovePython3
goto eof
:RemovePython3
echo %0 :: Uninstalling Python 3 ...
echo ---------------------------------------------------------------------
2017-05-24 22:22:43 +00:00
:: 64 bit
if exist "%LOCALAPPDATA%\Package Cache\{b94f45d6-8461-440c-aa4d-bf197b2c2499}" (
echo %0 :: - 3.5.3 64bit
"%LOCALAPPDATA%\Package Cache\{b94f45d6-8461-440c-aa4d-bf197b2c2499}\python-3.5.3-amd64.exe" /uninstall /passive
2017-05-24 22:22:43 +00:00
)
:: 32 bit
if exist "%LOCALAPPDATA%\Package Cache\{a10037e1-4247-47c9-935b-c5ca049d0299}" (
echo %0 :: - 3.5.3 32bit
"%LOCALAPPDATA%\Package Cache\{a10037e1-4247-47c9-935b-c5ca049d0299}\python-3.5.3" /uninstall /passive
2017-05-24 22:22:43 +00:00
)
rem wipe the Python directory
2017-08-31 20:15:06 +00:00
echo %0 :: Removing the C:\Python35 Directory ...
echo ---------------------------------------------------------------------
2017-08-31 20:15:06 +00:00
rd /s /q "C:\Python35"
if %errorLevel%==0 (
echo Successful
) else (
echo Failed, please remove manually
)
goto eof
2016-08-09 19:53:55 +00:00
:eof
echo.
echo =====================================================================
echo End of %0
echo =====================================================================