stephen.starkie
9th January 2009 16:29 UTC
NSIS equivalent of merge modules
Hi,
We have some sub projects (which typically install a small tool) which we use in other larger projects. I would like to create NSIS installers for the smaller projects that I can then reuse in the larger projects (which typically take a selection of the small tools and package them together). Is there a good way to do this?
Steve.
KrisAster
9th January 2009 16:46 UTC
You can include .NSI scripts in a main .NSI project. So, what I've done is separate certain sections of my installer into sub parts and then have thin main projects that include many of the sub-components or sections. It prevents duplication of work, it doesn't have the overhead of a whole MSM, it's easy to track in versioning software. I prefer this method to MSMs myself.
stephen.starkie
12th January 2009 09:42 UTC
Thanks,
This sounds like exactly what I want to do - are there any examples of this way of doing things around?
Afrow UK
12th January 2009 14:15 UTC
There won't be examples of this because as most examples are typically quite small we do not need to split them up.
It's quite simple. When you use !include File.ext you are effectively copying the contents of that file into the current script where you have put the include statement.
Stu
KrisAster
12th January 2009 15:14 UTC
The basic idea is something like this:
This is sharedtool.nsi
Section "-Hidden Shared Tool"
File "blah"
; Set registry settings or whatever
SectionEnd
>
Installer that uses shared tool:
Section "Component 1"
; Files
SectionEnd
>; This line would be in every installer that you would
>; want to have use the shared code
>!include "sharedtool.nsi"
>Section "-Post"
; Settings
SectionEnd
>
Keep in mind this is just the most *basic* example. For all of this to work it needs to have some forethought. Do you want to share sections? lists of files? It's all up to you. I keep track of all the installs myself so my system is a little... sloppier, for lack of a better word, but it's quick and easy. If you have multiple developers for the same setup, you may need to think it out a bit more.
Hope this helps.