Skip to content
⌘ NSIS Forum Archive

ProgramData

7 posts

Gluck#

ProgramData

Hi,

I would know the variable name of ProgramData, the hidden folder in C.\

I've checked it with NSIS_Constats but cannot find the correct name.

Thanks.
Anders#
FOLDERID_ProgramData is the same as CSIDL_COMMON_APPDATA

SetShellVarContext All
MessageBox mb_ok "$AppData" 
Gluck#
So, If I have to switch between ProgramData and AppData I have everytime change into All and Current?
Gluck#
Not working...

I have to copy some files in ProgramData, so I've written:

!define TARGETDIR1 "SetShellVarContext All\MyFolder"

But NSIS says: "Relative paths not supported"

What's wrong?
Gluck#
Sorry, my error.

The right code is:

SetShellVarContext All ; Define ProgramData
!define TARGETDIR1 "$AppData\MyApp" ; Define variable
Anders#
You have to use SetShellVarContext at the correct place in your section/function, not when you create the define.