The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

WinSCP installer error because WinSCP site thinks wget can parse JavaScript.

Posted by jpluimers on 2014/03/22

If your downloaded WinSCP install ever throws this error, and you cannot find the cause on the WinSCP forums, then this is probably the reason:

The caption of the error message should be enough: Windows thinks it is a 16-bit MS-DOS program, not a Windows installer.

This means that the install download went wrong. In my case, I downloaded it through this wget command:

wget -m -np http://winscp.net/download/winscp552setup.exe

At first I thought that WinSCP has a referrer check, so this is the command that would work (similar to wget direct download with referer: SpeedFan):

wget -m -np --referer=http://winscp.net/eng/download.php http://winscp.net/download/winscp552setup.exe

Bit it doesn’t. WinSCP is worse: they have a download redirect through JavaScript for every user agent (wget uses User-Agent: Wget/1.11.4) even if that user agent does not understand JavaScript. Bad Site!

Since wget does not do JavaScript parsing, but DHTMLGET might work, you have to parse the downloaded HTML for the file name. Too much work for me now. So I just downloaded it manually from the WinSCP download page: http://winscp.net/eng/download.php

Another alternative is to download through SourceForge: http://prdownloads.sourceforge.net/winscp/winscp552setup.exe?download. That works fine with wget:

wget -m -np http://prdownloads.sourceforge.net/winscp/winscp552setup.exe?download

The error has a caption “16 bit MS-DOS Subsystem” and a message containing “The NTVDM CPU has encountered an illegal instruction.”:


—————————
16 bit MS-DOS Subsystem
—————————
C:\WINDOWS\system32\cmd.exe – winscp.net\download\winscp552setup.exe
The NTVDM CPU has encountered an illegal instruction.
CS:0551 IP:0387 OP:63 64 6e 37 37 Choose 'Close' to terminate the application.
—————————
Close Ignore
—————————

Edit:

WinSCP fixed the wget download issue, but curl doesn’t work yet:

https://gist.github.com/jpluimers/9759939

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.