Pregunta

I'm working on a deployment plan for a C# Winforms application and would like to use a self-extracting .zip file to distribute all of the required files. Here is the file structure of the SFX:

Setup.exe
app.exe
app2.exe
readme.txt
manual.pdf

After the user runs the SFX, I want Setup.exe to take control and copy app.exe, app2.exe, readme.txt, and manual.pdf to location x. The path they are copied to will depend on choices the user makes from the UI of Setup.exe, system properties, etc.

How would I go about writing Setup.exe in C#?

¿Fue útil?

Solución

Personally, I had very good experiences with using NSIS as a setup tool. It's a bit more than a SFX but really good to use, rather flexible and free-of-charge.

So I recommend that you do not write your own SFX in C# (aka "re-inventing the wheel") but rather use something existing that is real-world-proofen.

There are, of course, a lot of other installers available.

Otros consejos

I agree, don't waste your time writing an installer when there are already ones available. If you did chose to write one on your own for whatever reason, I would encourage you to stay away from any languages that require dependencies (e.g. C# requires the .Net Runtime). I would suggest using C or C++ and turning on static linking using the /MT flag so that your installer is dependent on as little as possible.

Some of the installation software I've used (in order of preference):

See the list of installation software article on Wikipedia for other options.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top