I have a very simpel program in Delphi 10.4 that downloads a file with WebCopy, using wpSftp.
If I copy the exe + dll's, it works fine on my Windows 7 machine.
If I copy the exact same code in Delphi 2007, using the same Webcopy-version, nothing happens. The download will not start, and no events are triggered after "fileStart".
Yes, it compiled to W32.
After that, I copied the exe + libeay32.dll and libssh2.dll to the same directory my other exe is in (the one compiled with Delphi 2007).
So after that, I have on my windows 7 machine :
2 executables in the same directory,
with the exact same code,
one compiled in Delphi 10.4, and one with Delphi2007.
The Delphi2007 does not work, the other does.
I did not copy ssleay32. That dll is not in that directory.
In the function TWebCopy.ConnectSocket it breaks when it reaches the line
connRes := connect2(ASocket, P^.ai_addr, P^.ai_addrlen);
for the second time.
P: PAddrInfo is inaccessible :
I set the same breakpoint in Delpho10.4, and then I see that ai_addr is assigned, so that is different in D2007, where it is nil.
What could be the cause of that ? Have I forgotten to assign a property ?? (
I cannot see a reason for now.
Did you verify that all parameters with which getaddrinfo() is called are exactly the same on Delphi 2007 as on Delphi 10.4
The only difference is the value of "ASocket", but that is not a parameter of that function..
The screenshot shows the local variables at that point in Delphi2007 (white) and Delphi10.4 (black)
I cheked everything many times, even started a complete new project. It is very easy to reproduce. The whole code is given beneath.
So this code compiled in 10.4 works, even when I copy the exe tot the directory where my D2007 executable is on my Windows7 machine.
FYI: I never managed to get the upgrade-builder to work on this same account, usinf SFTP.
I suspect it is the same problem. After spending many hours I gave up, and used a different server (normal ftp).
Unfortunatly this account wil end soon, and I have to switch to SFTP very soon. I really hope you can find what is causing this problem.
I just did another test and hope this will help to find the cause :
I copied the directory with both executables and dll's to a Windows Home Server.
Launching the D10.4 - version it gave an error :
I copied that dll, and after that, it worked fine.
The Delphi2007-version however will still not run, and gives no error-messages.
Are there some other dll's, or versions of dll, I should be aware of ? I am running out of ideas, and start to believe this is a bug.
Can you maybe confirm that you have a working SFTP WebCopy demo running in Delphi 2007 ?
We are currently working on an update, so it will be in the coming weeks. I'll send you an incremental source update, check your forum messages.
It should be unrelated. There were SFTP related issues in the TWebUpdate component that is also used in Update Builder. Those got fixed in the meantime but we did not make a new Update Builder release yet.
Perhaps as a first step you could check if you can get TWebUpdate working with SFTP.