Languages that Windows supports out of the box - windows

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.

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.

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.

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.

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).

Related

Delphi cross compiler for linux

I was wondering if there is any Borland cross compiler that can make my windows code work on linux without wine.I'm using winxp with delphi 7. I was always wondering if it was possible to code same tool I coded in windows , again in Linux and how is it possible to code same tool by using pascal code in linux.Thanks
The best solution is Lazarus, the delphi-like GUI for Free Pascal. If you were using "pure" vcl, without Windows internales or any special add-ons the migration will be a pice of cake :)
Take a look here: http://lazarus.freepascal.org
BTW - Lazarus and FPC are true mulitplatform - you can compile code for Linux, Windows, MacOS and more with the same codebase :)
Your only option, if you want a Borland Delphi cross-compiler, is CrossKylix. This isn't a real cross-compiler. Instead you run the Kylix compiler for Linux under an emulated Linux environment.
Note that you'll be forced to use CLX rather than VCL and that Kylix is well and truly dead nowadays. Personally I think Wine is probably an easier and better option.
First of all, it all depends on what system functions you used in your programm. In most cases, there will be no possibility to cross-compile it under linux.
But, in some cases Borland Kylix can help, but, afaik, it's almost dead now.
Delphi 10.2 Tokyo supports Linux 64-bit Native Code Compilations.
To get some preview screenshots, click this post:
https://helloacm.com/delphi-compiles-code-to-linux-64-bit-server/

Portability of windows apps compiled with jsc

I recently discovered you can compile JScript into console apps using a built in tool in the .NET framework called jsc. It is already installed on my computer, and other windows computers which have .NET.
I want to know if the final compiled exe is dependent on .NET. Also, is it completely portable. Can I build an app on my machine, and then distribute it, and expect it to work on everyone else's machine?
What technical details would I need to put in the release notes? Maybe that it depends on .NET etc...
OK I'll put it into an answer format then :)
Concerning the JScript compiler (jsc):
The compiled exe will be dependent on .NET being installed on the target machine, just as any other .NET executable concerning versions, etc.
JScript.NET is a separate product from JScript (Microsoft's implementation of ECMAScript), so not everything will work in jsc that might work in the browser or in Windows Scripting Host.
I've read that JScript.NET was more-or-less abandoned by MS
Dynamic Language Runtime Discussion on JScript.NET
JScript.NET abandoned mentioned in IronJS article
SO question concerning JScript.NET
ie:
it doesn't know anything about generics, and won't let you reference generic types, or call generic methods. In terms of implementation, it uses reflection heavily with no additional optimizing layers (like DLR), and so is rather slower than e.g. IronPython.
You can also make console applications from other languages.

GCC on Windows OS

I was wondering is there a free Windows version of GCC.
I know there is minigw and something else but I don't know how to use them.
Sorry if this should be on SU.
The main choices are either MinGW or CygWin.
CygWin is a more complete UNIX-like environment than MinGW as it offers quite a lot of tools over and above development stuff. Even to the point of a full X-Windows server so you can develop software that'll run on both UNIX-like systems and Windows.
The installer is good but I would suggest installing everything even if you think you don't need it. Disk space is cheap and I've had problems in the past trying to get stuff going on partial installs (whether 1.7, or even earlier, fixes this, I don't know - I always do full installs).
However, it relies on the CygWin UNIX emulation DLL which, if I remember rightly, has restrictions for non-free software.
MinGW is more concentrated on the development tools. It generates native Windows applications rather than running under a emulation DLL like CygWin.
It used to be difficult to install with having to do MinGW, MSYS and others separately but it's come a long since then and has an easy graphical installer.
I believe it can do graphical applications using native Windows calls rather than via X-Windows, since it just links to the normal Windows runtimes.
If you want to know how to use either of them, you really have to look through the docs found at those links I provided - check the Documentation link on the left for MinGW (particularly Getting started) or the CygWin FAQ.
As for GUIs for development, I've never used one for CygWin - I'm old enough that I remember mark sense cards so I'm not scared of the command line interface :-).
I used Eclipse with CDT running over MinGW and wasn't that impressed although admittedly that was an early version. Don't get me wrong Eclipse is a brilliant tool and we use it for both Java and Linux/C development, I just had a lot of troubles with Eclipse/CDT under Windows.
Code::Blocks, on the other hand, was absolutely brilliant but you should check them all out to see which one suits you best. As I said, the last time I looked was about five years ago, an eternity in the IT world.
I am a bit late, but since the question may still arise...
gcc for Windows (including Ada, C, C++ and Fortran compilers) can be obtained from MinGW-builds on SourceForge: http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/
As of august 2013, there are 32 and 64 bits versions of gcc-4.8.1.

Which programming languages that can generate self contained windows .exes?

I want to make an easy to deploy Windows application and was was wondering which programming systems can create totally self contained Windows .exe files?
As a plus, if the same can be done with MacOSX and Linux from the same source this would be a bonus. I took a look at Realbasic but they have since abandoned the single .exe concept.
update: i am looking for something that can run from Windows XP up to Windows 7, no matter what version of .NET is installed. Is this even possible?
Delphi compiles to one executable, and generates native windows executables. So no dependencies to any kind of framework. If you use Free Pascal (fpc) and the Lazarus IDE, you could even develop for Linux and Apple from the same source.
If your using external dll's this would become a bit more tricky, but you could pack them up in your resource file and still maintain the one exe property.
Update 2020: since #Vassilis & #Marco van der Voort commented on this, I would like to update my old andswer and add that go is a very good way to make self-contained executables. Even crossplatform compilation is realy simple.
You can certainly do this with C/C++. Technically the runtime libraries are required, but they should already be installed on any windows, mac or linux system.
With .NET you can compile to an EXE, but of course the .NET framework is required. For newer versions of windows it should be installed by default, but on older versions (XP or older?) it may or may not be there. And of course you couldn't expect mono to be there by default on linux or mac either.
For Windows the following languages are viable:
C (MS, gcc)
C++ (MS, g++, Digital Mars)
D (Digital Mars)
Delphi (Embarcadero??? how do you spell that? just trips off the tongue doesn't it?)
Fortran (Intel, Salford Software)
Visual Basic 6 (MS)
Lua (you'll need a special tool to do it, but it is doable)
C#, VB.Net, F#, J#, etc (assuming that you don't mind using .Net technology)
You can use Tcl/tk. The technology you should research is a "starpack", which combines a runtime executable (a starkit) with a platform-specific runtime (a "tclkit") to create a single-file executable. It's remarkable in the fact that it's not just compiled code, but an entire self-contained virtual filesystem that can include images, sound, data, etc.
This same technology works for many platforms from the same code base. The only thing that is different is the platform-specific runtime. You can even "cross compile" in that you can copy the runtime for multiple platforms onto your dev box and then build starpacks for each platform without having to actually be on each platform.
Tcl can do this, especially through producing starpacks. They can be produced for all platforms from the same code. Note that this also includes all the necessary runtime libraries (except for things like the C library, but you don't want to make that static under normal circumstances).
JavaFX 2.2 supports that. It allows creation of self-contained applications targeting Windows, Mac OS, and Linux.
Please follow this link for more information: http://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm.
I would recommend taking a look at AutoIt. It is an easy-to-use scripting language that will compile into an exe, so there are no runtimes needed. This would be for windows only though.
http://www.autoitscript.com/autoit3/index.shtml
From the website:
AutoIt v3 is a freeware BASIC-like
scripting language designed for
automating the Windows GUI and general
scripting. ... AutoIt is also very small,
self-contained and will run on all
versions of Windows out-of-the-box
with no annoying "runtimes" required!
c/c++
purebasic
delphi
vb6
i hope this help :)
Here's a good source for a number of basic-like programming languages that build small stand-alone EXEs. Some are cross-platform for Windows and Linux:
www.basic.mindteq.com
You can use Liberty Basic which is easy and cheap, you can easily make stand alone programs for windows but not possible to transfer to MacOS or Linux.
You can do this for Windows with .NET languages using ILMerge
ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output. See the accompanying documentation for details.
However:
Currently, ILMerge works only on Windows-based platforms. It does not yet support Rotor or Mono.
QBasic can :-)
I wrote a few command line tools using it!

What languages require no external libraries/references/dependencies?

Have a quick project I need to put together for windows that can have no external references or dependencies; the stalwarts like C are obvious but if you are a .NET developer and need to build something like this very quick what language/tool would you use?
EDIT: Ultimately I want to be able to take JUST the exe produced by the compiler and put it alone on a windows machine and have the app run.
If you're a .net developer, you could consider something like using Remotesoft's Salamander or another similar tool that compiles everything into a single executable (including the framework).
This option lets you develop in .net, but not install the .net framework on your client's systems. If you're deploying on non-MS systems, you can use the Mono's deployment tools to accomplish the same thing for free.
In general, I'd say stick to the tools and languages you know. It's easier to build an installer to install the .net framework then it is to learn a new suite of tools, libraries, etc.
You can do it for practically any language (I'm excluding the obvious C/C++)
You can bundle the .NET runtime into your .exe and write the app in C#
You can write the app in Python and bundle everything into a single .exe using a tool like py2exe. I do this regularly. One can create great-looking and powerful applications with Python and PyQt, bundle everything into a single no-dependencies executable and deploy to users w/o a need to install anything else. The executable is a few MB large (~9 with PyQt), and loads and runs quickly.
Etc.
It's more important which language / environment do you currently know well. Focus on that, because the tools do exist for anything you'd want to use.
Delphi has always been the best product for producing stand-alone .EXEs for Windows. No Microsoft product has ever come near it in that regard.
I think a good allround answer to this is Free Pascal via the Lazarus IDE.
Free Pascal applications are native and dependency-free, and a lot of platforms are supported. Too many to list here! Free Pascal itself is a free and open source compiler.
For better convenience, I strongly recommend using the Lazarus IDE. Now you even get a RAD IDE for cross-platform GUI applications (as well as console), with a sizable set of builtin features, like database support. Really a pretty lovely all-in-one, often underestimated or even unknown, platform that produces self contained, native executables. There aren't all too many of those tools if you think about it. You can even cross-compile from it, for example to compile a GUI application for Linux on Windows, no virtual machines necessary.
One day, I wish .NET Native could get this far, but it is currently far from capable and I'm not sure if Microsoft even intends to go there. Google's Go language is also nice in that it compiles to native cross-platform code, but lacks a GUI library. Python can have its code packaged into executables but it's kind of a kludge and not native code. And so on...
C/C++ would be your language but don't use any fancy libraries like MFC, MSVCRT, etc. or if you do link them statically to your executable.
"No external references" is a bit vague. Are you talking about a deployment solution for an application?
For example, you can use Tcl which supports the ability to create a single file executable that contains both the application code and a virtual filesystem that can contain any other files needed by the application. If your goal is to create a single file that can be deployed without having to install extra files, read up about "starkits" and "starpacks".
If you target a Windows Vista .NET 3.0 is preinstalled,
If you target a Windows 7 .NET 3.5 is preinstalled, if you use no other libraries than the ones included in those distributions then you app will run. Installing .NET isn't really that much work anyway, just ship with the redistributable.
Assembler. Your only dependency is the CPU
Here's a left field answer...
Tcl
combined with starkits, you can create a simple double-clickable .exe with no need for an installer.
the downside, of course, is that it'll be written in tcl.
As an added bonus, you'll be able to port your app trivially to mac or linux (or a range of other odd operating systems)
Do you consider the .NET Framework "external"? If you stick to .NET Framework and use C#, your code should run anywhere the .NET Framework of appropriate version is installed, and you'll only need to deploy your .exe and .exe.config.
It is not possible to run a .NET program without the .NET Framework. If you can't require the .NET Framework to already be installed, then you cannot use a .NET program. That's what I meant.
I've no clue what the downvotes are about, but let me try once more to clarify. The original post said:
the stalwarts like C are obvious but
if you are a .NET developer and need
to build something like this very
quick what language/tool would you
use?
The answer is that if you are a .NET developer, there is no tool or language you can use for this purpose, as every .NET program requires the .NET Framework be installed. If you need a program that is entirely independant, then don't use .NET. As others have replied, you can bundle .NET into your exe. You can also have .NET installed with your application, if you're willing to ship a .MSI file and not just your exe.
But, by definition, a .NET program cannot be independent of the .NET Framework.

Resources