Archive: WriteRegStr ignored in script


WriteRegStr ignored in script
I have several sections similar to below. The command WriteReg used to work (as I see using Regedit), but the script, which compiles successfully, now seems to ignore these lines. Is there something that would prevent writing to the Registry. I'm logged in as an administrator and can edit the Registry using .reg files or Regedit.


Section ""
WriteRegStr HKCR "QKPfile" "" "Quikplot input"
WriteRegStr HKCR "QKPfile\Shell" "" ""
WriteRegStr HKCR "QKPfile\Shell\Print" "" ""
WriteRegStr HKCR "QKPfile\Shell\Print\command" "" 'Notepad.exe /p "%1"'
WriteRegStr HKCR "QKPfile\Shell\Open" "" ""
WriteRegStr HKCR "QKPfile\Shell\Open\command" "" '$INSTDIR\Quikplot.exe "%1"'
WriteRegStr HKCR "QKPfile\Shell\Edit" "" ""
WriteRegStr HKCR "QKPfile\Shell\Edit\command" "" 'Notepad.exe "%1"'
WriteRegStr HKCR ".QKP" "AlwaysShowExt" ""
WriteRegStr HKCR ".QKP" "" "QKPfile"
SectionEnd


Why would it ignore the lines?

Is this 64 bit windows? Either way, fire up Process Monitor and try to figure out the problem...

...also
* The verbs should not have empty strings, set a string or don't write anything at all
* '$INSTDIR\Quikplot.exe "%1"' should be '"$INSTDIR\Quikplot.exe" "%1"'
* Why are you setting AlwaysShowExt? Respect the users settings please...


Is s 64-bit Windows, but I don't think that should be a problem because it did work at one time. I'll take your advice about the AlwaysShowExt. Thanks for tip on Process Manager. I don't understand your first bullet.


I downloaded Process Monitor (not Manager as mentioned earlier) from CNET and ran the installer made from the script. Some of the WriteRegStr commands result is "SUCCESS", but RegCreateKey commands say "ACCESS DENIED Desired Access: Set Value". The RegQueryKey commands result in "SUCCESS."

There are some other Registry command evidently generated by the installer that say, for example "RegOpenKey HKCU\Software\Classes\QKPfile\Shell\Open NAME NOT FOUND Desired Access: Maximum Allowed". I am not sure if this is important.

Why when logged in as an administrator should I see ACCESS DENIED?


Do you have "RequestExecutionLevel admin" in your script?
RegCreateKey should not fail. Try deleting the key in regedit...

Don't do WriteRegStr HKCR "QKPfile\Shell\Open" "" "" etc


That's how I was testing the script: first delete the key in regedit. The "RequestExecutionLevel admin" statement solved the problem. Thanks a lot for the help.


Well then you did not run as admin before (Maybe you need to read about UAC on MSDN)

You should use http://pastebin.com/EvMkyLLt to make sure.


I saw the script in the link you supplied and I read about UAC is Wikipedia. I see why the statement "RequestExecutionLevel admin" is needed.

I started using NSIS just recently after using InstallShield for a long time, so I probably have quite a few things to learn. For one, I do not see how to access this message from the forums/winamp.com homepage without searching for something in the post. I was only able to start the original post by clicking on a link in one of kichik's replys. I would appreciate it if you could point me in right direction.


http://forums.winamp.com/ scroll down to "Developer Center" and click "NSIS Discussion" but I just type "nsis forum" in the addressbar and firefox+google does the rest...


Thanks. That will keep me from stumbling around...