How to distribute a command line tool?


Sorry if this not F# specific, but I’m new al all things windows, .Net and F# and this is the only community I know :slightly_smiling_face:

This is probably a very large topic but I’ll appreciate links to relevant articles - I can’t seem to get the wording correct when searching as I’m getting irrelevant results. Say I created a command line tool (later a GUI will be added) and I want to distribute it to friends and co-workers (without having to publish it to nuget or similar). How do I do it for windows? I’m completely clueless regarding distributing applications for Windows. I’m mostly interested in:

  • I know there’s a way to create single executables but these seems to be very large and I prefer to to have to use it unless I don’t have a choise.
  • I remember seeing a way (with dotnet cli) to create a directory with or without the .Net runtime. What does a user do with this directory? Is there a way to link the executable to somewhere in the PATH or does he have to add this directory to the PATH (which seems to be unmanageable after a couple of dozens tools)?
  • Is there a way to create an installer that will handle this for me?
  • How do I control the name of the generated CLI to be different than the project name?

Thanks in advance


1 Like

I recommend checking out the documentation covering application deployment here: Application publishing - .NET | Microsoft Docs

@cartermp, thanks. I started to read it already. What I couldn’t find there is how one manages a lot of command line utilities in windows environment. Provided that I don’t want to distribute it as single file (which tends to be very large) I was looking for the windows equivalent of linking the executable to a single directory in PATH. Eventually I did find the mklink command which creates symbolic links. Handling this in windows is a bit clunky, but at least it works.

I’ve noticed that dotnet publish'ed Linux binaries don’t work on all Linux distributions (such as NixOS) even if you install the used runtime libraries.

It would be great if I could generate fully statically-linked Linux binaries for dotnet apps.

Thanks for sharing useful post here.