Skip to content
⌘ NSIS Forum Archive

reg file problem

10 posts

Pacca#

reg file problem

hi to all 😁
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 😛)
Pacca#
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#
Do you want the content of this file to go into the registry? Simply read it with FileOpen, FileRead and FileClose.
Pacca#
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="&quot;d&quot; /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...)
Pacca#
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="&quot;d&quot; /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#
Use $\n instead of the actual line breaks.
${registry::StrToHex} '<?xml version="1.0" encoding="utf-8"?>$\n<PARAMS>$\n...