- NSIS Discussion
- reg file problem
Archive: reg file problem
Pacca
27th September 2008 17:54 UTC
reg file problem
hi to all :D
i'm trying to do a thing, but i don't know if it is impossible or not...
i have to write a reg binary, with a file path; but this path depends on the install path, so it would be a variable.
so, it is possible to have a variable, that during the installation of the file would be transformed in hex, using the function writeregbin?
thx very much (and sorry for my bad english :p)
kichik
27th September 2008 20:04 UTC
You can't do it with WriteRegBin, but the registry plug-in can help you there.
Pacca
28th September 2008 00:25 UTC
thx very much, i will try it!
Pacca
28th September 2008 17:12 UTC
ok...now i have only one problem
i'm using the registry::StrToHex function.
but how can i use this (the attached file) as value?
kichik
28th September 2008 17:16 UTC
Do you want the content of this file to go into the registry? Simply read it with FileOpen, FileRead and FileClose.
Pacca
28th September 2008 21:33 UTC
no no..
i have to add this text
<?xml version="1.0" encoding="utf-8"?> <PARAMS> <SCHEDULED_TASK PLUGIN="1000600" ACTION="0" DESCRIPTION="a"> <DATA> <NODE NAME="FILENAME" VALUE="b" TYPE="STRING" /> <NODE NAME="DIRECTORY" VALUE="c" TYPE="STRING" /> <NODE NAME="CMDLINE" VALUE=""d" /s" TYPE="STRING" /> </DATA> </SCHEDULED_TASK> </PARAMS>
to the windows registry (i don't know why i added the .txt file instead of copying it here) without reading it from a file.
only that i don't know how to convert this to hex using ${registry::StrToHex}, because it is multi-lined (when i copy it in the nsis editor it becomes a text on various lines...)
kichik
28th September 2008 22:26 UTC
Use $\n for new lines.
Pacca
29th September 2008 06:18 UTC
ok, thx
but if i make something like this
${registry::StrToHex} '<?xml version="1.0" encoding="utf-8"?>$\n
<PARAMS>$\n
<SCHEDULED_TASK PLUGIN="1000600" ACTION="0" DESCRIPTION="a">$\n
<DATA>$\n
<NODE NAME="FILENAME" VALUE="b" TYPE="STRING" />$\n
<NODE NAME="DIRECTORY" VALUE="c" TYPE="STRING" />$\n
<NODE NAME="CMDLINE" VALUE=""d" /s" TYPE="STRING" />$\n
</DATA>$\n
</SCHEDULED_TASK>$\n
</PARAMS>$\n
'$0
it makes me an error on the first line...
thx very much for the big help
kichik
29th September 2008 06:27 UTC
Use $\n instead of the actual line breaks.
${registry::StrToHex} '<?xml version="1.0" encoding="utf-8"?>$\n<PARAMS>$\n...
Pacca
29th September 2008 06:54 UTC
oh yes!:D :D :D
thx very much kichik!
your answers were so fast:p
:up: :up: :up: