Re: VBScript Custom Action

From: Nic Roche (nicroche_at_hotmail.com)
Date: 03/17/05


Date: Thu, 17 Mar 2005 14:43:26 +1000


> szDestKey = Session.Property("szVendId") //problem line of code
> szDestValue = Session.Property("szDevId")//problem line of code

try

szDestKey = Session.Property(szVendId) 'a comment
szDestValue = Session.Property(szDevId) 'a comment

The Key variable was a string literal of your variable name...

Nic Roche

"Phaniram" <phaniram.deekshitula@wipro.com> wrote in message
news:b4bd511d.0503161000.38be9afa@posting.google.com...
> Hi,
> I am working on a BASIC MSI project of installshield. I am facing a
> problem in getting the property value.
> My requirement is as follows.
>
> 1.Need to read [DEV_ID] section of sample.ini file.
> 2.The ini file contains some device and vendor ids.
> 3.I Need to read those ids and prepare two different lists of Ids of
> Devices and Vendors.
> 4.Now I need to create registry keys in the location
> HKLM\Myproductname\Devices of registry according to the list items.
> 5.Under that location I need to create my vendor ids with device ids
> as the values of those keys retrieving form the list.
> HKLM\Myproductname\Devices\vendorid1 ->deviseid1(string) with value
> "x"
> HKLM\Myproductname\Devices\vendorid2 ->deviseid2(string) with value
> "y"
> 6.I am successfully creating those key with all those values in the
> installsheild custom actions.
> 7.But the problem is with the same when I run my setup on 64 bit
> machine.
> 8.It is certainly creating the entries but not in the desired
> location.
> 9.Wow6432Node is the location in the registry.
> 10.For that reason I have started implementing the same with
> "VBScript" Custom Action.
> 11.Now I am setting those Vendor and Device lists with MsiSetproperty
> as properties so that list items can be retrieved
>
> later.
> 12.The role of VBScript custom action is to get those property values
> by
> 13 I am trying to retrieve those properties by using
> 'Session.property(VenID)'
> 13.Here my program fails to retrieve those values which are already
> set by the installscript custom action from the VB Script
>
> cutom action.
>
> 14.The following the code snippet of what I am doing in a VBScrip
> custom Action.
> const HKEY_LOCAL_MACHINE = &H80000002
> strComputer = "."
> Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
> &strComputer& "\root\default:StdRegProv")
> For i = 1 To VenIdCount
> szVendId ="VENID"&i
> szDevId ="DEVID"&i
> szDestKey = Session.Property("szVendId") //problem line of code
> szDestValue = Session.Property("szDevId")//problem line of code
> strKeyPath = "SOFTWARE\MyProductname\MyDevices"&"\"&szDestKey
> oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
> oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,szDestValue,,
> Next
>
> 15.Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
> &strComputer& "\root\default:StdRegProv") is how oReg is
>
> initialized.
>
> Please help me ASAP.
> Regards,
> -Ananda.