Packaging a .NET Application So It Will Run On A Computer Without .NET
I have been recently trying to deploy a C# application on a computer that does not have .NET installed.
I know that there have been many questions around the same topic here on StackOverflow. Here are a few of them, of which I read the responses to all:
So all of the responses to the above questions state that it is impossible without specific software, etc. One software mentioned was the Salamander .NET Linker. The only problem with that is that I cannot seem to be able to run the application after it has been processed by Salamender. I understand that this in itself is impossible, as it requires the .NET virtual machine to run. However, in the past, I have made Java applications and along with them, I shipped the entire JVM. Surprisingly, they still worked. So the reason why this is not a duplicate of the above questions is because my true question is:
What items of the .NET framework would I need to package? If I do manage to package all, would placing them in the same directory as the application I'm running allow the application to run?
I found one solution to this, the Microsoft .NET Redist Package. The only problem with this is that it has a GUI of its own. Aside from that, it would be a perfect fit. So, could anyone tell me one of two things:
Is there a command-line .NET package, and if so, where do I download it?
If there isn't, or it would be impractical to do so, approximately what directories would I need to copy from the .NET installations?
I understand that these files and directories are system specific, and that my .NET installation may not work on your computer, but if C# is like Java, then this should be achievable. Is it? Size is not a limitation, it does not matter to me whether or not the application and all its files is 1GB, or if it is only 1MB.
If in case there is no other solution, I used Dependency Walker to check all the dependencies of my program. If I were to package most of them, would my application, in theory, work?
For .NET, you really must just install the appropriate .NET framework. The .NET framework installation does include command line options to allow for silent installs, such as:
dotnetfx35.exe /q /norestart
That being said, most installation packages will handle these details for you as part of the installation. Using a decent installer will take care of this dependency automatically.