Search code examples
c#self-extracting

Self-Extracting Zip: Specify Extraction Path With .exe File


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#?


Solution

  • 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.