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.

584 lines
17 KiB

  1. ;=====================================================================
  2. ; THIS INF CONTAINS ALL THE SUBROUTINES COMMONLY USED IN THE SETUP INF
  3. ;=====================================================================
  4. ;
  5. ;
  6. ;========================================
  7. ; MESSAGE REPORTING SUBROUTINES:
  8. ;========================================
  9. ;
  10. ; 1. SetupMessage: To display warnings, fatal errors, non fatal errors and
  11. ; status messages.
  12. ;
  13. ; 2. QueryUserQuit: To ask if the user wants to quit setup.
  14. ;
  15. ;========================================
  16. ; ALLOCATION AND DEALLOCATION OF DRIVES
  17. ;========================================
  18. ;
  19. ; 1. AllocateUnusedDrive: To allocate a drive letter to use for reassignment
  20. ;
  21. ; 2. FreeUnusedDrive: To free a drive to the unused drive list
  22. ;
  23. ;========================================
  24. ; MESSAGE REPORTING SUBROUTINES:
  25. ;========================================
  26. ;-----------------------------------------------------------------------
  27. ; ROUTINE: SetupMessage
  28. ;
  29. ; DESCRIPTION: This routine lets the user
  30. ;
  31. ; INPUTS: $0: Language To Use
  32. ; $1: MessageType: WARNING | FATAL | NONFATAL | STATUS
  33. ; $2: MessageText.
  34. ;
  35. ; OUTPUTS: $R0: STATUS: STATUS_SUCCESSFUL |
  36. ; STATUS_NOLANGUAGE
  37. ; STATUS_FAILED
  38. ;
  39. ; $R1: DLGEVENT: OK | CANCEL
  40. ;
  41. ;------------------------------------------------------------------------
  42. [SetupMessage]
  43. ;
  44. ; Initialize
  45. ;
  46. set Status = STATUS_FAILED
  47. set UserAction = "CANCEL"
  48. ;
  49. ; See if the language indicated is supported
  50. ;
  51. ;
  52. ; Check if the language requested is supported
  53. ;
  54. set LanguageList = ^(LanguageID, 1)
  55. Ifcontains(i) $($0) in $(LanguageList)
  56. goto displaymessage
  57. else
  58. set Status = STATUS_NOLANGUAGE
  59. goto finish_SetupMessage
  60. endif
  61. ;
  62. ; examine the message type and accordingly read in the right dialog
  63. ; parameters
  64. ;
  65. displaymessage = +
  66. set DlgText = $($2)
  67. ifstr(i) $($1) == "WARNING"
  68. read-syms WarningDlg$($0)
  69. else-ifstr(i) $($1) == "FATAL"
  70. read-syms FatalDlg$($0)
  71. else-ifstr(i) $($1) == "NONFATAL"
  72. read-syms NonfatalDlg$($0)
  73. else-ifstr(i) $($1) == "STATUS"
  74. read-syms StatusDlg$($0)
  75. else
  76. goto finish_SetupMessage
  77. endif
  78. ui start "SetupMessage"
  79. ifstr(i) $(DLGEVENT) == "OK"
  80. set Status = STATUS_SUCCESSFUL
  81. set UserAction = $(DLGEVENT)
  82. else-ifstr(i) $(DLGEVENT) == "CANCEL"
  83. set Status = STATUS_SUCCESSFUL
  84. set UserAction = $(DLGEVENT)
  85. else
  86. endif
  87. finish_SetupMessage = +
  88. Return $(Status) $(UserAction)
  89. end
  90. ;-----------------------------------------------------------------------
  91. ; ROUTINE: QueryUserQuit
  92. ;
  93. ; DESCRIPTION: This routine queries whether the user wants to quit setup
  94. ;
  95. ; INPUTS: $0: Language To Use
  96. ;
  97. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL |
  98. ; STATUS_NOLANGUAGE |
  99. ; STATUS_FAILED
  100. ;
  101. ; $R1: UserAction: OK | CANCEL
  102. ;
  103. ;------------------------------------------------------------------------
  104. [QueryUserQuit]
  105. set Status = STATUS_FAILED
  106. set UserAction = CANCEL
  107. ;
  108. ; See if the language indicated is supported
  109. ;
  110. ;
  111. ; Check if the language requested is supported
  112. ;
  113. set LanguageList = ^(LanguageID, 1)
  114. Ifcontains(i) $($0) in $(LanguageList)
  115. else
  116. set Status = STATUS_NOLANGUAGE
  117. goto fin_QueryUserQuit
  118. endif
  119. ;
  120. ; read in quit message
  121. ;
  122. read-syms ExitWarningDlg$($0)
  123. ui start "ExitWarning"
  124. ifstr(i) $(DLGEVENT) == "YES"
  125. set Status = STATUS_SUCCESSFUL
  126. set UserAction = "OK"
  127. else-ifstr(i) $(DLGEVENT) == "NO"
  128. set Status = STATUS_SUCCESSFUL
  129. set UserAction = "CANCEL"
  130. else
  131. endif
  132. fin_QueryUserQuit = +
  133. Return $(Status) $(UserAction)
  134. ;-----------------------------------------------------------------------
  135. ;
  136. ; ROUTINE: PushBillboard
  137. ;
  138. ; DESCRIPTION: Put up a billboard or update the text in the existing billboard
  139. ;
  140. ; INPUTS: $0: Billboard template
  141. ; $1: Billboard message
  142. ;
  143. ; OUTPUTS: None
  144. ;------------------------------------------------------------------------
  145. [PushBillboard]
  146. ifstr(i) $(!NTN_NOTIFY_HWND) == ""
  147. read-syms BillboardDlg$(!STF_LANGUAGE)
  148. ui start "Billboard"
  149. endif
  150. Return
  151. ;-----------------------------------------------------------------------
  152. ;
  153. ; ROUTINE: PopBillboard
  154. ;
  155. ; DESCRIPTION: Pop off a billboard
  156. ;
  157. ; INPUTS: None
  158. ;
  159. ; OUTPUTS: None
  160. ;------------------------------------------------------------------------
  161. [PopBillboard]
  162. ifstr(i) $(!NTN_NOTIFY_HWND) == ""
  163. ui pop 1
  164. endif
  165. Return
  166. ;========================================
  167. ; ALLOCATION AND DEALLOCATION OF DRIVES
  168. ;========================================
  169. ;-----------------------------------------------------------------------
  170. ; ROUTINE: AllocateUnusedDrive
  171. ;
  172. ; DESCRIPTION: This routine lets the user allocate a drive from the unused
  173. ; drive pool.
  174. ;
  175. ; INPUTS: None
  176. ;
  177. ; OUTPUTS: $R0: STATUS: STATUS_SUCCESSFUL |
  178. ; STATUS_FAILED
  179. ; $R1: Drive allocated.
  180. ;
  181. ;------------------------------------------------------------------------
  182. [AllocateUnusedDrive]
  183. ;
  184. ;
  185. set Status = STATUS_FAILED
  186. set Drive = ""
  187. ;
  188. ifstr(i) $(!STF_UNUSEDDRIVES) == {}
  189. goto finish_allocate
  190. else-ifstr(i) $(!STF_UNUSEDDRIVES) == ""
  191. goto finish_allocate
  192. else
  193. set NewDriveList = {}
  194. ForListDo $(!STF_UNUSEDDRIVES)
  195. ifstr(i) $(#) != 1
  196. set NewDriveList = >($(NewDriveList), $($))
  197. else
  198. set Drive = $($)
  199. set Status = STATUS_SUCCESSFUL
  200. endif
  201. EndForListDo
  202. set !STF_UNUSEDDRIVES = $(NewDriveList)
  203. endif
  204. finish_allocate = +
  205. Return $(Status) $(Drive)
  206. ;-----------------------------------------------------------------------
  207. ; ROUTINE: FreeUnusedDrive
  208. ;
  209. ; DESCRIPTION: This routine lets the user allocate a drive from the unused
  210. ; drive pool.
  211. ;
  212. ; INPUTS: $0: Drive to free
  213. ;
  214. ; OUTPUTS: None
  215. ;
  216. ;
  217. ;------------------------------------------------------------------------
  218. [FreeUnusedDrive]
  219. set !STF_UNUSEDDRIVES = >($(!STF_UNUSEDDRIVES), $($0))
  220. Return
  221. ;-----------------------------------------------------------------------
  222. ; ROUTINE: DriversExist
  223. ;
  224. ; DESCRIPTION: This routine informs the user that the drivers for the
  225. ; option he has selected exist on the destination and asks
  226. ; whether they should be replaced.
  227. ;
  228. ; INPUTS: $0: Language To Use
  229. ; $1: Dialog Text
  230. ;
  231. ; OUTPUTS: STATUS_CURRENT if the current files are to be used
  232. ; STATUS_NEW if new files are to be copied over
  233. ; STATUS_USERCANCEL if user chose to cancel installation
  234. ; STATUS_NOLANGUAGE if the language requested is not supported
  235. ; STATUS_FAILED if any other failure exists
  236. ;
  237. ;------------------------------------------------------------------------
  238. [DriversExist]
  239. set Status = STATUS_FAILED
  240. ;
  241. ; See if the language indicated is supported
  242. ;
  243. set LanguageList = ^(LanguageID, 1)
  244. Ifcontains(i) $($0) in $(LanguageList)
  245. else
  246. set Status = STATUS_NOLANGUAGE
  247. goto finish_DriversExist
  248. endif
  249. read-syms DriversExistDlg$($0)
  250. ui start "DriversExist"
  251. ifstr(i) $(DLGEVENT) == "DLGBUTTON0"
  252. set Status = STATUS_CURRENT
  253. else-ifstr(i) $(DLGEVENT) == "DLGBUTTON1"
  254. set Status = STATUS_NEW
  255. else-ifstr(i) $(DLGEVENT) == "BACK"
  256. set Status = STATUS_USERCANCEL
  257. endif
  258. ui pop 1
  259. finish_DriversExist = +
  260. Return $(Status)
  261. ;-----------------------------------------------------------------------
  262. ;
  263. ; ROUTINE: DoAskSource
  264. ;
  265. ; DESCRIPTION: This routine prompts the source of the windows nt files
  266. ;
  267. ; INPUTS: $0: Current Src
  268. ;
  269. ; OUTPUTS: $R0: STATUS: STATUS_SUCCESSFUL |
  270. ; STATUS_USERCANCEL |
  271. ; STATUS_FAILED
  272. ;
  273. ; $R1: Diskette Src
  274. ;
  275. ; $R2: Drive to Free or "" if none
  276. ;
  277. ; $R3: Actual string returned from dialog
  278. ;
  279. ;------------------------------------------------------------------------
  280. [DoAskSource]
  281. read-syms DoAskSourceDlgText$(!STF_LANGUAGE)
  282. shell "" DoAskSourceEx $($0) $(DlgText)
  283. Return $($R0) $($R1) $($R2) $($R3)
  284. ;-----------------------------------------------------------------------
  285. ;
  286. ; ROUTINE: DoAskSourceEx
  287. ;
  288. ; DESCRIPTION: This routine prompts the source of the windows nt files
  289. ;
  290. ; INPUTS: $0: Current Src
  291. ; $1: Dialog Text To Use
  292. ;
  293. ; OUTPUTS: $R0: STATUS: STATUS_SUCCESSFUL |
  294. ; STATUS_USERCANCEL |
  295. ; STATUS_FAILED
  296. ;
  297. ; $R1: Diskette Src
  298. ;
  299. ; $R2: Drive to Free or "" if none
  300. ;
  301. ; $R3: Actual string returned from dialog
  302. ;
  303. ;------------------------------------------------------------------------
  304. [DoAskSourceEx]
  305. ;
  306. ;
  307. set Status = STATUS_FAILED
  308. set Src = $($0)
  309. set DriveToFree = ""
  310. read-syms AskSourceStrings$(!STF_LANGUAGE)
  311. asksource = +
  312. read-syms DisketteDlg$(!STF_LANGUAGE)
  313. ui start "Diskette"
  314. ifstr(i) $(DLGEVENT) == "CONTINUE"
  315. LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(EditTextOut)
  316. ifstr(i) $(IsFullPath) == "NO"
  317. StartWait
  318. LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(EditTextOut)
  319. EndWait
  320. ifstr(i) $(STATUS) == "ERROR"
  321. shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String1)
  322. goto asksource
  323. else-ifstr(i) $(STATUS) == "NOT-UNC"
  324. shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String2)
  325. goto asksource
  326. else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT"
  327. shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String4)
  328. goto asksource
  329. else
  330. set Src = $(STATUS)
  331. endif
  332. else
  333. set Src = $(EditTextOut)
  334. endif
  335. ui pop 1
  336. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(Src)
  337. ifstr(i) $(STATUS) == "ERROR"
  338. goto finish_DoAskSource
  339. else
  340. set Src = $(STATUS)
  341. set Status = STATUS_SUCCESSFUL
  342. goto finish_DoAskSource
  343. endif
  344. else-ifstr(i) $(DLGEVENT) == "BACK"
  345. ui pop 1
  346. set Status = STATUS_USERCANCEL
  347. goto finish_DoAskSource
  348. else
  349. ui pop 1
  350. goto finish_DoAskSource
  351. endif
  352. finish_DoAskSource = +
  353. Return $(Status) $(Src) $(DriveToFree) $(EditTextOut)
  354. ;--------------------------------------------------------------------------
  355. ; Setup.Hlp Context IDs
  356. ; =====================
  357. ;
  358. ; The following are the help IDs used in the setup inf files. The help IDs
  359. ; are in the following ranges:
  360. ;
  361. ; 0 - 999 : Main Setup
  362. ; 1000 - 1999 : Network Setup
  363. ; 2000 - 2999 : MaintenanceModeSetup
  364. ;
  365. ;---------------------------------------------------------------------------
  366. [SetupHelpIds]
  367. ;
  368. ; NOTE: PLEASE UPDATE THE !MaximumID field whenever you add a new ID
  369. ;
  370. !MinimumID = 0
  371. !MaximumID = 5000
  372. !InitialContentsID = 5
  373. ;
  374. ; Main Setup IDs
  375. ;
  376. !IDH_DB_COMPUTERNAMEQ_INS = 10
  377. !IDH_DB_COMPUTERNAMEV_INS = 11
  378. !IDH_DB_FULLNAMEQ_INS = 30
  379. !IDH_DB_FULLNAMEV_INS = 31
  380. !IDH_DB_ORGNAMEQ_INS = 32
  381. !IDH_DB_ORGNAMEV_INS = 33
  382. !IDH_DB_PRODUCTIDQ_INS = 40
  383. !IDH_DB_PRODUCTIDV_INS = 41
  384. !IDH_DB_INSTALLMODE_INS = 50
  385. !IDH_DB_OPTIONS_INS = 60
  386. !IDH_DB_SYSTEM_INS = 70
  387. !IDH_DB_VIRTUAL_INS = 80
  388. !IDH_DB_REPAIR_INS = 90
  389. !IDH_DB_PRNSETUP_INS = 100
  390. !IDH_DB_OPTIONAL_INS = 110
  391. !IDH_DB_CUSTOMISE_INS = 111
  392. !IDH_DB_OEMSINGLESEL_INS = 120
  393. !IDH_DB_OEMMULTISEL_INS = 121
  394. !IDH_DB_ACCOUNTSETUP_INS = 130
  395. !IDH_DB_ACCOUNTADMN_INS = 131
  396. !IDH_DB_SEARCHDRIVE_INS = 150
  397. !IDH_DB_APPCONFLICT_INS = 151
  398. !IDH_DB_ASTYPE_INS = 160
  399. ;
  400. ; Maintenance mode setup IDs
  401. ;
  402. !IDH_DB_MAINTAIN_INS = 1000
  403. !IDH_DB_MOPTIONAL_INS = 1010
  404. !IDH_DB_MCUSTOMISE_INS = 1011
  405. !IDH_DB_MSYSTEM_INS = 1020
  406. !IDH_DB_MPROFILE_INS = 1030
  407. !IDH_DB_SCSI_DRIVER_INS = 1040
  408. !IDH_DB_SCSI_SELECTDRIVER_INS = 1041
  409. !IDH_DB_DRIVEREXIST_INS = 1042
  410. !IDH_DB_TAPE_DRIVER_INS = 1043
  411. !IDH_DB_TAPE_SELECTDRIVER_INS = 1044
  412. ;
  413. ; Network card inf Help ID
  414. ;
  415. !IDH_DB_CARDSELECTION_INS = 3000 ; Net card selection dialog
  416. !IDH_DB_SOFTSELECTION_INS = 3001 ; Software selection dialog
  417. !IDH_DB_OEMNADD1_INS = 3500 ; Dec100
  418. !IDH_DB_OEMNADD2_INS = 3510 ; Dec201
  419. !IDH_DB_OEMNADDE_INS = 3520 ; Decstation
  420. !IDH_UB_OEMNADDP_INS = 3521 ; DEC PC
  421. !IDH_DB_OEMNADE1_INS = 3530 ; Elink 16
  422. !IDH_DB_OEMNADE2_INS = 3540 ; Elink ii
  423. !IDH_DB_OEMNADE3_INS = 3545 ; Elink 3
  424. !IDH_DB_OEMNADLB_INS = 3546 ; MS Loop Back
  425. !IDH_DB_OEMNADAM_INS = 3547 ; AMD
  426. !IDH_DB_OEMNADEM_INS = 3550 ; Elink MC
  427. !IDH_DB_OEMNADN2_INS = 3551 ; NE2000
  428. !IDH_DB_OEMNADN1_INS = 3552 ; NE1000
  429. !IDH_DB_OEMNADNE_INS = 3560 ; NE3200
  430. !IDH_DB_OEMNADIN_INS = 3561 ; Intel EE16
  431. !IDH_DB_OEMNADEP_INS = 3565 ; Intel EtherExpress Pro
  432. !IDH_DB_OEMNADP3_INS = 3570 ; Proteon 1390
  433. !IDH_DB_OEMNADP9_INS = 3580 ; Proteon 1990
  434. !IDH_DB_OEMNADSO_INS = 3590 ; Sonic
  435. !IDH_DB_OEMNADTK_INS = 3600 ; IBM Token
  436. !IDH_DB_OEMNADT2_INS = 3601 ; IBM Token II
  437. !IDH_DB_OEMNADTE_INS = 3602 ; IBM Token EISA
  438. !IDH_DB_OEMNADTM_INS = 3605 ; IBM Token
  439. !IDH_DB_OEMNADUB_INS = 3610 ; UB Card
  440. !IDH_DB_OEMNADWD_INS = 3620 ; Western Digital
  441. !IDH_DB_OEMNADWM_INS = 3630 ; Western Digital MicroChannel
  442. !IDH_DB_OEMNADAR1_INS = 3631 ; Arcnet
  443. !IDH_DB_OEMNADAR2_INS = 3632 ; Thomas Conard 1
  444. !IDH_DB_OEMNADAR3_INS = 3633 ; Thomas Conard 2
  445. !IDH_DB_OEMNADNF_INS = 3634 ; Netflx Token Ring card
  446. !IDH_DB_OEMNSVNB_INS = 3640 ; Netbios
  447. !IDH_DB_OEMNSVRD_INS = 3650 ; Redriector
  448. !IDH_DB_OEMNSVRE_INS = 3660 ; Repl
  449. !IDH_DB_OEMNSVSV_INS = 3670 ; Server
  450. !IDH_DB_OEMNSVWK_INS = 3680 ; workstation
  451. !IDH_DB_OEMNXPDL_INS = 3690 ; dlc
  452. !IDH_DB_OEMNXPNB_INS = 3700 ; netbeui
  453. !IDH_DB_OEMNXPSN_INS = 3710 ; snmp
  454. !IDH_DB_OEMNXPSN_1 = 3711 ; snmp - 1st dialog
  455. !IDH_DB_OEMNXPSN_2 = 3712 ; snmp - security dialog
  456. !IDH_DB_OEMNXPTC_INS = 3720 ; tcpip
  457. !IDH_DB_OEMNXPTC_1 = 3721 ; tcpip - 1st dialog
  458. !IDH_DB_OEMNXPTC_2 = 3722 ; tcpip - 2nd dialog
  459. !IDH_DB_OEMNXPTC_3 = 3723 ; tcpip - 3nd dialog
  460. !IDH_DB_LMHOST_INS = 3730 ; LMHOST dialog
  461. !IDH_DB_RPCLOCATE_INS = 3740 ; RPC Name Service dialog
  462. !IDH_DB_OEMNSVRI_INS = 3745 ; Remoteboot Service dialog
  463. !IDH_DB_RETURN_TO_NCPA = 3750 ; Return to NCPA
  464. !IDH_DB_GET_PROTOCOL = 4000 ; Get Primary Protocol dialog
  465. !IDH_DB_VER_EXISTED = 4010 ; software or netcard already existed
  466. !IDH_DB_DETECT_BYPASS = 4020 ; Want to bypass netcard detection?
  467. !IDH_DB_DETECT_FOUND = 4030 ; Detection found a netcard
  468. !IDH_DB_DETECT_FAILED = 4040 ; Netcard detection failed
  469. !IDH_DB_DETECT_CHKRAS = 4050 ; Detection failed-- want RAS?
  470. !IDH_DB_OEMNADLT_INS = 4060 ; LocalTalk Card Config help
  471. ;-----------------------------------------------------------------------
  472. ; ROUTINE: ReadSetupHelpIds
  473. ;
  474. ; DESCRIPTION: This routine sets up the help context ids as globals
  475. ;
  476. ;
  477. ; INPUTS: $0: Drive to free
  478. ;
  479. ; OUTPUTS: None
  480. ;
  481. ;
  482. ;------------------------------------------------------------------------
  483. [ReadSetupHelpIds]
  484. read-syms "SetupHelpIds"
  485. Return
  486. ;-----------------------------------------------------------------------
  487. ; ROUTINE: GetDefaultAnswer
  488. ;
  489. ; DESCRIPTION: This routine sets up the help context ids as globals
  490. ;
  491. ;
  492. ; INPUTS: $0: Section name in the $winnt$.inf file
  493. ;
  494. ; OUTPUTS: None
  495. ;
  496. ;
  497. ;------------------------------------------------------------------------
  498. [GetDefaultAnswer]
  499. ifstr(i) $(!STF_GUI_UNATTENDED) == "YES"
  500. shell $(!STF_UNATTENDED) ReadDefaultData $($0)
  501. endif
  502. Return