Old 13th June 2012, 13:19   #1
mike_123
Junior Member
 
Join Date: Jun 2012
Posts: 5
Copy/delete file in (%programdata%)

Hello,

I'm new user to Nsis .

Would you be so kind as to help solving this problem.

I'm trying to copy a file to ProgramData (C:\ProgramData) in Nsis.


But I couldn't find the path of %programdata%


For exmaple deleting file from Programdata;


RMDir /r "$ALLUSERSAPPDATA\testfile"
Sleep 500

or

RMDir /r "$ALLUSERSPROFILE\testfile"
Sleep 500

both are not working.

Nsis constant (app) is showing me this path;

[$APPDATA]
current APPDATA=C:\Users\xxx\AppData\Roaming
all APPDATA=C:\ProgramData

$APPDATA is referring to %appdata% not to %programdata%

I'm using Windows 7.

And furthermore do I need a admin permission to be able to copy/delete files.



Thank you in advance.
mike_123 is offline   Reply With Quote
Old 13th June 2012, 13:49   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,610
Are you calling "SetShellVarContext all"?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th June 2012, 13:50   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
SetShellVarContext all
DetailPrint $APPDATA ; prints C:\ProgramData

Stu
Afrow UK is offline   Reply With Quote
Old 13th June 2012, 15:34   #4
mike_123
Junior Member
 
Join Date: Jun 2012
Posts: 5
First of all,

thank you for your hospitality, for solving
of the problem (Anders and Afrow UK ). I appreciate it

SetShellVarContext all
DetailPrint $APPDATA ; prints C:\ProgramData


If %programdata% is on another partition. like D:\ partition.

for example; after compiling the NSIS Script to an executable file.

And running it on other workstation. Shall this work

Or should I put something else ?.



thank you.
mike_123 is offline   Reply With Quote
Old 13th June 2012, 16:37   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,610
Yes it should work even if the user has changed the location...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th June 2012, 16:41   #6
mike_123
Junior Member
 
Join Date: Jun 2012
Posts: 5
thank you Anders
mike_123 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