Closed RayzorDuff closed 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-]
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.
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. ;)
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 } {
$obj properties props -subst 1
lappend args -progressvirtualtext $props(ProgressVirtualText)
}
lappend args -virtualtext $props(Target)
}
eval ::InstallAPI::FetchURL $args } diff -urN installjammer.orig/lib/installapi.tcl installjammer/lib/installapi.tcl --- installjammer.orig/lib/installapi.tcl 2010-11-23 22:34:38.000000000 -0700 +++ installjammer/lib/installapi.tcl 2011-04-15 11:08:35.842009365 -0600 @@ -369,6 +369,9 @@ }
proc ::InstallAPI::FetchURL { args } { +
global conf + ::InstallAPI::ParseArgs _args $args { -blocksize { string 0 "8192" } -file { string 0 "" } @@ -502,6 +505,10 @@ }
http::cleanup $token
+
}
}
return 1 @@ -2433,12 +2440,12 @@
if {$code == 200} { set return 1
} elseif {[string match {30[1237]} $code]} {
array set meta $state(meta)
if {![info exists meta(Location)]} {
return -code error "$code Redirect without new Location"
}
set _args(-url) $meta(Location)
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.