Archive: WriteRegStr Failure


WriteRegStr Failure
Ok, the first I wanna say is:

NSIS is great!

I tried Install Shield and any other Programs before, but nothing satisfied me like NSIS

the 2nd thing: My English is bad, don't worry about it

ok, now the most important thing of this post

There is an Error in the Command WriteRegStr...

I Wrote a Program which needs a Password depending on the Database, so I used a var to write the Password in the registry. So far so good - executing the Setup it writes the
key_name in the subkey, but no value - if I change the key_name it writes the value
:igor: I don't know what NSIS doesn't like on PWD as key_name, because it accepts PWX or PWA or anything like this... hope anyone can help me to get this f*cking PWD in the Registry

thanks in advance

Davion


Can you post the code? Maybe you are missing something. :)

Oh, BTW:
Willkommen zu den Foren.

That means, welcome to the forums. :D


Willkommen zu den Foren
^^Thanks :D I didn't expect that ;)

ok, it looks like this:

.
. (other stuff)
.
var PWD
.
. (other vars, sections and stuff like that)
.
StrCpy "$PWD" "JW463;"
WriteRegStr HKLM "Software\MyProg" "PWD" "$PWD"
.
. (other stuff)
.

first I thought it happened because of the ';' but without this it didn't work, too.

then I tried other values for $PWD but there was no result

then I just changed "PWD" to "PWE" and it worked fine...

sombody could think it would be easier to change "PWD" but there are a few Customers I would have to update, because all of them have a PWD Field in the registry

if there are still open questions, you can also write a mail or a PM

come on don't be shy ;)

Hope this wasn't too bad english


worried
Ok, I tried it with another script again

and it worked... :igor:

I copied the few lines into my other script and it still didn't...

I don't know whats going on there

I had an error like this with another script, I tried and tried but it didn't work after a reinstallation of NSIS it worked

am I stupid or are there known errors like this?

*throwing the PC through the window*
much better

now in serious, which I make wrongly?

EDIT:

I have the Error:

WriteRegStr HKLM "Software\My Prog" "PWD" "$c_PWD"
^^doesn't work

WriteRegStr HKLM Software\MyProg "PWD" "$c_PWD"
^^works fine

But there is the problem that I have to use THIS sub_key...
It seems to be a "bug" in NSIS - hope anyone has an Idea how to fix it


hi

try this:

WriteRegStr HKLM "Software\MyProg\PWD" "$c_PWD"


That is not going to work. If you think it's a NSIS bug, please create a script that reproduces the problem and submit a bug report at the project page.


Yeah
THX this works!:D

WriteRegStr HKLM "Software\MyProg" "PWD" "$c_PWD"
^^old
WriteRegStr HKLM "Software\MyProg\" "PWD" "$c_PWD"
^^new

just a missing backslash :igor: