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.

1783 lines
57 KiB

  1. ;
  2. ; KEYED SECTIONS. These sections are provided for files where a selection
  3. ; is made from a set of files and the chosen one is copied under a generic
  4. ; name. This can be used to update the hal.dll, ntoskrnl.exe, ntbootdd.sys,
  5. ; ntdetect.com.
  6. ;
  7. [FileKeyedClasses]
  8. Hal = hal.dll
  9. Ntoskrnl = ntoskrnl.exe
  10. ; Ntdetect = ntdetect.com
  11. [FilesKeyedSections]
  12. FilesHal = $(STF_HALDEST)
  13. FilesNtoskrnl = $(STF_WINDOWSSYSPATH)
  14. ; FilesNtdetect = $(STF_OSLDEST)
  15. [FilesHal]
  16. ; for x86
  17. ; hal = 1, hal.dll , RENAME=$(NEWFILE)
  18. ; halast = 1, halast.dll , RENAME=$(NEWFILE)
  19. ; halcbus = 1, halcbus.dll , RENAME=$(NEWFILE)
  20. ; hal486c = 1, hal486c.dll , RENAME=$(NEWFILE)
  21. ; halmca = 1, halmca.dll , RENAME=$(NEWFILE)
  22. ; halncr = 1, halncr.dll , RENAME=$(NEWFILE)
  23. ; haloli = 1, haloli.dll , RENAME=$(NEWFILE)
  24. ; halsp = 1, halsp.dll , RENAME=$(NEWFILE)
  25. ; halwyse7 = 1, halwyse7.dll , RENAME=$(NEWFILE)
  26. ; for mips
  27. ; hal = 1, hal.dll , RENAME=$(NEWFILE)
  28. ; haldti = 1, haldti.dll , RENAME=$(NEWFILE)
  29. ; halduomp = 1, halduomp.dll , RENAME=$(NEWFILE)
  30. ; halfxs = 1, halfxs.dll , RENAME=$(NEWFILE)
  31. ; halacr = 1, halacr.dll , RENAME=$(NEWFILE)
  32. ; halsgi = 1, halsgi.dll , RENAME=$(NEWFILE)
  33. ; for ppc
  34. ; hal = 1, hal.dll , RENAME=$(NEWFILE)
  35. ; halppc = 1, halppc.dll , RENAME=$(NEWFILE)
  36. ; halpolo = 1, halpolo.dll , RENAME=$(NEWFILE)
  37. ; halwood = 1, halwood.dll , RENAME=$(NEWFILE)
  38. ; for alpha
  39. [FilesNtoskrnl]
  40. ; for ppc, x86, mips, alpha
  41. ; ntoskrnl = 1, ntoskrnl.exe , RENAME=$(NEWFILE)
  42. ; ntkrnlmp = 1, ntkrnlmp.exe , RENAME=$(NEWFILE)
  43. ; [FilesNtdetect]
  44. ; for x86
  45. ; ntdetect = 1, ntdetect.com , RENAME=$(NEWFILE)
  46. ;
  47. ; REGULAR SECTIONS. These sections are provided for files where the file
  48. ; just needs to be copied to a known destination.
  49. ;
  50. [FileSections]
  51. FilesPrimary = C:
  52. FilesOsLoader = $(STF_OSLDEST)
  53. FilesPal = $(STF_HALDEST)
  54. FilesWinnt = $(STF_WINDOWSPATH)
  55. FilesSystem32 = $(STF_WINDOWSSYSPATH)
  56. FilesSystem = $(STF_WINDOWSPATH)\system
  57. FilesDrivers = $(STF_WINDOWSSYSPATH)\drivers
  58. FilesConfig = $(STF_WINDOWSSYSPATH)\config
  59. FilesWinspool = $(STF_WINDOWSSYSPATH)\spool
  60. FilesPrnDriver = $(STF_WINDOWSSYSPATH)\spool\drivers\$(!STF_PRNPLATFORM)
  61. FilesPrnProc = $(STF_WINDOWSSYSPATH)\spool\prtprocs\$(!STF_PRNPLATFORM)
  62. FilesDbgCom = $(STF_WINDOWSPATH)\symbols\com
  63. FilesDbgCpl = $(STF_WINDOWSPATH)\symbols\cpl
  64. FilesDbgDll = $(STF_WINDOWSPATH)\symbols\dll
  65. FilesDbgDrv = $(STF_WINDOWSPATH)\symbols\drv
  66. FilesDbgExe = $(STF_WINDOWSPATH)\symbols\exe
  67. FilesDbgScr = $(STF_WINDOWSPATH)\symbols\scr
  68. FilesDbgSys = $(STF_WINDOWSPATH)\symbols\sys
  69. [FileSectionsCopyAlways]
  70. FilesSystem32CopyAlways = $(STF_WINDOWSSYSPATH)
  71. FilesDriversCopyAlways = $(STF_WINDOWSSYSPATH)\drivers
  72. ;
  73. ; product specific sections
  74. ;
  75. [FileSectionsWINNT]
  76. FilesInfWinnt = $(STF_WINDOWSSYSPATH)
  77. [FileSectionsLANMANNT]
  78. FilesInfLanmanNT = $(STF_WINDOWSSYSPATH)
  79. ;
  80. ; FilesPrimary only covers ntldr. For ntbootddd, a keyed section needs to
  81. ; be created. Also this section is relevant only for x86.
  82. ;
  83. [FilesPrimary]
  84. ; 1 = 1, file1, RENAME=$(NEWFILE)
  85. ; 2 = 1, file2, RENAME=$(NEWFILE)
  86. ;
  87. ; FilesOsLoader only covers osloader.exe. This is only relevant
  88. ;
  89. [FilesOsLoader]
  90. ; 1 = 1, file1, RENAME=$(NEWFILE)
  91. ; 2 = 1, file2, RENAME=$(NEWFILE)
  92. [FilesPal]
  93. ; 1 = 1, file1, RENAME=$(NEWFILE)
  94. ; 2 = 1, file2, RENAME=$(NEWFILE)
  95. [FilesWinnt]
  96. ; 1 = 1, file1, RENAME=$(NEWFILE)
  97. ; 2 = 1, file2, RENAME=$(NEWFILE)
  98. [FilesSystem32]
  99. ; 1 = 1, file1, RENAME=$(NEWFILE)
  100. ; 2 = 1, file2, RENAME=$(NEWFILE)
  101. [FilesSystem]
  102. ; 1 = 1, file1, RENAME=$(NEWFILE)
  103. ; 2 = 1, file2, RENAME=$(NEWFILE)
  104. [FilesDrivers]
  105. ; 1 = 1, file1, RENAME=$(NEWFILE)
  106. ; 2 = 1, file2, RENAME=$(NEWFILE)
  107. [FilesConfig]
  108. ; 1 = 1, file1, RENAME=$(NEWFILE)
  109. ; 2 = 1, file2, RENAME=$(NEWFILE)
  110. [FilesWinspool]
  111. ; 1 = 1, file1, RENAME=$(NEWFILE)
  112. ; 2 = 1, file2, RENAME=$(NEWFILE)
  113. [FilesPrnDriver]
  114. ; 1 = 1, file1, RENAME=$(NEWFILE)
  115. ; 2 = 1, file2, RENAME=$(NEWFILE)
  116. [FilesPrnProc]
  117. ; 1 = 1, file1, RENAME=$(NEWFILE)
  118. ; 2 = 1, file2, RENAME=$(NEWFILE)
  119. [FilesDbgCom]
  120. ; 1 = 1, file1, RENAME=$(NEWFILE)
  121. ; 2 = 1, file2, RENAME=$(NEWFILE)
  122. [FilesDbgCpl]
  123. ; 1 = 1, file1, RENAME=$(NEWFILE)
  124. ; 2 = 1, file2, RENAME=$(NEWFILE)
  125. [FilesDbgDll]
  126. ; 1 = 1, file1, RENAME=$(NEWFILE)
  127. ; 2 = 1, file2, RENAME=$(NEWFILE)
  128. [FilesDbgDrv]
  129. ; 1 = 1, file1, RENAME=$(NEWFILE)
  130. ; 2 = 1, file2, RENAME=$(NEWFILE)
  131. [FilesDbgExe]
  132. ; 1 = 1, file1, RENAME=$(NEWFILE)
  133. ; 2 = 1, file2, RENAME=$(NEWFILE)
  134. [FilesDbgScr]
  135. ; 1 = 1, file1, RENAME=$(NEWFILE)
  136. ; 2 = 1, file2, RENAME=$(NEWFILE)
  137. [FilesDbgSys]
  138. ; 1 = 1, file1, RENAME=$(NEWFILE)
  139. ; 2 = 1, file2, RENAME=$(NEWFILE)
  140. [FilesInfWinnt]
  141. ; 1 = 1, file1, RENAME=$(NEWFILE)
  142. ; 2 = 1, file2, RENAME=$(NEWFILE)
  143. [FilesInfLanmanNT]
  144. ; 1 = 1, file1, RENAME=$(NEWFILE)
  145. ; 2 = 1, file2, RENAME=$(NEWFILE)
  146. [FilesSystem32CopyAlways]
  147. ; 1 = 1, file1, RENAME=$(NEWFILE)
  148. ; 2 = 1, file2, RENAME=$(NEWFILE)
  149. [FilesDriversCopyAlways]
  150. ; 1 = 1, file1, RENAME=$(NEWFILE)
  151. ; 2 = 1, file2, RENAME=$(NEWFILE)
  152. [FileAttributes]
  153. ;1=1, NTLDR, $(FilesPrimary), SHR
  154. ;2=1, BOOT.INI, $(FilesPrimary), SHR
  155. [ProcessorID]
  156. ProcessorID_I386 = I386
  157. ProcessorID_I486 = I486
  158. ProcessorID_I586 = I586
  159. ProcessorID_R4000 = R4000
  160. [UiVars]
  161. STF_PLATFORMDET = "" ? $(!LIBHANDLE) GetPlatform
  162. STF_CSDVER = 256
  163. STF_BUILDVER = 807
  164. STF_CSD1_NT35 = 256
  165. STF_NT31_BUILDVER = 528
  166. STF_NT35_BUILDVER = 807
  167. STF_PRIMARY = "C:"
  168. STF_NTDRIVE = ""
  169. STF_WINDOWSPATH = "" ? $(!LIBHANDLE) GetWindowsNtDir
  170. STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  171. STF_CONTROLSET = CurrentControlSet
  172. VolumeList = {} ? $(!LIBHANDLE) GetHardDriveLetters
  173. VolumeFSList = {} ? $(!LIBHANDLE) GetHardDriveFileSystems
  174. VolumeFreeList = {} ? $(!LIBHANDLE) GetHardDriveFreeSpace
  175. DisketteList = {} ? $(!LIBHANDLE) GetFloppyDriveLetters
  176. ;
  177. ; Amount of free space (in MB) required on the winnt drive
  178. ; before we'll do the upgrade patch.
  179. ;
  180. [FreeSpaceI386]
  181. RequiredFreeWinnt = 25
  182. [FreeSpaceMips]
  183. RequiredFreeWinnt = 32
  184. [FreeSpaceppc]
  185. RequiredFreeWinnt = 32
  186. [FreeSpaceAlpha]
  187. RequiredFreeWinnt = 27
  188. [NVRAMVars]
  189. SystemPartition = "" ? $(!LIBHANDLE) GetNVRAMVar SYSTEMPARTITION
  190. OsLoader = "" ? $(!LIBHANDLE) GetNVRAMVar OSLOADER
  191. OsLoadPartition = "" ? $(!LIBHANDLE) GetNVRAMVar OSLOADPARTITION
  192. OsLoadFilename = "" ? $(!LIBHANDLE) GetNVRAMVar OSLOADFILENAME
  193. ;
  194. ; INF LOGIC
  195. ;
  196. [Shell Commands]
  197. set-title "Windows NT Setup"
  198. set-subst CR = "\r"
  199. set-subst LF = "\n"
  200. set STF_LANGUAGE = ENG
  201. read-syms Strings
  202. shell "subroutn.inf" PushBillboard STATUSDLG $(Billboard1)
  203. set BillboardPushed = TRUE
  204. set !LIBHANDLE = ""
  205. set !PATCHLIBHANDLE = ""
  206. ;
  207. ; Initialize Library support for the inf
  208. ;
  209. install LoadSetupLibrary
  210. ;
  211. ; find out the essential information about the installed hardware and
  212. ; software
  213. ;
  214. read-syms ProductType
  215. ifstr(i) $(!STF_PLATFORM) == I386
  216. set STF_PRNPLATFORM = "w32x86"
  217. else-ifstr(i) $(!STF_PLATFORM) == Mips
  218. set STF_PRNPLATFORM = "w32mips"
  219. else-ifstr(i) $(!STF_PLATFORM) == ppc
  220. set STF_PRNPLATFORM = "w32ppc"
  221. else-ifstr(i) $(!STF_PLATFORM) == Alpha
  222. set STF_PRNPLATFORM = "w32alpha"
  223. endif
  224. read-syms UiVars
  225. detect UiVars
  226. read-syms FreeSpace$(!STF_PLATFORM)
  227. ;
  228. ; if the Platform is not the same as the one supported by this patch
  229. ; diskette, inform the user and quit
  230. ;
  231. ifstr(i) $(STF_PLATFORM) != $(STF_PLATFORMDET)
  232. ifstr(i) $(BillboardPushed) == TRUE
  233. shell "subroutn.inf" PopBillboard
  234. set BillboardPushed = FALSE
  235. endif
  236. shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "FATAL" $(String1)
  237. goto patchnotdone
  238. endif
  239. ;
  240. ; Check to make sure we have admin privileges, if not print fatal error
  241. ;
  242. shell "registry.inf" CheckSetupModify
  243. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  244. ; DEBUG
  245. ;
  246. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Failed to shell CheckSetupModify"
  247. ;
  248. ; DEBUG END
  249. ifstr(i) $(BillboardPushed) == TRUE
  250. shell "subroutn.inf" PopBillboard
  251. set BillboardPushed = FALSE
  252. endif
  253. Debug-Output "shelling CheckSetupModify failed"
  254. goto patchnotdone
  255. else-ifstr(i) $($R0) != STATUS_SUCCESSFUL
  256. ifstr(i) $(BillboardPushed) == TRUE
  257. shell "subroutn.inf" PopBillboard
  258. set BillboardPushed = FALSE
  259. endif
  260. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String4)
  261. goto patchnotdone
  262. endif
  263. ;
  264. ; Initialize the patch library support for the inf
  265. ;
  266. install LoadPatchLibrary
  267. ;
  268. ; find out if the system we are patching is checked / free using GetCheckedFree
  269. ; and fail if we find a checked system. ignore any errors in getting
  270. ; checked/free status since this is not important.
  271. ;
  272. shell "" GetCheckedFree
  273. ifint $($ShellCode) == $(!SHELL_CODE_OK)
  274. ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  275. ifstr(i) $($R1) == "checked"
  276. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String15)
  277. goto patchnotdone
  278. endif
  279. endif
  280. endif
  281. ;
  282. ; Get the build and patch version for the system. If this is more than our patch
  283. ; version warn the user, allowing him to exit
  284. ;
  285. LibraryProcedure STATUS,$(!PATCHLIBHANDLE), CheckBuildVersion
  286. ifint $(STATUS) <= $(STF_NT31_BUILDVER)
  287. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) FATAL $(String16)
  288. goto patchnotdone
  289. else-ifint $(STATUS) < $(STF_NT35_BUILDVER)
  290. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) FATAL $(String17)
  291. goto patchnotdone
  292. endif
  293. ;
  294. ; Version is 807 or greater (assuming NT 3.5)
  295. ; Find out whether or not the system was updated in the past
  296. ;
  297. shell "" GetCSDVersion
  298. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  299. ifstr(i) $(BillboardPushed) == TRUE
  300. shell "subroutn.inf" PopBillboard
  301. set BillboardPushed = FALSE
  302. endif
  303. Debug-Output "PATCH.INF: Shelling GetCSDVersion failed"
  304. goto patchnotdone
  305. endif
  306. ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  307. ;
  308. ; CSD for NT 3.5 was never applied to this system.
  309. ; If this is not the first CSD for NT 3.5, then inform the user
  310. ; that he must apply CSD1 for Daytona before applying the current CSD
  311. ;
  312. Debug-Output "PATCH.INF: GetCSDVersion failed to return a value"
  313. ;
  314. ; There is no CSD 1 for PowerPC
  315. ;
  316. ifstr(i) $(!STF_PLATFORM) != ppc
  317. ifint $(!STF_CSDVER) >= $(STF_CSD1_NT35)
  318. else
  319. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) FATAL $(String18)
  320. goto patchnotdone
  321. endif
  322. endif
  323. else
  324. ;
  325. ; A CSD for NT 3.5 was applied in the past.
  326. ;
  327. ifint $($R1) > $(!STF_CSDVER)
  328. ifstr(i) $(BillboardPushed) == TRUE
  329. shell "subroutn.inf" PopBillboard
  330. set BillboardPushed = FALSE
  331. endif
  332. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) WARNING $(String8)
  333. ifstr(i) $($R1) == "OK"
  334. else
  335. goto patchnotdone
  336. endif
  337. endif
  338. endif
  339. skip_patchvercheck = +
  340. ;
  341. ; Get the NT DRIVE
  342. ;
  343. GetDriveInPath !STF_NTDRIVE $(!STF_WINDOWSSYSPATH)
  344. ;
  345. ; Check for enough disk space.
  346. ;
  347. ifint *($(VolumeFreeList), ~($(VolumeList), $(!STF_NTDRIVE))) < $(RequiredFreeWinnt)
  348. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) FATAL $(String13a)$(RequiredFreeWinnt)$(String13b)$(!STF_NTDRIVE)$(String13c)
  349. goto patchnotdone
  350. endif
  351. ;
  352. ; get the product type we are running on
  353. ;
  354. set STF_PRODUCT = ""
  355. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\ProductOptions" 33554432 KeyProductOption
  356. ifstr(i) $(KeyProductOption) != ""
  357. GetRegValue $(KeyProductOption) "ProductType" ProductTypeList
  358. set TempProductType = *($(ProductTypeList),4)
  359. ifstr(i) $(TempProductType) == "winnt"
  360. set !STF_PRODUCT = WINNT
  361. set !PRODUCT_DIR = WINNT
  362. else-ifstr(i) $(TempProductType) == "lanmannt"
  363. set !STF_PRODUCT = LANMANNT
  364. set !PRODUCT_DIR = NTAS
  365. else-ifstr(i) $(TempProductType) == "servernt"
  366. set !STF_PRODUCT = SERVERNT
  367. set !PRODUCT_DIR = NTAS
  368. endif
  369. CloseRegKey $(KeyProductOptions)
  370. endif
  371. ;
  372. ; if we are unable to determine the product type print error and exit
  373. ;
  374. ifstr(i) $(STF_PRODUCT) == ""
  375. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) FATAL $(String14)
  376. goto patchnotdone
  377. endif
  378. ;
  379. ; Find the hal and osloader destination on Mips, Alpha, and PPC
  380. ;
  381. ifstr(i) $(!STF_PLATFORM) == I386
  382. set STF_HALDEST = $(!STF_WINDOWSSYSPATH)
  383. LibraryProcedure STF_OSLDEST,$(!PATCHLIBHANDLE), GetOsLoaderDest
  384. else
  385. read-syms NVRAMVars
  386. detect NVRAMVars
  387. LibraryProcedure STATUS,$(!PATCHLIBHANDLE), GetOsLoaderDest +
  388. $(SystemPartition) +
  389. $(OsLoader) +
  390. $(OsLoadPartition) +
  391. $(OsLoadFilename)
  392. ifstr(i) $(STATUS) == ERROR
  393. goto patchnotdone
  394. else
  395. set STF_OSLDEST = $(STATUS)
  396. set STF_HALDEST = $(STATUS)
  397. endif
  398. endif
  399. ;
  400. ; Get the required information about keyed files
  401. ;
  402. read-syms FilesKeyedSections
  403. set KeyedClassKeys = ^(FileKeyedClasses, 0)
  404. set KeyedClassFiles = ^(FileKeyedClasses, 1)
  405. set KeyedClassFilesList = {}
  406. ForListDo $(KeyedClassKeys)
  407. set TmpKey = Files$($)
  408. set TmpFile = #(FileKeyedClasses, $($), 1)
  409. set TmpFilePath = $($(TmpKey))\$(TmpFile)
  410. set KeyedClassFilesList = >($(KeyedClassFilesList), $(TmpFilePath))
  411. EndForListDo
  412. LibraryProcedure STATUS,$(!PATCHLIBHANDLE), GetFileTypes $(KeyedClassFilesList)
  413. ifstr(i) $(STATUS) == ERROR
  414. goto patchnotdone
  415. else-ifstr(i) $(STATUS) == SETUPLOGNOTPRESENT
  416. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) FATAL $(String11)
  417. goto patchnotdone
  418. else
  419. ForListDo $(KeyedClassKeys)
  420. set $($)Type = *($(STATUS), $(#))
  421. EndForListDo
  422. endif
  423. ;
  424. ; Warn the user about the patch process..
  425. ;
  426. ifstr(i) $(BillboardPushed) == TRUE
  427. shell "subroutn.inf" PopBillboard
  428. set BillboardPushed = FALSE
  429. endif
  430. shell "" QueryOkCancel $(String9)
  431. ifstr(i) $($R1) == "OK"
  432. else
  433. set String = $(String12)
  434. goto finish2
  435. endif
  436. shell "subroutn.inf" PushBillboard STATUSDLG $(Billboard2)
  437. set BillboardPushed = TRUE
  438. ;
  439. ; initialize copy
  440. ;
  441. set MoveFileExList = {}
  442. ;
  443. ; Run through the directory list adding files to the copy list
  444. ;
  445. read-syms FileSections
  446. set FileSectionsList = ^(FileSections, 0)
  447. set FileSource = $(!STF_SRCDIR)
  448. ForListDo $(FileSectionsList)
  449. set FileSection = $($)
  450. set FileDest = $($($))
  451. set FileList = ^($(FileSection), 0)
  452. ForListDo $(FileList)
  453. set FileKey = $($)
  454. set File = #($(FileSection), $(FileKey), 2)
  455. set FileDestFullPath = $(FileDest)\$(File)
  456. ;
  457. ; Check to see if file exists, if it is does not exist, it doesn't
  458. ; need to be copied over
  459. LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FileDestFullPath)
  460. ifstr(i) $(STATUS) == YES
  461. ; DEBUG
  462. ;
  463. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Examining to see if file opened excl: "$(FileDestFullPath)
  464. ;
  465. ; DEBUG END
  466. LibraryProcedure STATUS, $(!PATCHLIBHANDLE), IsFileOpenedExclusive $(FileDestFullPath)
  467. ifstr(i) $(STATUS) == ERROR
  468. goto patchnotdone
  469. else
  470. ifstr(i) $(STATUS) == "YES"
  471. LibraryProcedure NEWFILE, $(!PATCHLIBHANDLE), GenerateTemporary $(FileDest)
  472. ifstr(i) $(NEWFILE) == ERROR
  473. goto patchnotdone
  474. else
  475. set FileComp = {$(FileDest)\$(NEWFILE), $(FileDestFullPath)}
  476. ; DEBUG
  477. ;
  478. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Adding to movefile ex list: "$(FileComp)
  479. ;
  480. ; DEBUG END
  481. set MoveFileExList = >($(MoveFileExList), $(FileComp))
  482. endif
  483. else
  484. set NEWFILE = $(File)
  485. endif
  486. ; DEBUG
  487. ;
  488. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Copying File Section: "$(FileSection)" : Key: "$(FileKey)" Source: "$(FileSource)" Dest: "$(FileDest)" rename = "$(NEWFILE)
  489. ;
  490. ; DEBUG END
  491. install Install-File
  492. endif
  493. endif
  494. EndForListDo
  495. EndForListDO
  496. ;
  497. ; Add the keyed sections to the copy list
  498. ;
  499. set FileSource = $(!STF_SRCDIR)
  500. ForListDo $(KeyedClassKeys)
  501. set FileSection = Files$($)
  502. set FileDest = $($(FileSection))
  503. set FileKey = $($($)Type)
  504. set KeyedClassChoices = ^(Files$($), 0)
  505. ifcontains(i) $(FileKey) in $(KeyedClassChoices)
  506. set File = #(FileKeyedClasses, $($), 1)
  507. set FileDestFullPath = $(FileDest)\$(File)
  508. ;
  509. ; Check to see if file exists, if it is does not exist, it doesn't
  510. ; need to be copied over
  511. LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FileDestFullPath)
  512. ifstr(i) $(STATUS) == YES
  513. ; DEBUG
  514. ;
  515. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Examining to see if file opened excl: "$(FileDestFullPath)
  516. ;
  517. ; DEBUG END
  518. LibraryProcedure STATUS, $(!PATCHLIBHANDLE), IsFileOpenedExclusive $(FileDestFullPath)
  519. ifstr(i) $(STATUS) == ERROR
  520. goto patchnotdone
  521. else
  522. ifstr(i) $(STATUS) == "YES"
  523. LibraryProcedure NEWFILE, $(!PATCHLIBHANDLE), GenerateTemporary $(FileDest)
  524. ifstr(i) $(NEWFILE) == ERROR
  525. goto patchnotdone
  526. else
  527. set FileComp = {$(FileDest)\$(NEWFILE), $(FileDestFullPath)}
  528. ; DEBUG
  529. ;
  530. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Adding to movefile ex list: "$(FileComp)
  531. ;
  532. ; DEBUG END
  533. set MoveFileExList = >($(MoveFileExList), $(FileComp))
  534. endif
  535. else
  536. set NEWFILE = $(File)
  537. endif
  538. ; DEBUG
  539. ;
  540. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Copying File Section: "$(FileSection)" : Key: "$(FileKey)" Source: "$(FileSource)" Dest: "$(FileDest)" rename = "$(NEWFILE)
  541. ;
  542. ; DEBUG END
  543. install Install-File
  544. endif
  545. endif
  546. endif
  547. EndForListDo
  548. ;
  549. ; add product specific files to the copy list
  550. ;
  551. ; ServerNT and LanmanNT share the same files
  552. ;
  553. ifstr(i) $(STF_PRODUCT) == "WINNT"
  554. set TEMP_PRODUCT = WINNT
  555. else
  556. set TEMP_PRODUCT = LANMANNT
  557. endif
  558. read-syms FileSections$(TEMP_PRODUCT)
  559. set FileSectionsList = ^(FileSections$(TEMP_PRODUCT), 0)
  560. set FileSource = $(!STF_SRCDIR)$(PRODUCT_DIR)
  561. ForListDo $(FileSectionsList)
  562. set FileSection = $($)
  563. set FileDest = $($($))
  564. set FileList = ^($(FileSection), 0)
  565. ForListDo $(FileList)
  566. set FileKey = $($)
  567. set File = #($(FileSection), $(FileKey), 2)
  568. set FileDestFullPath = $(FileDest)\$(File)
  569. ;
  570. ; Check to see if file exists, if it is does not exist, it doesn't
  571. ; need to be copied over
  572. LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FileDestFullPath)
  573. ifstr(i) $(STATUS) == YES
  574. ; DEBUG
  575. ;
  576. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Examining to see if file opened excl: "$(FileDestFullPath)
  577. ;
  578. ; DEBUG END
  579. LibraryProcedure STATUS, $(!PATCHLIBHANDLE), IsFileOpenedExclusive $(FileDestFullPath)
  580. ifstr(i) $(STATUS) == ERROR
  581. goto patchnotdone
  582. else
  583. ifstr(i) $(STATUS) == "YES"
  584. LibraryProcedure NEWFILE, $(!PATCHLIBHANDLE), GenerateTemporary $(FileDest)
  585. ifstr(i) $(NEWFILE) == ERROR
  586. goto patchnotdone
  587. else
  588. set FileComp = {$(FileDest)\$(NEWFILE), $(FileDestFullPath)}
  589. ; DEBUG
  590. ;
  591. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Adding to movefile ex list: "$(FileComp)
  592. ;
  593. ; DEBUG END
  594. set MoveFileExList = >($(MoveFileExList), $(FileComp))
  595. endif
  596. else
  597. set NEWFILE = $(File)
  598. endif
  599. ; DEBUG
  600. ;
  601. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "Copying File Section: "$(FileSection)" : Key: "$(FileKey)" Source: "$(FileSource)" Dest: "$(FileDest)" rename = "$(NEWFILE)
  602. ;
  603. ; DEBUG END
  604. install Install-File
  605. endif
  606. endif
  607. EndForListDo
  608. EndForListDO
  609. ifstr(i) $(BillboardPushed) == TRUE
  610. shell "subroutn.inf" PopBillboard
  611. set BillboardPushed = FALSE
  612. endif
  613. ;
  614. ; add the files which are always copied
  615. ;
  616. read-syms FileSectionsCopyAlways
  617. set FileSectionsList = ^(FileSectionsCopyAlways, 0)
  618. set FileSource = $(!STF_SRCDIR)
  619. ForListDo $(FileSectionsList)
  620. set FileSection = $($)
  621. set FileDest = $($($))
  622. set FileList = ^($(FileSection), 0)
  623. ForListDo $(FileList)
  624. set FileKey = $($)
  625. set File = #($(FileSection), $(FileKey), 2)
  626. set NEWFILE = $(File)
  627. set FileDestFullPath = $(FileDest)\$(File)
  628. install Install-File
  629. EndForListDo
  630. EndForListDO
  631. ;
  632. ; Do the copy
  633. ;
  634. read-syms ProgressCopy$(!STF_LANGUAGE)
  635. install Install-DoCopy
  636. ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  637. goto patchnotdone
  638. else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  639. goto patchnotdone
  640. endif
  641. ;
  642. ; Process the Attributes List
  643. ;
  644. set FileSection = "FileAttributes";
  645. set FileList = ^(FileSection, 0)
  646. ForListDo $(FileList)
  647. set FileKey = $($)
  648. set File = #($(FileSection), $(FileKey), 2)
  649. set FileDest = #($(FileSection), $(FileKey), 3)
  650. set FilePerms = #($(FileSection), $(FileKey), 4)
  651. set FileDestFullPath = $(FileDest)\$(File)
  652. ifstr(i) $(FilePerms) != ""
  653. LibraryProcedure STATUS,$(!PATCHLIBHANDLE),ChangeFileAttributes $(FilePerms) $(FileDestFullPath)
  654. endif
  655. EndForListDo
  656. processmovefileex=+
  657. ;
  658. ; Process MoveFileExList
  659. ;
  660. ForListDo $(MoveFileExList)
  661. ;
  662. set ExistingPath = *($($), 1)
  663. set NewPath = *($($), 2)
  664. ; DEBUG
  665. ;
  666. ;shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "STATUS" "CopyFileOnReboot "$(ExistingPath)" to "$(NewPath)
  667. ;
  668. ; DEBUG END
  669. LibraryProcedure STATUS, $(!PATCHLIBHANDLE), CopyFileOnReboot $(ExistingPath) $(NewPath)
  670. ifstr(i) $(STATUS) == ERROR
  671. goto patchnotdone
  672. endif
  673. EndForListDo
  674. patchdone =+
  675. ifstr(i) $(BillboardPushed) == TRUE
  676. shell "subroutn.inf" PopBillboard
  677. set BillboardPushed = FALSE
  678. endif
  679. ;
  680. ; do the registry modifications needed
  681. ;
  682. shell "" DoRegistryModifications $(!STF_CSDVER)
  683. read-syms SetupDoneDlg$(!STF_LANGUAGE)
  684. ui start "SetupDone"
  685. ifstr(i) $(DLGEVENT) == "CONTINUE"
  686. ui pop 1
  687. goto rebootend
  688. else
  689. ui pop 1
  690. goto finish1
  691. endif
  692. patchnotdone =+
  693. set String = $(String2)
  694. finish2 =+
  695. ifstr(i) $(BillboardPushed) == TRUE
  696. shell "subroutn.inf" PopBillboard
  697. set BillboardPushed = FALSE
  698. endif
  699. shell "subroutn.inf" SetupMessage $(STF_LANGUAGE) "FATAL" $(String)
  700. goto finish1
  701. finish1 =+
  702. ;
  703. ; Free the library support
  704. ;
  705. install FreeSetupLibrary
  706. finish =+
  707. install FreePatchLibrary
  708. exit
  709. rebootend =+
  710. set Reboot = YES
  711. install Install-Shutdown
  712. goto finish1
  713. exit
  714. ;-----------------------------------------------------------------------
  715. ; INSTALL HELPERS
  716. ;-----------------------------------------------------------------------
  717. [LoadPatchLibrary]
  718. LoadLibrary "x" patchdll.dll !PATCHLIBHANDLE
  719. exit
  720. [FreePatchLibrary]
  721. ifstr(i) $(!PATCHLIBHANDLE) != ""
  722. FreeLibrary $(!PATCHLIBHANDLE)
  723. endif
  724. exit
  725. [LoadSetupLibrary]
  726. LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  727. exit
  728. [FreeSetupLibrary]
  729. ifstr(i) $(!LIBHANDLE) != ""
  730. FreeLibrary $(!LIBHANDLE)
  731. endif
  732. exit
  733. [Install-File]
  734. set STF_VITAL = ""
  735. AddSectionKeyFileToCopyList $(FileSection) $(FileKey) $(FileSource) $(FileDest)
  736. exit
  737. [Install-DoCopy]
  738. CopyFilesInCopyList
  739. exit
  740. [Install-Shutdown]
  741. ;
  742. LibraryProcedure STATUS,$(!LIBHANDLE),ShutdownSystem $(Reboot)
  743. exit
  744. ;-----------------------------------------------------------------------
  745. ; REGISTRY SUBROUTINES
  746. ;-----------------------------------------------------------------------
  747. [RegistryConstants]
  748. MaskAllAccess = 33554432
  749. NoTitle = 0
  750. RegLastError = $(!REG_ERROR_SUCCESS)
  751. ;-----------------------------------------------------------------------
  752. ; ROUTINE: DoRegistryModifications
  753. ;
  754. ; DESCRIPTION: Does the registry modifications needed.
  755. ; - Sets the compatibility flags for the postcript stuff
  756. ; - Creates an entry for the WinNT software.
  757. ;
  758. ; INPUTS: $0: CSD Version #
  759. ;
  760. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL
  761. ; STATUS_FAILED
  762. ;
  763. ;------------------------------------------------------------------------
  764. [DoRegistryModifications]
  765. set Status = STATUS_FAILED
  766. read-syms RegistryConstants
  767. ;
  768. ; Modify the compatibility flags..
  769. ;
  770. set KeyPath = { +
  771. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  772. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  773. {"Windows NT", $(NoTitle), $(MaskAllAccess)}, +
  774. {CurrentVersion, $(NoTitle), $(MaskAllAccess)}, +
  775. {WOW, $(NoTitle), $(MaskAllAccess)}, +
  776. {Compatibility, $(NoTitle), $(MaskAllAccess)} +
  777. }
  778. ;
  779. ; Form the value info structures for the WinNT entry
  780. ;
  781. set KeyValues = { +
  782. {FH3, $(NoTitle), $(!REG_VT_SZ), "0x00004000" } +
  783. }
  784. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  785. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  786. goto endCSDVersionCreate
  787. endif
  788. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  789. goto endCSDVersionCreate
  790. else
  791. CloseRegKey $($R1)
  792. endif
  793. ;
  794. ; Modify the values of DosKeybIDs..
  795. ;
  796. set KeyPath = { +
  797. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  798. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  799. {Control, $(NoTitle), $(MaskAllAccess)}, +
  800. {"Keyboard Layout", $(NoTitle), $(MaskAllAccess)}, +
  801. {DosKeybIDs, $(NoTitle), $(MaskAllAccess)} +
  802. }
  803. ;
  804. ; Form the value info structures for the DosKeybIDs entry
  805. ;
  806. set KeyValues = { +
  807. {0000041F, $(NoTitle), $(!REG_VT_SZ), "179" } +
  808. {0001041F, $(NoTitle), $(!REG_VT_SZ), "440" } +
  809. }
  810. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  811. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  812. goto endCSDVersionCreate
  813. endif
  814. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  815. goto endCSDVersionCreate
  816. else
  817. CloseRegKey $($R1)
  818. endif
  819. ;
  820. ; Modify the value of Romance Standard Time
  821. ;
  822. set KeyPath = { +
  823. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  824. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  825. {"Windows NT", $(NoTitle), $(MaskAllAccess)}, +
  826. {CurrentVersion, $(NoTitle), $(MaskAllAccess)}, +
  827. {"Time Zones", $(NoTitle), $(MaskAllAccess)}, +
  828. {"Romance Standard Time", $(NoTitle), $(MaskAllAccess)} +
  829. }
  830. ;
  831. ; Form the value info structures for the Romance Standard Time entry
  832. ;
  833. set KeyValues = { +
  834. {TZI, $(NoTitle), $(!REG_VT_BIN), { +
  835. "196","255","255","255", +
  836. "000","000","000","000", +
  837. "196","255","255","255", +
  838. "000","000","009","000", +
  839. "000","000","005","000", +
  840. "000","000","000","000", +
  841. "000","000","000","000", +
  842. "000","000","003","000", +
  843. "000","000","005","000", +
  844. "000","000","000","000", +
  845. "000","000","000","000" +
  846. } +
  847. } +
  848. }
  849. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  850. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  851. goto endCSDVersionCreate
  852. endif
  853. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  854. goto endCSDVersionCreate
  855. else
  856. CloseRegKey $($R1)
  857. endif
  858. ;
  859. ; Modify the value of GFT Standard Time
  860. ;
  861. set KeyPath = { +
  862. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  863. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  864. {"Windows NT", $(NoTitle), $(MaskAllAccess)}, +
  865. {CurrentVersion, $(NoTitle), $(MaskAllAccess)}, +
  866. {"Time Zones", $(NoTitle), $(MaskAllAccess)}, +
  867. {"GFT Standard Time", $(NoTitle), $(MaskAllAccess)} +
  868. }
  869. ;
  870. ; Form the value info structures for the GFT Standard Time entry
  871. ;
  872. set KeyValues = { +
  873. {TZI, $(NoTitle), $(!REG_VT_BIN), { +
  874. "136","255","255","255", +
  875. "000","000","000","000", +
  876. "196","255","255","255", +
  877. "000","000","009","000", +
  878. "000","000","005","000", +
  879. "000","000","000","000", +
  880. "000","000","000","000", +
  881. "000","000","003","000", +
  882. "000","000","005","000", +
  883. "000","000","000","000", +
  884. "000","000","000","000" +
  885. } +
  886. } +
  887. }
  888. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  889. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  890. goto endCSDVersionCreate
  891. endif
  892. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  893. goto endCSDVersionCreate
  894. else
  895. CloseRegKey $($R1)
  896. endif
  897. ;
  898. ; Modify the value of Central Asia Standard Time
  899. ;
  900. set KeyPath = { +
  901. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  902. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  903. {"Windows NT", $(NoTitle), $(MaskAllAccess)}, +
  904. {CurrentVersion, $(NoTitle), $(MaskAllAccess)}, +
  905. {"Time Zones", $(NoTitle), $(MaskAllAccess)}, +
  906. {"Central Asia Standard Time", $(NoTitle), $(MaskAllAccess)} +
  907. }
  908. ;
  909. ; Form the value info structures for the GFT Standard Time entry
  910. ;
  911. set KeyValues = { +
  912. {Display, $(NoTitle), $(!REG_VT_SZ), "(GMT+06:00) Almaty, Dhaka" } +
  913. }
  914. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  915. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  916. goto endCSDVersionCreate
  917. endif
  918. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  919. goto endCSDVersionCreate
  920. else
  921. CloseRegKey $($R1)
  922. endif
  923. ;
  924. ; Modify the value of E. South America Standard Time
  925. ;
  926. set KeyPath = { +
  927. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  928. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  929. {"Windows NT", $(NoTitle), $(MaskAllAccess)}, +
  930. {CurrentVersion, $(NoTitle), $(MaskAllAccess)}, +
  931. {"Time Zones", $(NoTitle), $(MaskAllAccess)}, +
  932. {"E. South America Standard Time", $(NoTitle), $(MaskAllAccess)} +
  933. }
  934. ;
  935. ; Form the value info structures for the GFT Standard Time entry
  936. ;
  937. set KeyValues = { +
  938. {Display, $(NoTitle), $(!REG_VT_SZ), "(GMT-03:00) Brazilia" } +
  939. }
  940. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  941. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  942. goto endCSDVersionCreate
  943. endif
  944. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  945. goto endCSDVersionCreate
  946. else
  947. CloseRegKey $($R1)
  948. endif
  949. ;
  950. ; Modify the value of win.ini\windows
  951. ;
  952. set KeyPath = { +
  953. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  954. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  955. {"Windows NT", $(NoTitle), $(MaskAllAccess)}, +
  956. {CurrentVersion, $(NoTitle), $(MaskAllAccess)}, +
  957. {IniFileMapping, $(NoTitle), $(MaskAllAccess)}, +
  958. {win.ini, $(NoTitle), $(MaskAllAccess)}, +
  959. {Windows, $(NoTitle), $(MaskAllAccess)} +
  960. }
  961. ;
  962. ; Form the value info structure
  963. ;
  964. set KeyValues = { +
  965. {SnapToDefaultButton, $(NoTitle), $(!REG_VT_SZ), "#USR:Control Panel\Mouse" } +
  966. }
  967. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  968. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  969. goto endCSDVersionCreate
  970. endif
  971. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  972. goto endCSDVersionCreate
  973. else
  974. CloseRegKey $($R1)
  975. endif
  976. ;
  977. ; Modify the value of Providers
  978. ;
  979. set KeyPath = { +
  980. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  981. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  982. {Control, $(NoTitle), $(MaskAllAccess)}, +
  983. {Print, $(NoTitle), $(MaskAllAccess)}, +
  984. {Providers, $(NoTitle), $(MaskAllAccess)} +
  985. }
  986. ;
  987. ; Form the value info structure
  988. ;
  989. set KeyValues = { +
  990. {RouterCacheSize, $(NoTitle), $(!REG_VT_DWORD), 5 } +
  991. }
  992. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  993. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  994. goto endCSDVersionCreate
  995. endif
  996. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  997. goto endCSDVersionCreate
  998. else
  999. CloseRegKey $($R1)
  1000. endif
  1001. ;
  1002. ; Modify the value of ServiceGroupOrder
  1003. ;
  1004. set KeyPath = { +
  1005. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1006. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1007. {Control, $(NoTitle), $(MaskAllAccess)}, +
  1008. {ServiceGroupOrder, $(NoTitle), $(MaskAllAccess)} +
  1009. }
  1010. ;
  1011. ; Form the value info structure
  1012. ;
  1013. set KeyValues = { +
  1014. {List, $(NoTitle), $(!REG_VT_MULTI_SZ), { +
  1015. "SCSI miniport", +
  1016. "port", +
  1017. "Primary disk", +
  1018. "SCSI class", +
  1019. "SCSI CDROM class", +
  1020. "filter", +
  1021. "boot file system", +
  1022. "Base", +
  1023. "Pointer Port", +
  1024. "Keyboard Port", +
  1025. "Pointer Class", +
  1026. "Keyboard Class", +
  1027. "Video Init", +
  1028. "Video", +
  1029. "Video Save", +
  1030. "file system", +
  1031. "Event log", +
  1032. "Streams Drivers", +
  1033. "NDIS", +
  1034. "TDI", +
  1035. "NetBIOSGroup", +
  1036. "SpoolerGroup", +
  1037. "NetDDEGroup", +
  1038. "Parallel arbitrator", +
  1039. "extended base", +
  1040. "RemoteValidation", +
  1041. "PCI Configuration" +
  1042. } } +
  1043. }
  1044. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1045. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1046. goto endCSDVersionCreate
  1047. endif
  1048. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1049. goto endCSDVersionCreate
  1050. else
  1051. CloseRegKey $($R1)
  1052. endif
  1053. ;
  1054. ; Modify the value of Session Manager
  1055. ;
  1056. set KeyPath = { +
  1057. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1058. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1059. {Control, $(NoTitle), $(MaskAllAccess)}, +
  1060. {"Session Manager", $(NoTitle), $(MaskAllAccess)} +
  1061. }
  1062. ;
  1063. ; Form the value info structure
  1064. ;
  1065. set KeyValues = { +
  1066. {GlobalFlag, $(NoTitle), $(!REG_VT_DWORD), 0 } +
  1067. }
  1068. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1069. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1070. goto endCSDVersionCreate
  1071. endif
  1072. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1073. goto endCSDVersionCreate
  1074. else
  1075. CloseRegKey $($R1)
  1076. endif
  1077. ;
  1078. ; Modify the value of Memory Management
  1079. ;
  1080. set KeyPath = { +
  1081. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1082. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1083. {Control, $(NoTitle), $(MaskAllAccess)}, +
  1084. {"Session Manager", $(NoTitle), $(MaskAllAccess)}, +
  1085. {"Memory Management", $(NoTitle), $(MaskAllAccess)} +
  1086. }
  1087. ;
  1088. ; Form the value info structure
  1089. ;
  1090. set KeyValues = { +
  1091. {DisablePagingExecutive, $(NoTitle), $(!REG_VT_DWORD), 0 } +
  1092. }
  1093. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1094. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1095. goto endCSDVersionCreate
  1096. endif
  1097. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1098. goto endCSDVersionCreate
  1099. else
  1100. CloseRegKey $($R1)
  1101. endif
  1102. ;
  1103. ; Modify the value of Device0
  1104. ;
  1105. set KeyPath = { +
  1106. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1107. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1108. {Services, $(NoTitle), $(MaskAllAccess)}, +
  1109. {et4000, $(NoTitle), $(MaskAllAccess)}, +
  1110. {Device0, $(NoTitle), $(MaskAllAccess)} +
  1111. }
  1112. ;
  1113. ; Form the value info structure
  1114. ;
  1115. set KeyValues = { +
  1116. {InstalledDisplayDrivers, $(NoTitle), $(!REG_VT_MULTI_SZ), { +
  1117. "vga", +
  1118. "w32", +
  1119. "vga256", +
  1120. "vga64k" +
  1121. } } +
  1122. }
  1123. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1124. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1125. goto endCSDVersionCreate
  1126. endif
  1127. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1128. goto endCSDVersionCreate
  1129. else
  1130. CloseRegKey $($R1)
  1131. endif
  1132. ;
  1133. ; Modify the value of tga
  1134. ;
  1135. set KeyPath = { +
  1136. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1137. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1138. {Services, $(NoTitle), $(MaskAllAccess)}, +
  1139. {tga, $(NoTitle), $(MaskAllAccess)} +
  1140. }
  1141. ;
  1142. ; Form the value info structure
  1143. ;
  1144. set KeyValues = { +
  1145. {Type, $(NoTitle), $(!REG_VT_DWORD), 1 } +
  1146. {Start, $(NoTitle), $(!REG_VT_DWORD), 1 } +
  1147. {ErrorControl, $(NoTitle), $(!REG_VT_DWORD), 0 } +
  1148. {Group, $(NoTitle), $(!REG_VT_SZ), "Video" } +
  1149. }
  1150. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1151. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1152. goto endCSDVersionCreate
  1153. endif
  1154. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1155. goto endCSDVersionCreate
  1156. else
  1157. CloseRegKey $($R1)
  1158. endif
  1159. ;
  1160. ; Modify the value of tga\Device0
  1161. ;
  1162. set KeyPath = { +
  1163. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1164. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1165. {Services, $(NoTitle), $(MaskAllAccess)}, +
  1166. {tga, $(NoTitle), $(MaskAllAccess)}, +
  1167. {Device0, $(NoTitle), $(MaskAllAccess)}, +
  1168. }
  1169. ;
  1170. ; Form the value info structure
  1171. ;
  1172. set KeyValues = { +
  1173. {VgaCompatible, $(NoTitle), $(!REG_VT_DWORD), 0 } +
  1174. {InstalledDisplayDrivers,$(NoTitle), $(!REG_VT_MULTI_SZ), {"tga"} } +
  1175. }
  1176. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1177. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1178. goto endCSDVersionCreate
  1179. endif
  1180. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1181. goto endCSDVersionCreate
  1182. else
  1183. CloseRegKey $($R1)
  1184. endif
  1185. ;
  1186. ; Modify the value of PCIDump
  1187. ;
  1188. set KeyPath = { +
  1189. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1190. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1191. {Services, $(NoTitle), $(MaskAllAccess)}, +
  1192. {PCIDump, $(NoTitle), $(MaskAllAccess)} +
  1193. }
  1194. ;
  1195. ; Form the value info structure
  1196. ;
  1197. set KeyValues = { +
  1198. {ErrorControl, $(NoTitle), $(!REG_VT_DWORD), 0 } +
  1199. {Group, $(NoTitle), $(!REG_VT_SZ), "PCI Configuration" } +
  1200. {Start, $(NoTitle), $(!REG_VT_DWORD), 1 } +
  1201. {Tag, $(NoTitle), $(!REG_VT_DWORD), 1 } +
  1202. {Type, $(NoTitle), $(!REG_VT_DWORD), 1 } +
  1203. }
  1204. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1205. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1206. goto endCSDVersionCreate
  1207. endif
  1208. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1209. goto endCSDVersionCreate
  1210. else
  1211. CloseRegKey $($R1)
  1212. endif
  1213. ;
  1214. ; Modify the value of Classes\CLSID\{00022601-0000-0000-C000-000000000046}
  1215. ;
  1216. set KeyPath = { +
  1217. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  1218. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  1219. {Classes, $(NoTitle), $(MaskAllAccess)}, +
  1220. {CLSID, $(NoTitle), $(MaskAllAccess)}, +
  1221. {"{00022601-0000-0000-C000-000000000046}", $(NoTitle), $(MaskAllAccess)} +
  1222. }
  1223. ;
  1224. ; Form the value info structures for the Media Clip entry
  1225. ;
  1226. set KeyValues = { +
  1227. {"", $(NoTitle), $(!REG_VT_SZ), "Media Clip" } +
  1228. }
  1229. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1230. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1231. goto endCSDVersionCreate
  1232. endif
  1233. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1234. goto endCSDVersionCreate
  1235. else
  1236. CloseRegKey $($R1)
  1237. endif
  1238. ;
  1239. ; Modify the value of Classes\CLSID\{00022601-0000-0000-C000-000000000046}\verb\2
  1240. ;
  1241. set KeyPath = { +
  1242. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  1243. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  1244. {Classes, $(NoTitle), $(MaskAllAccess)}, +
  1245. {CLSID, $(NoTitle), $(MaskAllAccess)}, +
  1246. {"{00022601-0000-0000-C000-000000000046}", $(NoTitle), $(MaskAllAccess)} +
  1247. {verb, $(NoTitle), $(MaskAllAccess)} +
  1248. {2, $(NoTitle), $(MaskAllAccess)} +
  1249. }
  1250. ;
  1251. ; Form the value info structures for the entry
  1252. ;
  1253. set KeyValues = { +
  1254. {"", $(NoTitle), $(!REG_VT_SZ), "&Open,0,2" } +
  1255. }
  1256. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1257. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1258. goto endCSDVersionCreate
  1259. endif
  1260. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1261. goto endCSDVersionCreate
  1262. else
  1263. CloseRegKey $($R1)
  1264. endif
  1265. ;
  1266. ; Modify the value of Classes\MPlayer\protocol\StdFileEditing\Verb\2
  1267. ;
  1268. set KeyPath = { +
  1269. {SOFTWARE, $(NoTitle), $(MaskAllAccess)}, +
  1270. {Microsoft, $(NoTitle), $(MaskAllAccess)}, +
  1271. {Classes, $(NoTitle), $(MaskAllAccess)}, +
  1272. {MPlayer, $(NoTitle), $(MaskAllAccess)}, +
  1273. {protocol, $(NoTitle), $(MaskAllAccess)}, +
  1274. {StdFileEditing, $(NoTitle), $(MaskAllAccess)}, +
  1275. {verb, $(NoTitle), $(MaskAllAccess)} +
  1276. {2, $(NoTitle), $(MaskAllAccess)} +
  1277. }
  1278. ;
  1279. ; Form the value info structures for the entry
  1280. ;
  1281. set KeyValues = { +
  1282. {"", $(NoTitle), $(!REG_VT_SZ), "&Open" } +
  1283. }
  1284. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1285. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1286. goto endCSDVersionCreate
  1287. endif
  1288. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1289. goto endCSDVersionCreate
  1290. else
  1291. CloseRegKey $($R1)
  1292. endif
  1293. ;
  1294. ; Modify the value of qv\Device0
  1295. ;
  1296. set KeyPath = { +
  1297. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1298. {ControlSet001, $(NoTitle), $(MaskAllAccess)}, +
  1299. {Services, $(NoTitle), $(MaskAllAccess)}, +
  1300. {qv, $(NoTitle), $(MaskAllAccess)}, +
  1301. {Device0, $(NoTitle), $(MaskAllAccess)}, +
  1302. }
  1303. ;
  1304. ; Form the value info structure
  1305. ;
  1306. set KeyValues = { +
  1307. {InstalledDisplayDrivers,$(NoTitle), $(!REG_VT_MULTI_SZ), {"vga", "qv"} } +
  1308. }
  1309. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1310. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1311. goto endCSDVersionCreate
  1312. endif
  1313. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1314. goto endCSDVersionCreate
  1315. else
  1316. CloseRegKey $($R1)
  1317. endif
  1318. ;
  1319. ; Form the path up to the version key
  1320. ;
  1321. set KeyPath = { +
  1322. {SYSTEM, $(NoTitle), $(MaskAllAccess)}, +
  1323. {CurrentControlSet, $(NoTitle), $(MaskAllAccess)}, +
  1324. {Control, $(NoTitle), $(MaskAllAccess)}, +
  1325. {ProductOptions, $(NoTitle), $(MaskAllAccess)}, +
  1326. }
  1327. ;
  1328. ; Form the value info structures for the WinNT entry
  1329. ; Note that for NT 3.5, the CSD version goes into the high order word
  1330. ;
  1331. set KeyValues = { +
  1332. {CSDVersion, $(NoTitle), $(!REG_VT_DWORD), $($0) } +
  1333. }
  1334. shell "registry.inf" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  1335. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1336. goto endCSDVersionCreate
  1337. endif
  1338. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1339. goto endCSDVersionCreate
  1340. else
  1341. CloseRegKey $($R1)
  1342. endif
  1343. set Status = STATUS_SUCCESSFUL
  1344. endCSDVersionCreate = +
  1345. Return $(Status)
  1346. ;-----------------------------------------------------------------------
  1347. ; ROUTINE: GetCSDVersion
  1348. ;
  1349. ; DESCRIPTION: Reads the software entry to find out what the CSD Patch Version
  1350. ; is
  1351. ;
  1352. ; INPUTS: $0: None
  1353. ;
  1354. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL
  1355. ; STATUS_FAILED
  1356. ;
  1357. ; $R1: CSDVersion
  1358. ;
  1359. ;------------------------------------------------------------------------
  1360. [GetCSDVersion]
  1361. set Status = STATUS_SUCCESSFUL
  1362. read-syms RegistryConstants
  1363. set CSDVersion = 0
  1364. ;
  1365. ; Open the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
  1366. ; key
  1367. set KeyName = "SYSTEM\CurrentControlSet\ProductOptions"
  1368. OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  1369. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1370. Debug-Output "REGISTRY.INF: Couldn't open windows nt software key for read access"
  1371. goto end_GetCSDVersion
  1372. endif
  1373. ;
  1374. ; read the csdversion entry
  1375. ;
  1376. GetRegValue $(KeyHandle) "CSDVersion" CSDVersionValue
  1377. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1378. CloseRegKey $(KeyHandle)
  1379. goto end_GetCSDVersion
  1380. endif
  1381. set CSDVersion = *($(CSDVersionValue), 4)
  1382. CloseRegKey $(KeyHandle)
  1383. end_GetCSDVersion = +
  1384. Return $(Status) $(CSDVersion)
  1385. ;-----------------------------------------------------------------------
  1386. ; ROUTINE: GetCheckedFree
  1387. ;
  1388. ; DESCRIPTION: Reads the software entry to find out whether the system
  1389. ; is checked / free.
  1390. ;
  1391. ; INPUTS: $0: None
  1392. ;
  1393. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL
  1394. ; STATUS_FAILED
  1395. ;
  1396. ; $R1: Checked | Free
  1397. ;
  1398. ;------------------------------------------------------------------------
  1399. [GetCheckedFree]
  1400. set Status = STATUS_SUCCESSFUL
  1401. read-syms RegistryConstants
  1402. set System = Free
  1403. ;
  1404. ; Open the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
  1405. ; key
  1406. set KeyName = "Software\Microsoft\Windows NT\CurrentVersion"
  1407. OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  1408. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1409. Debug-Output "REGISTRY.INF: Couldn't open windows nt software key for read access"
  1410. goto end_GetCheckedFree
  1411. endif
  1412. ;
  1413. ; read the currenttype value
  1414. ;
  1415. GetRegValue $(KeyHandle) "CurrentType" CurrentTypeValue
  1416. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1417. CloseRegKey $(KeyHandle)
  1418. goto end_GetCheckedFree
  1419. endif
  1420. ;
  1421. ; split the currenttype value and see if the split string has "free" or
  1422. ; "checked" in it
  1423. ;
  1424. Split-String *($(CurrentTypeValue), 4) " " CurrentTypeList
  1425. ForListDo $(CurrentTypeList)
  1426. ifstr(i) $($) == "free"
  1427. set System = free
  1428. else-ifstr(i) $($) == "checked"
  1429. set System = checked
  1430. endif
  1431. EndForListDo
  1432. CloseRegKey $(KeyHandle)
  1433. end_GetCheckedFree = +
  1434. Return $(Status) $(System)
  1435. ;-----------------------------------------------------------------------
  1436. ; ROUTINE: QueryOkCancel
  1437. ;
  1438. ; DESCRIPTION: This routine lets the user query OK / Cancel giving OK as
  1439. ; default
  1440. ;
  1441. ; INPUTS: $0: MessageText.
  1442. ;
  1443. ; OUTPUTS: $R0: STATUS: STATUS_SUCCESSFUL |
  1444. ; STATUS_NOLANGUAGE
  1445. ; STATUS_FAILED
  1446. ;
  1447. ; $R1: DLGEVENT: OK | CANCEL
  1448. ;
  1449. ;------------------------------------------------------------------------
  1450. [QueryOkCancel]
  1451. set DlgText = $($0)
  1452. read-syms QueryOKCancelDlg$(!STF_LANGUAGE)
  1453. ui start "SetupMessage"
  1454. ifstr(i) $(DLGEVENT) == "OK"
  1455. set Status = STATUS_SUCCESSFUL
  1456. set UserAction = $(DLGEVENT)
  1457. else-ifstr(i) $(DLGEVENT) == "CANCEL"
  1458. set Status = STATUS_SUCCESSFUL
  1459. set UserAction = $(DLGEVENT)
  1460. else
  1461. set Status = STATUS_FAILED
  1462. set UserAction = "CANCEL"
  1463. endif
  1464. Return $(Status) $(UserAction)