Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 16th May 2005, 13:27   #1
saurabhagarwal
Guest
 
Posts: n/a
Finding path of "Application Data" folder in user's machine

Hi!

While uninstalling I need to delete some files from user's machine. These files are there in the following path
C:\Documents and Settings\develop\Application Data\MyFolder\abc.txt

Upto "Application Data" we have system folders. MyFolder is user created folder. I need to delete file abc.txt from this folder.

Now problem is that the path to Application Data folder may be different in different machines. Then how can I delete this file.

Any any help will be greatly appreciated.

Regards
Saurabh
  Reply With Quote
Old 16th May 2005, 13:51   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,185
Send a message via ICQ to Yathosho
$APPDATA
The application data directory. Detection of the current user path requires Internet Explorer 4 and above. Detection of the all users path requires Internet Explorer 5 and above. The context of this constant (All Users or Current user) depends on the SetShellVarContext setting. The default is the current user.
Yathosho is offline   Reply With Quote
Old 16th May 2005, 14:25   #3
restools
Junior Member
 
Join Date: Feb 2005
Posts: 6
--Now problem is that the path to Application Data folder may be different in different machines
code:
......
......

Section install
SetOutPath "$APPDATA\MyFolder"
File "abc1.txt"
File "abc2.txt"
File "abc3.txt"
FileOpen $0 $INSTDIR\Inst.log w
FileWrite $0 "$APPDATA\MyFolder\abc1.txt$\r$\n"
FileWrite $0 "$APPDATA\MyFolder\abc2.txt$\r$\n"
FileWrite $0 "$APPDATA\MyFolder\abc3.txt$\r$\n"
FileClose $0
SectionEnd

......
......

Section Uninstall
FileOpen $0 $INSTDIR\Inst.log r
read:
FileRead $0 $1
IfErrors close
Delete "$1"
Goto read
close:
FileClose $0
SectionEnd


restools is offline   Reply With Quote
Reply
Go Back   Winamp 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