Leaked source code of windows server 2003
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

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Developer Studio">
  4. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  5. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  6. <TITLE>Document Title</TITLE>
  7. <SCRIPT LANGUAGE=javascript>
  8. var SHT_NOTACTIVE = 0x00000000;
  9. var SHT_QUERYING = 0x00000001;
  10. var SHT_QUERIED = 0x00000002;
  11. var SHT_COPYING_DB = 0x00000003;
  12. var SHT_COPYING_FILES = 0x00000004;
  13. var SHT_INSTALLING = 0x00000005;
  14. var SHT_INSTALLED = 0x00000006;
  15. var SHT_UNINSTALLING = 0x00000007;
  16. var SHT_UNINSTALLED = 0x00000008;
  17. var SHT_ABORTING = 0x00000009;
  18. var SHT_ABORTED = 0x0000000A;
  19. var SHT_FAILED = 0x0000000B;
  20. var g_db = pchealth.Database;
  21. var g_sku = null;
  22. var g_coll = null;
  23. function notifyCollection( obj, status, hr, file )
  24. {
  25. out2.innerHTML += "Status: " + status + " Error: " + hr + " File: " + file + "<BR>";
  26. if(status == SHT_QUERIED)
  27. {
  28. if(g_coll.Count == 0)
  29. {
  30. pchealth.MessageBox( "Sorry, the specified server doesn't export any SKU", "OK" );
  31. }
  32. else
  33. {
  34. for(var e = new Enumerator( g_coll ); !e.atEnd(); e.moveNext())
  35. {
  36. var sku = e.item();
  37. PromptForInstall( sku );
  38. }
  39. }
  40. }
  41. }
  42. function notifyForInstall( obj, status, hr, file )
  43. {
  44. out2.innerHTML += "Status: " + status + " Error: " + hr + " File: " + file + "<BR>";
  45. if(status == SHT_QUERIED)
  46. {
  47. if(obj.IsInstalled == true)
  48. {
  49. pchealth.MessageBox( "The specified SKU is already installed.", "OK" );
  50. }
  51. else if(obj.CanInstall == false)
  52. {
  53. pchealth.MessageBox( "Sorry, you cannot install the specified SKU", "OK" );
  54. }
  55. else
  56. {
  57. PromptForInstall( obj );
  58. }
  59. }
  60. }
  61. function notify( obj, status, hr, file )
  62. {
  63. out2.innerHTML += "Status: " + status + " Error: " + hr + " File: " + file + "<BR>";
  64. }
  65. ////////////////////////////////////////////////////////////////////////////////
  66. function PromptForInstall( sku )
  67. {
  68. if(pchealth.MessageBox( "Do you want to install " + sku.SKU + "/" + sku.Language + "?", "YESNO" ) == "YES")
  69. {
  70. sku.onStatusChange = notify;
  71. sku.Install( false );
  72. }
  73. }
  74. function button_installFile()
  75. {
  76. g_sku = null;
  77. g_coll = null;
  78. g_sku = g_db.ConnectToFile( idSrcFile.value, notifyForInstall );
  79. }
  80. function button_installServer()
  81. {
  82. g_sku = null;
  83. g_coll = null;
  84. g_coll = g_db.ConnectToServer( idSrcServer.value, notifyCollection );
  85. }
  86. function button_uninstall()
  87. {
  88. var skus = g_db.InstalledSKUs;
  89. for(var e = new Enumerator( skus ); !e.atEnd(); e.moveNext())
  90. {
  91. var sku = e.item();
  92. if(sku.CanUninstall == true)
  93. {
  94. if(pchealth.MessageBox( "Do you want to uninstall " + sku.SKU + "/" + sku.Language + "?", "YESNO" ) == "YES")
  95. {
  96. try
  97. {
  98. sku.onStatusChange = notify;
  99. sku.Uninstall();
  100. }
  101. catch(e)
  102. {
  103. alert( "Failed: " + e.number );
  104. }
  105. }
  106. }
  107. }
  108. }
  109. </SCRIPT>
  110. </HEAD>
  111. <BODY>
  112. <INPUT type="button" value="Uninstall" onClick="button_uninstall();"><BR><BR>
  113. \\mgmtx86fre\latest\pro\i386\pchdt_w3.ca_<BR>
  114. <INPUT type="button" value="Install From File:" onClick="button_installFile();" ><INPUT type="file" id=idSrcFile size=80><BR>
  115. <INPUT type="button" value="Install From Server:" onClick="button_installServer();"><INPUT id=idSrcServer size=80><BR>
  116. <DIV ID=out></DIV>
  117. <DIV ID=out2 style="color: blue"></DIV>
  118. </BODY>
  119. </HTML>