Old 12th May 2018, 12:57   #1
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
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.
Gluck is offline   Reply With Quote
Old 12th May 2018, 16:03   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,907
FOLDERID_ProgramData is the same as CSIDL_COMMON_APPDATA

PHP Code:
SetShellVarContext All
MessageBox mb_ok 
"$AppData

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th May 2018, 09:45   #3
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
Thanks
Gluck is offline   Reply With Quote
Old 13th May 2018, 10:11   #4
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
So, If I have to switch between ProgramData and AppData I have everytime change into All and Current?
Gluck is offline   Reply With Quote
Old 13th May 2018, 10:19   #5
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
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 is offline   Reply With Quote
Old 13th May 2018, 10:30   #6
Gluck
Member
 
Join Date: Apr 2018
Posts: 80
Sorry, my error.

The right code is:

SetShellVarContext All ; Define ProgramData
!define TARGETDIR1 "$AppData\MyApp" ; Define variable
Gluck is offline   Reply With Quote
Old 13th May 2018, 12:20   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,907
You have to use SetShellVarContext at the correct place in your section/function, not when you create the define.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump