tags:

views:

204

answers:

9

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.

A: 

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

Bryan Oakley
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.
keithwarren7
Yeah, you can do that with Tcl and Starpacks, no problem. This isn't a .net solution though -- it would require that you learn Tcl and the mechanism for creating starpacks. It's not hard by any stretch of the imagination, just different.
Bryan Oakley
A: 

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.

John Saunders
re-read the post; of course .netfx is an external library (or set of libraries in this case)
keithwarren7
It's "external" but it's already installed on any system your program could run on. The rest is already there. If it's not already there, then your program can't run if it's written in _any_ .NET language.
John Saunders
Well, yes. If you write a .NET program, then the .NET runtime is already installed on any system the program can run on. That's not a particularly useful observation. Plenty of computers run programs without having .NET installed.
David Thornley
.netfx is not 'already installed on any system your program could run on'. I have 10K desktops and half are XP. I should have been more clear about that.
keithwarren7
Did you not specify that this is a .NET program? You said "but if you are a .NET developer". Also, with 10k desktops, does the client have no auto-deployment technology implemented? How big a problem is 5k .NET deployments if they're automated?
John Saunders
@downvoter: care to say what your problem is, or should we guess?
John Saunders
@AnotherDownvoter: come on! Why the downvote?
John Saunders
+1  A: 

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.

David Pokluda
+1  A: 

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.

Reed Copsey
Unfortunately this needs to hit about 10K desktops and installing .netfx is out of the question for this client
keithwarren7
What about the Salamander option? If you're going to deploy to that many desktops, the cost shouldn't be a huge issue...
Reed Copsey
+2  A: 

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.

Eli Bendersky
Unfortunately, Py2exe does not currently provide a way to bundle all required resources into a single file. It goes a long way, by collecting the few (possibly just one) .dll's that must be installed alongside, but it still doesn't quite meet keithwarren7's requirement.
TokenMacGuy
tokenmacguy: do you mean msvcr71.dll? it's there basically on all Windows boxes these days, hardly a limitation. But to be absolutely sure it's another single 340KB file to carry around - quite harmless.
Eli Bendersky
A: 

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.

John Leidegren
not an option in this case, and about 50% of the desktops are still XP
keithwarren7
Ship with the redistributable, it's the right thing to do. If you wanna do .NET development.
John Leidegren
A: 

Assembler. Your only dependency is the CPU

AZ
... and a bit of RAM
Javier
While true, it's not a practical or useful answer.
Bryan Oakley
A: 

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)

TokenMacGuy
A: 

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.

anon