Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 17th April 2008, 15:07   #1
and84
Junior Member
 
Join Date: Apr 2008
Posts: 12
Need to help(Read/write txt-file and definition of a path)?

Hello all!
I not so well understand in NSIS, help please
I am sorry, if it was already discussed. Searched at a forum but the decision of a problem has not seen

From seen here, has made:

!include "Locate.nsh"
Name "ListFile"
OutFile "ListFile.exe"

ShowInstDetails show

Section ""
FileOpen $2 $EXEDIR\ListFile.txt w
${locate::Open} "$EXEDIR" "" $R0
loop:
${locate::Find} $R0 $R1 $R2 $R3 $R4 $R5 $R6
StrCmp $R1 '' close
CRCCheck::GenCRC "$R1"
Pop $R7
StrCmp $R4 '' 0 +2
goto +2
FileWrite $2 'File: $R3$\r$\nPath: $R2\$R3$\r$\nCRC: $R7$\r$\n'
goto loop
close:
${locate::Close} $R0
${locate::Unload}
FileClose $2
Exec '"notepad.exe" "$EXEDIR\ListFile.txt"'
SectionEnd


As a result I receive the list of files written down in txt-file with indication CRC and path to file.

In txt-file:
File: 129196134213_0.dat
Path: D:\RunDir\Dir1\129196134213_0.dat
CRC: 1605411789
File: other.ifr
Path: D:\RunDir\Dir1\Dir3\other.ifr
CRC: 2902805570


Interests:
1) As it is possible to read through data from file? (a CRC/name of file)
2) As it is possible to make so, that the path to file would enter the name in txt-file
\Dir1 \196147198_0.dat
Without the indication of a directory from where has been started install a file.
If it is not difficult on an example.

Excuse for my English.

Thanks!
and84 is offline   Reply With Quote
Old 18th April 2008, 08:22   #2
and84
Junior Member
 
Join Date: Apr 2008
Posts: 12
Re: Need to help(Read/write txt-file and definition of a path)?

StrLen $3 "$EXEDIR"
StrCpy $R8 "$R2" "" $3

and84 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