Archive: EXE Installer - Copy and Pasting Directories To and From


EXE Installer - Copy and Pasting Directories To and From
I am new to software development (though not programming). I am in the process of delivering my first application for commercial release, and I am in need of a single-click installer package. I looked into a number of solutions - I coded my own in C# (it basically just grabs my three folders to their respective destinations), but ran into some issues with bundling some IO libraries. I found NSIS, and while its tutorials are great, I still have some questions.

I have three files

1. myApplication2013 folder
2. myApplication2014 folder
3. System.Data.SQLite.dll

The general logic of the installer is this: http://puu.sh/51YUE/3a143d80f9.png

What the installer really does is it takes the source folders/files (from the 3 above) and literally copies them to the target location. This is also what my C# script does (though it uses the IO library). What are the steps I need to for NSIS?

Thank you.


That's what the File command is for.
It embeds the files you want from your dev machine in the installer executable, and copies those files on the computer of the user.
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.5


Originally posted by jpderuiter
That's what the File command is for.
It embeds the files you want from your dev machine in the installer executable, and copies those files on the computer of the user.
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.5
Thanks for the reply jpderuiter.

Could you give me an example on how this works?

For example, I'd like to copy all the files inside C:/Users/myName/Desktop/myApplication-2013/ into C:/ProgramData/Autodesk/REVIT/Autodesk2013/Addins, how would the script look? Is there also a way to do a conditional, that is, if myApplication-2013 doesn't exist, but myApplication-2014 exists, copy into myApplication-2014.

Thanks for the help.:)

If you really want the destination folder fixed (user cannot change it), first call

SetOutPath "C:/ProgramData/Autodesk/REVIT/Autodesk2013/Addins"

Then call the File command:
File "C:/Users/myName/Desktop/myApplication-2013/*.*"
If you want to have a conditional destination directory, you can use LogicLib and SetOutPath: http://nsis.sourceforge.net/LogicLib

However, looking at Revit addin deployment, copying the dll files seems to be not enough, you should also register the addin.
Search google, it seems like some Revit Addin deployment tools are available which makes it easy to create an installer.