Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change filezilla server's download location #64

Closed
wants to merge 4 commits into from

Conversation

scipiojr
Copy link

Since July 1st, 2013, sf has established a new program called DevShare, meaning that (some? all?) installer packages downloaded from SF will be wrapped by a custom installer, which means that the filename of the download has changed (SFInstaller_SFFZ_filezilla_10770709_.exe) and is no loanger version dependent. Also the command line switches do no longer function as known, and a silent mode is not provided, at least not documented or known to me. As a result, this packages is no longer able to build the right download url and therefor fails to download the installation file.

Fortunately, the filezilla project hosts its own copy which is the original installer, following the already-known naming pattern. I have modified the files to use this download instead of sourceforge's.

Switch download location from sourceforge to filezilla's own server as sourceforge no longer provides packages without their own sf-installer
Change download location from sourceforge to filezilla's own server as sf doesn't provide "unbundled" downloads any more
@ferventcoder
Copy link
Owner

Total WTF for SF.

@ferventcoder
Copy link
Owner

@TomOne - were you aware of SF messing up their downloads?

@TomOne
Copy link
Contributor

TomOne commented Jan 18, 2014

Yes, I am aware. But that DevShare thing gets only applied when the developers of the software – in this case the Filezilla developers – agree to include it. I think they also get money for it. The link to the installer with the DevShare adware is on the official FileZilla site: https://filezilla-project.org/download.php?type=server
But if you go to Show additional download options on the same site, there’s the possibility to download FileZilla Server without adware and working silent mode. But just to make sure, it is better to get the download link from the “Files” section in the official SourceForge repository: http://sourceforge.net/projects/filezilla/files/FileZilla%20Server/

The developers of GIMP moved their files away from SourceForge, because they didn’t like this advertising strategy. You can read the news from 2013-11-05 on http://www.gimp.org/ for more information. Also read this: http://www.gluster.org/2013/08/how-far-the-once-mighty-sourceforge-has-fallen/

@TomOne
Copy link
Contributor

TomOne commented Jan 18, 2014

@scipiojr both old and now download links of the chocolateyInstall.ps1 lead to a 404 error

This package has also another issue: it tries to write a file into the Program Files\FileZilla Server folder. If an user has UAC activated, the package will break with an access denied error.

I don’t understand at all why people deactivate UAC. It’s a good security feature that Linux already had many years before it was introduced with Windows Vista: the su or sudo command. So Microsoft did a good work in this case. But deactivating UAC throws one back to the security level of Windows XP. 😄

@ferventcoder
Copy link
Owner

@TomOne UAC is crap without a command line call like su or sudo - that's why folks deactivate it.

@TomOne
Copy link
Contributor

TomOne commented Jan 19, 2014

I’m sure malware authors are quite happy about that. So they can get adiminstrator rights immediately and the only barrier would be the antivirus software – if one is installed and recognizes the malware. 😆

But now back to the topic. I’ve found out an interesting fact: If you download FileZilla or FileZilla Server from the official SourceForge project page, with a browser, using these links

But if you download it with wget and also with Chocolatey from the same URL, it downloads the clean installer without crapware. After experimenting a little bit I discovered that it’s the user agent which makes the difference. SourceForge detects if the user has a commonly used browser and offers the crapware in that case. If for example I spoof the user agent with wget, using this command:

wget --user-agent="Mozilla/5.0 (Windows NT 6.3; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0" http://sourceforge.net/projects/filezilla/files/FileZilla_Client/3.7.3/FileZilla_3.7.3_win32-setup.exe/download

it returns a HTML page with the following meta element:

<meta http-equiv="refresh" content="5; url=http://ak.pipoffers.apnpartners.com/static/partners/dynamic/SFFZ/SFInstaller_SFFZ_filezilla_8992693_.exe">

Here we got the culprit. This is responsible for the redirection to the adware installer. 😈

So this pull request is basically not necessary. But we need to fix the other two issues of this package:

  • Download link gives 404 error
  • Access denied error on systems with UAC active

@scipiojr
Copy link
Author

I must admit that the whole automatic package magic doesn't really work for me, so please apologize the half-baked proposal. Having said that, I also don't know how to put together the right download url, though apparently the package tries to use the version information directly where it should replace the dots by underscores.

Concerning the UAC problems:
As I already had a manual Filezilla Server installation before the discovery of Chocolatey, the checks performed by this package didn't apply to me, so I didn't realize there was a pitfall there.

I tried to address the UAC problem with another patch, but as I'm more the svn guy, I'm not really sure how to post the new proposal the "git way". I guess I should have opened a new pull request, but the context of this discussion might get lost there. If you want me to do so, let me know, for the time being, here is the corresponding diff:

69bef5bc5978ff7e327ea2b8a176bd2d722baeda
 filezilla.server/tools/chocolateyInstall.ps1 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/filezilla.server/tools/chocolateyInstall.ps1 b/filezilla.server/tools/chocolateyInstall.ps1
index 6808761..e62595c 100644
--- a/filezilla.server/tools/chocolateyInstall.ps1
+++ b/filezilla.server/tools/chocolateyInstall.ps1
@@ -13,16 +13,18 @@ try {
   Start-sleep 8

   if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir)}
-  if (![System.IO.Directory]::Exists($fileZillaInstallDir)) {[System.IO.Directory]::CreateDirectory($fileZillaInstallDir)}
+  if (![System.IO.Directory]::Exists($fileZillaInstallDir)) {
+    Start-ChocolateyProcessAsAdmin "[System.IO.Directory]::CreateDirectory('$fileZillaInstallDir')" -validExitCodes @(0,-1073741510)
+  }

   if (![System.IO.File]::Exists("$($fileZillaInstallDir)\FileZilla Server Interface.xml")) {
     Write-Host "Copying FileZilla Server Interface.xml to install directory"
-    Copy-Item "$($toolsDir)\FileZilla Server Interface.xml" "$fileZillaInstallDir" -Force
+    Start-ChocolateyProcessAsAdmin "Copy-Item '$($toolsDir)\FileZilla Server Interface.xml' '$fileZillaInstallDir' -Force"
   }

   if (![System.IO.File]::Exists("$($fileZillaInstallDir)\FileZilla Server.xml")) {
     Write-Host "Copying FileZilla Server.xml to install directory"
-    Copy-Item "$($toolsDir)\FileZilla Server.xml" "$fileZillaInstallDir" -Force
+    Start-ChocolateyProcessAsAdmin "Copy-Item '$($toolsDir)\FileZilla Server.xml' '$fileZillaInstallDir' -Force"
   }

   Install-ChocolateyPackage 'filezilla.server' 'exe' '/S' 'http://download.filezilla-project.org/FileZilla_Server-{{PackageVersion}}.exe'

For sure it is far from beeing the perfect solution, as the user is prompted for rights elevation 3 times, but as the copy operations are only neccessary on a fresh install, I think this could be tolerated.

@ferventcoder
Copy link
Owner

Ketarin allows you to change your User Agent. Just an FYI. This might help with the download issues?

}

if (![System.IO.File]::Exists("$($fileZillaInstallDir)\FileZilla Server.xml")) {
Write-Host "Copying FileZilla Server.xml to install directory"
Copy-Item "$($toolsDir)\FileZilla Server.xml" "$fileZillaInstallDir" -Force
Start-ChocolateyProcessAsAdmin "Copy-Item '$($toolsDir)\FileZilla Server.xml' '$fileZillaInstallDir' -Force"
}

Install-ChocolateyPackage 'filezilla.server' 'exe' '/S' 'http://downloads.sourceforge.net/filezilla/FileZilla_Server-{{PackageVersion}}.exe'
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace 'http://downloads.sourceforge.net/filezilla/FileZilla_Server-{{PackageVersion}}.exe'
with '{{DownloadUrl}}'. That will fix the 404 error.

@TomOne
Copy link
Contributor

TomOne commented Jan 29, 2014

@scipiojr

For sure it is far from beeing the perfect solution, as the user is prompted for rights elevation 3 times, but as the copy operations are only neccessary on a fresh install, I think this could be tolerated.

You could run an external PowerShell script with administrator permissions. In that case the UAC prompt would appear only once. I did that in my defraggler package: https://github.com/TomOne/chocolateyautomaticpackages/blob/master/defraggler/tools/chocolateyInstall.ps1

@ferventcoder
Copy link
Owner

Closing as this has been moved out of this repo - if you believe this is still something to implement, let's discuss it over at https://github.com/ferventcoder/chocolatey-packages/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants