Archive: Header files organization


Header files organization
Hi all,

I'm new to NSIS, and had a question regarding the organization of the header files. We're in process to convert our installers to NSIS installer.

There are a few different installers and a lot of functions are shared between them. It makes sense to make a common header file which will be shared between all the installers.

1) The way i see things at the movement, we can place a header files only in the C:\Program Files\NSIS\Include folder. Please correct me if I'm wrong?

2) I also know that I can use a header file in the dir above as a pointer to point to the actual location of the header file i.e. MUI.nsh points to another file.

I'm not sure if it's possible but here's what I want to achieve:

I want to place a ptr file in C:\Program Files\NSIS\Include, let's call it 'commonFuncPtr.nsh' and inside this file I just want to point to the actually header file which will be checked into SVN repository. The repository could be somewhere on the machine.

I can determine the root dir, and then find my way to the actual header file...but I don't know how to pass that path to the header file inside C:\Program Files\NSIS\Include

Instead of 'NSISDIR', I will pass in 'RootDir'\installer\headerfiles\headerfile1.nsh'


Is this possible to achieve? If yes, how can I pass in the path? Thanks!
Also, is NSISDIR a built in variable?


Also check the PATH_TO_NSIS\nsisconf.nsh

${NSISDIR} is built in see the docs


Why not do like this in your installer:

!define RootDir "C:\Dev\My Project"

!include "${RootDir}\installer\headerfiles\headerfile1.nsh"
!include "${RootDir}\installer\headerfiles\headerfile2.nsh"
!include "${RootDir}\installer\headerfiles\headerfile3.nsh"

thanks for the both suggestions, Lord_Mulder's suggestion is something I was looking for. Thanks so much!