Source code of Windows XP (NT5)
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
12 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 objFSO = new ActiveXObject("Scripting.FileSystemObject");
  80. if (objFSO.FileExists(GetVendorDir() + "\\pssmachinesnapshot.XML") && objFSO.FileExists(GetWindowsDir() + "\\PCHealth\\HelpCtr\\Config\\DataSpec.XML"))
  81. {
  82. idButton.style.display = "none";
  83. bold.innerText="Save File";
  84. T3.style.display="";
  85. cancel.style.display="";
  86. oDc = pchealth.CreateObject_DataCollection();
  87. oDc.MachineData_Dataspec = GetVendorDir() + "\\pssmachinesnapshot.XML";
  88. oDc.History_Dataspec = GetWindowsDir() + "\\PCHealth\\HelpCtr\\Config\\DataSpec.XML";
  89. oDc.History_MaxDeltas = 10;
  90. RegisterDCHandlers();
  91. oDc.ExecuteASync();
  92. }
  93. else
  94. {
  95. alert(L_DCFailed_ErrorMessage);
  96. idButton.style.display = "";
  97. }
  98. }
  99. function RegisterDCHandlers()
  100. {
  101. oDc.onStatusChange = dc_onStatusChange;
  102. oDc.onProgress = dc_onProgress;
  103. }
  104. var NoOfGR = 0;
  105. function dc_onProgress(DataCollectionPtr, done, total)
  106. {
  107. idProgress.innerText = L_DCProgress_Message + " " + Math.round((done / total) * 100) + "%";
  108. /*idPre.style.width = (Math.round((done / total) * 100)) + "%";
  109. idPost.style.width = (100 - (Math.round((done / total) * 100))) + "%";*/
  110. var complete = Math.round((done / total) * 100);
  111. complete = Math.round((complete * 425) / 100);
  112. complete = Math.round(complete / 8);
  113. complete = (complete - NoOfGR);
  114. NoOfGR = (NoOfGR + complete);
  115. for (i=0; i<complete; i++)
  116. {
  117. imgGR.insertAdjacentHTML("beforeEnd","<img src='GRect.gif'>");
  118. }
  119. }
  120. function dc_onStatusChange(DataCollectionPtr, status)
  121. {
  122. var L_DCNotActive_Message = "Data Collection not active";
  123. var L_DCStart_Message = "Collecting...";
  124. var L_DCFailed_Message = "Data Collection failed.";
  125. var L_DCFinish_Message = "Saving...";
  126. switch(status)
  127. {
  128. case 3:
  129. idStatus.innerText = L_DCFinish_Message;
  130. SaveDataCollection();
  131. imgGR.innerHTML="<img src='spacer.gif'>";
  132. return;
  133. case 2:
  134. idStatus.innerText = L_DCFailed_Message;
  135. return;
  136. case 1:
  137. idStatus.innerText = L_DCStart_Message;
  138. idBarTable.style.display = "";
  139. return;
  140. case 0:
  141. idStatus.innerText = L_DCNotActive_Message;
  142. return;
  143. }
  144. }
  145. function SaveDataCollection()
  146. {
  147. var oMCInc
  148. var varDCDataFailed = false;
  149. var L_DCSnapshot_ErrorMessage = "Failed to get collected machine snapshot data.";
  150. var L_DCHistory_ErrorMessage = "Failed to get collected machine history data.";
  151. oMCInc = pchealth.CreateObject_Incident();
  152. if(oDc.History_GetStream() != null )
  153. {
  154. oMCInc.MachineHistory = oDc.History_GetStream();
  155. }
  156. if(oDc.MachineData_GetStream() != null )
  157. {
  158. oMCInc.MachineSnapshot = oDc.MachineData_GetStream();
  159. }
  160. if(varDCDataFailed == false)
  161. {
  162. oMCInc.UploadType=1;
  163. oMCInc.UserName = GetUnique();
  164. oMCInc.ProductID = strProductID;
  165. oMCInc.ProductName = strProductID;
  166. var L_ProbDesc_Text="Offline Assisted Support";
  167. oMCInc.ProblemDescription = L_ProbDesc_Text;
  168. oMCInc.GetXML(GetTempPath());
  169. Cabinet();
  170. }
  171. }
  172. function Cabinet()
  173. {
  174. oCab = pchealth.CreateObject_Cabinet();
  175. boolcabstart = true;
  176. oCab.IgnoreMissingFiles = true;
  177. RegisterCabHandler();
  178. oCab.AddFile (GetTempPath(),"PSSMCData.xml");
  179. oCab.Compress (varFolder + varFileName);
  180. }
  181. function RegisterCabHandler()
  182. {
  183. oCab.onComplete = cab_onComplete;
  184. oCab.onProgressBytes = cab_onProgress;
  185. }
  186. function cab_onComplete(objCab, hr)
  187. {
  188. var L_CABFailed_Message = "Compressing Failed.";
  189. if (objCab.Status != 2)
  190. {
  191. idStatus.innerText = L_CABFailed_Message;
  192. }
  193. else
  194. {
  195. step1.style.display="none";
  196. filepath.innerText = " " + varFolder + varFileName;
  197. filename.innerText=varFileName;
  198. head1tbl.style.display="none";
  199. FinalText.style.display="";
  200. }
  201. }
  202. var NoOfGR_X=0;
  203. function cab_onProgress(objCab, done, total)
  204. {
  205. idProgress.innerText = L_DCProgress_Message + " " + Math.round((done / total) * 100) + "%";
  206. /*idPre.style.width = "0%";
  207. idPost.style.width = "100%";
  208. idPre.style.width = (Math.round((done / total) * 100)) + "%";
  209. idPost.style.width = (100 - (Math.round((done / total) * 100))) + "%";*/
  210. var complete = Math.round((done / total) * 100);
  211. complete = Math.round((complete * 425) / 100);
  212. complete = Math.round(complete / 8);
  213. complete = (complete - NoOfGR_X);
  214. NoOfGR_X = (NoOfGR_X + complete);
  215. for (i=0; i<complete; i++)
  216. {
  217. imgGR.insertAdjacentHTML("beforeEnd","<img src='GRect.gif'>");
  218. }
  219. }
  220. function GetUnique()
  221. {
  222. var objshell = new ActiveXObject( "WScript.Shell" );
  223. var PIDNumber = objshell.RegRead("HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\ProductId");
  224. PIDNumber = RemoveJunkChar(PIDNumber) + "NW" + (d.getMonth() + 1) + d.getDate() + d.getFullYear();
  225. return PIDNumber;
  226. }
  227. function RemoveJunkChar(sNumber)
  228. {
  229. var sTempNumber = sNumber.toString();
  230. var iLoop = 0;
  231. var sTemp = "";
  232. var sChar ;
  233. while ((iLoop < (sTempNumber.length)) )
  234. {
  235. sChar = sTempNumber.charAt(iLoop);
  236. switch(sChar)
  237. {
  238. case "(":
  239. case ")":
  240. case " ":
  241. case "-":
  242. case ".":
  243. case ",":
  244. break;
  245. default :
  246. sTemp += sChar;
  247. break;
  248. }
  249. iLoop++;
  250. }
  251. sNumber = sTemp;
  252. return sNumber;
  253. }
  254. function OnExit()
  255. {
  256. if (boolcabstart == true)
  257. oCab.Abort();
  258. if (idButton.style.display == "none")
  259. if(oDC)
  260. oDc.Abort();
  261. }
  262. function CancelDC()
  263. {
  264. if (boolcabstart == true)
  265. {
  266. oCab.Abort();
  267. }
  268. oDc.Abort();
  269. location.href="offlineoptions.htm";
  270. }
  271. </SCRIPT>
  272. </HEAD>
  273. <BODY onunload="OnExit()" topmargin="0" leftmargin="0">
  274. <table cellpadding=0 cellspacing=0 id="head1tbl">
  275. <tr id="head1tr">
  276. <td id="head1td" class="sys-font-heading3 sys-rhp-color-title padgl pad1emt">
  277. Offline Support Options
  278. </td>
  279. </tr>
  280. </table>
  281. <span id="step1">
  282. <table width="100%" cellpadding="0" cellspacing="0" border=0>
  283. <tr><td id="subhead" class="sys-font-body-bold sys-color-body padgl pad1emt">Save information about this computer as a file</td></tr>
  284. <tr><td id="text1" class="sys-font-body sys-color-body padgl padgr padt">
  285. 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.
  286. </td></tr></table>
  287. <TABLE align="right" id="T2" width="100%" border=0 cellpadding="0" cellspacing="0">
  288. <TR><TD id="T1R1C1" class="sys-font-body padgr padt" align="right">
  289. <BUTTON id="idButton" onclick="BrowseFolder()" accesskey="S" class="sys-font-body"><U>S</U>ave File</BUTTON>
  290. </TD></TR>
  291. </TABLE>
  292. <TABLE cellpadding="0" cellspacing="0" id="T3" border=0 style="display: none" width="99%">
  293. <TR>
  294. <TD id="T3R1C2" class="padt padgl">
  295. <TABLE id="T4" class="sys-font-body sys-color-body padgl"><TR>
  296. <TD id="idStatus"></TD>
  297. </TR></TABLE>
  298. </TD>
  299. </TR>
  300. <TR>
  301. <TD id="T3R2C2" class="padgr padgl">
  302. <table id="idBarTable" border="0" cellpadding="0" cellspacing="0" width="435">
  303. <tr id="tr1">
  304. <td id="tr1sp1"><img id="img1sp1" src="spacer.gif" width="4" height="1" border="0"></td>
  305. <td id="tr1sp2"><img id="img1sp2" src="spacer.gif" width="428" height="1" border="0"></td>
  306. <td id="tr1sp3"><img id="img1sp3" src="spacer.gif" width="3" height="1" border="0"></td>
  307. <td id="tr1sp4"><img id="img1sp4" src="spacer.gif" width="1" height="1" border="0"></td>
  308. </tr>
  309. <tr id="tr2">
  310. <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>
  311. <td id="tdr1_c2"><img id="imgr1_c2" name="Untitled1_r1_c2" src="r1_c2.gif" width="428" height="3" border="0"></td>
  312. <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>
  313. <td id="tr2sp1"><img id="img2sp1" src="spacer.gif" width="1" height="3" border="0"></td>
  314. </tr>
  315. <tr id="tr3">
  316. <td id="imgGR" valign="center"><img id="green" src="spacer.gif" width="1" height="1"></td>
  317. <td id="tr3sp1"><img id="img3sp1" src="spacer.gif" width="1" height="12" border="0"></td>
  318. </tr>
  319. <tr id="tr4">
  320. <td id="tdr3_c2"><img id="imgr3_c2" name="r3_c2" src="r3_c2.gif" width="428" height="3" border="0"></td>
  321. <td id="tr4sp1"><img id="img4sp1" src="spacer.gif" width="1" height="3" border="0"></td>
  322. </tr>
  323. </table>
  324. </TD>
  325. </TR>
  326. <TR>
  327. <TD id="idProgress" class="sys-font-body sys-color-body padgl"></TD>
  328. </TR>
  329. </TABLE>
  330. <table id="cancel" style="display: none" align="right"><tr><td id="cancelbutton" class="padgr padt" align="right">
  331. <BUTTON id="idCancel" onclick="CancelDC()" accesskey="C" class="sys-font-body"><U>C</U>ancel</BUTTON>
  332. </td></tr></table>
  333. </span>
  334. <span id="FinalText" class="padt padgl padgr" style="display: none">
  335. <table><tr><td class="padgl padgt padgr">
  336. <table border=0 cellspacing=0 cellpadding=0 width="100%" class="BorderColor padt padgl padgr sys-inlineform-bgcolor2">
  337. <tr>
  338. <td class="padgl padgt" width="32" height="32" valign="top"><img valign="top" id="infoimg" width="32" height="32" src="status_ok.gif"></td>
  339. <td id="filesaved" valign="center" class="sys-font-body sys-color-body padgt pad1eml padgr padb" width="100%">
  340. <font class="sys-font-heading3 sys-rhp-color-title padgr">Your file has been saved successfully</font>
  341. <BR>Your file has been saved successfully to <span id="filepath"></span>
  342. <BR><BR><BR>
  343. <font id="instruc" class="sys-font-body-bold sys-color-body padgr">
  344. Instructions for submitting this file to Microsoft
  345. </font>
  346. <BR><BR>
  347. <font id="forcust" class="sys-font-body sys-color-body">
  348. 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>.
  349. </font>
  350. </td>
  351. </tr>
  352. </table>
  353. </td></tr></table>
  354. </span>
  355. </BODY>
  356. </HTML>