From f0cdd7d678284f85542bc78e030b0ef2a5ea61d3 Mon Sep 17 00:00:00 2001 From: Jacob Danner Date: Fri, 8 Jun 2012 23:25:19 -0700 Subject: [PATCH] Attempt to fix Issue #10 Installer should read proxy settings Please take these changes with a grain of salt. I was unable to get the installer to build locally for many many other reasons and figured it'd be best to pass along an 'example' of how this might be done. It makes used of the ProxySettings plugin to get the proxy value for HTTP, the value on the stack is the checked and the --proxy flag is added properly. --- install.nsi | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/install.nsi b/install.nsi index 00a41d5..a8d4a18 100644 --- a/install.nsi +++ b/install.nsi @@ -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