View Full Version : Registry KeyPath from automation

04-19-2001, 12:00 AM
Thanks, got it.

"Robert M. Dickau (InstallShield)"
@installshield.com> wrote in message news:3add9a2b@
> A registry value (but not a key) can be used as the key path of a
> just right-click the value and select Set Key Path...
> "Craig Hynd" <craigh@gaelquality.co.uk> wrote in message
> news:3adc3e73@
> > Is it possible to specify a component as having a registry key as the
> > keypath from anywhere in the InstallShield IDE. I am currently using
> version
> > 1.52.
> >
> > Should KeyPath entries work properly in a per-user installation where
> > key path is one of the user profile specific directories? e.g.
> > <AppDataFolder> It seems to be identifying the component as being
> installed
> > if the install was run under a different user profile.
> >
> > Thanks,
> >
> > Craig

02-27-2002, 04:36 AM
Hi all,

Does anyone tried to set the keypath of a component trough the automation interface?

I'm trying to set the keypath to a registry value from the component and I keep geeting 800a0005 error stating:
Registry KeyPath must be in the form [Key]|Name

I've checked and double checked that the format of the keypath I'm setting is correct but it keeps showing this error.:confused:

Note: I've set the KeyPathType to 1.

What is wrong?

Does anyone has a sample code that is working? It would be wonderfull if you could share it.


02-27-2002, 08:22 AM
Hi :
Can you post a sniuppet of the code that you are using to access this via Automation Interface.
Thanks !

02-27-2002, 08:35 AM
Of course, see below.

Set m_ISWiProject = CreateObject("ISWiAutomation.ISWiProject")
strFile = "C:\My Documents\MySetups\Your Project Name.ism"
m_ISWiProject.OpenProject strFile

for each comp in m_ISWiProject.ISWiComponents
if comp.name = "REG_CODE" then
comp.KeyPathType = 1
comp.KeyPath "[HKEY_LOCAL_MACHINE\Software\MyCompany\ProductKeys\CODE]|Serial"
end if

The registry key is already part of the component.

02-27-2002, 09:57 AM
Hi :
I tested this with a VB exe and I am getting the same error at my end.

06-07-2002, 07:09 PM
I've been able to set the KeyPath for registry successfully, but my application that uses the automation interface is a C++ app and not Vbscript. But i found another similar problem. I have a registry name-value pair like
"C:\program files\sample product\bin\test.exe" = "" (empty string value)
under our product's registry key. So I set the component's keyPathType to kptRegistry and its keypath to:
[HKEY_LOCAL_MACHINE\Software\SampleProduct\1.0]|"C:\Program Files\SampleProduct\bin\test.exe" which doesnot work. It throws an error that KeyPath format is not correct and should be in the form of [Key]|Name.

I think automation has no support for any special characters in the Name field.