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.

1157 lines
39 KiB

  1. ;***********************************************************************
  2. ; CONSTANTS FOR USING DIALOGS
  3. ;***********************************************************************
  4. [GeneralConstants]
  5. ;
  6. ; Constants to support the use of radio button dialogs
  7. ;
  8. Radio1 = "1"
  9. Radio2 = "2"
  10. Radio3 = "3"
  11. Radio4 = "4"
  12. Radio5 = "5"
  13. Radio6 = "6"
  14. Radio7 = "7"
  15. Radio8 = "8"
  16. Radio9 = "9"
  17. ;
  18. ; Constants to support the use of checkbox dialogs
  19. Chosen = "ON"
  20. NotChosen = "OFF"
  21. ;************************************************************************
  22. ; CONFIGURATION CHOICES
  23. ; ---------------------
  24. ; the sections below contain the different choices supported for
  25. ; the configuration items shown. an id section establishes the
  26. ; language independent IDs supported by nt setup. for each language
  27. ; supported a text section displays the text used for the different
  28. ; choices
  29. ;************************************************************************
  30. ;********************************
  31. ; PLATFORM INDEPENDENT CHOICES
  32. ;********************************
  33. ;----------------------------------------------------
  34. ; PROCESSOR CHOICES
  35. ;----------------------------------------------------
  36. [ProcessorID]
  37. ProcessorID_I386 = I386
  38. ProcessorID_I486 = I486
  39. ProcessorID_I586 = I586
  40. ProcessorID_R4000 = R4000
  41. ProcessorID_Alpha = Alpha_AXP
  42. ProcessorID_PPC601 = PPC601
  43. ProcessorID_PPC603 = PPC603
  44. ProcessorID_PPC604 = PPC604
  45. ProcessorID_PPC620 = PPC620
  46. ;----------------------------------------------------
  47. ; PLATFORM CHOICES
  48. ;----------------------------------------------------
  49. [PlatformID]
  50. PlatformID_I386 = I386
  51. PlatformID_Mips = Mips
  52. PlatformID_Alpha = Alpha
  53. PlatformID_PPC = ppc
  54. ;**************************************************************
  55. ; UI VARIABLES
  56. ;**************************************************************
  57. [ProcessorVar]
  58. STF_PROCESSOR = "" ? $(LIBHANDLE) GetProcessor
  59. STF_PLATFORM = ""
  60. [LanguageVar]
  61. ;
  62. ; Language to Use For interaction with user
  63. ;
  64. STF_LANGUAGE = "" ? $(LIBHANDLE) GetLanguage
  65. [UiVars]
  66. ;
  67. ; Version Information
  68. ;
  69. BuildVersion = "12-91"
  70. ;
  71. ; Destination TOOLS Drive Particulars
  72. ;
  73. VolumeList = {} ? $(LIBHANDLE) GetHardDriveLetters
  74. VolumeFreeList = {} ? $(LIBHANDLE) GetHardDriveFreeSpace
  75. VolumeFSList = {} ? $(LIBHANDLE) GetHardDriveFileSystems
  76. DestVolume = ""
  77. ;
  78. ;
  79. ; Mstools directory
  80. ;
  81. MSTOOLS = "\MSTOOLS"
  82. ;
  83. ; user environment variables in the current user's profile
  84. ;
  85. PathEnvVar = {} ? $(LIBHANDLE) GetEnvVar USER Path
  86. LibEnvVar = {} ? $(LIBHANDLE) GetEnvVar USER Lib
  87. IncludeEnvVar = {} ? $(LIBHANDLE) GetEnvVar USER Include
  88. InitEnvVar = {} ? $(LIBHANDLE) GetEnvVar USER init
  89. ;
  90. ; Installation mode
  91. ;
  92. MinInteract = $(Radio1)
  93. MaxInteract = $(Radio2)
  94. STF_INSTALL_MODE = $(MinInteract)
  95. ;
  96. ; Mstools Setup Help IDs
  97. ;
  98. !IDH_DB_TOOLSWELCOME_INS = 3000
  99. !IDH_DB_MSTINSTALLMODE_INS = 3010
  100. !IDH_DB_MSTDEST_INS = 3020
  101. !IDH_DB_MSTOPTIONS_INS = 3030
  102. [VarsI386]
  103. ;
  104. MinToolsSize = 10
  105. MaxToolsSize = 26
  106. ToolsSamplesSize = 1058816
  107. ToolsHelpSize = 8671232
  108. MfcSize = 5675520
  109. PosixSize = 0
  110. ;
  111. ; Installation options
  112. ;
  113. DoToolsSamples = $(Chosen)
  114. DoToolsHelp = $(Chosen)
  115. DoMfc = $(Chosen)
  116. DoPosix = $(NotChosen)
  117. ;
  118. ; Options to disable
  119. ;
  120. DisableList = {4}
  121. [VarsMips]
  122. ;
  123. MinToolsSize = 20
  124. MaxToolsSize = 36
  125. ToolsSamplesSize = 1058816
  126. ToolsHelpSize = 8671232
  127. MfcSize = 0
  128. PosixSize = 0
  129. ;
  130. ; Installation options
  131. ;
  132. DoToolsSamples = $(Chosen)
  133. DoToolsHelp = $(Chosen)
  134. DoMfc = $(NotChosen)
  135. DoPosix = $(NotChosen)
  136. ;
  137. ; Options to disable
  138. ;
  139. DisableList = {3,4}
  140. [Varsppc]
  141. ;
  142. MinToolsSize = 20
  143. MaxToolsSize = 36
  144. ToolsSamplesSize = 1058816
  145. ToolsHelpSize = 8671232
  146. MfcSize = 0
  147. PosixSize = 0
  148. ;
  149. ; Installation options
  150. ;
  151. DoToolsSamples = $(Chosen)
  152. DoToolsHelp = $(Chosen)
  153. DoMfc = $(NotChosen)
  154. DoPosix = $(NotChosen)
  155. ;
  156. ; Options to disable
  157. ;
  158. DisableList = {3,4}
  159. ;**************************************************************************
  160. ; DLL LOAD and FREE
  161. ; the following section contain commands to load specific dll libraries and
  162. ; to free them
  163. ;**************************************************************************
  164. ;----------------------------------------------
  165. ; a) DETECT LIBRARY
  166. ;----------------------------------------------
  167. [LoadSetupLibrary]
  168. LoadLibrary "x" $(STF_CWDDIR)\setupdll.dll LIBHANDLE
  169. exit
  170. [FreeSetupLibrary]
  171. FreeLibrary $(LIBHANDLE)
  172. exit
  173. ;**************************************************************************
  174. ; SHELL COMMANDS SCRIPT
  175. ;**************************************************************************
  176. [Shell Commands]
  177. ;
  178. ; Initialise the app, by setting the caption and loading the support library
  179. ;
  180. set-title "Win32 SDK Setup"
  181. set Exit_Code = $(!SETUP_ERROR_GENERAL)
  182. install LoadSetupLibrary
  183. StartWait
  184. ;
  185. ; read general constants
  186. ;
  187. set-subst LF = "\n"
  188. read-syms GeneralConstants
  189. ;
  190. ; read the platform independent choices
  191. ;
  192. read-syms LanguageID
  193. read-syms ProcessorID
  194. read-syms PlatformID
  195. ;
  196. ; read the default language and try to detect the language
  197. ;
  198. read-syms LanguageVar
  199. detect LanguageVar
  200. ;
  201. ; read and detect the processor we are working on
  202. ;
  203. read-syms ProcessorVar
  204. detect ProcessorVar
  205. read-syms Strings$(!STF_LANGUAGE)
  206. ;
  207. ; Check processor type, see if it is supported, if so what platform does it
  208. ; belong to.
  209. ;
  210. ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I386)
  211. set STF_PLATFORM = $(PlatformID_I386)
  212. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I486)
  213. set STF_PLATFORM = $(PlatformID_I386)
  214. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I586)
  215. set STF_PLATFORM = $(PlatformID_I386)
  216. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_R4000)
  217. set STF_PLATFORM = $(PlatformID_Mips)
  218. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_Alpha)
  219. set STF_PLATFORM = $(PlatformID_Alpha)
  220. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC601)
  221. set STF_PLATFORM = $(PlatformID_PPC)
  222. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC603)
  223. set STF_PLATFORM = $(PlatformID_PPC)
  224. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC604)
  225. set STF_PLATFORM = $(PlatformID_PPC)
  226. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC620)
  227. set STF_PLATFORM = $(PlatformID_PPC)
  228. else
  229. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String1)
  230. goto setupnotdone
  231. endif
  232. ;
  233. ; read the UI Variables and detect their setting on the current machine
  234. ;
  235. read-syms UiVars
  236. detect UiVars
  237. read-syms Vars$(STF_PLATFORM)
  238. EndWait
  239. welcome =+
  240. read-syms WelcomeDlg$(STF_LANGUAGE)
  241. ui start "Welcome"
  242. ifstr(i) $(DLGEVENT) == "CONTINUE"
  243. ui pop 1
  244. goto queryinstallmode
  245. else-ifstr(i) $(DLGEVENT) == "EXIT"
  246. shell "" QueryUserQuit
  247. ifstr(i) $($R1) == "OK"
  248. ui pop 1
  249. goto setupnotdone
  250. else
  251. goto welcome
  252. endif
  253. else
  254. goto end
  255. endif
  256. ;
  257. ; show install mode dialog and query if we are to operate in express mode
  258. ; or in full install
  259. ;
  260. queryinstallmode =+
  261. read-syms InstallModeDlg$(STF_LANGUAGE)
  262. ui start "InstallMode"
  263. ifstr(i) $(DLGEVENT) == "CONTINUE"
  264. ui pop 1
  265. set STF_INSTALL_MODE = $(ButtonChecked)
  266. goto setdestination
  267. else-ifstr(i) $(DLGEVENT) == "EXIT"
  268. shell "" QueryUserQuit
  269. ifstr(i) $($R1) == "OK"
  270. ui pop 1
  271. goto setupnotdone
  272. else
  273. goto queryinstallmode
  274. endif
  275. else
  276. goto end
  277. endif
  278. setdestination =+
  279. ;
  280. ; go through the volume list and form the destination volume list of
  281. ; all volumes which have the size needed to install the mstools.
  282. ;
  283. set DestVolumeList = {}
  284. set DestVolumeFreeList = {}
  285. ForListDo $(VolumeList)
  286. set CurrentVolume = *($(VolumeList), $(#))
  287. set CurrentVolumeFree = *($(VolumeFreeList), $(#))
  288. set CurrentVolumeFS = *($(VolumeFSList), $(#))
  289. Ifstr(i) $(CurrentVolumeFS) == ""
  290. goto skipvol
  291. else-Ifint $(CurrentVolumeFree) < $(MinToolsSize)
  292. goto skipvol
  293. endif
  294. set DestVolumeList = >($(DestVolumeList), $(CurrentVolume))
  295. set DestVolumeFreeList = >($(DestVolumeFreeList), $(CurrentVolumeFree))
  296. skipvol=+
  297. EndForListDo
  298. ;
  299. ; check to see if there is any volume else tell the user to create enough
  300. ; space and exit
  301. ;
  302. ifstr(i) $(DestVolumeList) == {}
  303. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String8)$(MaxToolsSize)$(String10)$(String11)
  304. goto setupnotdone
  305. endif
  306. ;
  307. ; destination drive is the drive with the maximum space
  308. ;
  309. set DestVolume = ""
  310. set DestVolumeFree = 0
  311. ForListDo $(DestVolumeList)
  312. set Volume = $($)
  313. set VolumeFree = *($(DestVolumeFreeList), ~($(DestVolumeList), $(Volume)))
  314. ifint $(VolumeFree) > $(DestVolumeFree)
  315. set DestVolume = $(Volume)
  316. set DestVolumeFree = $(VolumeFree)
  317. endif
  318. EndForListDo
  319. set MstoolsDir = $(DestVolume)$(MSTOOLS)
  320. ;
  321. ; display tools destination, size available and needed for
  322. ; user approval
  323. ;
  324. destination =+
  325. ifstr(i) $(STF_INSTALL_MODE) == $(MinInteract)
  326. ifint $(DestVolumeFree) < $(MaxToolsSize)
  327. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String8)$(MaxToolsSize)$(String10)$(String12)
  328. goto setupnotdone
  329. else
  330. goto mstooldirs
  331. endif
  332. endif
  333. read-syms DestinationDlg$(STF_LANGUAGE)
  334. ui start "Destination"
  335. ifstr(i) $(DLGEVENT) == "NOTIFY"
  336. ifstr(i) $(Combo1Out) != $(DestVolume)
  337. set ReInit = YES
  338. set DestVolume = $(Combo1Out)
  339. set DestVolumeFree = *($(DestVolumeFreeList), ~($(DestVolumeList), $(DestVolume)))
  340. set MstoolsDir = $(DestVolume)$(MSTOOLS)
  341. else
  342. set ReInit = NO
  343. endif
  344. goto destination
  345. else-ifstr(i) $(DLGEVENT) == "CONTINUE"
  346. set ReInit = NO
  347. LibraryProcedure IsFullPath, $(LIBHANDLE), CheckPathFullPathSpec $(EditTextOut)
  348. ifstr(i) $(IsFullPath) == "NO"
  349. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String13)$(DestVolume)$(MSTOOLS)
  350. goto destination
  351. else
  352. GetDriveInPath Drive, $(EditTextOut)
  353. Ifcontains(i) $(Drive) in $(DestVolumeList)
  354. set DestVolume = $(Drive)
  355. set DestVolumeFree = *($(DestVolumeFreeList), ~($(DestVolumeList), $(DestVolume)))
  356. set MstoolsDir = $(EditTextOut)
  357. else
  358. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String14)
  359. goto destination
  360. endif
  361. endif
  362. ui pop 1
  363. goto mstooldirs
  364. else-ifstr(i) $(DLGEVENT) == "EXIT"
  365. set ReInit = NO
  366. shell "" QueryUserQuit
  367. ifstr(i) $($R1) == "OK"
  368. ui pop 1
  369. goto setupnotdone
  370. else
  371. goto destination
  372. endif
  373. else
  374. goto end
  375. endif
  376. mstooldirs = +
  377. LibraryProcedure MstoolsDir, $(LIBHANDLE), AppendBackSlash $(MstoolsDir)
  378. ;
  379. ; First find all the destination directories for the tools
  380. ;
  381. set MstoolsPath = $(MstoolsDir)bin
  382. set MstoolsLib = $(MstoolsDir)lib
  383. set MstoolsInclude = $(MstoolsDir)h
  384. set MstoolsIncStrict = $(MstoolsDir)h\strict
  385. set MstoolsInit = $(MstoolsDir)init
  386. set ToolsSamplesInclude = $(MstoolsDir)samples\inc
  387. set MfcLib = $(MstoolsDir)mfc\lib
  388. set MfcInclude = $(MstoolsDir)mfc\include
  389. ;
  390. ; mstool install. ask user for options on mstool install.
  391. ;
  392. mstools = +
  393. ifstr(i) $(STF_INSTALL_MODE) == $(MinInteract)
  394. goto mstoolsinstall
  395. endif
  396. ifint $(DestVolumeFree) < $(MaxToolsSize)
  397. set DoToolsSamples = $(NotChosen)
  398. set DoToolsHelp = $(NotChosen)
  399. set DoMfc = $(NotChosen)
  400. set DoPosix = $(NotChosen)
  401. endif
  402. set-sub FreeForOptional = $(DestVolumeFree) $(MinToolsSize)
  403. ifstr(i) $(FreeForOptional) == 0
  404. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(String15)
  405. endif
  406. read-syms MSToolsOptionsDlg$(STF_LANGUAGE)
  407. ui start "Options"
  408. ifstr(i) $(DLGEVENT) == "CONTINUE"
  409. set DoToolsSamples = *($(CheckItemsOut), 1)
  410. set DoToolsHelp = *($(CheckItemsOut), 2)
  411. set DoMfc = *($(CheckItemsOut), 3)
  412. set DoPosix = *($(CheckItemsOut), 4)
  413. ui pop 1
  414. goto mstoolsinstall
  415. else-ifstr(i) $(DLGEVENT) == "EXIT"
  416. shell "" QueryUserQuit
  417. ifstr(i) $($R1) == "OK"
  418. ui pop 1
  419. goto setupnotdone
  420. else
  421. goto mstools
  422. endif
  423. else
  424. goto "end"
  425. endif
  426. ;
  427. ; build mstools copy list
  428. ;
  429. mstoolsinstall =+
  430. StartWait
  431. install Install-CopyToolsFiles
  432. EndWait
  433. ;
  434. ; Complete the copying of files added by other options.
  435. ;
  436. ; Alter the CFG/INI files as needed by the options.
  437. ;
  438. ; print information screen to restart
  439. ;
  440. finish = +
  441. ;
  442. ; first copy all the files over
  443. ;
  444. read-syms ProgressCopy$(STF_LANGUAGE)
  445. install Install-All-Files-Now
  446. ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_SUCCESS"
  447. goto mstoolsconfig
  448. else
  449. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String4)
  450. goto setupnotdone
  451. endif
  452. StartWait
  453. mstoolsconfig=+
  454. ;
  455. ; first initialize the variables which indicate whether new values are
  456. ; to be set for the variables or not
  457. ;
  458. ForListDo {Path, Lib, Include, Init}
  459. set FSet$($)Var = FALSE
  460. EndForListDo
  461. ;
  462. ; add the mfc variables if mfc chosen, posix is not set up
  463. ;
  464. ifstr(i) $(DoMfc) == $(Chosen)
  465. ForListDo {Include}
  466. set Var = $($)
  467. ifstr(i) $($(Var)EnvVar) == {}
  468. set $(Var)EnvVar = {$(Var), 0, $(!REG_VT_EXPAND_SZ), {$(Mfc$(Var))}}
  469. set FSet$(Var)Var = TRUE
  470. else
  471. set VarTitle = *($($(Var)EnvVar), 2)
  472. set VarRegType = *($($(Var)EnvVar), 3)
  473. set VarValue = *($($(Var)EnvVar), 4)
  474. shell "" PrependNewValueToEnvVar $(VarValue) $(Mfc$(Var))
  475. ifstr(i) $($R0) == STATUS_FAILED
  476. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String6)
  477. goto setupnotdone
  478. endif
  479. ifstr(i) $($R1) == "TRUE"
  480. set FSet$(Var)Var = TRUE
  481. set $(Var)EnvVar = {$(Var), $(VarTitle), $(VarRegType), $($R2)}
  482. endif
  483. endif
  484. EndForListDo
  485. endif
  486. ifstr(i) $(DoToolsSamples) == $(Chosen)
  487. ForListDo {Include}
  488. set Var = $($)
  489. ifstr(i) $($(Var)EnvVar) == {}
  490. set $(Var)EnvVar = {$(Var), 0, $(!REG_VT_EXPAND_SZ), {$(ToolsSamples$(Var))}}
  491. set FSet$(Var)Var = TRUE
  492. else
  493. set VarTitle = *($($(Var)EnvVar), 2)
  494. set VarRegType = *($($(Var)EnvVar), 3)
  495. set VarValue = *($($(Var)EnvVar), 4)
  496. shell "" PrependNewValueToEnvVar $(VarValue) $(ToolsSamples$(Var))
  497. ifstr(i) $($R0) == STATUS_FAILED
  498. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String6)
  499. goto setupnotdone
  500. endif
  501. ifstr(i) $($R1) == "TRUE"
  502. set FSet$(Var)Var = TRUE
  503. set $(Var)EnvVar = {$(Var), $(VarTitle), $(VarRegType), $($R2)}
  504. endif
  505. endif
  506. EndForListDo
  507. endif
  508. ;
  509. ; For the Path, Lib and Include variables see if we can prepend them
  510. ; onto the current variables
  511. ;
  512. ForListDo {Path, Lib, Include, Init}
  513. set Var = $($)
  514. ifstr(i) $($(Var)EnvVar) == {}
  515. set $(Var)EnvVar = {$(Var), 0, $(!REG_VT_EXPAND_SZ), {$(Mstools$(Var))}}
  516. set FSet$(Var)Var = TRUE
  517. else
  518. set VarTitle = *($($(Var)EnvVar), 2)
  519. set VarRegType = *($($(Var)EnvVar), 3)
  520. set VarValue = *($($(Var)EnvVar), 4)
  521. shell "" PrependNewValueToEnvVar $(VarValue) $(Mstools$(Var))
  522. ifstr(i) $($R0) == STATUS_FAILED
  523. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String6)
  524. goto setupnotdone
  525. endif
  526. ifstr(i) $($R1) == "TRUE"
  527. set FSet$(Var)Var = TRUE
  528. set $(Var)EnvVar = {$(Var), $(VarTitle), $(VarRegType), $($R2)}
  529. endif
  530. endif
  531. EndForListDo
  532. ForListDo {Include}
  533. set Var = $($)
  534. ifstr(i) $($(Var)EnvVar) == {}
  535. set $(Var)EnvVar = {$(Var), 0, $(!REG_VT_EXPAND_SZ), {$(MstoolsIncStrict)}}
  536. set FSet$(Var)Var = TRUE
  537. else
  538. set VarTitle = *($($(Var)EnvVar), 2)
  539. set VarRegType = *($($(Var)EnvVar), 3)
  540. set VarValue = *($($(Var)EnvVar), 4)
  541. shell "" PrependNewValueToEnvVar $(VarValue) $(MstoolsIncStrict)
  542. ifstr(i) $($R0) == STATUS_FAILED
  543. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String6)
  544. goto setupnotdone
  545. endif
  546. ifstr(i) $($R1) == "TRUE"
  547. set FSet$(Var)Var = TRUE
  548. set $(Var)EnvVar = {$(Var), $(VarTitle), $(VarRegType), $($R2)}
  549. endif
  550. endif
  551. EndForListDo
  552. ;
  553. ; make cpu variable - STF_PLATFORM
  554. ;
  555. set FSetCpuVar = TRUE
  556. ifstr(i) $(!STF_PLATFORM) == $(!PlatformID_I386)
  557. set CpuEnvVar = {Cpu, 0, $(!REG_VT_SZ), i386}
  558. endif
  559. ifstr(i) $(!STF_PLATFORM) == $(!PlatformID_MIPS)
  560. set CpuEnvVar = {Cpu, 0, $(!REG_VT_SZ), MIPS}
  561. endif
  562. ifstr(i) $(!STF_PLATFORM) == $(!PlatformID_Alpha)
  563. set CpuEnvVar = {Cpu, 0, $(!REG_VT_SZ), ALPHA}
  564. endif
  565. ifstr(i) $(!STF_PLATFORM) == $(!PlatformID_PPC)
  566. set CpuEnvVar = {Cpu, 0, $(!REG_VT_SZ), ppc}
  567. endif
  568. ;
  569. ; modify all the environment variables
  570. ;
  571. ForListDo {Path, Lib, Include, Init, Cpu}
  572. ;
  573. ; if the variable to set the variable is set
  574. ifstr(i) $(FSet$($)Var) == "TRUE"
  575. shell "" SetEnvironmentString $($($)EnvVar)
  576. ifstr(i) $($R0) == STATUS_FAILED
  577. shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String7)
  578. endif
  579. endif
  580. EndForListDo
  581. install Install-MSTools-Groups
  582. setupdone=+
  583. set Exit_Code = $(!SETUP_ERROR_SUCCESS)
  584. read-syms SetupDoneDlg$(STF_LANGUAGE)
  585. EndWait
  586. ui start "Done"
  587. ifstr(i) $(DLGEVENT) == "CONTINUE"
  588. ui pop 1
  589. goto end
  590. else
  591. goto end
  592. endif
  593. setupnotdone=+
  594. read-syms SetupNotDoneDlg$(STF_LANGUAGE)
  595. EndWait
  596. ui start "NotDone"
  597. ifstr(i) $(DLGEVENT) == "CONTINUE"
  598. ui pop 1
  599. goto end
  600. else
  601. goto end
  602. endif
  603. end = +
  604. install FreeSetupLibrary
  605. exit
  606. ;*****************************************************************
  607. ; *
  608. ; INSTALLATION SUPPORT ROUTINES *
  609. ; *
  610. ;*****************************************************************
  611. ;-----------------------------------------------------------------------
  612. ; ROUTINE: QueryUserQuit
  613. ;
  614. ; DESCRIPTION: This routine queries whether the user wants to quit setup
  615. ;
  616. ; INPUTS: None
  617. ;
  618. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL |
  619. ; STATUS_FAILED
  620. ;
  621. ; $R1: UserAction: OK | CANCEL
  622. ;
  623. ;------------------------------------------------------------------------
  624. [QueryUserQuit]
  625. set Status = STATUS_FAILED
  626. set UserAction = CANCEL
  627. ;
  628. ; read in quit message
  629. ;
  630. read-syms ExitWarningDlg$(!STF_LANGUAGE)
  631. ui start "ExitWarning"
  632. ifstr(i) $(DLGEVENT) == "YES"
  633. set Status = STATUS_SUCCESSFUL
  634. set UserAction = "OK"
  635. else-ifstr(i) $(DLGEVENT) == "NO"
  636. set Status = STATUS_SUCCESSFUL
  637. set UserAction = "CANCEL"
  638. else
  639. endif
  640. fin_QueryUserQuit = +
  641. Return $(Status) $(UserAction)
  642. ;-----------------------------------------------------------------------
  643. ; ROUTINE: PrependNewValueToEnvVar
  644. ;
  645. ; DESCRIPTION: Looks at the existing value of an environment variable
  646. ; and appends a new value if it is not already present
  647. ;
  648. ; INPUTS: $0: OldValueList
  649. ; $1: NewValue
  650. ;
  651. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL
  652. ; STATUS_FAILED
  653. ;
  654. ; $R1: Changed?
  655. ; $R2: NewValueList
  656. ;
  657. ;------------------------------------------------------------------------
  658. [PrependNewValueToEnvVar]
  659. ;
  660. set Status = STATUS_FAILED
  661. set NewValueList = {}
  662. set Changed = TRUE
  663. ;
  664. set Error = NO
  665. ForListDo $($0)
  666. ifstr(i) $(Error) == NO
  667. ifstr(i) $(Changed) == TRUE
  668. LibraryProcedure ExpandedValue, $(!LIBHANDLE), ExpandSz $($)
  669. ifstr(i) $(ExpandedValue) == "ERROR"
  670. set Error = YES
  671. else-ifstr(i) $(ExpandedValue) == $($1)
  672. set Changed = FALSE
  673. endif
  674. endif
  675. endif
  676. EndForListDo
  677. ifstr(i) $(Error) == "YES"
  678. goto finish_append
  679. endif
  680. set Status = STATUS_SUCCESSFUL
  681. ifstr(i) $(Changed) == TRUE
  682. set NewValueList = {$($1)}
  683. ForListDo $($0)
  684. set NewValueList = >($(NewValueList), $($))
  685. EndForListDo
  686. endif
  687. finish_append = +
  688. return $(Status) $(Changed) $(NewValueList)
  689. ;-----------------------------------------------------------------------
  690. ; ROUTINE: SetEnvironmentString
  691. ;
  692. ; DESCRIPTION: Set the value for a user environment string
  693. ;
  694. ; INPUTS: $0: VarList
  695. ;
  696. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL
  697. ; STATUS_FAILED
  698. ;
  699. ;
  700. ;------------------------------------------------------------------------
  701. [SetEnvironmentString]
  702. ;
  703. ;
  704. set Status = STATUS_FAILED
  705. set Var = *($($0), 1)
  706. set VarTitle = *($($0), 2)
  707. set VarRegType = *($($0), 3)
  708. set VarValueList = *($($0), 4)
  709. set VarValue = ""
  710. ForListDo $(VarValueList)
  711. ifstr(i) $(VarValue) != ""
  712. set VarValue = $(VarValue)";"$($)
  713. else
  714. set VarValue = $($)
  715. endif
  716. EndForListDo
  717. LibraryProcedure STATUS, $(!LIBHANDLE), SetEnvVar USER $(Var) $(VarTitle) $(VarRegType) $(VarValue)
  718. ifstr(i) $(STATUS) == "ERROR"
  719. goto finish_setenvstr
  720. endif
  721. set Status = STATUS_SUCCESSFUL
  722. finish_setenvstr = +
  723. Return $(Status)
  724. ;*****************************************************************
  725. ; *
  726. ; INSTALLATION SUPPORT ROUTINES *
  727. ; *
  728. ;*****************************************************************
  729. [Install-MSTools-Groups]
  730. set ToolsGroup = "Win32 Software Development Kit"
  731. CreateProgManGroup $(ToolsGroup) ""
  732. ShowProgManGroup $(ToolsGroup), 1
  733. CreateProgmanItem $(ToolsGroup) , "Readme" "notepad "$(MstoolsDir)"readme.txt" "" 0
  734. CreateProgmanItem $(ToolsGroup) , "M Editor" $(MstoolsPath)"\mep" "moricons.dll" 86
  735. CreateProgmanItem $(ToolsGroup) , "Dialog Editor" $(MstoolsPath)"\dlgedit" "" 0
  736. CreateProgmanItem $(ToolsGroup) , "Image Editor" $(MstoolsPath)"\imagedit" "" 0
  737. CreateProgmanItem $(ToolsGroup) , "Spy" $(MstoolsPath)"\spy" "" 0
  738. CreateProgmanItem $(ToolsGroup) , "DDESpy" $(MstoolsPath)"\ddespy" "" 0
  739. CreateProgmanItem $(ToolsGroup) , "WinDbg" $(MstoolsPath)"\windbg" "" 0
  740. CreateProgmanItem $(ToolsGroup) , "Zoom Utility" $(MstoolsPath)"\zoomin" "" 0
  741. CreateProgmanItem $(ToolsGroup) , "Font Editor" $(MstoolsPath)"\fontedit" "" 0
  742. CreateProgmanItem $(ToolsGroup) , "PView" $(MstoolsPath)"\pview" "" 0
  743. CreateProgmanItem $(ToolsGroup) , "PortTool" $(MstoolsPath)"\porttool" "" 0
  744. CreateProgmanItem $(ToolsGroup) , "PStat" $(MstoolsPath)"\pstat" "progman.exe" 40
  745. CreateProgmanItem $(ToolsGroup) , "CPU Thermometer" $(MstoolsPath)"\cputherm" "" 0
  746. ifstr(i) $(DoToolsHelp) == $(Chosen)
  747. CreateProgmanItem $(ToolsGroup) , "Win32 API Reference" "winhelp "$(MstoolsPath)"\api32wh.hlp" "" 0
  748. CreateProgmanItem $(ToolsGroup) , "C Run-time Reference" "winhelp "$(MstoolsPath)"\msc.hlp" "" 0
  749. CreateProgmanItem $(ToolsGroup) , "RPC Language Help" "winhelp "$(MstoolsPath)"\midl10wh.hlp" "" 0
  750. CreateProgmanItem $(ToolsGroup) , "Samples Help" "winhelp "$(MstoolsPath)"\samples.hlp" "" 0
  751. endif
  752. ShowProgManGroup $(ToolsGroup), 6
  753. exit
  754. ;************************************************************************
  755. ; *
  756. ; MSTOOLS SUPPORT *
  757. ; *
  758. ;************************************************************************
  759. [Install-CopyToolsFiles]
  760. set STF_VITAL = ""
  761. ;
  762. ; 1. MSTOOLS - always done
  763. CreateDir $(MstoolsDir)
  764. CreateDir $(MstoolsInclude)
  765. CreateDir $(MstoolsInclude)\sys
  766. CreateDir $(MstoolsInclude)\strict
  767. CreateDir $(MstoolsPath)
  768. CreateDir $(MstoolsLib)
  769. CreateDir $(MstoolsInit)
  770. AddSectionFilesToCopyList Files-mstools $(STF_SRCDIR)mstools $(MstoolsDir)
  771. AddSectionFilesToCopyList Files-mstools-bin-$(STF_PLATFORM) $(STF_SRCDIR)mstools\bin\$(STF_PLATFORM) $(MstoolsPath)
  772. AddSectionFilesToCopyList Files-mstools-h $(STF_SRCDIR)mstools\h $(MstoolsInclude)
  773. AddSectionFilesToCopyList Files-mstools-h-sys $(STF_SRCDIR)mstools\h\sys $(MstoolsInclude)\sys
  774. AddSectionFilesToCopyList Files-mstools-h-strict $(STF_SRCDIR)mstools\h\strict $(MstoolsInclude)\strict
  775. AddSectionFilesToCopyList Files-mstools-init $(STF_SRCDIR)mstools\init $(MstoolsInit)
  776. AddSectionFilesToCopyList Files-mstools-lib-$(STF_PLATFORM) $(STF_SRCDIR)mstools\lib\$(STF_PLATFORM) $(MstoolsLib)
  777. ;
  778. ; 2. Help files - conditional
  779. ;
  780. ifstr(i) $(!DoToolsHelp) == $(!Chosen)
  781. AddSectionFilesToCopyList Files-mstools-help $(STF_SRCDIR)mstools\help $(MstoolsPath)
  782. endif
  783. ;
  784. ; 3. Mstools samples - conditional
  785. ;
  786. ifstr(i) $(!DoToolsSamples) == $(!Chosen)
  787. set SampleList = { +
  788. cliptext ,+
  789. comm ,+
  790. console ,+
  791. cursor ,+
  792. deb ,+
  793. filer ,+
  794. fontview ,+
  795. gdidemo ,+
  796. generic ,+
  797. getsys ,+
  798. inc ,+
  799. input ,+
  800. mandel ,+
  801. maskblt ,+
  802. memory ,+
  803. menu ,+
  804. mfedit ,+
  805. mltithrd ,+
  806. multipad ,+
  807. mypal ,+
  808. npclient ,+
  809. npserver ,+
  810. ntfonts ,+
  811. output ,+
  812. owncombo ,+
  813. pdc ,+
  814. playit ,+
  815. plgblt ,+
  816. polydraw ,+
  817. registry ,+
  818. select ,+
  819. showdib ,+
  820. sidcln ,+
  821. simple ,+
  822. tls ,+
  823. wxform ,+
  824. rpc +
  825. }
  826. ;
  827. ; First copy all the files in the samples directory
  828. ;
  829. CreateDir $(MstoolsDir)samples
  830. AddSectionFilesToCopyList Files-mstools-samples $(STF_SRCDIR)mstools\samples $(MstoolsDir)samples
  831. ;
  832. ; Then copy all the files in the various directories at the sample level
  833. ;
  834. ForListDo $(SampleList)
  835. CreateDir $(MstoolsDir)samples\$($)
  836. AddSectionFilesToCopyList Files-mstools-samples-$($) $(STF_SRCDIR)mstools\samples\$($) $(MstoolsDir)samples\$($)
  837. EndForListDo
  838. ;
  839. ; Lastly handle ole, rpc & ddeml separately because this has multiple level subdirs
  840. ;
  841. ; 1. ole
  842. CreateDir $(MstoolsDir)samples\ole
  843. CreateDir $(MstoolsDir)samples\ole\clidemo
  844. CreateDir $(MstoolsDir)samples\ole\srvrdemo
  845. AddSectionFilesToCopyList Files-mstools-samples-ole-clidemo $(STF_SRCDIR)mstools\samples\ole\clidemo $(MstoolsDir)samples\ole\clidemo
  846. AddSectionFilesToCopyList Files-mstools-samples-ole-srvrdemo $(STF_SRCDIR)mstools\samples\ole\srvrdemo $(MstoolsDir)samples\ole\srvrdemo
  847. ; 2. ddeml
  848. CreateDir $(MstoolsDir)samples\ddeml
  849. CreateDir $(MstoolsDir)samples\ddeml\client
  850. CreateDir $(MstoolsDir)samples\ddeml\clock
  851. CreateDir $(MstoolsDir)samples\ddeml\server
  852. AddSectionFilesToCopyList Files-mstools-samples-ddeml-client $(STF_SRCDIR)mstools\samples\ddeml\client $(MstoolsDir)samples\ddeml\client
  853. AddSectionFilesToCopyList Files-mstools-samples-ddeml-clock $(STF_SRCDIR)mstools\samples\ddeml\clock $(MstoolsDir)samples\ddeml\clock
  854. AddSectionFilesToCopyList Files-mstools-samples-ddeml-server $(STF_SRCDIR)mstools\samples\ddeml\server $(MstoolsDir)samples\ddeml\server
  855. ; 3. rpc
  856. CreateDir $(MstoolsDir)samples\rpc
  857. CreateDir $(MstoolsDir)samples\rpc\data
  858. CreateDir $(MstoolsDir)samples\rpc\data\dunion
  859. CreateDir $(MstoolsDir)samples\rpc\data\inout
  860. CreateDir $(MstoolsDir)samples\rpc\data\xmit
  861. CreateDir $(MstoolsDir)samples\rpc\doctor
  862. CreateDir $(MstoolsDir)samples\rpc\dict
  863. CreateDir $(MstoolsDir)samples\rpc\handles
  864. CreateDir $(MstoolsDir)samples\rpc\handles\auto
  865. CreateDir $(MstoolsDir)samples\rpc\handles\cxhndl
  866. CreateDir $(MstoolsDir)samples\rpc\handles\usrdef
  867. CreateDir $(MstoolsDir)samples\rpc\hello
  868. CreateDir $(MstoolsDir)samples\rpc\mandel
  869. CreateDir $(MstoolsDir)samples\rpc\whello
  870. AddSectionFilesToCopyList Files-mstools-samples-rpc $(STF_SRCDIR)mstools\samples\rpc $(MstoolsDir)samples\rpc
  871. AddSectionFilesToCopyList Files-mstools-samples-rpc-data $(STF_SRCDIR)mstools\samples\rpc\data $(MstoolsDir)samples\rpc\data
  872. AddSectionFilesToCopyList Files-mstools-samples-rpc-data-dunion $(STF_SRCDIR)mstools\samples\rpc\data\dunion $(MstoolsDir)samples\rpc\data\dunion
  873. AddSectionFilesToCopyList Files-mstools-samples-rpc-data-inout $(STF_SRCDIR)mstools\samples\rpc\data\inout $(MstoolsDir)samples\rpc\data\inout
  874. AddSectionFilesToCopyList Files-mstools-samples-rpc-data-xmit $(STF_SRCDIR)mstools\samples\rpc\data\xmit $(MstoolsDir)samples\rpc\data\xmit
  875. AddSectionFilesToCopyList Files-mstools-samples-rpc-doctor $(STF_SRCDIR)mstools\samples\rpc\doctor $(MstoolsDir)samples\rpc\doctor
  876. AddSectionFilesToCopyList Files-mstools-samples-rpc-dict $(STF_SRCDIR)mstools\samples\rpc\dict $(MstoolsDir)samples\rpc\dict
  877. AddSectionFilesToCopyList Files-mstools-samples-rpc-handles $(STF_SRCDIR)mstools\samples\rpc\handles $(MstoolsDir)samples\rpc\handles
  878. AddSectionFilesToCopyList Files-mstools-samples-rpc-handles-auto $(STF_SRCDIR)mstools\samples\rpc\handles\auto $(MstoolsDir)samples\rpc\handles\auto
  879. AddSectionFilesToCopyList Files-mstools-samples-rpc-handles-cxhndl $(STF_SRCDIR)mstools\samples\rpc\handles\cxhndl $(MstoolsDir)samples\rpc\handles\cxhndl
  880. AddSectionFilesToCopyList Files-mstools-samples-rpc-handles-usrdef $(STF_SRCDIR)mstools\samples\rpc\handles\usrdef $(MstoolsDir)samples\rpc\handles\usrdef
  881. AddSectionFilesToCopyList Files-mstools-samples-rpc-hello $(STF_SRCDIR)mstools\samples\rpc\hello $(MstoolsDir)samples\rpc\hello
  882. AddSectionFilesToCopyList Files-mstools-samples-rpc-mandel $(STF_SRCDIR)mstools\samples\rpc\mandel $(MstoolsDir)samples\rpc\mandel
  883. AddSectionFilesToCopyList Files-mstools-samples-rpc-whello $(STF_SRCDIR)mstools\samples\rpc\whello $(MstoolsDir)samples\rpc\whello
  884. endif
  885. ;
  886. ; 4. Microsoft C++ - optional
  887. ;
  888. ifstr(i) $(DoMfc) == $(Chosen)
  889. CreateDir $(MstoolsDir)mfc
  890. CreateDir $(MfcInclude)
  891. CreateDir $(MfcLib)
  892. CreateDir $(MstoolsDir)mfc\doc
  893. CreateDir $(MstoolsDir)mfc\samples
  894. CreateDir $(MstoolsDir)mfc\samples\about2
  895. CreateDir $(MstoolsDir)mfc\samples\chart
  896. CreateDir $(MstoolsDir)mfc\samples\ctrltest
  897. CreateDir $(MstoolsDir)mfc\samples\fileview
  898. CreateDir $(MstoolsDir)mfc\samples\hello
  899. CreateDir $(MstoolsDir)mfc\samples\helloapp
  900. CreateDir $(MstoolsDir)mfc\samples\mdi
  901. CreateDir $(MstoolsDir)mfc\samples\minmdi
  902. CreateDir $(MstoolsDir)mfc\samples\minsvr
  903. CreateDir $(MstoolsDir)mfc\samples\minsvrmi
  904. CreateDir $(MstoolsDir)mfc\samples\multipad
  905. CreateDir $(MstoolsDir)mfc\samples\oclient
  906. CreateDir $(MstoolsDir)mfc\samples\oserver
  907. CreateDir $(MstoolsDir)mfc\samples\restool
  908. CreateDir $(MstoolsDir)mfc\samples\showfont
  909. CreateDir $(MstoolsDir)mfc\samples\templdef
  910. CreateDir $(MstoolsDir)mfc\samples\tracer
  911. CreateDir $(MstoolsDir)mfc\samples\tutorial
  912. CreateDir $(MstoolsDir)mfc\samples\tutorial\char
  913. CreateDir $(MstoolsDir)mfc\samples\tutorial\win
  914. CreateDir $(MstoolsDir)mfc\src
  915. AddSectionFilesToCopyList Files-mstools-mfc $(STF_SRCDIR)mstools\mfc $(MstoolsDir)mfc
  916. AddSectionFilesToCopyList Files-mstools-mfc-doc $(STF_SRCDIR)mstools\mfc\doc $(MstoolsDir)mfc\doc
  917. AddSectionFilesToCopyList Files-mstools-mfc-include $(STF_SRCDIR)mstools\mfc\include $(MfcInclude)
  918. AddSectionFilesToCopyList Files-mstools-mfc-lib-$(STF_PLATFORM) $(STF_SRCDIR)mstools\mfc\lib\$(STF_PLATFORM) $(MfcLib)
  919. AddSectionFilesToCopyList Files-mstools-mfc-samples $(STF_SRCDIR)mstools\mfc\samples $(MstoolsDir)mfc\samples
  920. AddSectionFilesToCopyList Files-mstools-mfc-samples-about2 $(STF_SRCDIR)mstools\mfc\samples\about2 $(MstoolsDir)mfc\samples\about2
  921. AddSectionFilesToCopyList Files-mstools-mfc-samples-chart $(STF_SRCDIR)mstools\mfc\samples\chart $(MstoolsDir)mfc\samples\chart
  922. AddSectionFilesToCopyList Files-mstools-mfc-samples-ctrltest $(STF_SRCDIR)mstools\mfc\samples\ctrltest $(MstoolsDir)mfc\samples\ctrltest
  923. AddSectionFilesToCopyList Files-mstools-mfc-samples-fileview $(STF_SRCDIR)mstools\mfc\samples\fileview $(MstoolsDir)mfc\samples\fileview
  924. AddSectionFilesToCopyList Files-mstools-mfc-samples-hello $(STF_SRCDIR)mstools\mfc\samples\hello $(MstoolsDir)mfc\samples\hello
  925. AddSectionFilesToCopyList Files-mstools-mfc-samples-helloapp $(STF_SRCDIR)mstools\mfc\samples\helloapp $(MstoolsDir)mfc\samples\helloapp
  926. AddSectionFilesToCopyList Files-mstools-mfc-samples-mdi $(STF_SRCDIR)mstools\mfc\samples\mdi $(MstoolsDir)mfc\samples\mdi
  927. AddSectionFilesToCopyList Files-mstools-mfc-samples-minmdi $(STF_SRCDIR)mstools\mfc\samples\minmdi $(MstoolsDir)mfc\samples\minmdi
  928. AddSectionFilesToCopyList Files-mstools-mfc-samples-minsvr $(STF_SRCDIR)mstools\mfc\samples\minsvr $(MstoolsDir)mfc\samples\minsvr
  929. AddSectionFilesToCopyList Files-mstools-mfc-samples-minsvrmi $(STF_SRCDIR)mstools\mfc\samples\minsvrmi $(MstoolsDir)mfc\samples\minsvrmi
  930. AddSectionFilesToCopyList Files-mstools-mfc-samples-multipad $(STF_SRCDIR)mstools\mfc\samples\multipad $(MstoolsDir)mfc\samples\multipad
  931. AddSectionFilesToCopyList Files-mstools-mfc-samples-oclient $(STF_SRCDIR)mstools\mfc\samples\oclient $(MstoolsDir)mfc\samples\oclient
  932. AddSectionFilesToCopyList Files-mstools-mfc-samples-oserver $(STF_SRCDIR)mstools\mfc\samples\oserver $(MstoolsDir)mfc\samples\oserver
  933. AddSectionFilesToCopyList Files-mstools-mfc-samples-restool $(STF_SRCDIR)mstools\mfc\samples\restool $(MstoolsDir)mfc\samples\restool
  934. AddSectionFilesToCopyList Files-mstools-mfc-samples-showfont $(STF_SRCDIR)mstools\mfc\samples\showfont $(MstoolsDir)mfc\samples\showfont
  935. AddSectionFilesToCopyList Files-mstools-mfc-samples-templdef $(STF_SRCDIR)mstools\mfc\samples\templdef $(MstoolsDir)mfc\samples\templdef
  936. AddSectionFilesToCopyList Files-mstools-mfc-samples-tracer $(STF_SRCDIR)mstools\mfc\samples\tracer $(MstoolsDir)mfc\samples\tracer
  937. AddSectionFilesToCopyList Files-mstools-mfc-samples-tutorial $(STF_SRCDIR)mstools\mfc\samples\tutorial $(MstoolsDir)mfc\samples\tutorial
  938. AddSectionFilesToCopyList Files-mstools-mfc-samples-tutorial-char $(STF_SRCDIR)mstools\mfc\samples\tutorial\char $(MstoolsDir)mfc\samples\tutorial\char
  939. AddSectionFilesToCopyList Files-mstools-mfc-samples-tutorial-win $(STF_SRCDIR)mstools\mfc\samples\tutorial\win $(MstoolsDir)mfc\samples\tutorial\win
  940. AddSectionFilesToCopyList Files-mstools-mfc-src $(STF_SRCDIR)mstools\mfc\src $(MstoolsDir)mfc\src
  941. endif
  942. ;
  943. ; 5. Microsoft mstools posix - optional
  944. ;
  945. ifstr(i) $(DoPosix) == $(Chosen)
  946. endif
  947. exit
  948. [Install-All-Files-Now]
  949. CopyFilesInCopyList
  950. exit