Index: main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java
===================================================================
--- main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java	(revision 31876)
+++ main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java	(revision 31877)
@@ -619,24 +619,27 @@
 
 	    String [] env = null;
-         
-	    if (Utility.isWindows()) {
-              	prcs = new SafeProcess(cmd);
-	    }
-	    else {
+
 		if (proxy_url != null && !proxy_url.equals("")) {          	
 		    // Specify proxies as environment variables
 		    // Need to manually specify GSDLHOME and GSDLOS also
-		    env = new String[6];
-                    proxy_url = proxy_url.replaceAll("http://","");
-		    env[0] = "http_proxy=http://"+proxy_url;
-		    env[1] = "https_proxy=http://"+proxy_url; // HTTP protocol for https:// too
-		                // see also https://wiki.archlinux.org/index.php/proxy_settings
-		    env[2] = "ftp_proxy=ftp://"+proxy_url;
+		    
+			proxy_url = proxy_url.replaceAll("http://","");
+					
+			env = new String[7];
+		    
+			env[0] = "http_proxy=http://"+proxy_url;
+			env[1] = "https_proxy=http://"+proxy_url; // yes, HTTP protocol for https:// too
+		                   // see also https://wiki.archlinux.org/index.php/proxy_settings
+			env[2] = "ftp_proxy=ftp://"+proxy_url;
 		    env[3] = "GSDLHOME=" + Configuration.gsdl_path;
 		    env[4] = "GSDLOS=" + Gatherer.client_operating_system;
 		    env[5] = "WGETRC=" + LocalGreenstone.getBinOSDirectoryPath(Gatherer.client_operating_system)+"wgetrc"; // teach it where the wgetrc file lives, in gs2build/bin/<os>
+			// If PATH is not made available, so that Perl is not on the PATH, then WgetDownload.pm's open3() call
+			// to run wget fails with cryptic failure message. So make PATH available for open3():
+			env[6] = "PATH="+System.getenv("PATH");		
+			
 		    prcs = new SafeProcess(cmd, env, null);
 		} 
-		else if(Gatherer.isGsdlRemote && Gatherer.isDownloadEnabled) {
+		else if(Gatherer.isGsdlRemote && Gatherer.isDownloadEnabled && !Utility.isWindows()) {
 		    // Not Windows, but running client with download panel
 		    // Need to manually specify GSDLHOME and GSDLOS
@@ -651,5 +654,5 @@
 		    prcs = new SafeProcess(cmd);
 		}
-	    }
+
 	    //System.out.println(newcmd);
 	    prcs.setMainHandler(this); // attach handler to clean up before and after process.destroy()
Index: main/trunk/gli/src/org/greenstone/gatherer/download/ServerInfoDialog.java
===================================================================
--- main/trunk/gli/src/org/greenstone/gatherer/download/ServerInfoDialog.java	(revision 31876)
+++ main/trunk/gli/src/org/greenstone/gatherer/download/ServerInfoDialog.java	(revision 31877)
@@ -104,24 +104,26 @@
 	String[] command = (String[]) commands.toArray(new String[0]);
 	DebugStream.println("Getting server info: "+commands);
-	try {
-	    String [] env = null;
+	try {	    
 	    SafeProcess prcs = null;
 	    
-	    if (Utility.isWindows()) {
-		prcs = new SafeProcess(command);
-	    }
-	    else {
-		if (proxy_url != null && !proxy_url.equals("")) {          	
+		if (proxy_url != null && !proxy_url.equals("")) {
 		    // Specify proxies as environment variables
 		    // Need to manually specify GSDLHOME and GSDLOS also
-		    env = new String[6];
-                    proxy_url = proxy_url.replaceAll("http://","");
-		    env[0] = "http_proxy=http://"+proxy_url;
-		    env[1] = "https_proxy=http://"+proxy_url; // yes, HTTP protocol for https:// too
+		    
+            proxy_url = proxy_url.replaceAll("http://","");
+			
+			String [] env = new String[7];
+		    
+			env[0] = "http_proxy=http://"+proxy_url;
+			env[1] = "https_proxy=http://"+proxy_url; // yes, HTTP protocol for https:// too
 		                   // see also https://wiki.archlinux.org/index.php/proxy_settings
-		    env[2] = "ftp_proxy=ftp://"+proxy_url;
+			env[2] = "ftp_proxy=ftp://"+proxy_url;
 		    env[3] = "GSDLHOME=" + Configuration.gsdl_path;
 		    env[4] = "GSDLOS=" + Gatherer.client_operating_system;
 		    env[5] = "WGETRC=" + LocalGreenstone.getBinOSDirectoryPath(Gatherer.client_operating_system)+"wgetrc"; // teach it where the wgetrc file lives, in gs2build/bin/<os>
+			// If PATH is not made available, so that Perl is not on the PATH, then WgetDownload.pm's open3() call
+			// to run wget fails with cryptic failure message. So make PATH available for open3():
+			env[6] = "PATH="+System.getenv("PATH");
+			
 		    prcs = new SafeProcess(command, env, null);
 		} 
@@ -130,5 +132,4 @@
 		    prcs = new SafeProcess(command);
 		}
-	    }
 	    
 	    // special processing of Process' stderr stream: 
Index: main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java
===================================================================
--- main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java	(revision 31876)
+++ main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java	(revision 31877)
@@ -780,5 +780,5 @@
 		
 		// Write the use proxy command - we don't do this anymore, instead we set environment variables - hopefully these can't be spied on like the following can (using ps) - actually the environment stuff didn't work for windows, so lets go back to this
-		if (Utility.isWindows()) {
+		/*if (Utility.isWindows()) {
 	    
 		   arg = current_download.getArgument("user_name");
@@ -790,10 +790,11 @@
 		   arg.setAssigned(true);
 		  }
-	       else{
+		 
+	       else{*/
  		    String user_name = user_pass.substring(0, user_pass.indexOf("@"));
  		    String user_pwd = user_pass.substring(user_pass.indexOf("@") + 1);
  		    proxy_url = user_name+":"+user_pwd+"@"+proxy_host+":"+proxy_port+"/";
 		   
- 	       }
+ 	       /*}*/
 		
 	       return true;
Index: main/trunk/greenstone2/perllib/downloaders/WebDownload.pm
===================================================================
--- main/trunk/greenstone2/perllib/downloaders/WebDownload.pm	(revision 31876)
+++ main/trunk/greenstone2/perllib/downloaders/WebDownload.pm	(revision 31877)
@@ -193,4 +193,7 @@
     my $strBaseCMD = $strOptions." --tries=2 -q -O - \"$self->{'url'}\"";
 
+	#&util::print_env(STDERR, "https_proxy", "http_proxy", "HTTPS_PROXY", "HTTP_PROXY", "ftp_proxy", "FTP_PROXY");
+	#&util::print_env(STDERR);	
+	
     my $strIdentifyText = $self->useWget($strBaseCMD);
     
Index: main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm
===================================================================
--- main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm	(revision 31876)
+++ main/trunk/greenstone2/perllib/downloaders/WgetDownload.pm	(revision 31877)
@@ -165,18 +165,11 @@
 }
 
-sub getWgetOptions
-{
-    my ($self) = @_;
-    my $strOptions = "";
-
-    # If http_proxy ENV VARS are not set, but proxy Perl vars are set, then we're on Windows
-    # and need to use the proxy vars as flags to wget
-    # If http_proxy Env Vars are set, then we're on Linux, wget will use the http(s) proxy
-    # env vars and we shouldn't be passing any proxy perl vars as flags
-    
-    # Truth in Perl: https://home.ubalt.edu/abento/452/perl/perltruth.html
-    # http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F
-    
-    if (!$ENV{'http_proxy'} && !$ENV{'https_proxy'}) {
+# Not using this. On Windows, we used to pass proxying settings as flags to wget. But, as that can be
+# seen with Task Manager, we now have the proxy settings set in the environment and are no longer passing it
+sub addProxySettingsAsWgetFlags
+{
+	my ($self) = @_;
+	my $strOptions = "";
+	
 	if ($self->{'proxy_on'} && $self->{'proxy_host'} && $self->{'proxy_port'})
 	{
@@ -193,7 +186,25 @@
 	    $strOptions .= " --proxy ";
 	}
-    }
-
-    if($self->{'no_check_certificate'}) { #&& $self->{'url'} =~ m/^https\:/) { # URL may be http that gets redirected to https, so if no_check_certificate is on, turn it on even if URL is http
+	
+	return $strOptions;
+}
+
+sub getWgetOptions
+{
+    my ($self) = @_;
+    my $strOptions = "";
+    
+	# If proxy settings are set up in the environment, wget is ready to use them. More secure.
+	# But if proxy settings are not set up in the environment, pass them as flags to wget
+	# This is less secure, as pwd etc visible in task manager, but it was the original way in
+	# which wget was run on windows.
+	# Truth in Perl: https://home.ubalt.edu/abento/452/perl/perltruth.html
+    # http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F
+
+    if (!$ENV{'http_proxy'} && !$ENV{'https_proxy'}) {
+		$strOptions .= $self->addProxySettingsAsWgetFlags();
+    } # else wget will use proxy settings in environment, assume enough settings have been provided
+	
+    if($self->{'no_check_certificate'}) { # URL may be http that gets redirected to https, so if no_check_certificate is on, turn it on even if URL is http
 
 	$strOptions .= " --no-check-certificate ";
