home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 September
/
CHIPCD_9_99.iso
/
software
/
uaktualnienia
/
OptionPackPL
/
MTS4.CAB
/
WSH_InstPak.vbs
< prev
next >
Wrap
Text File
|
1998-04-27
|
1KB
|
46 lines
' Filename: InstPak.vbs
'
' Description: Sample VB Script that installs the Sample Bank package from a .pak file
'
' This file is provided as part of the Microsoft Transaction Server Samples
' See the MTS Software Development Kit for more information on Scriptable Administration Objects
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
' OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
' PURPOSE.
'
' Copyright (C) 1997 Microsoft Corporation, All rights reserved
Dim path
Dim pakPath
path = "C:\Program Files\Samples\Packages\"
pakPath = path & "Sample Bank.pak"
packageName = "Sample Bank"
' First, we create the catalog object
Dim catalog
Set catalog = CreateObject("MTSAdmin.Catalog.1")
' Then we get the packages collection
Dim packages
Set packages = catalog.GetCollection("Packages")
packages.populate
' Remove all packages that go by the same name as the package we wish to install
numPackages = packages.Count
For i = numPackages - 1 To 0 Step -1
If packages.Item(i).Value("Name") = packageName Then
packages.Remove (i)
End If
Next
' Commit our deletions
packages.SaveChanges
' Add the new package from a .pak file
Dim util
Set util = packages.getUtilInterface
util.InstallPackage pakPath, "", mtsInstallUsers