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

Reading a Registry Value Into a Property


2 replies to this topic

russellperry

russellperry
  • Full Members
  • 31 posts

Posted 26 July 2006 - 17:31

I want to read the registry value HKLM\SOFTWARE\Microsoft\Java VM\\Classpath into a public property called MSVM_CLASSPATH_VALUE.

I've authored:

AppSearch Table

Property
MSVM_CLASSPATH_VALUE
Signature_
msvm_classpath


RegLocator Table

Signature_
msvsm_classpath
Root
2
Key
SOFTWARE\Microsoft\Java VM
Name
Classpath
Type
2


But MSVM_CLASSPATH_VALUE is never set by the AppSearch action. The Signature is not in the Signature or CompLocator tables, so AppSearch should assume this is a Registry value. Setting a breakpoint at IsLaunchConditions, immediately after AppSearch in the debugger, shows that the MSVM_CLASSPATH_VALUE is never set with the registry value, which is definitely present in the Registry on the development machine.

If I define the property in the Property table with a default value of 0, then the value remains 0 after AppSearch. If I don't define the property, it never shows up in the property list of the debugger view, which tells me AppSearch is not finding the Registry key, and that maybe the problem is the way I'm authoring the Reglocator table. But I can't figure out exactly what I'm doing wrong.

Any ideas? What am I missing?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 July 2006 - 21:02

So they key is HKLM\SOFTWARE\Microsoft\Java VM (in the tree view part of regedit), and there's a named string value with name "Classpath"? Generate a verbose log to see what Windows Installer is finding or not. Is your AppSearch action actually running or does it have a condition?

russellperry

russellperry
  • Full Members
  • 31 posts

Posted 26 July 2006 - 21:53

It's fixed now, but I'm not sure why. The verbose log showed that AppSearch wasn't ever checking Reglocator, no fail, no success, no nothing:
CODE

AppSearch: Property: MSVM_CLASSPATH_VALUE, Signature: msvsm_classpath
MSI (c) (88:28) [11:41:24:022]: Note: 1: 2262 2: CompLocator 3: -2147287038
MSI (c) (88:28) [11:41:24:022]: Note: 1: 2262 2: IniLocator 3: -2147287038
Action ended 11:41:24: AppSearch. Return value 1.


All the properties and table values were exactly as I described earlier, but with some mucking around with names, creating a test app, cut-and-pasting values back and forth, it finally worked. Go figure.