diff --git a/floppy/01-install-wget.cmd b/floppy/01-install-wget.cmd index c33f0f48..064671f6 100644 --- a/floppy/01-install-wget.cmd +++ b/floppy/01-install-wget.cmd @@ -23,10 +23,17 @@ if exist "%filename%" goto exit0 echo ==^> Downloading "%WGET_URL%" to "%filename%" :powershell +if defined http_proxy ( + powershell -Command "$wc = (New-Object System.Net.WebClient); $wc.proxy = (new-object System.Net.WebProxy('%http_proxy%')) ; $wc.proxy.BypassList = (('%no_proxy%').split(',')) ; $wc.DownloadFile('%WGET_URL%', '%filename%')" >nul +) else ( + powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%WGET_URL%', '%filename%')" >nul +) -powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%WGET_URL%', '%filename%')" nul +) else ( + powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%url%', '%filename%')" >nul +) if not errorlevel 1 if exist "%filename%" goto exit0 +if defined USE_BITS ( + if "%USE_BITS%" == "false" if not exist "%filename%" goto exit1 +) + :bitsadmin set bitsadmin= diff --git a/floppy/_packer_config.cmd b/floppy/_packer_config.cmd index a4d8406a..29768c05 100644 --- a/floppy/_packer_config.cmd +++ b/floppy/_packer_config.cmd @@ -1,5 +1,22 @@ @echo off +:: Uncomment to disable trying to use BITS for file downloads. +:: set USE_BITS=false + +:: Uncomment the following to set proxy server config for all scripts +:: Be sure to set the proxy and no_proxy lines to your required settings +:: set http_proxy= +:: set https_proxy= +:: set proxy=10.10.10.10:80 +:: +:: if defined proxy ( +:: echo ==^> Setting HTTP Proxy.... +:: echo ==^> HTTP Proxy Set to %proxy% +:: set http_proxy=http://%proxy% +:: set https_proxy=http://%proxy% +:: set no_proxy=noproxy.domain.com,noproxy2.domain.com +:: ) + :: Uncomment the following to set a different Cygwin mirror :: Default: http://mirrors.kernel.org/sourceware/cygwin :: set CYGWIN_MIRROR_URL=http://mirrors.kernel.org/sourceware/cygwin diff --git a/floppy/bitvisessh.bat b/floppy/bitvisessh.bat index 5b54a246..032ea8d4 100644 --- a/floppy/bitvisessh.bat +++ b/floppy/bitvisessh.bat @@ -19,8 +19,13 @@ if exist "%SystemRoot%\_download.cmd" ( call "%SystemRoot%\_download.cmd" "%BITVISE_URL%" "%BITVISE_PATH%" ) else ( echo ==^> Downloading "%BITVISE_URL%" to "%BITVISE_PATH%" - powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%BITVISE_URL%', '%BITVISE_PATH%')" nul + ) else ( + powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%BITVISE_URL%', '%BITVISE_PATH%')" >nul + ) ) + if not exist "%BITVISE_PATH%" goto exit1 echo ==^> Blocking SSH port 22 on the firewall diff --git a/floppy/cygwin.bat b/floppy/cygwin.bat index 00b42400..3aa853c9 100644 --- a/floppy/cygwin.bat +++ b/floppy/cygwin.bat @@ -34,8 +34,13 @@ if exist "%SystemRoot%\_download.cmd" ( call "%SystemRoot%\_download.cmd" "%CYGWIN_URL%" "%CYGWIN_PATH%" ) else ( echo ==^> Downloading "%CYGWIN_URL%" to "%CYGWIN_PATH%" - powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%CYGWIN_URL%', '%CYGWIN_PATH%')" nul + ) else ( + powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%CYGWIN_URL%', '%CYGWIN_PATH%')" >nul + ) ) + if errorlevel 1 goto exit1 echo ==^> Blocking SSH port 22 on the firewall @@ -50,7 +55,11 @@ set /a CYGWIN_TRY=%CYGWIN_TRY%+1 echo ==^> Installing Cygwin (attempt %CYGWIN_TRY% of %CYGWIN_TRIES%) -"%CYGWIN_PATH%" -a %CYGWIN_ARCH% -q -R %CYGWIN_HOME% -P %CYGWIN_PACKAGES% -s %CYGWIN_MIRROR_URL% +if defined proxy ( + "%CYGWIN_PATH%" -a %CYGWIN_ARCH% -q -R %CYGWIN_HOME% -P %CYGWIN_PACKAGES% -s %CYGWIN_MIRROR_URL% -p %proxy% +) else ( + "%CYGWIN_PATH%" -a %CYGWIN_ARCH% -q -R %CYGWIN_HOME% -P %CYGWIN_PACKAGES% -s %CYGWIN_MIRROR_URL% +) if not errorlevel 1 goto installed_ok @@ -120,4 +129,3 @@ goto :exit verify other 2>nul :exit - diff --git a/floppy/fixnetwork.ps1 b/floppy/fixnetwork.ps1 index f5bfdd2e..74330797 100644 --- a/floppy/fixnetwork.ps1 +++ b/floppy/fixnetwork.ps1 @@ -20,4 +20,4 @@ $connections |foreach { Write-Host $_.GetNetwork().GetName()"category was previously set to"$_.GetNetwork().GetCategory() $_.GetNetwork().SetCategory(1) Write-Host $_.GetNetwork().GetName()"changed to category"$_.GetNetwork().GetCategory() -} \ No newline at end of file +} diff --git a/floppy/hotfix-KB2842230.bat b/floppy/hotfix-KB2842230.bat index 6727c143..7bcb7f80 100644 --- a/floppy/hotfix-KB2842230.bat +++ b/floppy/hotfix-KB2842230.bat @@ -31,8 +31,13 @@ if exist "%SystemRoot%\_download.cmd" ( call "%SystemRoot%\_download.cmd" "%HOTFIX_2842230_URL%" "%HOTFIX_2842230_PATH%" ) else ( echo ==^> Downloading "%HOTFIX_2842230_URL%" to "%HOTFIX_2842230_PATH%" - powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%HOTFIX_2842230_URL%', '%HOTFIX_2842230_PATH%')" nul + ) else ( + powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%HOTFIX_2842230_URL%', '%HOTFIX_2842230_PATH%')" >nul + ) ) + if errorlevel 1 goto exit1 echo ==^> Extracting Hotfix KB2842230 diff --git a/floppy/openssh.bat b/floppy/openssh.bat index cec19dc0..3288c5f5 100644 --- a/floppy/openssh.bat +++ b/floppy/openssh.bat @@ -16,12 +16,16 @@ mkdir "%OPENSSH_DIR%" pushd "%OPENSSH_DIR%" if exist "%SystemRoot%\_download.cmd" ( - call "%SystemRoot%\_download.cmd" "%OPENSSH_URL%" "%OPENSSH_PATH%" + call "%SystemRoot%\_download.cmd" "%OPENSSH_URL%" "%OPENSSH_PATH%" ) else ( - echo ==^> Downloading "%OPENSSH_URL%" to "%OPENSSH_PATH%" - powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%OPENSSH_URL%', '%OPENSSH_PATH%')" nul + ) else ( + powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%OPENSSH_URL%', '%OPENSSH_PATH%')" >nul + ) ) -if not exist "%OPENSSH_PATH%" goto exit1 + +if errorlevel 1 goto exit1 echo ==^> Blocking SSH port 22 on the firewall netsh advfirewall firewall add rule name="SSHD" dir=in action=block program="%ProgramFiles%\OpenSSH\usr\sbin\sshd.exe" enable=yes diff --git a/floppy/upgrade-wua.bat b/floppy/upgrade-wua.bat index 4ac8a74d..181ff990 100644 --- a/floppy/upgrade-wua.bat +++ b/floppy/upgrade-wua.bat @@ -24,7 +24,11 @@ if exist "%SystemRoot%\_download.cmd" ( call "%SystemRoot%\_download.cmd" "%WUA_URL%" "%WUA_PATH%" ) else ( echo ==^> Downloading "%WUA_URL%" to "%WUA_PATH%" - powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%WUA_URL%', '%WUA_PATH%')" nul + ) else ( + powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%WUA_URL%', '%WUA_PATH%')" >nul + ) ) if not exist "%WUA_PATH%" goto exit1