I don’t suppose anyone has a VBS that will check for the presents of SOURCELIST in a package? My VB is rubbish, I don’t have a clue where to start and I have 100s of packages to check.

0 Comments   [ + ] Show 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.


Sorry but do you mean you want to check if the SOURCELIST property is included in any installed MSI package(s) and if so where they point to?
Answered 05/25/2007 by: AngelD
Red Belt

Please log in to comment
No... sorry. I mean I need to check that the SOURCELIST property is present (and ideally correct) in all the packages in my repository.
Answered 05/25/2007 by: fuz_kitten
Second Degree Blue Belt

Please log in to comment

The following VB Script code will output the value of the SOURCELIST property in an MSI database :

Option Explicit
Dim argCount
Dim installer, database, message
Dim databasePath
Dim view, rec

Const msiOpenDatabaseModeReadOnly = 0

If Wscript.arguments.Count = 0 Then
Wscript.Echo "You need to supply the name of the MSI database as a parameter to this script"
Wscript.Quit 1
End If

' Instantiate Windows Installer object
On Error Resume Next
Set installer = Nothing
Set installer = Wscript.CreateObject("WindowsInstaller.Installer")

' Open the MSI database
databasePath = Wscript.Arguments(0)
Set database = installer.OpenDatabase(databasePath, msiOpenDatabaseModeReadOnly)
Set view=Database.OpenView("SELECT `Property`,`Value` FROM `Property` WHERE `Property` = 'SOURCELIST' ORDER BY `Value`")
set rec = View.Fetch
if rec.StringData(2) = "" then
Wscript.Echo "MSI file at " & databasepath & " has a blank SOURCELIST property"
Wscript.Echo "MSI file at " & databasepath & " has SOURCELIST property set to " & rec.StringData(2)
end if
Set installer=nothing
Wscript.Quit 0

To use it you need to supply the name of the MSI file as a parameter

i.e. cscript sourcelist.vbs <full path to MSI file>

[I produced this in a bit of rush, so the above code is fairly crude and, more importantly, it won't the situation where you have introduced SOURCELIST in a transform - let me know if this is the case and I'll have a go at that (may take a while longer though [;)] )


Answered 05/25/2007 by: spartacus
Black Belt

Please log in to comment
Your a star! I'll let you know how i get on.

Answered 05/25/2007 by: fuz_kitten
Second Degree Blue Belt

Please log in to comment
set objInstaller = CreateObject("WindowsInstaller.Installer")
objInstaller.AddSource("ProductCodeofApp", "newSourcelocation")

this will do to change stuff already deployed.

SMS can handle this as well if you are using it.
Answered 05/27/2007 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment
AppDelploy's very own MSISearch.exe is great for sticky jobs like this...
Mange too
Search for Property Values that match your criteria and you get an instant'ish traffic light response
This app has helped me a few times - finding conflict files for instance - back in the day...
Worth saving to your tools repository even if you don't use it today
B/H Mon - you may need to copy your MSI farm to the local drive - a quick test will hightlight its power/weakness

From the Options menu you can search through tables galore - well, file names, reg data and values, properties.
Well handy :)
Answered 05/28/2007 by: AB
Purple Belt

Please log in to comment