Old 25th February 2012, 05:54   #1
jbillen
Junior Member
 
Join Date: Feb 2012
Posts: 6
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
jbillen is offline   Reply With Quote
Old 25th February 2012, 07:46   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 25th February 2012, 17:55   #3
jbillen
Junior Member
 
Join Date: Feb 2012
Posts: 6
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.
jbillen is offline   Reply With Quote
Old 25th February 2012, 19:45   #4
jbillen
Junior Member
 
Join Date: Feb 2012
Posts: 6
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?
jbillen is offline   Reply With Quote
Old 25th February 2012, 20:45   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 25th February 2012, 22:28   #6
jbillen
Junior Member
 
Join Date: Feb 2012
Posts: 6
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.
jbillen is offline   Reply With Quote
Old 26th February 2012, 06:50   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 26th February 2012, 18:19   #8
jbillen
Junior Member
 
Join Date: Feb 2012
Posts: 6
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.
jbillen is offline   Reply With Quote
Old 26th February 2012, 18:35   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 26th February 2012, 18:55   #10
jbillen
Junior Member
 
Join Date: Feb 2012
Posts: 6
Thanks. That will keep me from stumbling around...
jbillen is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump