I have a setup which can connect to an Ftp server and download some files during the installation process.
It works fine within a CDRom media.
Then I built an Internet media (one-click install setup) of the same project and I have FTP errors during the get file phase.
That is, the setup successful open the ftp session, (InternetOpenA and InternetConnectA Windows call) but it fails retrieving a file:
Code Sample |
if(!FtpGetFileA(hFtp, sRemoteFileName, sLocalFileName, bFailIfExists, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY, 0)) then errNum = Err.LastDllError; errStr = FormatMessage (errNum); SprintfBox (SEVERE, "GetLastError partecipation", "Error code: %ld\nMessage text: %s", errNum, errStr); endif |
Well, as shown in .gif attached:
errNum = 1813
errStr = The specified resource type cannot be found in the image file. (ERROR_RESOURCE_TYPE_NOT_FOUND)
Anyone can help me to better understand where is the error?
What is the "resource type" not found? The remote or the local?
What is the "image file"?
Remarks
1.
By the way, I don't think FtpGetFileA produces this error (it's meaningless in my context), but Err.LastDllError when it tries to load the error string (for the unknown error produced by FtpGetFileA) and fails. Is it possible?
2.
Why can't I call GetLastError directly?
(ref. HOWTO: Getting the Return Code from the GetLastError API Document ID: Q105598).
I guess InstallShield zeroes the error code (using SetLastError()) in its
own functions, but I don't see why GetLastError() wouldn't work immediately
after FtpGetFileA().
Thanks.
Ciao, Giuseppe
Note:
Remember the fact: It works in CDRom media so the problem must reside in some difference between "CDRom-media approach" and "Internet-media approach"
Moreover, I'm testing the product so I'm sure there is not a banal error like:
-wrong file to retrieve (or absent or wrong-typed)
-wrong directory on the Ftp server (or absent)
-wrong local directory (or absent)
All these information are correct