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.

600 lines
16 KiB

  1. <?XML version="1.0" ?>
  2. <?job debug="false"?>
  3. <package>
  4. <job>
  5. <comment>
  6. <![CDATA[
  7. We recommend the use of
  8. Option Explicit inside every set
  9. of <SCRIPT></SCRIPT> tags
  10. ]]>
  11. </comment>
  12. <resource id="regbase">HKLM\Software\Microsoft\</resource>
  13. <resource id="windows">Windows NT\CurrentVersion\</resource>
  14. <resource id="BVTdata">BVT\</resource>
  15. <resource id="title">MUI BVT</resource>
  16. <resource id="machine">%BOOTTESTMACHINE%</resource>
  17. <resource id="skip">
  18. SaveButton
  19. ClearButton
  20. InputReady
  21. </resource>
  22. <runtime>
  23. <named name="title" helpstring="dialog title" required="false" type="string"/>
  24. <named name="machine" helpstring="Boot test machine" required="false" type="simple"/>
  25. <named name="debug" helpstring="debug" required="false" type="simple"/>
  26. <named name="showinput" helpstring="parse comment fields (LANG,PRODID,DRIVE,BLDNUM)" required="false" type="string"/>
  27. <named name="[h]elp" helpstring="display this message" required="false" type="simple"/>
  28. <named name="pkd" helpstring="open second explorer window to go product key" required="false" type="simple"/>
  29. <named name="escape" helpstring="escape special characters" required="false" type="simple"/>
  30. </runtime>
  31. <resource id="tags">
  32. LANG
  33. PRODID
  34. DRIVE
  35. BLDNUM
  36. </resource>
  37. <resource id="entries">
  38. P_roductID
  39. BT_U
  40. BT_P
  41. </resource>
  42. <resource id="blank">
  43. <![CDATA[
  44. <HTML>
  45. <HEAD>
  46. <SCRIPT LANGUAGE="JavaScript">
  47. function myOnClick(val){
  48. val.form.BT_U.value = ""
  49. val.form.BT_P.value = ""
  50. }
  51. </SCRIPT>
  52. <script language="vbscript">
  53. set window.onBeforeUnload = getref("PostQuitWrnMsg")
  54. sub PostQuitWrnMsg
  55. bComplete = false
  56. spQuitWrnMsg = "The calling script has not indicated " & _
  57. "that it has completed." & _
  58. VBNEWLINE & _
  59. "Closing this window may " & _
  60. "cause the calling script to fail."
  61. For npCnt = 0 to document.forms(0).elements.length - 1
  62. spName = document.forms(0).elements(npCnt).Name
  63. If 0 = strComp( "InputReady", spName, VBTEXTCOMPARE) Then
  64. bComplete = document.forms(0).elements(npCnt).Value
  65. End If
  66. Next
  67. if bComplete then exit sub
  68. window.event.returnvalue = spQuitWrnMsg
  69. end sub
  70. </script>
  71. </HEAD>
  72. <BODY BACKGROUND="%IMAGE%" TEXT="WHITE">
  73. </BODY>
  74. </HTML>
  75. ]]>
  76. </resource>
  77. <resource id="dyna">
  78. <![CDATA[
  79. <CENTER>
  80. <TABLE BORDER="0">
  81. <FORM NAME="InitBOOTTESTMACHINE">
  82. <INPUT NAME="BT_M" TYPE="HIDDEN" SIZE="50" VALUE="%BOOTTESTMACHINE%">
  83. <INPUT NAME="InputReady" TYPE="HIDDEN" SIZE="1" VALUE="0">
  84. <TR><TD COLSPAN="3"><P ALIGN="RIGHT">
  85. <FONT FACE="Arial" SIZE ="5" COLOR="#FFFFFF"><B>%TITLE% %BOOTTESTMACHINE%</B></P></FONT>
  86. </TD></TR>
  87. <TR><TD COLSPAN="2"><FONT FACE="Arial" SIZE ="4" COLOR="#FFFFFF">User:</FONT></TD>
  88. <TD><P ALIGN="RIGHT"><INPUT NAME="BT_U" SIZE="20"></P></TD></TR>
  89. <TR><TD COLSPAN="2"><FONT FACE="Arial" SIZE ="4" COLOR="#FFFFFF">Password:</FONT></TD>
  90. <TD><P ALIGN="RIGHT"><INPUT TYPE="PASSWORD" NAME="BT_P" SIZE="20"></P></TD></TR>
  91. <PRODID>
  92. <TR><TD COLSPAN="2"><FONT FACE="Arial" SIZE ="4" COLOR="#FFFFFF">Product ID:</FONT></TD>
  93. <TD><P ALIGN="RIGHT"><INPUT NAME="BT_I" SIZE="40" VALUE=""></P></TD></TR>
  94. </PRODID>
  95. <DRIVE>
  96. <TR><TD COLSPAN="2"><FONT FACE="Arial" SIZE ="4" COLOR="#FFFFFF">Drive:</FONT></TD>
  97. <TD><P ALIGN="RIGHT"><INPUT NAME="BT_D" SIZE="2" VALUE=""></P></TD></TR>
  98. </DRIVE>
  99. <BLDNUM>
  100. <TR><TD COLSPAN="2"><FONT FACE="Arial" SIZE ="4" COLOR="#FFFFFF">Build:</FONT></TD>
  101. <TD><P ALIGN="RIGHT"><INPUT NAME="BT_N" SIZE="2" VALUE=""></P></TD></TR>
  102. </BLDNUM>
  103. <LANG>
  104. <TR><TD><FONT FACE="Arial" SIZE ="4" COLOR="#FFFFFF">Language:</FONT></TD>
  105. <TD COLSPAN="2"><P ALIGN="RIGHT"><INPUT TYPE="TEXT" NAME="BT_L" SIZE="3"></P></TD></TR>
  106. </LANG>
  107. <COMMENT>COMMENT IT</COMMENT>
  108. <TR><TD><IMG SRC="%IMAGE%" WIDTH="50"></TD>
  109. <TD COLSPAN="2">
  110. <P ALIGN="RIGHT">
  111. <INPUT TYPE="BUTTON" NAME="SaveButton" VALUE="Save Values">
  112. <INPUT TYPE="BUTTON" NAME="ClearButton" VALUE="Clear" onClick="myOnClick(this)">
  113. </P>
  114. </TD></TR></TABLE>
  115. </FORM>
  116. </CENTER>
  117. ]]>
  118. </resource>
  119. <comment></comment>
  120. <resource id="bgimg">bkg.jpg</resource>
  121. <resource id="comment"><![CDATA[<!--]]></resource>
  122. <resource id="/comment"><![CDATA[-->]]></resource>
  123. <comment>
  124. // document.href='about:blank'
  125. </comment>
  126. <script language="VBScript">
  127. <![CDATA[
  128. Function CurrentPageFieldVal(oiHierObj, siFieldName)
  129. Dim npCnt, npElementNumber, spName
  130. For npCnt = 0 to oiHierObj.forms(0).elements.length - 1
  131. spName = oiHierObj.forms(0).elements(npCnt).Name
  132. If InStr(siFieldName, spName) Then
  133. npElementNumber = npCnt
  134. End If
  135. Next
  136. CurrentPageFieldVal = oiHierObj.forms(0).elements(npElementNumber).value
  137. End Function
  138. Function CurrentPageSetVal(oiHierObj, siFieldName, siValue)
  139. Dim npCnt, npElementNumber, spName
  140. siFieldName = Cstr(siFieldName)
  141. For npCnt = 0 to oiHierObj.forms(0).elements.length - 1
  142. spName = Cstr(oiHierObj.forms(0).elements(npCnt).Name)
  143. If 0 = strComp(siFieldName, spName, VBTEXTCOMPARE) Then
  144. npElementNumber = npCnt
  145. End If
  146. Next
  147. oiHierObj.forms(0).elements(npElementNumber).value = cStr(siValue)
  148. CurrentPagesetdVal = oiHierObj.forms(0).elements(npElementNumber).value
  149. End Function
  150. Sub InsertCommentText(oiHierObj, siText)
  151. oiHierObj.body.insertAdjacentHTML "beforeEnd", siText
  152. End Sub
  153. ]]>
  154. </script>
  155. <script language="VBScript">
  156. <![CDATA[
  157. Function spQthisE(siBarE)
  158. Dim opRxS, opRxX, opRxA, opRxB, opRxC
  159. Set opRxS = CreateObject("Scripting.Dictionary")
  160. Set opRxX = CreateObject("VBscript.RegExp")
  161. opRxS.add "!", "^!"
  162. opRxS.add "%", "^%"
  163. opRxS.add " ", "^ "
  164. With opRxX
  165. .Global = True
  166. .IgnoreCase = True
  167. .Pattern = ""
  168. End With
  169. opRxB = siBarE
  170. For Each opRxA in opRxS.Keys
  171. opRxB = Replace(opRxB, opRxA, opRxS(opRxA))
  172. Next
  173. If bpDebug Then
  174. If opRxX.Test(opRxB) then
  175. WSCript.echo "Replaced:", _
  176. QQUOT & siBarE & QQUOT, _
  177. QQUOT & opRxB & QQUOT
  178. End If
  179. End If
  180. Set opRxS = Nothing
  181. Set opRxX = Nothing
  182. spQthisE = opRxB
  183. End Function
  184. ]]>
  185. </script>
  186. <script language="VBScript">
  187. <![CDATA[
  188. Function ReadResource(sPresId)
  189. On Error resume next
  190. Dim WshShell
  191. Set WshShell = CreateObject("WScript.Shell")
  192. Dim sPRes, asRes, uRes, tsRes
  193. sPREs = GetResource(sPresId)
  194. If Err.number <> 0 Then
  195. Wscript.echo err.number & " " & err.description
  196. ' The Error description are not informative when failed getresource
  197. IF Err.number = 7 Then
  198. Wscript.echo chr(9) & "Null resource: " & _
  199. sPresId
  200. End If
  201. IF Err.number = 5 Then
  202. Wscript.echo chr(9) & "Undefined resource: " & _
  203. sPresId
  204. End If
  205. Wscript.quit
  206. End If
  207. asRes = Split(WshShell.ExpandEnvironmentStrings(sPRes), VBNEWLINE)
  208. Set ures = CreateObject("Scripting.Dictionary")
  209. For Each tsRes in asRes
  210. If 0 <> Len(tsRes) Then
  211. uRes(tsRes) = 1
  212. End If
  213. Next
  214. Dim tResource
  215. tResource = uRes.Keys
  216. If uBound(tResource) = 0 Then
  217. ReadResource = tResource(0)
  218. Else
  219. ReadResource = tResource
  220. End If
  221. Set WshShell = Nothing
  222. Set uRes = Nothing
  223. End Function
  224. ]]>
  225. </script>
  226. <script language="VBScript">
  227. <![CDATA[
  228. Sub ofSvFCVAsdrt
  229. _
  230. npReady = CurrentPageFieldVal(opContainerObject, "InputReady")
  231. spP_roductID = CurrentPageFieldVal(opContainerObject, "BT_P")
  232. If spP_roductID <> "" Then
  233. npReady = 1
  234. Call CurrentPageSetVal(opContainerObject, "InputReady", npReady)
  235. End If
  236. _
  237. End Sub
  238. Function sGetKeyValue (siRegKey)
  239. _
  240. on Error Resume Next
  241. sGetKeyValue = opShell.RegRead(siRegKey)
  242. if err.number <>0 Then
  243. sGetKeyValue = NULL
  244. End If
  245. _
  246. End Function
  247. Function mkTemp(siExtension)
  248. Dim spRndName, snDotPos, opFilesys, opshell
  249. Dim opLocSyz, opTextFyle
  250. Set opLocSyz = CreateObject("WinNTSystemInfo")
  251. Set opShell = CreateObject("WScript.Shell")
  252. Set opFilesys = CreateObject("Scripting.FilesystemObject")
  253. Randomize ' Initialize random-number generator
  254. spRndName = cStr(Rnd)
  255. snDotPos = InstrRev(spRndName, ".", 1, VBTEXTCOMPARE) + 1
  256. mkTemp = opFilesys.BuildPath(opShell.ExpandEnvironmentStrings("%TEMP%"), Mid(spRndName, snDotPos) & _
  257. "." & siExtension)
  258. Set opTextFyle = opFilesys.CreateTextFile(mkTemp, true)
  259. opTextFyle.WriteLine getResource("comment") & _
  260. " " & _
  261. opLocSyz.DomainName & _
  262. "\"& _
  263. opLocSyz.UserName & _
  264. " " & _
  265. getResource("/comment")
  266. opTextFyle.Close
  267. Set opShell = Nothing
  268. Set opFilesys = Nothing
  269. If bpDebug then
  270. WSCript.echo mkTemp
  271. End If
  272. End Function
  273. ]]>
  274. </script>
  275. <script language="VBScript">
  276. <![CDATA[
  277. Option Explicit
  278. Const csQuote = """"
  279. Dim opNetwork, opWManager, opIexplore, opIexplore2, opShell, opFilesys
  280. Dim sbgimg, sBareScriptName, sPathScriptName, opGNamArgs
  281. Dim spTextBodyDisplay, opBlStreem, spBlunkPige, sBlunkDot, sScriptPath
  282. Set opGNamArgs = WScript.Arguments.Named
  283. '' skip some form fields here...
  284. Dim opdSkipFNames, spFieldSkip
  285. Set opdSkipFNames = createObject("Scripting.Dictionary")
  286. For each spFieldSkip in ReadResource("skip")
  287. opdSkipFNames.add ucase(spFieldSkip), 1
  288. Next
  289. Dim spEscape
  290. spEscape = opGNamArgs.Exists("escape")
  291. If opGNamArgs.Exists("help") or opGNamArgs.Exists("h") Then
  292. WScript.Arguments.showUsage
  293. WScript.quit
  294. End If
  295. Set opFilesys = CreateObject("Scripting.FilesystemObject")
  296. spBlunkPige = mkTemp("html")
  297. Const cForReading = 1, cForWriting = 2, cForAppending = 8
  298. Set opBlStreem = opFilesys.OpenTextFile(spBlunkPige, cForAppending, True ,0)
  299. sPathScriptName = opFilesys.GetAbsolutePathName(WScript.ScriptFullName )
  300. sBareScriptName = opFilesys.GetFileName(sPathScriptName)
  301. sScriptPath = Replace(sPathScriptName,"\" & sBareScriptName, "",1,1)
  302. sbgimg = Replace(_
  303. opFilesys.BuildPath( sScriptPath, _
  304. GetResource("bgimg")), _
  305. "\", _
  306. "/")
  307. spTextBodyDisplay = Replace(GetResource("dyna"), "%IMAGE%", sbgimg)
  308. sBlunkDot = Replace(GetResource("blank"), "%IMAGE%", sbgimg)
  309. opBlStreem.Write sBlunkDot
  310. opBlStreem.Close
  311. Set opNetwork = Wscript.CreateObject("Wscript.network")
  312. Set opIexplore = CreateObject("InternetExplorer.Application")
  313. If bpDebug Then
  314. WScript.echo TypeName(opIexplore)
  315. End If
  316. '' showinput must be better checked.
  317. If opGNamArgs.Exists("pkd") then
  318. Set opIexplore2 = CreateObject("InternetExplorer.Application")
  319. end If
  320. Set opWManager = CreateObject("Shell.Application")
  321. Set opWManager = Nothing
  322. Set opShell = WScript.CreateObject("WScript.Shell")
  323. '' Set opWinMan = CreateObject("window.manager")
  324. ' is it a XP regression or a feature?
  325. Dim spTitle, siTitle, siMachine, spMachine
  326. spTitle = GetResource("title")
  327. siTitle = WSCript.Arguments.Named("title")
  328. If siTitle <> "" Then
  329. spTitle = siTitle
  330. End If
  331. spMachine = GetResource("machine")
  332. siMachine = WSCript.Arguments.Named("machine")
  333. spMachine = Replace(spMachine, "%BOOTTESTMACHINE%", opNetwork.ComputerName & "1")
  334. If siMachine <> "" Then
  335. spMachine = siMachine
  336. End If
  337. spTextBodyDisplay = Replace(spTextBodyDisplay , "%TITLE%", spTitle, 1, 10)
  338. spTextBodyDisplay = Replace(spTextBodyDisplay , "%BOOTTESTMACHINE%", spMachine, 1, 10)
  339. Set opNetwork = Nothing
  340. Dim bpShwCm
  341. Dim bpDebug: bpDebug = False
  342. If opGNamArgs.Exists("debug") then
  343. bpDebug = True
  344. End If
  345. If opGNamArgs.Exists("showinput") then
  346. Dim spInputField
  347. For each spInputField in Split(opGNamArgs("showinput"), ",")
  348. '' PARSING COMMENT IDS TOO DIFFICULT WITH NO MSXML
  349. '' SAVE IT FOR ANOTHER VERSION
  350. Dim opOpComX
  351. Dim opClComX
  352. Set opOpComX = CreateObject("VBscript.Regexp")
  353. Set opClComX = CreateObject("VBscript.Regexp")
  354. With opOpComX
  355. .Pattern = "<" & ucase(spInputField) & ">"
  356. .Ignorecase = True
  357. .Global = True
  358. End With
  359. With opClComX
  360. .Pattern = "</" & ucase(spInputField) & ">"
  361. .Ignorecase = True
  362. .Global = True
  363. End With
  364. spTextBodyDisplay = opOpcomX.Replace(spTextBodyDisplay,"")
  365. spTextBodyDisplay = opClcomX.Replace(spTextBodyDisplay,"")
  366. Set opClComX = Nothing
  367. Set opOpComX = Nothing
  368. Next
  369. End If
  370. For Each spInputField in ReadResource("tags")
  371. Set opOpComX = CreateObject("VBscript.Regexp")
  372. Set opClComX = CreateObject("VBscript.Regexp")
  373. With opOpComX
  374. .Pattern = "<" & ucase(spInputField) & ">"
  375. .Ignorecase = True
  376. .Global = True
  377. End With
  378. With opClComX
  379. .Pattern = "</" & ucase(spInputField) & ">"
  380. .Ignorecase = True
  381. .Global = True
  382. End With
  383. spTextBodyDisplay = opOpcomX.Replace(spTextBodyDisplay,getResource("comment"))
  384. spTextBodyDisplay = opClcomX.Replace(spTextBodyDisplay,getResource("/comment"))
  385. Set opClComX = Nothing
  386. Set opOpComX = Nothing
  387. Next
  388. If bpDebug Then
  389. WScript.echo spTextBodyDisplay
  390. End If
  391. With opIexplore
  392. .width = 535
  393. .height = 255
  394. .top = 0
  395. .left = 0
  396. .menubar = false
  397. .statusbar = false
  398. .resizable = false
  399. .visible = false
  400. .toolbar = false
  401. .navigate ("file://" & _
  402. spBlunkPige )
  403. .document.bgcolor = "#8899CF"
  404. End With
  405. opIexplore.top = opIexplore.document.parentWindow.screen.availHeight - _
  406. opIexplore.height
  407. opIexplore.left = opIexplore.document.parentWindow.screen.availWidth - _
  408. opIexplore.width
  409. WScript.Sleep 25
  410. With opIexplore
  411. .visible=1
  412. .document.title = "Initialisation: "
  413. End With
  414. WScript.Sleep 25
  415. With opIexplore
  416. .document.body.innerHTML=spTextBodyDisplay
  417. .visible=0
  418. End with
  419. WScript.Sleep 25
  420. opIexplore.visible=1
  421. If opGNamArgs.Exists("pkd") Then
  422. '' Use the second IE window to navigate to pkd page when PRODID is to be
  423. '' filled
  424. WScript.Sleep 100
  425. With opIexplore2
  426. .width = 720
  427. .height = 640
  428. .top = 0
  429. .left = 0
  430. .menubar = false
  431. .statusbar = true
  432. .resizable = true
  433. .toolbar = true
  434. .navigate ("About:blank")
  435. .document.title = "Initialisation: "
  436. .visible = false
  437. End With
  438. opIexplore2.navigate ("http://pkd/")
  439. opIexplore2.visible=1
  440. End If
  441. Dim opContainerObject
  442. Set opContainerObject = opIexplore.document
  443. Dim spP_roductID
  444. Dim npReady: npReady = 0
  445. opContainerObject.all.SaveButton.onClick = GetRef("ofSvFCVAsdrt")
  446. Do While npReady <> 1
  447. WSCript.sleep(10)
  448. Loop
  449. InsertCommentText opIexplore.document, "<P ALIGN=""RIGHT""><FONT FACE=""Arial"">Done...</FONT></P>"
  450. WScript.Sleep 100
  451. Dim siOutputField
  452. Dim spOutputField, npCnt
  453. siOutputField = CSTR((WScript.Arguments.Named("field")))
  454. For npCnt = 0 to opContainerObject.forms(0).elements.length - 1
  455. spOutputField = opContainerObject.forms(0).elements(npcnt).Name
  456. If ("" = siOutputField AND NOT opdSkipFNames.Exists(ucase(spOutputField)) ) _
  457. OR 0 = strComp(spOutputField, siOutputField, VBTEXTCOMPARE) _
  458. Then
  459. If Not spEscape Then
  460. WSCript.echo spOutputField, _
  461. "=", _
  462. CurrentPageFieldVal( _
  463. opContainerObject,spOutputField)
  464. Else
  465. WSCript.echo spOutputField, _
  466. "=", _
  467. spQthisE(CurrentPageFieldVal( _
  468. opContainerObject,spOutputField))
  469. End If
  470. End If
  471. Next
  472. If opGNamArgs.Exists("pkd") then
  473. opIexplore2.quit
  474. Set opIexplore2 = Nothing
  475. End If
  476. opIexplore.quit
  477. Set opIexplore = Nothing
  478. Set opShell = Nothing
  479. Set opGNamArgs = Nothing
  480. If bpDebug Then
  481. WSCript.echo "opFilesys.DeleteFile" , spBlunkPige
  482. End If
  483. opFilesys.DeleteFile spBlunkPige
  484. Set opFilesys = Nothing
  485. WScript.quit
  486. ]]>
  487. </script>
  488. </job>
  489. </package>