PDA

View Full Version : Registry KeyPath from automation



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

"Robert M. Dickau (InstallShield)"
<i_wish_i_had_time_to_answer_individual_questions_through_e-mail_but_i_don't
@installshield.com> wrote in message news:3add9a2b@12.41.20.38...
> A registry value (but not a key) can be used as the key path of a
component;
> just right-click the value and select Set Key Path...
>
> "Craig Hynd" <craigh@gaelquality.co.uk> wrote in message
> news:3adc3e73@12.41.20.38...
> > 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
the
> > 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
>
>
>

bogdan
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.

Thanks.

GogiGrewal
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 !
-Gogi

bogdan
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
next
m_ISWiProject.SaveProject
m_ISWiProject.CloseProject

The registry key is already part of the component.

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

rbrinda
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.

Thanks.