Hi, I am in need of some help, so I can stop banging my head against a brick wall.

I am adding a key in to the HKLM\Software\Companyname\Application\Appname\Appver in the registry in my msi package. This is all working ok etc

I want to use the Wise Package Validation tool in Wise Studio Professional V4 to check the package and ensure that the key exists.

I want to do this in vbscript.

The problem I have is that I am unsure where to start with this, as the Wise documentation doesnt really extend as far as discussing custom cub files.

Can someone please provide me with an example vbscript to do this so I can see how this is done please? I am unsure how to get the vbscript to check the path, and I am unsure how to return a code back to the package validater tool, to flag an error if it does not exist.

Can anyone please help, I would be most greatful.

Many thanks
Paul E Davey
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Has anyone got any idea's?? Please?? [:o]
Answered 05/07/2004 by: pauledavey
Yellow Belt

Please log in to comment
0
I don't know of anyone who has had a requirement to build their own CUB and documentation seems a bit sketchy. Check here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/building_an_ice_database.asp

If you have not already, there is an example CUB that may give you a good starting point.
Answered 05/10/2004 by: bkelly
Red Belt

Please log in to comment
0
An alternative would be to use the Macro Editor and have it run at Compile time to check if the key exists in the registry table. Refer to chapter 18 of the Windows Installer Reference manual for more information about OLE automation and the macro editor.
Answered 05/11/2004 by: Aaron
Senior Yellow Belt

Please log in to comment
0
I have managed to get some things working, but I cant get some very basic functionalty working. IT seems like some vbscript coding just wont work!! Back to the drawing board I guess!!!![:@]
Answered 05/26/2004 by: pauledavey
Yellow Belt

Please log in to comment
0
are you just trying to add a tag into the registry ?

this is rather easy using the macro editor.

heres an example.

Sub subCreateReg(szRegistry,szRoot,szKey,szName,szValue,szComponent)


'Written by John McFadyen
'huckey@mindless.com

Dim szKeyExists
Dim rowRegistry

szkeyexists = 0

For Each rowRegistry In tblRegistry.WRows

If rowRegistry("Registry") = szRegistry Then

szkeyexists = 1

Exit For
End If

Next

If szkeyexists = 1 Then
rowRegistry("Root") = szRoot
rowRegistry("Key") = szKey
rowRegistry("Name") = szName
rowRegistry("Value") = szValue
rowRegistry("Component_") = szComponent
' objlogfile.writeline "EXISTING Registry"
' objlogfile.writeline " ,Registry:" & szRegistry
' objlogfile.writeline " ,Root:" & szRoot
' objlogfile.writeline " ,Key:" & szKey
' objlogfile.writeline " ,Name:" & szName
' objlogfile.writeline " ,Value:" & szValue
' objlogfile.writeline " ,Component_:" & szComponent
' objlogfile.writeline ""
Else
Set rowNew = tblRegistry.NewWRow(True)
rowNew("Registry") = szRegistry
rowNew("Root") = szRoot
rowNew("Key") = szKey
rowNew("Name") = szName
rowNew("Value") = szValue
rowNew("Component_") = szComponent
' objlogfile.writeline "Creating Registry,"
' objlogfile.writeline " ,Registry:" & szRegistry
' objlogfile.writeline " ,Root:" & szRoot
' objlogfile.writeline " ,Key:" & szKey
' objlogfile.writeline " ,Name:" & szName
' objlogfile.writeline " ,Value:" & szValue
' objlogfile.writeline " ,Component_:" & szComponent
' objlogfile.writeline ""
End If

Set szKeyExists = Nothing
Set rowRegistry = Nothing


End Sub


subCreateReg(szRegistry1,szRoot1,szKey1,szName1,szValue1,szComponent1)
subCreateReg(szRegistry2,szRoot2,szKey2,szName2,szValue2,szComponent2)
subCreateReg(szRegistry3,szRoot3,szKey3,szName3,szValue3,szComponent3)

do the same for all other tables you want to add things into.

ps huckey@mindless.com
Answered 06/16/2004 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity