Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions floppy/01-install-wget.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration works if you download a file over HTTP but not over HTTPS. It fails with the first download of wget with my proxy and it works if I use %https_proxy%.

) 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
if not errorlevel 1 if exist "%filename%" goto exit0

if exist "%filename%" goto exit0
if defined USE_BITS (
if "%USE_BITS%" == "false" if not exist "%filename%" goto exit1
)

set bitsadmin=

Expand Down
11 changes: 9 additions & 2 deletions floppy/_download.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,18 @@ if not defined PACKER_DEBUG set WGET_OPTS=--no-verbose
if not errorlevel 1 if exist "%filename%" goto exit0

:powershell

powershell -Command "(New-Object System.Net.WebClient).DownloadFile('%url%', '%filename%')" <NUL
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('%url%', '%filename%')" >nul
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here with HTTPS

) 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=
Expand Down
17 changes: 17 additions & 0 deletions floppy/_packer_config.cmd
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 6 additions & 1 deletion floppy/bitvisessh.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
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('%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
Expand Down
14 changes: 11 additions & 3 deletions floppy/cygwin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
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('%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
Expand All @@ -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

Expand Down Expand Up @@ -120,4 +129,3 @@ goto :exit
verify other 2>nul

:exit

2 changes: 1 addition & 1 deletion floppy/fixnetwork.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
7 changes: 6 additions & 1 deletion floppy/hotfix-KB2842230.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
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('%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
Expand Down
12 changes: 8 additions & 4 deletions floppy/openssh.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
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('%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
Expand Down
6 changes: 5 additions & 1 deletion floppy/upgrade-wua.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
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('%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

Expand Down