damoncourtney / installjammer

InstallJammer Multiplatform Installer
http://www.installjammer.com/
Other
32 stars 20 forks source link

InstallAPI::FetchURL does not handle redirect for Sun AutoDL #69

Closed RayzorDuff closed 13 years ago

RayzorDuff commented 13 years ago

I'm attempting to create an auto download of Sun's JRE using the URL: http://javadl.sun.com/webapps/download/AutoDL?BundleId=42727

To do this, I've constructed a page that uses checks from the Locate Java Runtime and OS checks before the Fetch URL and Execute External Program calls. The process is failing, however, during the Fetch.

I see that there is some code already in installapi.tcl for handling a redirect. I'm not sure what is different about this particular redirect, but perhaps the following link will help? http://wiki.tcl.tk/11831

As a side note (and I can write up a separate issue if that's preferable), can the Fetch mechanism be updated to store the downloaded file with the execute bit already set? As it stands, I also need to find a way to set the execute bit on the downloaded Java installer before Execute External Program will pass.

damoncourtney commented 13 years ago

I'll have to test with the URL you sent and see why the redirect isn't working properly.

As for an executable bit, you're right. It should automatically set one after a file is downloaded. You can always do it yourself with an action or a script, but it feels like one of those things that should just be automatic. 0-]

damoncourtney commented 13 years ago

I just pushed a fix for this. Should be good. I fixed the redirects and made the default file permissions 0755 when downloading to a file.

RayzorDuff commented 13 years ago

Thanks Damon! Is there any chance you can merge this to the 1.3 branch? I moved to 1.3 but I can't remember the reason offhand except that it was important. ;)

RayzorDuff commented 13 years ago

Here's the patch for the 1.3 branch. I've tested this and it looks good.

diff -urN installjammer.orig/lib/Actions/GeneralActions/FetchURL.action installjammer/lib/Actions/GeneralActions/FetchURL.action --- installjammer.orig/lib/Actions/GeneralActions/FetchURL.action 2010-11-23 22:34:36.000000000 -0700 +++ installjammer/lib/Actions/GeneralActions/FetchURL.action 2011-04-06 16:41:12.393543165 -0600 @@ -46,93 +46,21 @@ progress of the download"

proc ::InstallJammer::actions::FetchURL { obj } {

- global info

- package require http

 $obj properties props -subst 1

- ::http::config -proxyhost $props(ProxyHost) -proxyport $props(ProxyPort)

- set total 0

- -virtualtext $props(ProgressVirtualText) -value 0 -autoupdate 1

- }

- set opts [list -blocksize 8192]

- }

- set filename [string trim $props(Target)]

- }

- fconfigure $fp -translation binary

- }

- }

- }

- }

- upvar #0 $token state

- close $fp

- }

- }