tags:

views:

313

answers:

8

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?

+1  A: 

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.

ChrisF
Can ILMerge even include core assemblies from the framework, negating the need to even install the .NET Framerwork?
snicker
@snicker - I don't know. The help doesn't say you can't.
ChrisF
@snicker: @ChrisF: You still need the CLR to run any IL assembly, even if you can link in mscorlib.dll.
Billy ONeal
+3  A: 

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!

BigJoe714
Errr.. no, AutoIt does not compile to C++.
Billy ONeal
Thanks for the correction. I edited my answer.
BigJoe714
OK :) Downvote removed.
Billy ONeal
Downside with AutoIt: it has problems with some anti-virus heuristics flagging it once in a while... dumb virus writer sometimes use AutoIt, combine that with simplistic virus scanner definitions == false positives :|
Davy Landman
@Davy Landman - I never have any problems with false positives when I compile AutoIT scripts if I right click the .au3 file and choose "Compile With Options" and uncheck the "Use UPX" option. This does add about ~260KB to the compiled file size, but with my needs, this is insignificant.
JohnForDummies
+4  A: 

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.

Eric Petroelje
You can set the compiler to link the runtime in statically.
Billy ONeal
@Billy - yes, that's a good point.
Eric Petroelje
+2  A: 

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.

Bryan Oakley
+2  A: 

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

Donal Fellows
+4  A: 

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.

Davy Landman
I couldn't find any link to download delphi. Is it still available?
Zubair
Yes, Delphi still exists, Borland sold it to Embarcadero http://www.embarcadero.com/products/delphi .
Davy Landman
A: 

QBasic can :-)

I wrote a few command line tools using it!

SLC
QBasic cannot. QuickBASIC can.
mgroves
I stand corrected, I thought they were the same.
SLC
QuckBASIC generates DOS .exe files. Modern Windows run these through *NTVDM* witch is unavailable on the 64-bit versions. On Linux and OS X you'll also need some kind of emulation or virtualisation layer to run DOS programs.
Alexandre Jasmin
+1  A: 

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)
Stephen Kellett
N.B. You can use C#, VB etc... without having to install .net; You just can't use the .net library, which means you would need to write everything yourself or use another library, e.g. Mono: http://www.mono-project.com/Main_Page
Lucas B