updateHostsWindows.bat: expand
authorTomasz Przybył <redacted>
Sat, 3 Sep 2016 13:52:28 +0000 (15:52 +0200)
committerGitHub <redacted>
Sat, 3 Sep 2016 13:52:28 +0000 (15:52 +0200)
- check if python runtime 3.5 is available on system
- update automaticaly hosts file before replace them

updateHostsWindows.bat

index 2d23ebdcbbf4ec053953d87fa6bc81f7d1a4b541..315db35d34e4849e4f3ad1a4877da0d9f63d9ff4 100644 (file)
@@ -3,12 +3,34 @@
 :: Next DNS Cache will be refreshed.
 :: YOU NEED RUNNING THIS BAT FILE IN COMMAND LINE PROMPT WITH ADMINISTRATOR PRIVILIGES
 @ECHO OFF
+
+if not exist "%WINDIR%\py.exe" (
+       ECHO :: ERROR :: Python 3.5 Runtime NOT FOUND...
+       ECHO :: ERROR :: Download and install lastest Python 3.5 for Windows from https://www.python.org/downloads/
+       ECHO :: ERROR :: Exit...
+       GOTO END
+) ELSE ( 
+       GOTO PY35RT
+ )
+:PY35RT
+if not exist "%PROGRAMFILES%\python35\Python35.dll" (
+       ECHO :: ERROR :: Python 3.5 Runtime NOT FOUND...
+       ECHO :: ERROR :: Download and install lastest Python 3.5 for Windows from https://www.python.org/downloads/
+       ECHO :: ERROR :: Exit...
+       GOTO END
+) ELSE ( 
+       ECHO :: INFO :: Python 3.5 Runtime was found...
+       ECHO :: INFO :: Running main script...
+    GOTO DNSCHECK
+ )
+:DNSCHECK
 if not exist "%WINDIR%\System32\drivers\etc\hosts.skel" (
        COPY %WINDIR%\System32\drivers\etc\hosts %WINDIR%\System32\drivers\etc\hosts.skel
        GOTO :CLEARDNS
 )
 :CLEARDNS
+       updateHostsFile.py -a
        COPY hosts %WINDIR%\System32\drivers\etc\
        ipconfig /flushdns
        GOTO END
-:END
\ No newline at end of file
+:END
git clone https://git.99rst.org/PROJECT