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.

371 lines
13 KiB

  1. <HTML>
  2. <HEAD>
  3. <meta http-equiv="MSThemeCompatible" content="Yes">
  4. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  5. <TITLE>Offline Data Collection</TITLE>
  6. <LINK ID=Stylesheet_Ref href="PSS.css" rel=STYLESHEET type=text/css>
  7. <LINK ID=Stylesheet_Ref_HSC href="hcp://system/css/shared.css" rel=STYLESHEET type=text/css>
  8. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  9. <SCRIPT language="JScript">
  10. var oDC
  11. var oCab
  12. var L_DCProgress_Message = "Progress...";
  13. var varFolder = "";
  14. var boolcabstart = false;
  15. var d = new Date();
  16. var varFileName = "incident" + (d.getMonth() + 1) + d.getDate() + d.getFullYear() + ".cab";
  17. var varTempName = "Temp" + (d.getMonth() + 1) + d.getDate() + d.getFullYear() + d.getSeconds() + d.getMinutes() + d.getHours() + ".xml";
  18. var strVendorID = "CN=Microsoft Corporation,L=Redmond,S=Washington,C=US";
  19. var strProductID = "PSS Online Assisted Support";
  20. var L_BrowseHeading_unknown = "Microsoft Assisted Support - Please select a location to save your computer information.";
  21. function BrowseFolder()
  22. {
  23. var L_FolderNotExist_Message = "The folder you selected is not an actual file system location.";
  24. var L_Incidentalreadyhave1_Message = "This folder already contains a file named";
  25. var L_Incidentalreadyhave2_Message = "Would you like to replace the existing file?";
  26. var alreadyhave = L_Incidentalreadyhave1_Message + " \'" + varFileName + "\'. " + L_Incidentalreadyhave2_Message;
  27. var objShell = new ActiveXObject( "Shell.Application" );
  28. varFolder = objShell.BrowseForFolder(0,L_BrowseHeading_unknown,0x0040,0x11);//Returns Folder object
  29. if (varFolder != null)
  30. {
  31. varFolder = varFolder.items();//Returns FolderItems object
  32. varFolder = varFolder.item();//Returns Folderitem object
  33. varFolder = varFolder.Path;//Returns Full Path
  34. if (varFolder.charAt(varFolder.length-1) != "\\")
  35. varFolder = varFolder + "\\";
  36. var objFSO = new ActiveXObject("Scripting.FileSystemObject");
  37. if (!objFSO.FolderExists(varFolder))
  38. {
  39. alert(L_FolderNotExist_Message);
  40. BrowseFolder();
  41. return;
  42. }
  43. else
  44. {
  45. if (objFSO.FileExists(varFolder + varFileName))
  46. {
  47. if(window.confirm(alreadyhave) == false)
  48. {
  49. BrowseFolder();
  50. return;
  51. }
  52. }
  53. DataCollection();
  54. }
  55. }
  56. }
  57. function GetVendorDir()
  58. {
  59. var oChannel = pchealth.CreateObject_Channel(strVendorID, strProductID)
  60. var VendorDir = oChannel.VendorDirectory;
  61. return VendorDir;
  62. }
  63. function GetWindowsDir()
  64. {
  65. var objFSO = new ActiveXObject("Scripting.FileSystemObject");
  66. var WindowsDir = objFSO.GetSpecialFolder(0);
  67. return WindowsDir;
  68. }
  69. function GetTempPath()
  70. {
  71. var oWshShell = new ActiveXObject("WScript.Shell");
  72. TempPath = oWshShell.ExpandEnvironmentStrings("%TEMP%");
  73. TempPath = TempPath + "\\" + varTempName;
  74. return TempPath;
  75. }
  76. function DataCollection()
  77. {
  78. var L_DCFailed_ErrorMessage = "Data collection cannot be carried as the parameter files are missing.";
  79. var L_SaveFile_Message = "Save File";
  80. var objFSO = new ActiveXObject("Scripting.FileSystemObject");
  81. if (objFSO.FileExists(GetVendorDir() + "\\pssmachinesnapshot.XML") && objFSO.FileExists(GetWindowsDir() + "\\PCHealth\\HelpCtr\\Config\\DataSpec.XML"))
  82. {
  83. idButton.style.display = "none";
  84. bold.innerText=L_SaveFile_Message;
  85. T3.style.display="";
  86. cancel.style.display="";
  87. oDc = pchealth.CreateObject_DataCollection();
  88. oDc.MachineData_Dataspec = GetVendorDir() + "\\pssmachinesnapshot.XML";
  89. oDc.History_Dataspec = GetWindowsDir() + "\\PCHealth\\HelpCtr\\Config\\DataSpec.XML";
  90. oDc.History_MaxDeltas = 10;
  91. RegisterDCHandlers();
  92. oDc.ExecuteASync();
  93. }
  94. else
  95. {
  96. alert(L_DCFailed_ErrorMessage);
  97. idButton.style.display = "";
  98. }
  99. }
  100. function RegisterDCHandlers()
  101. {
  102. oDc.onStatusChange = dc_onStatusChange;
  103. oDc.onProgress = dc_onProgress;
  104. }
  105. var NoOfGR = 0;
  106. function dc_onProgress(DataCollectionPtr, done, total)
  107. {
  108. idProgress.innerText = L_DCProgress_Message + " " + Math.round((done / total) * 100) + "%";
  109. /*idPre.style.width = (Math.round((done / total) * 100)) + "%";
  110. idPost.style.width = (100 - (Math.round((done / total) * 100))) + "%";*/
  111. var complete = Math.round((done / total) * 100);
  112. complete = Math.round((complete * 425) / 100);
  113. complete = Math.round(complete / 8);
  114. complete = (complete - NoOfGR);
  115. NoOfGR = (NoOfGR + complete);
  116. for (i=0; i<complete; i++)
  117. {
  118. imgGR.insertAdjacentHTML("beforeEnd","<img src='GRect.gif'>");
  119. }
  120. }
  121. function dc_onStatusChange(DataCollectionPtr, status)
  122. {
  123. var L_DCNotActive_Message = "Data Collection not active";
  124. var L_DCStart_Message = "Collecting...";
  125. var L_DCFailed_Message = "Data Collection failed.";
  126. var L_DCFinish_Message = "Saving...";
  127. switch(status)
  128. {
  129. case 3:
  130. idStatus.innerText = L_DCFinish_Message;
  131. SaveDataCollection();
  132. imgGR.innerHTML="<img src='spacer.gif'>";
  133. return;
  134. case 2:
  135. idStatus.innerText = L_DCFailed_Message;
  136. return;
  137. case 1:
  138. idStatus.innerText = L_DCStart_Message;
  139. idBarTable.style.display = "";
  140. return;
  141. case 0:
  142. idStatus.innerText = L_DCNotActive_Message;
  143. return;
  144. }
  145. }
  146. function SaveDataCollection()
  147. {
  148. var oMCInc
  149. var varDCDataFailed = false;
  150. var L_DCSnapshot_ErrorMessage = "Failed to get collected machine snapshot data.";
  151. var L_DCHistory_ErrorMessage = "Failed to get collected machine history data.";
  152. oMCInc = pchealth.CreateObject_Incident();
  153. if(oDc.History_GetStream() != null )
  154. {
  155. oMCInc.MachineHistory = oDc.History_GetStream();
  156. }
  157. if(oDc.MachineData_GetStream() != null )
  158. {
  159. oMCInc.MachineSnapshot = oDc.MachineData_GetStream();
  160. }
  161. if(varDCDataFailed == false)
  162. {
  163. oMCInc.UploadType=1;
  164. oMCInc.UserName = GetUnique();
  165. oMCInc.ProductID = strProductID;
  166. oMCInc.ProductName = strProductID;
  167. var L_ProbDesc_Text="Offline Assisted Support";
  168. oMCInc.ProblemDescription = L_ProbDesc_Text;
  169. oMCInc.GetXML(GetTempPath());
  170. Cabinet();
  171. }
  172. }
  173. function Cabinet()
  174. {
  175. oCab = pchealth.CreateObject_Cabinet();
  176. boolcabstart = true;
  177. oCab.IgnoreMissingFiles = true;
  178. RegisterCabHandler();
  179. oCab.AddFile (GetTempPath(),"PSSMCData.xml");
  180. oCab.Compress (varFolder + varFileName);
  181. }
  182. function RegisterCabHandler()
  183. {
  184. oCab.onComplete = cab_onComplete;
  185. oCab.onProgressBytes = cab_onProgress;
  186. }
  187. function cab_onComplete(objCab, hr)
  188. {
  189. var L_CABFailed_Message = "Compressing Failed.";
  190. if (objCab.Status != 2)
  191. {
  192. idStatus.innerText = L_CABFailed_Message;
  193. }
  194. else
  195. {
  196. step1.style.display="none";
  197. filepath.innerText = " " + varFolder + varFileName;
  198. filename.innerText=varFileName;
  199. head1tbl.style.display="none";
  200. FinalText.style.display="";
  201. }
  202. }
  203. var NoOfGR_X=0;
  204. function cab_onProgress(objCab, done, total)
  205. {
  206. idProgress.innerText = L_DCProgress_Message + " " + Math.round((done / total) * 100) + "%";
  207. /*idPre.style.width = "0%";
  208. idPost.style.width = "100%";
  209. idPre.style.width = (Math.round((done / total) * 100)) + "%";
  210. idPost.style.width = (100 - (Math.round((done / total) * 100))) + "%";*/
  211. var complete = Math.round((done / total) * 100);
  212. complete = Math.round((complete * 425) / 100);
  213. complete = Math.round(complete / 8);
  214. complete = (complete - NoOfGR_X);
  215. NoOfGR_X = (NoOfGR_X + complete);
  216. for (i=0; i<complete; i++)
  217. {
  218. imgGR.insertAdjacentHTML("beforeEnd","<img src='GRect.gif'>");
  219. }
  220. }
  221. function GetUnique()
  222. {
  223. var objshell = new ActiveXObject( "WScript.Shell" );
  224. var PIDNumber = objshell.RegRead("HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\ProductId");
  225. PIDNumber = RemoveJunkChar(PIDNumber) + "NW" + (d.getMonth() + 1) + d.getDate() + d.getFullYear();
  226. return PIDNumber;
  227. }
  228. function RemoveJunkChar(sNumber)
  229. {
  230. var sTempNumber = sNumber.toString();
  231. var iLoop = 0;
  232. var sTemp = "";
  233. var sChar ;
  234. while ((iLoop < (sTempNumber.length)) )
  235. {
  236. sChar = sTempNumber.charAt(iLoop);
  237. switch(sChar)
  238. {
  239. case "(":
  240. case ")":
  241. case " ":
  242. case "-":
  243. case ".":
  244. case ",":
  245. break;
  246. default :
  247. sTemp += sChar;
  248. break;
  249. }
  250. iLoop++;
  251. }
  252. sNumber = sTemp;
  253. return sNumber;
  254. }
  255. function OnExit()
  256. {
  257. if (boolcabstart == true)
  258. oCab.Abort();
  259. if (idButton.style.display == "none")
  260. if(oDC)
  261. oDc.Abort();
  262. }
  263. function CancelDC()
  264. {
  265. if (boolcabstart == true)
  266. {
  267. oCab.Abort();
  268. }
  269. oDc.Abort();
  270. location.href="offlineoptions.htm";
  271. }
  272. </SCRIPT>
  273. </HEAD>
  274. <BODY onunload="OnExit()" topmargin="0" leftmargin="0">
  275. <table cellpadding=0 cellspacing=0 id="head1tbl">
  276. <tr id="head1tr">
  277. <td id="head1td" class="sys-font-heading3 sys-rhp-color-title padgl pad1emt">
  278. Offline Support Options
  279. </td>
  280. </tr>
  281. </table>
  282. <span id="step1">
  283. <table width="100%" cellpadding="0" cellspacing="0" border=0>
  284. <tr><td id="subhead" class="sys-font-body-bold sys-color-body padgl pad1emt">Save information about this computer as a file</td></tr>
  285. <tr><td id="text1" class="sys-font-body sys-color-body padgl padgr padt">
  286. When you click <span id="bold"><B>Save File</B></span>, pertinent information will be collected from this computer and formatted into a file that a support professional will use to help solve the problem. Note that you must submit this file from a computer that is connected to the Internet.
  287. </td></tr></table>
  288. <TABLE align="right" id="T2" width="100%" border=0 cellpadding="0" cellspacing="0">
  289. <TR><TD id="T1R1C1" class="sys-font-body padgr padt" align="right">
  290. <BUTTON id="idButton" onclick="BrowseFolder()" accesskey="S" class="sys-font-body"><U>S</U>ave File</BUTTON>
  291. </TD></TR>
  292. </TABLE>
  293. <TABLE cellpadding="0" cellspacing="0" id="T3" border=0 style="display: none" width="99%">
  294. <TR>
  295. <TD id="T3R1C2" class="padt padgl">
  296. <TABLE id="T4" class="sys-font-body sys-color-body padgl"><TR>
  297. <TD id="idStatus"></TD>
  298. </TR></TABLE>
  299. </TD>
  300. </TR>
  301. <TR>
  302. <TD id="T3R2C2" class="padgr padgl">
  303. <table id="idBarTable" border="0" cellpadding="0" cellspacing="0" width="435">
  304. <tr id="tr1">
  305. <td id="tr1sp1"><img id="img1sp1" src="spacer.gif" width="4" height="1" border="0"></td>
  306. <td id="tr1sp2"><img id="img1sp2" src="spacer.gif" width="428" height="1" border="0"></td>
  307. <td id="tr1sp3"><img id="img1sp3" src="spacer.gif" width="3" height="1" border="0"></td>
  308. <td id="tr1sp4"><img id="img1sp4" src="spacer.gif" width="1" height="1" border="0"></td>
  309. </tr>
  310. <tr id="tr2">
  311. <td rowspan="3" id="tdr1_c1"><img id="imgr1_c1" name="Untitled1_r1_c1" src="r1_c1.gif" width="4" height="18" border="0"></td>
  312. <td id="tdr1_c2"><img id="imgr1_c2" name="Untitled1_r1_c2" src="r1_c2.gif" width="428" height="3" border="0"></td>
  313. <td id="tdr1_c3" rowspan="3"><img id="imgr1_c3" name="Untitled1_r1_c3" src="r1_c3.gif" width="3" height="18" border="0"></td>
  314. <td id="tr2sp1"><img id="img2sp1" src="spacer.gif" width="1" height="3" border="0"></td>
  315. </tr>
  316. <tr id="tr3">
  317. <td id="imgGR" valign="center"><img id="green" src="spacer.gif" width="1" height="1"></td>
  318. <td id="tr3sp1"><img id="img3sp1" src="spacer.gif" width="1" height="12" border="0"></td>
  319. </tr>
  320. <tr id="tr4">
  321. <td id="tdr3_c2"><img id="imgr3_c2" name="r3_c2" src="r3_c2.gif" width="428" height="3" border="0"></td>
  322. <td id="tr4sp1"><img id="img4sp1" src="spacer.gif" width="1" height="3" border="0"></td>
  323. </tr>
  324. </table>
  325. </TD>
  326. </TR>
  327. <TR>
  328. <TD id="idProgress" class="sys-font-body sys-color-body padgl"></TD>
  329. </TR>
  330. </TABLE>
  331. <table id="cancel" style="display: none" align="right"><tr><td id="cancelbutton" class="padgr padt" align="right">
  332. <BUTTON id="idCancel" onclick="CancelDC()" accesskey="C" class="sys-font-body"><U>C</U>ancel</BUTTON>
  333. </td></tr></table>
  334. </span>
  335. <span id="FinalText" class="padt padgl padgr" style="display: none">
  336. <table><tr><td class="padgl padgt padgr">
  337. <table border=0 cellspacing=0 cellpadding=0 width="100%" class="BorderColor padt padgl padgr sys-inlineform-bgcolor2">
  338. <tr>
  339. <td class="padgl padgt" width="32" height="32" valign="top"><img valign="top" id="infoimg" width="32" height="32" src="status_ok.gif"></td>
  340. <td id="filesaved" valign="center" class="sys-font-body sys-color-body padgt pad1eml padgr padb" width="100%">
  341. <font class="sys-font-heading3 sys-rhp-color-title padgr">Your file has been saved successfully</font>
  342. <BR>Your file has been saved successfully to <span id="filepath"></span>
  343. <BR><BR><BR>
  344. <font id="instruc" class="sys-font-body-bold sys-color-body padgr">
  345. Instructions for submitting this file to Microsoft
  346. </font>
  347. <BR><BR>
  348. <font id="forcust" class="sys-font-body sys-color-body">
  349. Using a computer connected to the Internet, go to <B>http://go.microsoft.com/fwlink/?LinkId=376</B>. (You might want to write down the address.) Then fill out the form on that web page, which will prompt you to attach <span id="filename"></span>.
  350. </font>
  351. </td>
  352. </tr>
  353. </table>
  354. </td></tr></table>
  355. </span>
  356. </BODY>
  357. </HTML>