PDA

View Full Version : Screen: Download File Progress


Brett
09-21-2004, 04:03 PM
Screen: Download File Progress
Last Revision: September 21, 2004 (001)

Overview
This screen downloads a file from the Internet on a progress bars screen. Full progress and statistics are displayed during the download. The Cancel button cancels the download. As well as being useful in your projects, this screen will also teach you how to:

Use the HTTP.Download action
Use a callback function during a download
Generally use the progress screens

Author Information
This screen was created for use by registered owners of Setup Factory 7.0 by Brett Kapilik (http://www.setupfactory.com). Indigo Rose Corporation does not provide support for any 3rd party screens or addons.

Installation Instructions
To make this screen available to your Setup Factory 7.0 projects, follow the steps below:

Close Setup Factory 7.0, if it is running.
Browse to the folder where Setup Factory 7.0 is installed on your system. By default it is C:\Program Files\Setup Factory 7.0.
Locate the "Screens" folder.
Unzip the contents of Download_File_Progress.zip (see bottom of article) into the Setup Factory 7.0 Screens folder, making sure you preserve the folder structure.
Restart Setup Factory 7.0.
To use this new screen in your project, select Project > Screens from the main menu and click the Before Installing or After Installing tab. Click the Add button and select "Download File Progress" from the screen gallery.

Next, double click the screen and then click the Actions tab. Go to the On Preload event and set the strSourceURL, strDestinationFile and bIsBinaryFile variables.

You should now be able to build and test the screen.

Screen Name: Download File Progress
Type: Setup Factory 7.0 Screen
Created By: Brett Kapilik

Comments? Please post them here.

rctshine
03-23-2005, 07:17 PM
Is there a way to have this download more than one file on this screen? :huh

Tek
04-02-2005, 11:07 AM
You should be able to use any of the 'Download Multiple Files' screens already built into TU2 to accomplish this.

cyberops
04-12-2005, 08:17 PM
just a simple question, im using this download and i love it but is it possible where the path is to store it to have it so it download to the current location of the setup ???? i hope someone knows what i mean.

Eagle
04-12-2005, 09:46 PM
the Lua builtin variable _SourceFolder will return the full Folder path to mysetup.exe.

find the action in the download script that sets the destination path
and change it to for eg: _SourceFolder.."\\mydest.ext"

or _TempLaunchFolder.."\\.... will dload to where irsetup.exe is running.

HTH

..another thing to consider when dloading to dests is to perform a
drive.getfreespace check

look it up in actions ..you can use the dest folder full path if ya like.

cyberops
04-12-2005, 10:35 PM
thanks, apreciate it.

Eagle
04-12-2005, 10:40 PM
have fun :yes

wasim21k
12-28-2006, 03:13 AM
thanks m8 was looking for working example you solved my very big problem

Shivansps
01-07-2007, 01:09 PM
I think that I found a bug, the actions in "on finish" also happen when the download is canceled.

Shivansps
01-07-2007, 01:30 PM
and, there is any way to download the file to %AppFolder%//*?

jassing
01-11-2007, 08:09 PM
and, there is any way to download the file to %AppFolder%//*?

In the OnStart
change
strDestinationFile = _TempFolder.."\\myfile.zip";

to reflect any folder you want!

strDestinationFile = SessionVar.Expand("%AppFolder%\\myfile.zip");

Shivansps
01-12-2007, 12:44 PM
oh, thanxs.

Shivansps
01-13-2007, 09:46 PM
I just noticed if the file was already download before and their are at the "strDestinationFile", when the programs starts to download it again their just override the fully downloaded file by the "downloading one", who is incomplete.

There is any way to avoid this?, maybe disable the override or something, or a warning or something that gives you a chance to abort the download before the file be deleted.

jassing
01-13-2007, 10:24 PM
I just noticed if the file was already download before and their are at the "strDestinationFile", when the programs starts to download it again their just override the fully downloaded file by the "downloading one", who is incomplete.

There is any way to avoid this?, maybe disable the override or something, or a warning or something that gives you a chance to abort the download before the file be deleted.

Go ahead and check if the file is there -- if it is; don't do the do the actual download -- or better yet; offer a dialog to say "it's there; would you like to re-download?" and then delete the file prior to starting the download.