Skip to content
⌘ NSIS Forum Archive

Why $PLUGINSDIR = DRIVE C: ?

5 posts

mrjohn#

Why $PLUGINSDIR = DRIVE C: ?

Hi,I read that is better to use $PLUGINSDIR instead of $TEMP
In documentation is written :

$PLUGINSDIR

The path to a temporary folder created upon the first usage of a plug-in or a call to InitPluginsDir. This folder is automatically deleted when the installer exits. This makes this folder the ideal folder to hold INI files for InstallOptions, bitmaps for the splash plug-in, or any other file that a plug-in needs to work

So I've made a test for a .reg file

Section "" 
  SetOutPath $PLUGINSDIR
  File my1.reg
SectionEnd 

But after install,I see my1.reg dropped directly on drive C:,not even deleted after install ?
There is something I miss there ?
Tested on XP SP3 (32)

Thanks !
MSG#
$PLUGINSDIR is a writable variable, perhaps you're changing it yourself?
Try a MessageBox MB_OK "$PLUGINSDIR" in your .onInit.
mrjohn#
No I didn't change it,this is whole script :

Name "Example1"
OutFile "example1.exe"
InstallDir $desktop
 RequestExecutionLevel user
Page directory
Page instfiles
Section ""
  SetOutPath "$PLUGINSDIR"
  File my1.reg
SectionEnd 
This :
Function .onInit
 MessageBox MB_OK "$PLUGINSDIR"
FunctionEnd 
give me an empy messagebox :



Thanks!

Originally Posted by MSG View Post
$PLUGINSDIR is a writable variable, perhaps you're changing it yourself?
Try a MessageBox MB_OK "$PLUGINSDIR" in your .onInit.
mrjohn#
Great,it is working now !
Thanks !
Originally Posted by Afrow UK View Post
InitPluginsDir.

Stu