Download File doesn't complete fully until installer exits

Got a problem you cannot solve? Try here.
Post Reply
cmwallace
Posts: 16
Joined: Fri Nov 14, 2008 1:12 pm

Download File doesn't complete fully until installer exits

Post by cmwallace »

In IA9, I am using Download File to check our server for an executable. The server gives the file, which then downloads, but even though the Download File function returns SUCCESS, and the file size looks right, the executable itself is lacking its icon, version information, digital signature, and it won't run until the installer exits. Once that happens, the exe file gets all that stuff back and runs fine.

Shouldn't the download be utterly complete when it returns SUCCESS? I need to run the executable from the installer immediately after downloading it.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

This is certainly abnormal behavior - does it happen with all kinds of EXE's from different servers, or just this one server/EXE?
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
cmwallace
Posts: 16
Joined: Fri Nov 14, 2008 1:12 pm

Post by cmwallace »

I apologize for the false alarm and wasting your time. The file was downloaded successfully and completely. I had written a DLL call that checked the size of the file after it was downloaded, which called CreateFile with the OPEN_EXISTING flag. I took that handle and passed it to GetFileSizeEx. The problem lay in that I neglected to close the handle afterwards. The function returned, but the handle was left open, and thus the EXE could not run.
Post Reply