6

I have been asked to write a (very) simple program for a set of Windows machines (XP I think) - so simple that the choice of language isn't really an issue. However, I want to be able to distribute a binary/script that will run straight away on the Windows machine, without the need to pre-install any interpretor or virtual machine. I'm developing on a Linux machine and I have no idea what languages Windows supports 'out of the box'. Can anyone advise?

For example

  • Perl would be great but I don't believe windows machines come with Perl pre-installed? Asking the user to install Perl to use my script is not acceptable.
  • I believe Python has the same problem? (although maybe I can use the PyInstaller? -- as in this question)
  • Likewise Java? Is the virtual machine pre-installed on most Windows distributions? (I understand it got removed after a dispute with Sun Microsystems?)

The only option I can think of so far is

  • c/c++ with MinGW cross-compiler.

While I'm happy to write the code in c++, I wanted to check my language options first.

Community
  • 1
  • 1
Tom
  • 5,219
  • 2
  • 29
  • 45
  • Maybe not the answer you are after but most (if not all nowadays) windows computers have .net framework installed. :) Also if the program is VERY simple, you can consider a batch file or maybe vb script? – Bazzz Oct 05 '11 at 07:15

4 Answers4

7

The only scripting languages supported out of the box are the batch interpreter, vbscript and jscript. Other than that you are into compiled languages. A good option could be C# but make sure you target the .net version that shipped with XP.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Okay, thank you. I was worried it might be something like this... Do they not even have a c library though? - will MinGW not even work? :( – Tom Oct 05 '11 at 07:22
  • any compiled language is fine – David Heffernan Oct 05 '11 at 07:22
  • @DavidHeffernan are you sure that all compiled languages? For example, several C++ variants I've seen require special runtime, and so does J++, for example. – Ramon Snir Oct 05 '11 at 07:24
  • @ramon I guess I mean any conpiled lang with a windows port. In reality that is everything remotely mainstream. – David Heffernan Oct 05 '11 at 07:28
  • 1
    Note that WSH is often disabled via group policies in more locked-down environments. In those cases batch files are often the only option remaining. – Joey Oct 05 '11 at 07:28
  • Oh, and WSH is an optional install in win98 :-) – Marco van de Voort Oct 17 '11 at 08:50
  • @Marco But what about that most important OS, Win 95? – David Heffernan Oct 17 '11 at 08:50
  • Like with all win98 added bits, it is an downloadable option, or you can get it with a MSIE version. But win95 is WAY longer EOL than Win98, so I generally don't regard it. Win98 is getting awfully rare nowdays (but it is not extinct) – Marco van de Voort Oct 17 '11 at 14:16
  • @Marco Depends on your clients. I've not seen Windows 9x via my clients for over 5 years. We also dropped w2k two or three years ago and not a single client commented. – David Heffernan Oct 17 '11 at 14:19
  • Most of the machines we encounter are not in common desktop use, but attached to hardware. Usually special printers or measuring equipment or even complete industrial production lines. Sometimes we have to run very small clients on it to propagate settings from/to our vision systems. Since for the main systems we deliver the hardware + software, we only support Win7 for the main software, though XP still works. – Marco van de Voort Oct 18 '11 at 09:49
3

Delphi and Lazarus/FreePascal generate native applications that don't even need on MSVCRT

Some of the other systems have requirements on relatively new MSVCRT versions that might be a burden on older windows versions.

However recent Lazarus and Delphi versions stop supporting windows NT4 and Win9x, with win2000 in a gray area (not supported but works afaik)

Having an internal win32/64 linker makes it also an excellent choice for crosscompiling from *nix to Windows.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
2

I don't think that Java comes pre-installed on Windows.

I'm not using Windows for some years now, but if I correctly remember you can develop scripts with VBScript or JScript and deploy them without need for clients to install anything.

Dragi
  • 43
  • 5
  • Afaik J# used to come with Internet Explorer, originally meant as a vector to promote installation of .NET. But MS canned it when it got popular enough. – Marco van de Voort Oct 17 '11 at 08:49
1

Any language which compiled to pure native assembly (without special run-time dependencies) should be fine. For example: many C variations (but not all), Microsoft Visual C++, Microsoft Visual Basic 6, OCaml, Haskell and more.

Requiring the .NET Framework (which gives you also C#, VB.NET and F#) is reasonable, and also JVM is pretty standard (and so you get Java, Closure and Scala).

Ramon Snir
  • 7,520
  • 3
  • 43
  • 61
  • Okay, I'm compiling on linux so most of the Microsoft languages are out. - If most windows machines have Java then I will probably use that. I thought it had been removed as part of the anti-trust dispute with the EU? – Tom Oct 05 '11 at 07:18
  • All .NET languages have Mono ports (C# and VB.NET come natively with Mono, F# has a CTP you can install from their site), so they aren't exactly out. Note: Mono is a proper subset of .NET, anything working on Mono will work on .NET, not always the other way around. About Java: most computers have Java either built-in (non-EU or older computers) or by-install (it *is* commonly used, people just download it). – Ramon Snir Oct 05 '11 at 07:22
  • Does MSVC++ allow static linking ? Otherwise you need to distribute a MSVCRT runtime DLL set. – Marco van de Voort Oct 12 '11 at 15:13
  • Not a C++ programmer, but other Microsoft languages have static linking and even a --standalone command-line parameter (statically linking everything). – Ramon Snir Oct 12 '11 at 18:54