Prerequisite Download - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Riffic
Posts: 1
Joined: Sat Sep 22, 2012 8:07 am

Prerequisite Download

Greetings,

I'm building an installer which downloads an exe from a URL. The URL is a php page on our server to redirect to the downloaded exe (In order for us to keep a working URL pointing to the right exe on the host). The problem is after downloading successfully I keep getting the error "This file does not have a file associated with it to perform this action. Please install a program, or if one is already installed, create an association in the Default Programs control panel".

Also after looking into the directory it is saving the file it appears to save the php page from above which contains the exe binary it seems.

Thanks,
Ryan
shawnlehner
Posts: 5
Joined: Sun Sep 23, 2012 8:47 pm

Re: Prerequisite Download

I am fairly new to how the installer world but it seems to me there are only a few reasons this would happen:

The first, most unlikely and easiest to test, is that your server is not configured correctly. This means that the file is being returned as source instead of being executed server side. Try the URL in your browser and if the download starts you know this is not the case.

The second, and most likely, is that the installer does not support automatic redirection for the download links. What this means is that when your PHP responds with the redirect header it is saving this information directly instead of checking for this response and using the new URL. At this point you are stuck between a rock and a hard place ... I suspect the reason you want to go the redirect route is so you don't waste bandwidth on your own servers but without support for the redirect you will need to either host the file on your server (so you can swap it out if it changes) or stream the file from the endpoint through your server which uses up even more bandwidth since you are going in two directions.

** EDIT: Forgot my third suggestion :)

Third, you can create a custom action which handles the download and installation of this file yourself. If you are already deploying a .NET application then you have .NET as a prerequisite and it should only take half an hour to hammer out a robust downloader which supports the redirection you are looking for.

Wish I could be of more help!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Prerequisite Download

Hello to you both and welcome to Advanced Installer forums,

Shawn's reply is mostly accurate. The URL does not support redirections.
A solution, as he mentioned, is to have a custom action scheduled after Finish Execution action group which launches the prerequisite installation. This scheduling is very important because two installations cannot run at the same time.
Maybe the "How do I launch a file after an installation?" article can also help.

Shawn, thanks for jumping in :!:

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”