Archive: Feature Request


Feature Request
Hello. This is my first post on this forum and I'm requesting a feature for NSIS. I've looked around on the forum, asked in the IRC channel, and read the documentation and I haven't found a feature that does what I need.


This is my situation:
I have a number of little freeware utilities that I've collected over the years and that I use all the time, but it's a pain reinstalling them when I reinstall Windows or if I want to install the utilities on a friend's computer.

I've created an installer using NSIS that will put all of them on my system with shortcuts where I want them with just a few clicks, and I'm very happy with it.


This is my problem:
Every so often, I'll find a new utility that I want to add to the group. This means that I have to keep my .nsi file around, along with the directory structure I use to build the installer (each utility's program files in a separate folder) so I can rebuild the installer if necessary.

This is wasteful because it requires me to keep three copies of all of my utilities around (the ones in the directory hierarchy I use to build the installer, the installer executable itself, and the installed programs).

I would like to see a command line switch added to installer executables that would restore the directory structure used to build the installer along with the .nsi file.


For example:
There's a directory called utilInstaller, and it contains several directories (UtilA, UtilB, UtilC, UtilD) along with myUtils.nsi. I build my utilities installer using the nsi file, and when it's done there's a Setup.exe in the utilInstaller directory.

I save Setup.exe, but delete everything else. I use Setup.exe several times to install the utilities on my computer and friends' computers.

I find a new utility called Foo2 that I want to add to the installer package. I create a new directory called Utils somewhere and copy Setup.exe into it. I run Setup.exe /EXTRACT and when it's done executing, Utils contains UtilA, UtilB, UtilC, UtilD, and myUtils.nsi. I create a new folder inside Utils, UtilE, and copy all of Foo2's files to it. I modify myUtils.nsi to have a new Section for Foo2. I compile myUtils.nsi, and get a new Setup.exe with UtilE added. I delete everything except Setup.exe.


Thanks for reading. :)


Well what I'd do is include the whole bunch using
SetOutPath $INSTDIR
File /r "C:\Program Files\My Apps"

Now, rather than having to keep copies in the My Apps folder all the time, you can just run your last NSIS installer to place them back.
When you add another program, just install/extract it to the My Apps folder, recompile your nsi script and there you go!

If you have to create shortcuts though, that'd be another matter. You'd have to add individual code to your nsi script no matter what.

Edit: And you should also put the CreateShortcut's in another Section so that you can choose (on Components page) whether or not you wish to create them. You won't want to create them if you are just re-creating the My Apps folder.

-Stu


Well what I'd do is include the whole bunch using
SetOutPath $INSTDIR
File /r "C:\Program Files\My Apps"
There are a couple reasons I don't want to do that.

The first is that some some of these programs aren't normally "installed"; you just unzip them to a folder and run. A lot of programs like this tend to create ini and other post-first-run files in whatever directory they inhabit, so repacking them would include those unnecessary, possibly machine specific files in the installer.

The second is that it means I would have to back up my nsi file too, and I want to avoid depending on more than one file if at all possible.

You can include your NSIS script and the other source files in your installer but only extract them when you run the installer using something like "setup /source" (instead of the normal "setup" command).

This idea was discussed in a thread a long time ago:
http://forums.winamp.com/showthread....585#post433585


Thanks, pengyou! That did exactly what I needed.