I was hesitant to post this since the Invalid command: ${registry::KeyExists} error has already been discussed in detail in previous threads, but none of the explanations so far have solved my problem.
I've installed Dialogs, FindProc, NewAdvSplash, and Registry.
I'm using the 2.3 template,but I'm still getting
Invalid command: ${registry::KeyExists}
Error in script "C:\Documents and Settings\xxx\Desktop\Celtx.nsi" on line 527 -- aborting creation process
of course Registry::SaveKey and DeleteKey don't work either.
Anyone know what's going on?
Do you have both the plugin (DLL) in the plugins folder, and the include file (NSH) in the include directory?
Do you have
!include Registry.nsh
at the top of your script?
The DLL and NSH files are in their respective directories,
the top of the script looks like,
!include Registry.nsh
/**************************************************************************
Name: CeltxPortable
Version:
Website:
the include wasn't originally there, so I added it in, though i don't see the point since !include Registry.nsh is also in
; **************************************************************************
; * Includes
; **************************************************************************
!ifdef DOREG | DOREGFILE ; add macro only when needed
!include "Registry.nsh" ; add registry manipulation macros, not included to NSIS by default
!endif
!include "WordFunc.nsh" ; add header for word manipulation
!insertmacro "WordFind" ; add function for splitting strings
!include "FileFunc.nsh" ; add header for file manipulation
!insertmacro "GetParameters" ; add function for retrieving command line parameters
!define VAR_R0 10 ;$R0 - needed for dialogs
I'm still getting the same error.
I'm running out of ideas, so I thought I'd post my regkeys definitions and ask if they're right. Since it's a lot, I didn't linewrap it.
[It is important to use PREs, so that you don't widen the page. Fixed for you - Ryan]
One way to troubleshoot that is to comment that define out, and include one
with just a single, simple registry key, and see if that works. That would
let you know if the long define is a problem. If one key works, you can
add the others back one at a time until it breaks again -- and report it
to the appropriate topic, since that would indicate a problem with that
Portable App Creator script.
You could also try compiling one of the simple NSI scripts that includes
a registry setting, and see if the registry add-in works there. If it
doesn't work with a simpler script, then it is likely something is wrong
with the path or way NSIS is set up.
By the way, when you post something that is really long, you should put
it inside "PRE" tags.
MC
commenting out the definition didn't help.
I also tried the registrytest example included with the plugin.
The example uses,
${registry::KeyExists} "HKEY_LOCAL_MACHINE\SOFTWARE\NSIS" $R0
and there's no error during compilation.
The Portableapps template uses,
${registry::KeyExists} "$R9" "$R7" ; check whether registry key exists
and there is an error during compilation.
The only difference is the quotes, and they don't matter.
The problem may be elsewhere in the script, but I'm not sure where, so if it helps, here's the makensisw output for the template,
http://pastebin.ca/797309
and thanks, I will keep pre in mind.
Forget ${registry::KeyExists} completely. I take it you are trying to detect NSIS. I have written a macro that does this for you:
I pulled that function out of my custom NSIS installer which detects NSIS, the source can be found at:
http://www.pages.drexel.edu/~sag47/source/NSIS-Installer.zip
Just in case you want to compile it yourself to see how it works.
Can someone tell me how to create a code-block in a forum post? it all looks messy.
SAM
[Code blocks are marked by PRE tags (i.e. <pre>SomeCode</pre>). I've fixed this for you. - Ryan]
What's a signature?
If you notice
!include "Registry.nsh"
. There is no Registry.nsh in the NSIS includes or in the entire NSIS DIR for that matter. And I was looking in the FirefoxPortable source and there is no Registry.nsh file which means it can't compile if it doesn't exist.If you are not trying to detect NSIS then here is some general knowledge about NSIS. NSIS has a built in function to read registry entries called ReadRegStr.
It can be used to read registry entries and then use StrCmp to see if the registry entry holds a value. If I'm losing you let me know but if you search the NSIS help documentation for these terms then it gives a great description of these commands.
SAM
What's a signature?
If you post your script or provide a link to it then I can fix it for you and post the fix. Also explain what you are trying to achieve with your script.
SAM
What's a signature?
I'm trying to make Celtx portable. Celtx is an open source program for screenwriting. It actually compiled with HM NIS, It's slow to open, but here's the code using the portableapps template.
http://pastebin.ca/806328