You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
147 lines
3.4 KiB
147 lines
3.4 KiB
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" Content="Microsoft Developer Studio">
|
|
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
|
|
<TITLE>Document Title</TITLE>
|
|
|
|
<SCRIPT LANGUAGE=javascript>
|
|
|
|
var SHT_NOTACTIVE = 0x00000000;
|
|
var SHT_QUERYING = 0x00000001;
|
|
var SHT_QUERIED = 0x00000002;
|
|
var SHT_COPYING_DB = 0x00000003;
|
|
var SHT_COPYING_FILES = 0x00000004;
|
|
var SHT_INSTALLING = 0x00000005;
|
|
var SHT_INSTALLED = 0x00000006;
|
|
var SHT_UNINSTALLING = 0x00000007;
|
|
var SHT_UNINSTALLED = 0x00000008;
|
|
var SHT_ABORTING = 0x00000009;
|
|
var SHT_ABORTED = 0x0000000A;
|
|
var SHT_FAILED = 0x0000000B;
|
|
|
|
var g_db = pchealth.Database;
|
|
var g_sku = null;
|
|
var g_coll = null;
|
|
|
|
function notifyCollection( obj, status, hr, file )
|
|
{
|
|
out2.innerHTML += "Status: " + status + " Error: " + hr + " File: " + file + "<BR>";
|
|
|
|
if(status == SHT_QUERIED)
|
|
{
|
|
if(g_coll.Count == 0)
|
|
{
|
|
pchealth.MessageBox( "Sorry, the specified server doesn't export any SKU", "OK" );
|
|
}
|
|
else
|
|
{
|
|
for(var e = new Enumerator( g_coll ); !e.atEnd(); e.moveNext())
|
|
{
|
|
var sku = e.item();
|
|
|
|
PromptForInstall( sku );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function notifyForInstall( obj, status, hr, file )
|
|
{
|
|
out2.innerHTML += "Status: " + status + " Error: " + hr + " File: " + file + "<BR>";
|
|
|
|
if(status == SHT_QUERIED)
|
|
{
|
|
if(obj.IsInstalled == true)
|
|
{
|
|
pchealth.MessageBox( "The specified SKU is already installed.", "OK" );
|
|
}
|
|
else if(obj.CanInstall == false)
|
|
{
|
|
pchealth.MessageBox( "Sorry, you cannot install the specified SKU", "OK" );
|
|
}
|
|
else
|
|
{
|
|
PromptForInstall( obj );
|
|
}
|
|
}
|
|
}
|
|
|
|
function notify( obj, status, hr, file )
|
|
{
|
|
out2.innerHTML += "Status: " + status + " Error: " + hr + " File: " + file + "<BR>";
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function PromptForInstall( sku )
|
|
{
|
|
if(pchealth.MessageBox( "Do you want to install " + sku.SKU + "/" + sku.Language + "?", "YESNO" ) == "YES")
|
|
{
|
|
sku.onStatusChange = notify;
|
|
sku.Install( false );
|
|
}
|
|
}
|
|
|
|
function button_installFile()
|
|
{
|
|
g_sku = null;
|
|
g_coll = null;
|
|
|
|
g_sku = g_db.ConnectToFile( idSrcFile.value, notifyForInstall );
|
|
}
|
|
|
|
function button_installServer()
|
|
{
|
|
g_sku = null;
|
|
g_coll = null;
|
|
|
|
g_coll = g_db.ConnectToServer( idSrcServer.value, notifyCollection );
|
|
}
|
|
|
|
function button_uninstall()
|
|
{
|
|
var skus = g_db.InstalledSKUs;
|
|
|
|
for(var e = new Enumerator( skus ); !e.atEnd(); e.moveNext())
|
|
{
|
|
var sku = e.item();
|
|
|
|
if(sku.CanUninstall == true)
|
|
{
|
|
if(pchealth.MessageBox( "Do you want to uninstall " + sku.SKU + "/" + sku.Language + "?", "YESNO" ) == "YES")
|
|
{
|
|
try
|
|
{
|
|
sku.onStatusChange = notify;
|
|
sku.Uninstall();
|
|
}
|
|
catch(e)
|
|
{
|
|
alert( "Failed: " + e.number );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
</SCRIPT>
|
|
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
|
|
<INPUT type="button" value="Uninstall" onClick="button_uninstall();"><BR><BR>
|
|
|
|
\\mgmtx86fre\latest\pro\i386\pchdt_w3.ca_<BR>
|
|
|
|
<INPUT type="button" value="Install From File:" onClick="button_installFile();" ><INPUT type="file" id=idSrcFile size=80><BR>
|
|
<INPUT type="button" value="Install From Server:" onClick="button_installServer();"><INPUT id=idSrcServer size=80><BR>
|
|
|
|
|
|
<DIV ID=out></DIV>
|
|
<DIV ID=out2 style="color: blue"></DIV>
|
|
|
|
|
|
</BODY>
|
|
</HTML>
|