noisehole
2nd May 2006 09:27 UTC
plugin development
hi,
im currently writing a small plugin for nsis based on the exdll example, which handles some file functions by itself.
now i need to resolve a nsis path like "$DESKTOP\blah" within the plugin, but couldnt find any solutions (am i missing some dev docs here?)
any hints are welcome
kichik
2nd May 2006 11:42 UTC
NSIS doesn't provide any plug-in API to do that, but you can call SHGetSpecialFolderLocation yourself. There's a usage example in GetNSISString in Source\exehead\util.c.
noisehole
2nd May 2006 12:17 UTC
yeah i know, but it would be nice to use that vars directly. most of the path constants eg depend on SetShellVarContext, its just too many cases
atm i push $INSTDIR $DESKTOP etc and do a search&replace in a plugin function.
thx for the reply
btw: i tried this, but failed. any solution for this?
- set a user var in the plugin. string contains eg $DESKTOP
- installerscript "resolves" these tokens
- push them back for use in the plugin
i tried a few things, but i keep failing at step 2
Afrow UK
2nd May 2006 14:43 UTC
It's probably easier to pass them as plugin parameters I guess.
e.g.
/EXEDIR $EXEDIR etc
-Stu
kichik
3rd May 2006 10:21 UTC
The resolving of the variables is done in the compiler. The compiler (makensis) pre-processes the strings and turns each variable and constant into a special sign, taking two to three bytes, that the installer itself can interpret. You can not pre-process the strings yourself in a plug-in.