18

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?

animuson
  • 53,861
  • 28
  • 137
  • 147
yazz.com
  • 57,320
  • 66
  • 234
  • 385
  • Do you care about dependencies such as runtime libraries? – snicker Apr 06 '10 at 15:23
  • If I want to run the exe as a web application and also have access to a database library/filesystem which runtime libraries would I need? – yazz.com Apr 06 '10 at 15:34
  • It's not possible to port to OSX and Linux if you're based on .NET; while yes, there's Mono, the libraries available are sufficiently different that you're still faced with a big porting task. – Donal Fellows Apr 06 '10 at 15:39
  • The lowest common denominator of .NET is 1.x, so you'd have to code to that, but this assumes that everyone has at least .NET 1.x installed -- I would venture to guess that there are some users out there with no .NET framework at all on their WinXP boxen. – Pretzel Apr 06 '10 at 15:39
  • 1
    That said, I read a statistic recently that said that 80%+ of all Windows machines have at least .NET 2.0 installed -- That's sort of my personal minimum when coding in .NET these days. I can't really live without generics... :-) – Pretzel Apr 06 '10 at 15:41
  • The answer is almost certainly "all of them", although it will probably be easier for some than others. – dfeuer Jan 20 '15 at 02:30

12 Answers12

9

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.

Davy Landman
  • 15,109
  • 6
  • 49
  • 73
  • I couldn't find any link to download delphi. Is it still available? – yazz.com Apr 07 '10 at 17:24
  • 1
    Yes, Delphi still exists, Borland sold it to Embarcadero http://www.embarcadero.com/products/delphi . – Davy Landman Apr 07 '10 at 19:12
  • Yes Delphi exists. In shameful conditions, with a quite annoying IDE and highly overpriced but yes, you can develop great applications in Delphi. I used to love it. Now it's nothing but struggling. The visual designer is great tho, you can sketch up the visible elements in a jiffy; then, good luck with the object jungle and the disappointing documentation. I started with Pascal back in the nineties so I'm not afraid to get my hands dirty; but instead of Delphi I use ZZEE php-to-exe whenever I can. Tells a lot. – dkellner May 22 '17 at 19:39
  • 1
    Isn't it impressive that besides C and C++, the only *real* candidates are *still* **Delphi** and **fpc**? – Vassilis Dec 22 '18 at 22:43
  • (V)C++ usually uses msvcrt, that might need runtime installing. – Marco van de Voort Jun 27 '20 at 21:51
  • I just added golang to the answer, since I think it's a very good option for self contained executables (on any platform). – Davy Landman Jun 29 '20 at 09:41
6

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
  • 59,820
  • 9
  • 127
  • 177
6

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)
Community
  • 1
  • 1
Stephen Kellett
  • 3,078
  • 1
  • 22
  • 25
  • 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 Apr 13 '10 at 16:34
3

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.

ytw
  • 1,335
  • 2
  • 20
  • 42
3

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
  • 370,779
  • 53
  • 539
  • 685
3

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
  • 133,037
  • 18
  • 149
  • 215
2

c/c++ purebasic delphi vb6

i hope this help :)

Dz-S.T.A.L
  • 21
  • 1
2

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
  • 6,732
  • 7
  • 46
  • 50
  • Errr.. no, AutoIt does not compile to C++. – Billy ONeal Apr 06 '10 at 15:39
  • 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 Apr 06 '10 at 15:51
  • @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 Apr 07 '10 at 16:15
2

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

Nicero
  • 4,181
  • 6
  • 30
  • 52
2

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.

Ashutosh
  • 21
  • 1
1

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
  • 134,786
  • 31
  • 255
  • 325
0

QBasic can :-)

I wrote a few command line tools using it!

NibblyPig
  • 51,118
  • 72
  • 200
  • 356
  • QBasic cannot. QuickBASIC can. – Matthew Groves Apr 13 '10 at 16:11
  • 2
    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. – Alex Jasmin Apr 15 '10 at 02:09