cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LennySh
Level 2

Installer that downloads the features from the internet

I want to make an install that has several different components, and most of them not actually be included in the setup.exe that they download. Meaning, I only want the files downloaded to their computer only after the have checked the features they want, and clicked next. Only the required files will be included, all the optional one's I would like to keep on either an ftp, or a website. That way they only download what they want. If I included everything, it would be a very big install file to download... :confused: Any Ideas..???
Labels (1)
0 Kudos
(4) Replies
lmoulder
Level 3

Hi Lenny,
I've done this for a couple of my installers. This may not be the most graceful way of doing it (I'm still fairly new to IS), but it seems to work. This is also assuming you're creating an InstallScript MSI installer.

First, create a new feature and set either the ftp or http location attribute to point to the file you want to download. The only catch I've found so far is that you can't embed a username/password set in the URL. Then create a function for the feature's installing action that downloads the file, starts the installer, and deletes the temp files.

Here's the script I use to download and install a feature in one of my projects:

function Tor_Installing()

string svTorPath, svTorDLDir, svTorInstallFile;
number nvResult;

begin

FeatureGetData(MEDIA, "Tor", FEATURE_FIELD_HTTPLOCATION, nvResult, svTorPath);
svTorDLDir = INSTALLDIR ^ "Tor";

// download the file and then store the filename
CreateDir(svTorDLDir);
XCopyFile(svTorPath, svTorDLDir, COMP_NORMAL);
nvResult = FindFile(svTorDLDir, "*.exe", svTorInstallFile);

// install
if (LaunchAppAndWait(svTorDLDir ^ svTorInstallFile, "", LAAW_OPTION_WAIT_INCL_CHILD) < ISERR_SUCCESS) then
MessageBox("Could not install Tor", SEVERE);
endif;

///////////////////////////////////////////////////////////////////////////////
// delete the downloaded files
///////////////////////////////////////////////////////////////////////////////
nvResult = DeleteDir(svTorDLDir, ALLCONTENTS);

end;


If you're not trying to run another installer, once you download the files, you can script whatever you need to do.

Hope this helps.
Leigh
0 Kudos
cbarlow
Level 7

What if you just have an InstallScript project? I'd like to do a similar thing, and although the FeatureGetData function allows you to access the ftp location associated with a particular feature, I haven't been able to figure out how to use this attribute to install the feature from a remote location like an ftp site. Do you have to use a Script-Created Feature Set? If anyone has done this (or knows how), I would really appreciate your help.

Thanks!
0 Kudos
guyjoules
Level 4

Hey Leigh.

What do you mean by set a feature to either ftp or http? by doing so, the files won't be in the installer exe?
also, do you need to place the feature's files in the ftp location manually, or InstallShield does it for you, once compiling?

thanks
Guy
0 Kudos
lmoulder
Level 3

I haven't tried something like this in a pure Installscript project, so I really don't know what differences (if any) you're going to face. I'd like to think that since the script above is all InstallScript code, you should be able to use it without a problem.

The few times I've used this code, I've always downloaded a setup file from the HTTP location and then run the installer that I just downloaded using the LaunchAppAndWait function. I've never tried using an Install From Web approach.

I also haven't tried to create a feature via scripts, but would also be interested in learning how.

Guy, When I mentioned setting the feature to FTP or HTTP, there's a feature property called 'FTP Location' and 'HTTP Location' that I set to the appropriate URL. I then use this value in the script. And no, the files referenced in the FTP/HTTP location will not be included in the installer exe file. But you will need to manually upload them to an FTP or HTTP server.

Leigh
0 Kudos