Link to home
Start Free TrialLog in
Avatar of Sheldon Livingston
Sheldon LivingstonFlag for United States of America

asked on

How to create a program that just runs. No installation required.

Is, at least some of, the thought of the .NET framework the ability to create a piece of software that doesn't require installation?

I would like to make a program that just runs. I have VS 2017.

I'm under the impression that I am correct... that is until you get to the point of using references that may need to be registered, etc.

At the end of the day I am familiar with C# and VB and would like to make a program that doesn't need to be installed and just runs. I would need to know the boundaries, or where the point is of "ok... now you have to install".

Thougts?
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
and to go a bit further, can you at least copy files to your users' computers (not install - just copy)?

most components will work if you just copy the DLLs into the same folder as your .EXE application
Avatar of Sheldon Livingston

ASKER

Thanks Éric
Avatar of Arana (G.P.)
Arana (G.P.)

You can but if it is based on .net then .net would have to be already  installed, I do a lot of such programs that are called from scripts, get some data from oracle or SAP, and spit out a PDF o email a notification., they just need to be copied to another PC and thats it, in the case of the oracle ones they need the managed driver,
 
In windows 10 you can compile programs to native code, with .net NATIVE which does not need external .NET libraries, but still may require some files but will be a lot  less installation size, the only way to avoid this is compiling directly to native code with  C++, or use something else like DELPHI or even compile with MONO to statically linked libraries.
As long as the user has .Net framework installed, he can indeed "just run" the program without any installation. If the exe is located on the server share, you don't need to even copy the files to user's workstation, just give him the shortcut.

>that is until you get to the point of using references that may need to be registered, etc.

Nothing needs to be registered, as long as everything needed for the program to run is in the program directory. This is usually any references that are not part of the .Net framework itself. All you need to do is mark those as "Copy Local" = True in the Visual Studio project, so they are copied to the program directory.

Even better way is to "publish" your project, even on the same share. Select "publish" under menu "Build", and follow the prompts. "Publish" will create so called click-once installation, essentially the same shortcut, but this shortcut will be checking for new versions and more. More information in the articles "Publish ClickOnce applications" and ".NET Core application deployment"