1

I've just finished my Windows Forms App project in Visual Studio using C#. I know I need to release it. To do so I need to go from Debug mode to Release above in VS and then just click on F6. After that I have a folder with an exe file in it. But in my project I use a dll library which was copied on my PC and registered by regsvr32.exe in cmd. Next in VS I went to Solution Explorer and added the library in References by writing the path to it. I also use two packages which were installed by NuGet Package Manager.

My program is developed to use it by my coworkers so I have to distribute it to them. The problem is that I don't know how to prepare my app for it.

I'm reading lots of different articles about the release step but I'm getting more confused. People usually write that I can just copy the exe file in the release folder and use it in another PC after installing .Net there. But in my project there are also the three libraries and without them my program won't work in another PC. I can copy and register the first library on other computers but what about the last two? How to set up them correctly?

About the first library, I put it in a folder created by me manually in the C directory of my computer. The release folder is in another place. And when registering this library in cmd and then adding it to References, I specified the path to it. It means if the path has been changed, it won't be possible to use the library in the project. I tried some times. It's not convenient and when placing the app in another PC without VS where I can specify the path, my program won't probably work. So it would be very convenient to place this library next to the release folder and after putting it in another PC, the path to the library wouldn't cause any problems.

To sum up, I'm looking for the way to easily and conveniently distribute my program to users. Of course, I want to put my app and the libraries together in a PC, not to set up them separately and then tune them separately to make the program work there. Might there a way to release it as an app with all the libraries connected to it?

I feel it must be easy but I'm not so experienced. I'm sorry for that.

pjs
  • 18,696
  • 4
  • 27
  • 56
  • 1
    the easiest is to zip all the files together and deploy them as an archive somewhere on a webservice. You can also create an installer. There are way to many ways to achieve that, that highly depend on what you expect your users to do with the app and how they use it. – MakePeaceGreatAgain Feb 14 '23 at 16:28
  • You only need to distribute you main application (.exe) and the three (.dlls). You can use an installer creator, such as [Setup Factory](https://www.indigorose.com/setup-factory/) to make creating the installer easier. This tool also allows you to specify which dlls need to be registered using regsvr32.exe. – user20716902 Feb 14 '23 at 17:06
  • I think you are also confusing all the steps required to build a project with actually running it once compiled, After building your project all the files that are need to run your application will be in the Release/Bin folder. Just add them all to your installer, which will install in a location like `C:\Program Files\My App Title\***` When you main exe runs it will search for the dlls it needs in the same folder as your app is installed. – user20716902 Feb 14 '23 at 17:16
  • Does this answer your question? [How to make an installer for my C# application?](https://stackoverflow.com/questions/2251062/how-to-make-an-installer-for-my-c-sharp-application) – Fildor Feb 14 '23 at 17:25
  • 1
    _"I feel it must be easy"_ - one might think that, but no. Making installers is _not_ trivial. – Fildor Feb 14 '23 at 17:33
  • Please read tag descriptors before using a tag. – pjs Feb 14 '23 at 18:52
  • @wenbingeng-MSFT I believe you meant this for the OP "@user21166109" – user20716902 Feb 21 '23 at 09:57
  • @user20716902 Yes, you really understand me. – wenbingeng-MSFT Feb 22 '23 at 01:12

1 Answers1

0

It is recommended that you use ClickOnce deployment:

ClickOnce deployment is a Microsoft technology that allows you to easily deploy your Windows Forms App along with all its dependencies. With ClickOnce deployment, you can publish your application to a web server or a file share and users can install it by simply clicking on a link. ClickOnce will automatically download and install all the required DLLs and packages on the user's computer.

Of course, there are some third-party packaging software that I can't recommend. If ClickOnce doesn't help you, I'll think of other ways.

wenbingeng-MSFT
  • 1,546
  • 1
  • 1
  • 8