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.

633 lines
20 KiB

  1. ;**********************************************************************
  2. ;
  3. ; NAME: NCPASHEL.INF
  4. ;
  5. ; PURPOSE:
  6. ;
  7. ; This INF script is invoked by the Network Control
  8. ; Panel Applet (NCPA).
  9. ;
  10. ;
  11. ; COMMENTARY:
  12. ;
  13. ; The NCPA builds a command line to invoke SETUP, instructing
  14. ; it to run this file. The other settings on the command line
  15. ; tell NCPASHEL.INF what to invoke and in what mode.
  16. ;
  17. ; The primary function of this file is to hide the distinction
  18. ; between invocation by the main install SETUP and later invocation
  19. ; by the NCPA. This involves restoring the STF_XXXXX global
  20. ; variables to their earlier settings, along with defining some
  21. ; new ones to "fine-tune" the functions of the product-level
  22. ; INF scripts.
  23. ;
  24. ;
  25. ; HISTORY:
  26. ;
  27. ; DavidHov Created 4/4/92
  28. ;
  29. ;***********************************************************************
  30. ;
  31. ;
  32. ;***********************************************************************
  33. ;
  34. ;
  35. ;
  36. ;***********************************************************************
  37. ;***********************************************************************
  38. ;
  39. ; Variables declared by SETUP.INF, the main INF for GUI Setup.
  40. ;
  41. ; Those marked with ** are established by the SETUP.EXE; the others
  42. ; are obtained from detection or established programmatically by
  43. ; SETUP.INF.
  44. ;
  45. ; The STF_* variables documented below are the globals which can be used
  46. ; by shelled INFs:
  47. ;
  48. ;*************************************************************************
  49. ;
  50. ; ** 0. STF_HWND: Handle to setup window (hex string)
  51. ;
  52. ; ** 1. STF_SRCTYPE: DOS | ARC | UNC | NT
  53. ;
  54. ; ** 2. STF_SRCDIR: NT Sources, e.g. f:\i386i\
  55. ;
  56. ; ** 3. STF_SRCBASE: Defined only for UNC srctype, the unc share, e.g.,
  57. ; \\Orville\razzle.
  58. ;
  59. ; 4. STF_NTDRIVE: Destination NT Drive, e.g. d:
  60. ;
  61. ; 5. STF_NTPATH: Path to nt, e.g. d:\nt
  62. ;
  63. ; 6. STF_WINDOWSPATH: Path to windows, e.g. d:\nt\windows
  64. ;
  65. ; 7. STF_WINDOWSSYSPATH: Path to windows system, e.g. d:\nt\windows\System32
  66. ;
  67. ; ** 8. STF_CWDDIR: Path to place where setup is run from.,
  68. ; e.g. d:\setup\
  69. ;
  70. ; 9. STF_LANGUAGE: Language to use (ENG | ...)
  71. ;
  72. ; 10. STF_INSTALL_MODE: EXPRESS | CUSTOM
  73. ;
  74. ; ** 11. STF_INSTALL_TYPE: SETUPRUN | SETUPBOOTED | NETDUMP | MAINTENANCE
  75. ; (SETUPRUN: Setup is run off any source (network, cdrom,
  76. ; ... from a running NT system)
  77. ;
  78. ; (SETUPBOOTED: Setupprep runs and then copies setup on the
  79. ; system and runs GUI Setup..)
  80. ;
  81. ; (SETUPTOSHARE: Copy sources to destination STF_DSTDIR)
  82. ;
  83. ; (MAINTENANCE: MAINTENACE mode setup)
  84. ;
  85. ; (used to be FRESH | UPGRADE | NETDUMP)
  86. ;
  87. ; 12. STF_UPGRADE: YES | NO
  88. ;
  89. ; 13. STF_PLATFORM: I386 | MIPS | Alpha | ppc
  90. ;
  91. ; 14. STF_PROCESSOR: I386 | I486 | I586 or R2000 | R3000 | R4000 | Alpha_AXP.
  92. ;
  93. ; 15. STF_USERNAME: Username for account. "string" (no whitespaces, < 15)
  94. ;
  95. ; 16. STF_COMPUTERNAME: Computername to identify machine (no whitespaces, < 15)
  96. ;
  97. ; 17. STF_PRODUCT: WINNT | LANMANNT | SERVERNT
  98. ;
  99. ; 18. STF_UNUSEDDRIVES: List of drives currently unused and available for
  100. ; assignment. {E:, F:, ...., Z:}. Use routine in
  101. ; subroutn.inf to allocate unused.
  102. ;
  103. ; nn. STF_NCDETECT: YES | NO determines if netcard detection is enabled
  104. ;
  105. ; Conditionally defined:
  106. ;
  107. ; ** 19. STF_DSTDIR: Only defined in SETUPTOSHARE. e.g., f:\beta\nt\i386\
  108. ;
  109. ; ** 20. STF_DSTTYPE as STF_SRCTYPE
  110. ;
  111. ; ** 21. STF_DSTBASE as STF_SRCBASE
  112. ;
  113. ; Others Sunil didn't mention:
  114. ;
  115. ; ** 22. STF_SRCINFPATH path to invoked (outermost) INF
  116. ;
  117. ; ** 23. STF_CONTEXTINFNAME path to currently executing INF
  118. ;
  119. ; ** 24. STF_SYS_INIT NO
  120. ;
  121. ;***********************************************************************
  122. ;
  123. ;***********************************************************************
  124. ; Variables required for NCPA support
  125. ;***********************************************************************
  126. ;
  127. ; NTN_RegBase Location of product key in SOFTWARE hive.
  128. ; Set by NCPA.CPL as command line option.
  129. ;
  130. ; NTN_ServiceBase Top of Services Tree
  131. ;
  132. ; NTN_InstallMode "install", "deinstall", "configure",
  133. ; "bind"
  134. ; Set by NCPA.CPL as command line option.
  135. ;
  136. ; NTN_Origination "ncpa", "install"
  137. ;
  138. ; NTN_Infname name (pathless) of INF file to execute.
  139. ; Set by NCPA.CPL as command line option.
  140. ;
  141. ; If the INF name is equal to one of these,
  142. ; then the appropriate section of
  143. ; NTLANMAN.INF is shelled to.
  144. ;
  145. ; NTN_InfOption INF option name associated with this product.
  146. ;
  147. ; NTN_InstallPhase "primary","secondary".
  148. ; "primary" implies main installation;
  149. ; "secondary" implies product add-on installation.
  150. ;
  151. ;***********************************************************************
  152. [StfVariableDetect]
  153. !STF_PROCESSOR = "" ? $(!LIBHANDLE) GetProcessor
  154. !STF_PLATFORM = "I386" ; BUGBUG-- How to establish?
  155. ;
  156. ;
  157. ; Language to Use For interaction with user
  158. ;
  159. !STF_LANGUAGE = "" ? $(!LIBHANDLE) GetLanguage
  160. LanguageList = ^(LanguageID, 1)
  161. ;
  162. ; Destination NT Directory relative to root of NT Drive
  163. ;
  164. !STF_WINDOWSPATH = "" ? $(!LIBHANDLE) GetWindowsNtDir
  165. !STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  166. !STF_NTPATH = $(!STF_WINDOWSPATH)
  167. !STF_COMPUTERNAME = "" ? $(!LIBHANDLE) GetMyComputerName
  168. !STF_BUSTYPE = "" ? $(!LIBHANDLE) GetMyBusType
  169. !STF_BUSTYPELIST = "" ? $(!LIBHANDLE) GetMyBusTypeList
  170. [StfVariableSyms]
  171. !ProcessorID_I386 = I386
  172. !ProcessorID_I486 = I486
  173. !ProcessorID_I586 = I586
  174. !ProcessorID_R4000 = R4000
  175. !ProcessorID_Alpha = Alpha_AXP
  176. !ProcessorID_PPC601 = PPC601
  177. !ProcessorID_PPC603 = PPC603
  178. !ProcessorID_PPC604 = PPC604
  179. !ProcessorID_PPC620 = PPC620
  180. !PlatformID_I386 = I386
  181. !PlatformID_Mips = Mips
  182. !PlatformID_Alpha = Alpha
  183. !PlatformID_PPC = ppc
  184. ;
  185. ; Version Information
  186. ;
  187. !STF_PRODUCT = WINNT ; BUGBUG-- Determine from Registry
  188. !STF_USERNAME = "" ; BUGBUG-- Determine from API calls
  189. !STF_INSTALL_MODE = "CUSTOM" ; It's always CUSTOM from the NCPA
  190. !STF_UPDGRADE = NO ; BUGBUG-- TBI
  191. !STF_NCDETECT = NO ; disable netcard detection
  192. !STF_NCOPTION = "" ; set defaults for other
  193. !STF_NCDETCARD = 99999 ; global netcard variables
  194. !STF_NCDETINFO = {} ; No detect information
  195. !STF_NC_PARAMS = {} ;
  196. !STF_NC_PNAMES = {} ;
  197. !STF_SRCDIR_KEYED = "" ; source dir as entered
  198. !STF_SRCDIR_USED = "" ; source dir as used
  199. !STF_SRCDIR_OVERRIDE = "" ; source dir override (see UTILITY.INF)
  200. !STF_SRCDIR_WINNT = "" ; WINNT override source path
  201. ; Establish the error dialog template overrides.
  202. !STF_TEMPLATE_CRITERR = "CRITERR2"
  203. !STF_TEMPLATE_NONCRITERR = "NONCRITERR2"
  204. ;
  205. ; DOS VDM Setup / OS2 Subsystem Setup
  206. ;
  207. !STF_INSTALLED_OS = {} ? $(!LIBHANDLE) GetInstalledOSNames
  208. FatalErrorIndex = 1
  209. Exit_Code = 0
  210. [DoAskOemsetupSource]
  211. read-syms DoAskUpgradeSrcDlgText$(!STF_LANGUAGE)
  212. shell "subroutn.inf" DoAskSourceEx $($0) $(DlgText)
  213. Return $($R0) $($R1) $($R2) $($R3)
  214. ;***********************************************************************
  215. ;
  216. ; Primary control section.
  217. ;
  218. ;***********************************************************************
  219. [Shell Commands]
  220. ;
  221. ; Initialization code borrowed from SETUP.INF. Establish all the
  222. ; STF_ variables not already created by initialization (in INIT.C).
  223. ;
  224. set-title "Windows NT Setup"
  225. ;
  226. ; Changing the literal 0 to a 1 will turn Debug-Output on.
  227. ;
  228. Set !G:DebugOutputControl = 0
  229. LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  230. ;
  231. ; Bind to NCPA.CPL. Defer this operation if we're
  232. ; installing new software.
  233. ;
  234. Set !NCPA_HANDLE = ""
  235. Ifstr(i) $(!NTN_InfSection) != OemSoftwareInstall
  236. Debug-Output "NCPASHEL.INF: LoadLibrary on "$(!STF_CWDDIR)ncpa.cpl
  237. LoadLibrary "y" $(!STF_CWDDIR)ncpa.cpl !NCPA_HANDLE
  238. Endif
  239. ;
  240. ; Establish the help IDs and help file.
  241. ;
  242. Shell "subroutn.inf" ReadSetupHelpIds
  243. SetHelpFile "NetCfg.hlp" $(!MinimumID) $(!MaximumID)
  244. set-subst LF = "\n"
  245. StartWait
  246. ;
  247. ; Reestablish the SETUP STF_ variables as best we can.
  248. ;
  249. read-syms StfVariableSyms
  250. read-syms StfVariableDetect
  251. detect StfVariableDetect
  252. Set !STF_NTPATH = $(!STF_WINDOWSSYSPATH)
  253. ;
  254. ; Get the product type from the registry
  255. ;
  256. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\ProductOptions" 33554432 KeyProductOption
  257. ifstr(i) $(KeyProductOption) != ""
  258. GetRegValue $(KeyProductOption) "ProductType" ProductTypeList
  259. set TempProductType = *($(ProductTypeList),4)
  260. ifstr(i) $(TempProductType) == "winnt"
  261. set !STF_PRODUCT = WINNT
  262. else-ifstr(i) $(TempProductType) == "lanmannt"
  263. set !STF_PRODUCT = LANMANNT
  264. else-ifstr(i) $(TempProductType) == "servernt"
  265. set !STF_PRODUCT = SERVERNT
  266. endif
  267. CloseRegKey $(KeyProductOptions)
  268. endif
  269. ;
  270. ; Determine the source location. If STF_SRCDIR is already set, use it.
  271. ; Otherwise, try to extract it from the NCPA's home location in the Registry.
  272. ;
  273. ;
  274. Debug-Output "NCPASHEL.INF: STF_SRCDIR is "$(!STF_SRCDIR)
  275. Debug-Output "NCPASHEL.INF: NTN_SRCPATH is "$(!NTN_SRCPATH)
  276. Ifstr(i) $(!NTN_SRCPATH) != ""
  277. Set !STF_ORIGINAL_SRCDIR = $(!STF_SRCDIR)
  278. Set !STF_SRCDIR = $(!NTN_SRCPATH)
  279. Debug-Output "NCPASHEL.INF: Reset STF_SRCDIR to:"$(!STF_SRCDIR)
  280. else
  281. OpenRegKey $(!REG_H_LOCAL) "" "SOFTWARE\Microsoft\Windows Nt\CurrentVersion" $(!REG_KEY_READ) KeyNt
  282. Ifstr(i) $(KeyNt) != ""
  283. GetRegValue $(KeyNt) "SourcePath" SourcePathValue
  284. Set !STF_SRCDIR = *($(SourcePathValue),4)
  285. Debug-Output "NCPASHEL.INF: SourcePath retrieved is "$(!STF_SRCDIR)
  286. CloseRegKey $(KeyNt)
  287. Endif
  288. Ifstr(i) $(!STF_SRCDIR) == ""
  289. Set !STF_SRCDIR = "A:\"
  290. Endif
  291. Endif
  292. ;
  293. ; Extract the "setup in progress" variable from the Registry;
  294. ; set global variables accordingly. If "setup in progress" flag is
  295. ; on, set !NTN_InstallPhase to "primary", then look for the
  296. ; "winnt source path" value; if found, set !STF_SRCDIR_WINNT.
  297. ;
  298. Set SetupInp = 0
  299. Set !NTN_InstallPhase = secondary
  300. ifstr(i) $(!NTN_OVERIDEPHASE) != ""
  301. Set !NTN_InstallPhase = $(!NTN_OVERIDEPHASE)
  302. Else
  303. OpenRegKey $(!REG_H_LOCAL) "" "SYSTEM\Setup" $(!REG_KEY_READ) KeySetup
  304. Ifstr(i) $(KeySetup) != ""
  305. GetRegValue $(KeySetup) "SystemSetupInProgress" SetupInpValue
  306. Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  307. Set SetupInp = *($(SetupInpValue),4)
  308. Debug-Output "NCPASHEL.INF: SetupInp = "$(SetupInp)
  309. Endif
  310. Ifint $(SetupInp) == 1
  311. Set !NTN_InstallPhase = primary
  312. GetRegValue $(KeySetup) "WinntPath" SetupPathValue
  313. Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  314. Set !STF_SRCDIR_WINNT = *($(SetupPathValue),4)
  315. Debug-Output "NCPASHEL.INF: STF_SRCDIR_WINNT = "$(!STF_SRCDIR_WINNT)
  316. Endif
  317. Endif
  318. CloseRegKey $(KeySetup)
  319. Endif
  320. EndIf
  321. Debug-Output "NCPASHEL.INF: NTN_InstallPhase = "$(!NTN_InstallPhase)
  322. Debug-Output "NCPASHEL.INF: NTN_InfSection = "$(!NTN_InfSection)
  323. Debug-Output "NCPASHEL.INF: NTN_InstallMode = "$(!NTN_InstallMode)
  324. ;
  325. ; Enable the netcard detection functions if necessary.
  326. ; Don't check for errors, since each INF will report
  327. ; the error if it really needs to use detection.
  328. ;
  329. ; We start detection for installations and configurations
  330. ; exceptfor final review INFs, which are marked as installations.
  331. ;
  332. Ifstr(i) $(!NTN_Origination) == "install"
  333. Goto skipdetection
  334. Endif
  335. Ifstr(i) $(!NTN_InfSection) == BindingsReview
  336. Goto skipdetection
  337. Endif
  338. Ifstr(i) $(!NTN_InstallMode) == install
  339. Goto startdetection
  340. Endif
  341. Ifstr(i) $(!NTN_InstallMode) == configure
  342. Goto startdetection
  343. Endif
  344. Goto skipdetection
  345. startdetection = +
  346. Ifstr(i) $(!NCPA_HANDLE) != ""
  347. Debug-Output "NCPASHEL.INF: Enable netcard detection from NCPA.CPL"
  348. Shell "NCPARAM.INF" Param_ControlDetection DTSTART
  349. Endif
  350. skipdetection = +
  351. ;
  352. ; Check processor type, see if it is supported, if so what platform does it
  353. ; belong to. Set also the SYS variable to denote which set of sources we
  354. ; are installing from
  355. ;
  356. ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_I386)
  357. set !STF_PLATFORM = $(!PlatformID_I386)
  358. set !SYS = $(!ProcessorID_I386)
  359. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_I486)
  360. set !STF_PLATFORM = $(!PlatformID_I386)
  361. set !SYS = $(!ProcessorID_I386)
  362. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_I586)
  363. set !STF_PLATFORM = $(!PlatformID_I386)
  364. set !SYS = $(!ProcessorID_I386)
  365. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_R4000)
  366. set !STF_PLATFORM = $(!PlatformID_Mips)
  367. set !SYS = $(!ProcessorID_R4000)
  368. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_Alpha)
  369. set !STF_PLATFORM = $(!PlatformID_Alpha)
  370. set !SYS = $(!ProcessorID_Alpha)
  371. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_PPC601)
  372. set !STF_PLATFORM = $(!PlatformID_PPC)
  373. set !SYS = $(!ProcessorID_PPC601)
  374. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_PPC603)
  375. set !STF_PLATFORM = $(!PlatformID_PPC)
  376. set !SYS = $(!ProcessorID_PPC603)
  377. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_PPC604)
  378. set !STF_PLATFORM = $(!PlatformID_PPC)
  379. set !SYS = $(!ProcessorID_PPC604)
  380. else-ifstr(i) $(!STF_PROCESSOR) == $(!ProcessorID_PPC620)
  381. set !STF_PLATFORM = $(!PlatformID_PPC)
  382. set !SYS = $(!ProcessorID_PPC620)
  383. else
  384. set !STF_PLATFORM = $(!PlatformID_I386)
  385. set !SYS = $(!ProcessorID_I386)
  386. endif
  387. Ifstr(i) $(!STF_LANGUAGE) != "ENG" ; BUGBUG: temporary
  388. Debug-Output "NCPASHEL: Language not set to English; resetting"
  389. !STF_LANGUAGE = "ENG"
  390. Endif
  391. read-syms ProgressCopy$(!STF_LANGUAGE)
  392. ;----------------------------------------------------------------------
  393. ;
  394. ; STF_ variables are now established.
  395. ;
  396. ; Establish by default the NCPA variables which the NCPA didn't.
  397. ;
  398. ;----------------------------------------------------------------------
  399. Ifstr(i) $(!NTN_RegBase) == ""
  400. set !NTN_RegBase = ""
  401. Endif
  402. set !NTN_ServiceBase = "SYSTEM\CurrentControlSet\SERVICES"
  403. ;
  404. ; Default the InstallMode to "configure"
  405. ;
  406. Ifstr(i) $(!NTN_InstallMode) == ""
  407. Debug-Output "NCPASHEL:!NTN_InstallMode was not defined!"
  408. set !NTN_InstallMode = "configure"
  409. Endif
  410. Ifstr(i) $(!NTN_SoftwareBase) == ""
  411. ; BUGBUG
  412. ; set !NTN_SoftwareBase = "SOFTWARE\Description"
  413. set !NTN_SoftwareBase = "SOFTWARE"
  414. Endif
  415. Ifstr(i) $(!NTN_Origination) == ""
  416. set !NTN_Origination = "ncpa"
  417. Endif
  418. ;----------------------------------------------------------------------
  419. ;
  420. ; NTN_ variables are now established.
  421. ;
  422. ; Prepare to Shell to target INF
  423. ;
  424. ;----------------------------------------------------------------------
  425. Ifstr(i) $(!NTN_Infname) == ""
  426. goto fatalnoinfname
  427. Endif
  428. Ifstr(i) $(!NTN_InfSection) == ""
  429. Set !NTN_InfSection = "InstallOption"
  430. Endif
  431. ;------------------------------------------------------------------------
  432. ;
  433. ; Shell to the given section of the component INF. If this is an
  434. ; update/upgrade, ask the user for the location of the file.
  435. ;
  436. ;------------------------------------------------------------------------
  437. ifstr(i) $(!NTN_InstallMode) == "Update"
  438. Debug-Output "NCPASHEL.INF: Upgrade mode"
  439. ;
  440. ; First, ask for oemsetup.inf location
  441. ; Then, pass the information to the inf file
  442. ;
  443. Shell "" DoAskOemsetupSource $(!STF_SRCDIR)
  444. Ifstr(i) $($ShellCode) != $(!SHELL_CODE_OK)
  445. goto shellerror
  446. Endif
  447. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  448. set !STF_SRCDIR = $($R1)
  449. else-ifstr(i) $($R0) == STATUS_USERCANCEL
  450. set Exit_Code = 1
  451. goto end
  452. else
  453. set Exit_Code = 2
  454. goto end
  455. endif
  456. ;
  457. ; Change NTN_Infname to refer to the OEMSETUP.INF file
  458. ; pointed to by the user.
  459. ;
  460. Set !NTN_Infname = $(!STF_SRCDIR)oemsetup.inf
  461. endif
  462. Ifstr(i) $(!NTN_InstallMode) == install
  463. set AddCopy = YES
  464. set DoCopy = YES
  465. set DoConfig = YES
  466. Else-ifstr(i) $(!NTN_InstallMode) == "Update"
  467. set AddCopy = YES
  468. set DoCopy = YES
  469. set DoConfig = NO
  470. ;
  471. ; If upgrade, check for option list.
  472. ;
  473. Debug-Output "NCPASHEL.INF: Shell to "$(!NTN_Infname)
  474. Shell $(!NTN_Infname) ReturnOptions $(!STF_LANGUAGE)
  475. Ifstr(i) $($ShellCode) != $(!SHELL_CODE_OK)
  476. Debug-Output "NCPASHEL.INF: SHELL ERROR: "$($ShellCode)
  477. goto shellerror
  478. Endif
  479. Ifstr(i) $($R0) == "STATUS_SUCCESSFUL"
  480. IfContains(i) $(!NTN_InfOption) in $($R1)
  481. goto ContinueUpgrade
  482. endif
  483. endif
  484. read-syms IncorrectOemsetupDisk$(!STF_LANGUAGE)
  485. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorText)
  486. set Exit_Code = 1
  487. goto end
  488. ContinueUpgrade = +
  489. Endif
  490. ;
  491. ; if we supplied a specific oem directory, use it
  492. ;
  493. ifstr(i) $(!NTN_SRCPATH) != ""
  494. Set !STF_SRCDIR_OVERRIDE = $(!STF_SRCDIR)
  495. Endif
  496. Shell $(!NTN_Infname) $(!NTN_InfSection) +
  497. $(!STF_LANGUAGE) $(!NTN_InfOption) +
  498. $(!STF_SRCDIR) $(AddCopy) $(DoCopy) $(DoConfig)
  499. Ifstr(i) $($ShellCode) != $(!SHELL_CODE_OK)
  500. Debug-Output "NCPASHEL.INF: SHELL ERROR: "$($ShellCode)
  501. goto shellerror
  502. Endif
  503. Debug-Output "NCPASHEL: INF return: "$($R0)
  504. Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  505. set Exit_Code = 0
  506. else-ifstr(i) $($R0) == STATUS_USERCANCEL
  507. set Exit_Code = 1
  508. else-ifstr(i) $($R0) == STATUS_NO_EFFECT
  509. set Exit_Code = 3
  510. else-ifstr(i) $($R0) == STATUS_REBIND
  511. set Exit_Code = 4
  512. else-ifstr(i) $($R0) == STATUS_REBOOT
  513. set Exit_Code = 5
  514. else
  515. set Exit_Code = 2
  516. Endif
  517. EndWait
  518. goto end
  519. ;------------------------------------------------------------------
  520. ; Fatal error display functions
  521. ;------------------------------------------------------------------
  522. shellerror = +
  523. read-syms ShellError$(!$ShellCode)$(!STF_LANGUAGE)
  524. Debug-Output "NCPASHEL: SHELL ERROR: "$(Error)
  525. goto fatal
  526. fatalnoinfname = +
  527. set FatalErrorIndex = 2
  528. goto fatalmsg
  529. fatalmsg = +
  530. read-syms FatalError$(FatalErrorIndex)$(!STF_LANGUAGE)
  531. Debug-Output "NCPASHEL: FATAL ERROR: "$(Error)
  532. goto fatal
  533. fatal = +
  534. read-syms FatalDlg$(!STF_LANGUAGE)
  535. ui start "FatalError"
  536. goto end
  537. ;------------------------------------------------------------------
  538. ; Exit NCPASHEL.INF; return to NCPA
  539. ;------------------------------------------------------------------
  540. end = +
  541. Ifstr(i) $(!LIBHANDLE) != ""
  542. LibraryProcedure DontCare, $(!LIBHANDLE), DeleteAllConnections
  543. Endif
  544. Debug-Output "NCPASHEL: NCPASHEL: returning to NCPA"
  545. goto term
  546. ;
  547. ; Immediate exit
  548. ;
  549. term = +
  550. Debug-Output "NCPASHEL: Bye."
  551. exit
  552. ;***********************************************************************
  553. ;
  554. ; End of NCPASHEL.INF
  555. ;
  556. ;***********************************************************************