4
votes

I am building a plugin for NSIS with VS 2010 and I would love to set up the project so that a test setup is automatically built from a simple NSI file.

All seems fine except I can't figure out how to make NSIS look for my plugin in my project's output folder instead of C:\Program Files (x86)\NSIS\Plugins\*.dll only.

Are there any commands I can put in my NSI script to make NSIS look for my freshly built plugin outside of "standard plugins folder"? It seems rather odd to have to copy my DLL each time I wanted to test it.

Any help is appreciated.

4

4 Answers

6
votes

You can use !addplugindir directive, see nsis compile-time commands.

2
votes

Use !addplugindir directive with defined symbol (/D on command line). Symbol is "the path to your location of .dll file"

For VS 2010 is the best option to use Visual & Installer - free VS addin for developing NSIS installers directly in Visual Studio.

Set your symbol in Project properties:

NSIS Project properties in VS 2010 Download here: www.unsigned-softworks.sk/visual-installer/

0
votes

As others have mentioned, the !addplugindir directive in your NSI script file will do the trick, and you can define a variable to pass to that directive on the command line using /D.

As for the code to add to your NSI file, you need something like this:

!ifdef EXTRANSISPLUGINSFOLDER
  !addplugindir "${EXTRANSISPLUGINSFOLDER}"
!endif

Then on the command line, you can call your NSI script like this:

makensis.exe /DEXTRANSISPLUGINSFOLDER=C:\somefolder\moreplugins\ YourInstallerScript.nsi

When defining the extra folder, you might find that having any spaces in the folder path causes problems, and using quotes around the path doesn't help. To work around this, try using the dir /x command in the Windows terminal to list the 8.3 DOS names for the folders with spaces in their name. This will help you build up a folder path that doesn't contain spaces. (eg C:\Program Files\ often becomes C:\PROGRA~1 when listed with dir /x from the root of C:)

-1
votes

May have missed the point here but could you not have used an XCOPY post build event to copy the output to the NSIS plugins directory?