Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Using string table entry in script


8 replies to this topic

Kate

Kate
  • Members
  • 61 posts

Posted 21 March 2001 - 19:55

I'm using IPWI 2.03. I've written a string table entry and am using it in a function in my script (RegDBGetKeyValueEx). I added it using "Insert String Table Entry". There's an "@" in front of it. And the function works if I replace the string table entry with a value that's hard-coded in the function. When I run debug, I get "Error: symbol "MY_KEY" not found".

Any ideas? What am I missing?


AndrewWalker

AndrewWalker
  • Members
  • 42 posts

Posted 21 March 2001 - 20:04

The @ sign means that what follows is a string table entry name.  You need to replace MY_KEY with the name you gave your string table entry.

For example, if you created a string table entry called "REGISTRYKEYNAME" with a value of "SOFTWARE\\Company\\Product", should have @REGISTRYKEYNAME in the function.

If that's confusing, or if your problem still isn't solved, please feel free to email me.


Kate

Kate
  • Members
  • 61 posts

Posted 21 March 2001 - 22:29

I do have @ in front of my string table entry (in the function).

string table entry is
MY_KEY   \\SOFTWARE\\Company\\Product


Then I've got the script...

RegDBGetKeyValueEx (@MY_KEY, szName, nvType, svValue, nvSize)

Doesn't work. :(



AndrewWalker

AndrewWalker
  • Members
  • 42 posts

Posted 21 March 2001 - 23:41

Hmmmm...

I tried a test similar to what you've said, and it worked just fine.  I even added a line:
MessageBox(@MY_KEY, INFORMATION);
which caused a message box to popup with the value that I had put into the String Table entry for MY_KEY.  The only difference (and this shouldn't be a problem) is that I used \ instead of \\ in the Value in the String Table.

Just a sanity check--if you go to General Information under Organize Your Setup, and then you go to the String Table for English, and scroll all the way to the bottom of the list, you do find MY_KEY there, right?


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 March 2001 - 08:31

Quote
The only difference (and this shouldn't be a problem) is that I used \ instead of \\ in the Value in the String Table.

This is indeed a significant difference: Use double backslashes in string literals you write in script:
szKey="Software\\Company";
But don't use such excape sequences in the string table:
MY_KEY   Software\Company

Also don't have a leading backslash in the key name. SO your string table entry should look like this:
MY_KEY   SOFTWARE\Company\Product


AndrewWalker

AndrewWalker
  • Members
  • 42 posts

Posted 22 March 2001 - 15:00

Yes, it IS a significant difference in the definition of the value of a string, but that is not (to my understanding) the problem she's having.  My understanding is that she has created a String Table entry, MY_KEY, which is not being recognized in the script.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 March 2001 - 18:32

Quote
My understanding is that she has created a String Table entry, MY_KEY, which is not being recognized in the script.

Oops, should have read the original post more thoroughly. In this case I suspect that she may not have perfoemd a media build after adding the string table entry.

Kate

Kate
  • Members
  • 61 posts

Posted 23 March 2001 - 20:26

Thanks much. I did 2 things - got rid of the double \\ and upgraded to 2.03. It now works.
So if it really was only a \\ problem, it's strange that the debugger showed the property as "not found"...

Thanks again for your help!