Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Attempt to fix Issue #10 Installer should read proxy settings #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
38 changes: 29 additions & 9 deletions install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -317,19 +317,39 @@ Section "Cygwin" SecCygwin
NSISdl::download ${CYGWIN_URL} "$DESKTOP\cygwin-setup.exe"

Pop $0
StrCmp $0 "success" ok
${IfNot} $0 "success"
MessageBox MB_OK "Couldn't download cygwin's setup.exe: $0"
SetErrors
DetailPrint "$0"
ok:

ExecWait "$DESKTOP\cygwin-setup.exe --quiet-mode \
--local-package-dir=c:\cygtmp\ \
--site=http://cygwin.cict.fr \
--packages=curl,make,mingw64-i686-gcc-g++,mingw64-i686-gcc,patch,rlwrap,libreadline6,diffutils,wget,vim \
>NUL 2>&1"
${EndIf}

end:
; add cygwin --proxy settings here
; references, unless there is a way to get the proxy from NSISdl script
; http://cygwin.com/faq/faq.setup.html#faq.setup.cli
; #Win32::Registry::HKEY_CURRENT_USER
; "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\" "ProxyServer"
; Add the following plugin
; http://nsis.sourceforge.net/ProxySettings

Var px
ProxySettings::GetConnectionProxyByProtocol "http://cygwin.cict.fr"
Pop $0
${If} $0 != ""
# read the value from the registry into the $0 register
# readRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" CurrentVersion
ExecWait "$INSTDIR\cygwin-setup.exe --quiet-mode \
--local-package-dir=$INSTDIR\cygtmp\ \
--site=http://cygwin.cict.fr \
--packages=curl,make,mingw64-i686-gcc-g++,mingw64-i686-gcc,patch,rlwrap,libreadline6,diffutils,wget,vim \
>NUL 2>&1"
${Else} ; TODO: could/should check for other errors
ExecWait "$INSTDIR\cygwin-setup.exe --quiet-mode \
--local-package-dir=$INSTDIR\cygtmp\ \
--proxy=$0 \
--site=http://cygwin.cict.fr \
--packages=curl,make,mingw64-i686-gcc-g++,mingw64-i686-gcc,patch,rlwrap,libreadline6,diffutils,wget,vim \
>NUL 2>&1"
${EndIf}

SectionEnd

Expand Down