Question

It might be a stupid question, but all of my tries to google this failed. The question is: How can you develop windows applications that don't need a redistributable pre-installed? I want to create applications that run also under older versions of Windows which don't have the .NET Framework or something similar included.

Thank you, eWolf

Was it helpful?

Solution

First, program in a native language, such as C++, no CLR.

Second, disable manifest and avoid linking external DLLs (such as STDC or MFC).

OTHER TIPS

What do you mean by older versions of Windows?
The .net Framework is part of Windows since Windows 2003 and .net 1.1.
So if you are targeting Windows Versions newer than Windows 2003, you can be sure that .net is available.

There are also solutions, that automate linking/packaging of .net products, so that you don't need to ship any redistributables etc.

Update:
I just found out that Mono allows you to link the whole runtime into your executable.
They call that feature Bundle.
Read more about that here.

Use Delphi - although the newer versions of the IDE have some odd bugs, it is easy to create native windows applications that don't need a redistributable. Much easier to use than C++/win32.

Edit: As eWolf pointed out he did not need the .NET, despite the original question tagged as .NET.

In short, some older machines such as Win95/98/2000 may not have the runtime installed. Since you specified .NET, I'm assuming you want to build an application using .NET, there's a big but, you need to have the .NET runtime installed beforehand you can execute the .NET application. You can easily get around that by two methods:

  • Install the .NET runtime manually OR
  • Use a custom installer script which can detect if .NET runtime is installed or not, to install the .NET runtime redistributable.

If you are talking about a native application such as C/C++, the best path to take (to avoid dependences and minimize the number of DLL's required) is, develop it in raw WinAPI32, using only the standard DLL's that a lot of Windows machines will have, COMMCTRL.DLL, USER32.DLL, ADVAPI.DLL to name but a few. The end result will be a smaller executable. Of course you can bundle other DLL's by statically linking the DLL's together to form one big mammoth executable.

I recommend you use the WTL, which is a lightweight C++ framework. It's only one step above the Win32 API really, so you get small EXEs with few dependencies. WTL requires the ATL framework which you can statically link to, meaning you only need to ship your EXE.

Another framework worth looking at is Qt. However, this does require you ship some DLLs with your application. Qt is a fantastic framework and I think you'll find it more productive than WTL (depending on your application needs of course.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top