Archive: Prompt for files to include at compilation


Prompt for files to include at compilation
I've been using NSIS for a while and have created an installer for the application that I work on (before it had to be installed manually copying files, changing registry etc but no one else at the company had been bothered to create an installed) and I find it nice to work with and mostly easy to use.

Now the question: I'm now working on a script to update new files and these are all in the same directory tree format as the installed app but contain only the new files. What I want to be able to do is easily at compile time of the NSIS script to be able to select which directory these files are in (to same other members of the team from having to know how to change the NSIS script). We want to keep archives of the updates so the path containing the files to be packaged will change with each update.

Anyone got any ideas how to do this? Perhaps passing some parameter to compiler (which I could make a little app to do)?


My Zip-To-SE (Zip to Self-Extractor) program does exactly that. It's a program that simply extracts files from the Zip into a temp folder, makes a list of files to compress in a temp Self-Extractor nsi script, then builds the Self-Extractor (Installer) script by calling makensis.exe "script.nsi".

Source file attached (written in NSIS).

You want to look at the WriteScript Function. It calls another custom GetFiles Function which writes all the files and new outpaths to the nsi script for compiling.

If you want to see the Self-Extractor kit, you can grab it at the NSIS Archive under NSIS Software.

-Stu


Cheers. I didn't use your script as is but got some ideas from it, seems fairly obvious now that the easiest way to do what I needed was to change values in the script then run makensis on it. I've now got a small NSIS exe which prompts for a path to create patch from and a name for the patch then it changes the appropriate values in a template script before compiling it.