|
|
#1 |
|
Member
Join Date: Jun 2003
Location: Estonia
Posts: 91
|
i would like to write some text and variables into a txt file.. so how to create file myfile.txt and write tekst ('my text') + variable(for example $INSTDIR) to file?? i know that it is possibel to write to ini, but i really need txt(or bat file)
|
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
See FileOpen, FileWrite and FileClose in the documentation.
There are also some examples in the Archive. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: May 2003
Posts: 676
|
is it possible to use the INI-functions on any text file (not only *.ini) ?
it might be the better way !? Greets, Brummelchen |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
|
Yes it is, you can make ini entries in not just .ini files.
You can also write $\r$\n to the end of the ini value to make a few nice gaps between entries or entry groups too hence while making logs. -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#6 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
I wouldn't use it. You can never know what the function will do with the data that's not structured as an INI file.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#7 |
|
Member
Join Date: Jun 2003
Location: Estonia
Posts: 91
|
tnx
it works, but it is strange, that in NSIS you can unite variable and string this strange way(without '+' or smth like that):FileWrite $1 '"$INSTDIR" is installation directory' output: "c:\program files" is installation directory it is fine to me, but what if i wanted to get this output: output2: "$INSTDIR" is installation directory (right now i don't need this output, but i was just wondering) anyway tnx again |
|
|
|
|
|
#8 |
|
Member
Join Date: Jun 2003
Location: Estonia
Posts: 91
|
ok, i just figured it out:
FileWrite $1 '"$' FileWrite $1 'INSTDIR" is installation directory' |
|
|
|
|
|
#9 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
The proper way to get NSIS to not process the dollar sign is to use two dollars. For example:
FileWrite $1 '"$$INSTDIR" is installation directory' NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|