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.

1318 lines
37 KiB

  1. ;***********************************************************************
  2. ; IIS Content Index install script
  3. ;***********************************************************************
  4. ;***********************************************************************
  5. ; SOURCE MEDIA DESCRIPTION
  6. ; ------------------------
  7. ; This is only here because we must have _something_ in this slot...
  8. ;
  9. ;***********************************************************************
  10. [Source Media Descriptions]
  11. 1 = "Disk containing HitHighlighting Sample Files for News Server ."
  12. [RegistryConstants]
  13. MaskAllAccess = 33554432
  14. NoTitle = 0
  15. RegLastError = $(!REG_ERROR_SUCCESS)
  16. REG_VT_BINARY = 3 ;define this ourselves as it is not defd for us
  17. ;************************************************************************
  18. ; CONFIGURATION CHOICES
  19. ; ---------------------
  20. ; the sections below contain the different choices supported for
  21. ; the configuration items shown. an id section establishes the
  22. ; language independent IDs supported by nt setup. for each language
  23. ; supported a text section displays the text used for the different
  24. ; choices
  25. ;************************************************************************
  26. ;********************************
  27. ; PLATFORM INDEPENDENT CHOICES
  28. ;********************************
  29. ;----------------------------------------------------
  30. ; LANGUAGE CHOICES-- this is all you get,,,
  31. ;----------------------------------------------------
  32. [LanguageID]
  33. LANGID_ENG = ENG
  34. ;----------------------------------------------------
  35. ; PROCESSOR CHOICES
  36. ;----------------------------------------------------
  37. [ProcessorID]
  38. ProcessorID_I386 = I386
  39. ProcessorID_I486 = I486
  40. ProcessorID_I586 = I586
  41. ProcessorID_R4000 = R4000
  42. ProcessorID_Alpha = Alpha_AXP
  43. ProcessorID_PPC601 = PPC601
  44. ProcessorID_PPC603 = PPC603
  45. ProcessorID_PPC604 = PPC604
  46. ProcessorID_PPC620 = PPC620
  47. ;----------------------------------------------------
  48. ; PLATFORM CHOICES
  49. ;----------------------------------------------------
  50. [PlatformID]
  51. PlatformID_I386 = I386
  52. PlatformID_Mips = Mips
  53. PlatformID_Alpha = Alpha
  54. PlatformID_ppc = ppc
  55. ;**************************************************************
  56. ; UI VARIABLES
  57. ;**************************************************************
  58. [ProcessorVar]
  59. STF_PROCESSOR = "" ? $(LIBHANDLE) GetProcessor
  60. STF_PLATFORM = ""
  61. [LocaleVar]
  62. [LanguageVar]
  63. ;
  64. ; Language to Use For interaction with user
  65. ;
  66. STF_LANGUAGE = "" ? $(LIBHANDLE) GetLanguage
  67. [UiVars]
  68. ;
  69. ; Computer name
  70. ;
  71. STF_COMPUTERNAME = "" ? $(!LIBHANDLE) GetMyComputerName
  72. ;
  73. ; Destination Particulars
  74. ;
  75. WinSysDir = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  76. ;
  77. ; Source location
  78. ;
  79. SrcDir = $(!STF_SRCDIR)
  80. UsrRootPerms = "UNKNOWN"
  81. ;
  82. ; Windows NT Directory
  83. ;
  84. STF_WINDOWSPATH = "" ? $(!LIBHANDLE) GetWindowsNtDir
  85. STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir
  86. STF_WINDOWSVERSION = "" ? $(!LIBHANDLE) GetWindowsNtVersion
  87. REG_VT_BINARY = 3 ;define this ourselves as it is not defd for us
  88. ;
  89. ; Installation mode
  90. ;
  91. STF_INSTALL_MODE = "1"
  92. [EnvironmentVars]
  93. ;
  94. ; user environment variables in the current user's profile
  95. ; that we are concerned about
  96. PathEnvVar = {} ? $(LIBHANDLE) GetEnvVar $(PRIVILEGES) Path
  97. InitEnvVar = {} ? $(LIBHANDLE) GetEnvVar $(PRIVILEGES) init
  98. [VarsPlatformCommon]
  99. ;
  100. ; Installation options
  101. ;
  102. ;
  103. ; Options to disable
  104. ;
  105. DisableList = {}
  106. [VarsI386]
  107. ;
  108. [VarsMips]
  109. ;
  110. [VarsAlpha]
  111. ;
  112. [Varsppc]
  113. ;
  114. [StringsENG]
  115. String1 = "Setup cannot install on the current processor."$(!LF)$(!LF)+
  116. "Cannot proceed with install."
  117. String3 = "Microsoft Index Server files not found."$(!LF)+
  118. "Please enter the directory path to the Microsoft Index Server files."
  119. String5 = "Path does not exist. Please enter a path to an existing directory."
  120. String6 = "Error processing path entered. Please reenter the path."
  121. String19 = "Microsoft Index Server Samples require prior installation of Microsoft Index Server"
  122. String20 = "Please enter the full physical path of the IIS scripts directory into which "+
  123. "Microsoft Index Server sample scripts should be copied. Then choose Continue."$(!LF)+
  124. "A virtual root may also be added to map this directory."
  125. String21 = "Please enter the full physical path of the IIS virtual root into which "+
  126. "Microsoft Index Server sample HTML pages should be copied. Then choose Continue."$(!LF)+
  127. "A virtual root may also be added to map this directory."
  128. ;--------------------
  129. ; BILLBOARD MESSAGES
  130. ;--------------------
  131. [BillboardsENG]
  132. ;***************************************************************************
  133. ; DIALOGS
  134. ; -------
  135. ; the following sections contain the dialogs used to interact with the user.
  136. ; for each language supported there is a different dialog section.
  137. ;***************************************************************************
  138. ;-----------------------------------------------
  139. ; WELCOME DIALOG
  140. ;-----------------------------------------------
  141. [WelcomeDlgENG]
  142. DlgType = Info
  143. DlgTemplate = WELCOME
  144. Caption = "Microsoft Index Server 1.1 Samples Installation"
  145. DlgText = "Welcome to Setup."$(LF)$(LF)+
  146. "This Setup program installs sample pages demonstrating the use "+
  147. "of Microsoft Index Server 1.1 together with Microsoft News Server."$(LF)$(LF)+
  148. "To install samples on your computer now, click Continue "+
  149. "or press Enter."$(LF)$(LF)+
  150. "To exit Setup without installing, click Exit "+
  151. "or press F3."
  152. Continue = &Continue
  153. Exit = E&xit
  154. Help = &Help
  155. HelpContext = 1
  156. ;--------------------------------------------------------------
  157. ; SETUP DONE - RESTART DIALOG
  158. ;--------------------------------------------------------------
  159. [SetupDoneDlgENG]
  160. DlgType = "Info"
  161. DlgTemplate = "RESTART"
  162. Caption = "Microsoft Index Server Samples Setup"
  163. DlgText = "Microsoft Index Server Samples are now installed. "+
  164. "A sample search page is located at:"$(LF)$(LF)+
  165. " http://"$(STF_COMPUTERNAME)$(HomeVDir)"/Samples/Search/news1.htm"$(LF)$(LF)
  166. Windows = "Exit to &Windows"
  167. ;--------------------------------------------------------------
  168. ; SETUP NOT DONE - RESTART DIALOG
  169. ;--------------------------------------------------------------
  170. [SetupNotDoneDlgENG]
  171. DlgType = "Info"
  172. DlgTemplate = "NONFATAL"
  173. Caption = "Microsoft Index Server Samples Setup"
  174. DlgText = "Microsoft Index Server Samples have not been installed."$(LF)$(LF)+
  175. "Please exit back to Windows NT."
  176. Windows = "Exit to &Windows"
  177. ;**************************************************************************
  178. ; DLL LOAD and FREE
  179. ; the following section contain commands to load specific dll libraries and
  180. ; to free them
  181. ;**************************************************************************
  182. ;----------------------------------------------
  183. ; a) DETECT LIBRARY
  184. ;----------------------------------------------
  185. [LoadSetupLibrary]
  186. LoadLibrary "x" $(STF_CWDDIR)setupdll.dll LIBHANDLE
  187. exit
  188. [FreeSetupLibrary]
  189. FreeLibrary $(LIBHANDLE)
  190. exit
  191. [LoadCiSetupLibrary]
  192. LoadLibrary "x" $(SrcPlatDir)cistp.dll CILIBHANDLE
  193. exit
  194. [FreeCiSetupLibrary]
  195. FreeLibrary $(CILIBHANDLE)
  196. exit
  197. ;**************************************************************************
  198. ; PROGRESS GUAGE VARIABLES
  199. ;**************************************************************************
  200. [ProgressCopyENG]
  201. ProCaption = "Microsoft Index Server Samples Setup"
  202. ProCancel = "Cance&l"
  203. ProCancelMsg = "Microsoft Index Server Samples Setup are not correctly installed. Are you sure "+
  204. "you want to cancel copying files?"
  205. ProCancelCap = "Setup Message"
  206. ProText1 = "Copying:"
  207. ProText2 = "To:"
  208. ;**************************************************************************
  209. ; SHELL COMMANDS SCRIPT
  210. ;**************************************************************************
  211. [Shell Commands]
  212. ;
  213. ; Initialize the app, by setting the caption and loading the support library
  214. ;
  215. set TestCopy = 0
  216. set TestReg = 0 ;-sc
  217. set TestRegVerbose = 0
  218. set-title "Microsoft Index Server Samples Setup"
  219. set Exit_Code = $(!SETUP_ERROR_GENERAL)
  220. install LoadSetupLibrary
  221. StartWait
  222. ;
  223. ; read general constants
  224. ;
  225. set-subst LF = "\n"
  226. set-subst MQ = \047 ;047=' in octal meta-quote
  227. set-subst DQ = \042 ;042=" in octal double-quote
  228. ;
  229. ; read the platform independent choices
  230. ;
  231. read-syms LanguageID
  232. read-syms ProcessorID
  233. read-syms PlatformID
  234. ;
  235. ; read the default language and try to detect the language
  236. ;
  237. read-syms LanguageVar
  238. detect LanguageVar
  239. ;
  240. ; read and detect the processor we are working on
  241. ;
  242. read-syms ProcessorVar
  243. detect ProcessorVar
  244. read-syms Strings$(!STF_LANGUAGE)
  245. detect Strings$(!STF_LANGUAGE)
  246. ;
  247. ; Check processor type, see if it is supported, if so what platform does it
  248. ; belong to.
  249. ;
  250. ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I386)
  251. set STF_PLATFORM = $(PlatformID_I386)
  252. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I486)
  253. set STF_PLATFORM = $(PlatformID_I386)
  254. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I586)
  255. set STF_PLATFORM = $(PlatformID_I386)
  256. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_R4000)
  257. set STF_PLATFORM = $(PlatformID_Mips)
  258. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_Alpha)
  259. set STF_PLATFORM = $(PlatformID_Alpha)
  260. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC601)
  261. set STF_PLATFORM = $(PlatformID_ppc)
  262. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC603)
  263. set STF_PLATFORM = $(PlatformID_ppc)
  264. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC604)
  265. set STF_PLATFORM = $(PlatformID_ppc)
  266. else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC620)
  267. set STF_PLATFORM = $(PlatformID_ppc)
  268. else
  269. shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String1)
  270. ui pop 1
  271. goto setupnotdone
  272. endif
  273. read-syms RegistryConstants
  274. ;
  275. ; read the UI Variables and detect their setting on the current machine
  276. ;
  277. read-syms UiVars
  278. detect UiVars
  279. read-syms Vars$(STF_PLATFORM)
  280. read-syms VarsPlatformCommon
  281. ;Makesure all our paths have '\' at the end
  282. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcDir)
  283. ifstr(i) $(STATUS) != "ERROR"
  284. set SrcDir = $(STATUS)
  285. endif
  286. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(WinSysDir)
  287. ifstr(i) $(STATUS) != "ERROR"
  288. set WinSysDir = $(STATUS)
  289. endif
  290. ;
  291. ; Append processor architecture to source dir
  292. ;
  293. set SrcPlatDir = $(SrcDir)$(STF_PLATFORM)
  294. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcPlatDir)
  295. ifstr(i) $(STATUS) != "ERROR"
  296. set SrcPlatDir = $(STATUS)
  297. endif
  298. EndWait
  299. set StartFolder = $(STF_WINDOWSPATH)"\Profiles\All Users\Start Menu\Programs\Microsoft Index Server (Common)"
  300. welcome =+
  301. read-syms WelcomeDlg$(STF_LANGUAGE)
  302. ui start "WelcomeMe"
  303. ifstr(i) $(DLGEVENT) == "CONTINUE"
  304. ui pop 1
  305. goto setsource
  306. else-ifstr(i) $(DLGEVENT) == "EXIT"
  307. shell "" QueryUserQuit
  308. ifstr(i) $($R1) == "OK"
  309. ui pop 1
  310. goto setupnotdone
  311. else
  312. goto welcome
  313. endif
  314. else
  315. goto end
  316. endif
  317. querysource =+
  318. shell "" DoAskPathEx $(SrcDir) $(String3) $(String6)
  319. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  320. goto setupnotdone
  321. endif
  322. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  323. set SrcDir = $($R1)
  324. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcDir)
  325. ifstr(i) $(STATUS) != "ERROR"
  326. set SrcDir = $(STATUS)
  327. endif
  328. set SrcPlatDir = $(SrcDir)$(STF_PLATFORM)
  329. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcPlatDir)
  330. ifstr(i) $(STATUS) != "ERROR"
  331. set SrcPlatDir = $(STATUS)
  332. endif
  333. else
  334. goto setupnotdone
  335. endif
  336. setsource =+
  337. ;
  338. ; Check for proper location
  339. ;
  340. set FileToCheck = $(SrcPlatDir)news1.htm
  341. LibraryProcedure STATUS,$(!LIBHANDLE), CheckFileExistance $(FileToCheck)
  342. ifstr(i) $(STATUS) == YES
  343. goto loadcilib
  344. else
  345. ;
  346. ; Try platform independent location
  347. ;
  348. set FileToCheck = $(SrcDir)news1.htm
  349. LibraryProcedure STATUS,$(!LIBHANDLE), CheckFileExistance $(FileToCheck)
  350. ifstr(i) $(STATUS) == YES
  351. set SrcPlatDir = $(SrcDir)
  352. goto loadcilib
  353. else
  354. goto querysource
  355. endif
  356. endif
  357. loadcilib =+
  358. install LoadCiSetupLibrary
  359. setdestination =+
  360. ;
  361. ; Code should go here to set destination for sample .htm, .idq, and .htx files.
  362. ;
  363. shell "" GetIISDirs
  364. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  365. shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String19)
  366. ui pop 1
  367. goto setupnotdone
  368. endif
  369. set ScriptDir = $($R1)
  370. set HomeDir = $($R2)
  371. set IsDefScriptDir = $($R3)
  372. set IsDefHomeDir = $($R4)
  373. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(ScriptDir)
  374. ifstr(i) $(STATUS) != "ERROR"
  375. set ScriptDir = $(STATUS)
  376. endif
  377. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(HomeDir)
  378. ifstr(i) $(STATUS) != "ERROR"
  379. set HomeDir = $(STATUS)
  380. endif
  381. setscript =+
  382. set DefScriptDir = $(ScriptDir)
  383. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(DefScriptDir)
  384. ifstr(i) $(STATUS) != "ERROR"
  385. set DefScriptDir = $(STATUS)
  386. endif
  387. shell "" DoAskPathEx $(ScriptDir) $(String20) $(String6)
  388. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  389. set ScriptDir = $($R1)
  390. else
  391. goto setupnotdone
  392. endif
  393. LibraryProcedure IsFullPath $(!LIBHANDLE) CheckPathFullPathSpec $(ScriptDir)
  394. ifstr(i) $(IsFullPath) == "No"
  395. shell "" SetupMessage $(!STF_LANGUAGE) NONFATAL $(String5)
  396. ui pop 1
  397. goto setscript
  398. endif
  399. shell "" DoMakeDir $(ScriptDir)Samples
  400. ;
  401. ; Clean up from previous install (if any)
  402. ;
  403. ifstr(i) $(IsDefScriptDir) == STATUS_SUCCESSFUL
  404. shell "" RemoveVRoot /Scripts/samples/search
  405. shell "" RemoveVRoot /Scripts/srchadm
  406. else
  407. ifstr(i) $(ScriptDir) != $(DefScriptDir)
  408. shell "" RemoveVRoot /Scripts/samples/search
  409. shell "" RemoveVRoot /Scripts/srchadm
  410. endif
  411. endif
  412. ;
  413. ; Did the user use a non-default script dir?
  414. ;
  415. ifstr(i) $(ScriptDir) != $(DefScriptDir)
  416. set ScriptVDir = "/Scripts"
  417. shell "" AddVRoot $(ScriptVDir)/samples/search $(ScriptDir)Samples\Search "4"
  418. shell "" AddVRoot $(ScriptVDir)/srchadm $(ScriptDir)srchadm "4"
  419. ;shell "" DoAskVPathEx $(ScriptVDir) $(String25) $(String6)
  420. ;ifstr(i) $($R0) == STATUS_SUCCESS
  421. ; set ScriptVDir = $($R1)
  422. ;else
  423. ; goto setupnotdone
  424. ;endif
  425. endif
  426. ;
  427. ; Set admin permissions on admin scripts
  428. ;
  429. shell "" DoMakeDir $(ScriptDir)srchadm
  430. LibraryProcedure RetVal $(!CILIBHANDLE) ApplySystemAcl $(ScriptDir)srchadm
  431. sethome =+
  432. set DefHomeDir = $(HomeDir)
  433. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(DefHomeDir)
  434. ifstr(i) $(STATUS) != "ERROR"
  435. set DefHomeDir = $(STATUS)
  436. endif
  437. shell "" DoAskPathEx $(HomeDir) $(String21) $(String6)
  438. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  439. set HomeDir = $($R1)
  440. else
  441. goto setupnotdone
  442. endif
  443. LibraryProcedure IsFullPath $(!LIBHANDLE) CheckPathFullPathSpec $(HomeDir)
  444. ifstr(i) $(IsFullPath) == "No"
  445. shell "" SetupMessage $(!STF_LANGUAGE) NONFATAL $(String5)
  446. ui pop 1
  447. goto sethome
  448. endif
  449. ;Make sure all our paths have '\' at the end
  450. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(ScriptDir)
  451. ifstr(i) $(STATUS) != "ERROR"
  452. set ScriptDir = $(STATUS)
  453. endif
  454. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(HomeDir)
  455. ifstr(i) $(STATUS) != "ERROR"
  456. set HomeDir = $(STATUS)
  457. endif
  458. shell "" DoMakeDir $(HomeDir)Samples
  459. ;
  460. ; Clean up from previous install (if any)
  461. ;
  462. shell "" RemoveVRoot /SearchHelp
  463. shell "" RemoveVRoot /srchadm
  464. ifstr(i) $(IsDefHomeDir) == STATUS_SUCCESSFUL
  465. shell "" RemoveVRoot /samples/search
  466. else
  467. ifstr(i) $(HomeDir) != $(DefHomeDir)
  468. shell "" RemoveVRoot /samples/search
  469. endif
  470. endif
  471. ;
  472. ; Did the user use a non-default home dir?
  473. ;
  474. ifstr(i) $(HomeDir) != $(DefHomeDir)
  475. set HomeVDir = "/"
  476. shell "" AddVRoot $(HomeVDir)samples/search $(HomeDir)Samples\Search "1"
  477. ;shell "" DoAskVPathEx $(HomeVDir) $(String26) $(String6)
  478. ;ifstr(i) $($R0) == STATUS_SUCCESS
  479. ; set HomeVDir = $($R1)
  480. ;else
  481. ; goto setupnotdone
  482. ;endif
  483. endif
  484. ;
  485. ; Setup root for admin.
  486. ;
  487. shell "" DoMakeDir $(HomeDir)srchadm
  488. LibraryProcedure RetVal $(!CILIBHANDLE) ApplySystemAcl $(HomeDir)srchadm
  489. shell "" AddVRoot /srchadm $(HomeDir)srchadm "1"
  490. finish = +
  491. install ICopyFiles
  492. install Install-All-Files-Now
  493. ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_SUCCESS"
  494. goto dosamples
  495. else
  496. shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String4)
  497. ui pop 1
  498. goto setupnotdone
  499. endif
  500. dosamples=+
  501. shell "" DoURLSection "Files-URL" $(StartFolder)
  502. shell "" AddCiNewsRoot
  503. setupdone=+
  504. set Exit_Code = $(!SETUP_ERROR_SUCCESS)
  505. read-syms SetupDoneDlg$(!STF_LANGUAGE)
  506. ui start "DoneWithThis"
  507. ifstr(i) $(DLGEVENT) == "CONTINUE"
  508. ui pop 1
  509. goto end
  510. else
  511. goto end
  512. endif
  513. setupnotdone=+
  514. read-syms SetupNotDoneDlg$(!STF_LANGUAGE)
  515. EndWait
  516. ui start "NotDoneMakingAMess"
  517. ifstr(i) $(DLGEVENT) == "CONTINUE"
  518. ui pop 1
  519. goto end
  520. else
  521. goto end
  522. endif
  523. end = +
  524. install FreeSetupLibrary
  525. install FreeCiSetupLibrary
  526. exit
  527. ;*****************************************************************
  528. ; *
  529. ; INSTALLATION SUPPORT ROUTINES *
  530. ; *
  531. ;*****************************************************************
  532. ;**************************************************************************
  533. ;
  534. ; GetIISDirs
  535. ;
  536. ; Attempts to locate Script and Home directories for IIS
  537. ;
  538. ; Returns: $R0: Status: STATUS_SUCCESSFUL
  539. ; STATUS_FAILED
  540. ;
  541. ; $R1: Script directory
  542. ;
  543. ; $R2: Home directory
  544. ;
  545. ;**************************************************************************
  546. [GetIISDirs]
  547. set Script = ""
  548. set Home = ""
  549. ;
  550. ; First, check for service
  551. ;
  552. set hKey = $(!REG_H_LOCAL)
  553. shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc" "Start"
  554. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  555. goto FailIIS
  556. endif
  557. shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/Scripts"
  558. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  559. split-string *($($R1),4) "," Tmp
  560. set Script = *($(Tmp),1)
  561. endif
  562. shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/Scripts,"
  563. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  564. split-string *($($R1),4) "," Tmp
  565. set Script = *($(Tmp),1)
  566. endif
  567. shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/"
  568. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  569. split-string *($($R1),4) "," Tmp
  570. set Home = *($(Tmp),1)
  571. endif
  572. shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/,"
  573. ifstr(i) $($R0) == STATUS_SUCCESSFUL
  574. split-string *($($R1),4) "," Tmp
  575. set Home = *($(Tmp),1)
  576. endif
  577. set Status = STATUS_SUCCESSFUL
  578. goto DoneIIS
  579. FailIIS =+
  580. set Status = STATUS_FAILED
  581. DoneIIS =+
  582. return $(Status) $(Script) $(Home)
  583. ;**************************************************************************
  584. ;
  585. ; AddCiNewsRoot
  586. ;
  587. ;**************************************************************************
  588. [AddCiNewsRoot]
  589. set Script = ""
  590. set Home = ""
  591. set hKey = $(!REG_H_LOCAL)
  592. ;
  593. ; First, lookup NNTP roots
  594. ;
  595. OpenRegKey $(hKey) "" "system\currentcontrolset\services\nntpsvc\parameters\virtual roots" $(!REG_KEY_READ) TempKey
  596. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  597. ; Debug-Output "REGISTRY.INF: OpenRegKey Failed: "$($)" "$($0)" "$($1)" "$($2)
  598. goto AddEnd
  599. endif
  600. EnumRegValue $(TempKey), NNTPRoots
  601. ;
  602. ; Adjust them to /$CiNews roots
  603. ;
  604. set SlamValueList = {}
  605. ForListDo $(NNTPRoots)
  606. set Virtual = *($($),1)
  607. split-string *($($),4) "," Tmp
  608. Set Physical = *($(Tmp),1)
  609. ;shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" "Virtual: "$(Virtual)" Physical: "$(Physical)
  610. set SlamValueList = >($(SlamValueList), { "/$CiNews"$(Virtual), $(!NoTitle), $(!REG_VT_SZ), $(Physical)",,"})
  611. EndForListDo
  612. ;
  613. ; Find NNTP home
  614. ;
  615. ;shell "" GetValue $(hKey) "system\currentcontrolset\services\nntpsvc\parameters\virtual roots" "/"
  616. ;ifstr(i) $($R0) == STATUS_SUCCESSFUL
  617. ; split-string *($($R1),4) "," Tmp
  618. ; set Home = *($(Tmp),1)
  619. ;endif
  620. ;shell "" GetValue $(hKey) "system\currentcontrolset\services\nntpsvc\parameters\virtual roots" "/,"
  621. ;ifstr(i) $($R0) == STATUS_SUCCESSFUL
  622. ; split-string *($($R1),4) "," Tmp
  623. ; set Home = *($(Tmp),1)
  624. ;endif
  625. ;
  626. ; Set equivalent Web home
  627. ;
  628. ;build up our KeyList
  629. set OurKeyList = {}
  630. set OurKeyList = >($(OurKeyList), {"system", $(!NoTitle), $(!MaskAllAccess)})
  631. set OurKeyList = >($(OurKeyList), {"currentcontrolset", $(!NoTitle), $(!MaskAllAccess)})
  632. set OurKeyList = >($(OurKeyList), {"services", $(!NoTitle), $(!MaskAllAccess)})
  633. set OurKeyList = >($(OurKeyList), {"w3svc", $(!NoTitle), $(!MaskAllAccess)})
  634. set OurKeyList = >($(OurKeyList), {"parameters", $(!NoTitle), $(!MaskAllAccess)})
  635. set OurKeyList = >($(OurKeyList), {"virtual roots", $(!NoTitle), $(!MaskAllAccess)})
  636. ;build up Value List
  637. ;set SlamValueList = {}
  638. ;set SlamValueList = >($(SlamValueList), { "/$CiNews", $(!NoTitle), $(!REG_VT_SZ), $(Home)",,4"})
  639. shell "" CreateKey $(hKey) $(OurKeyList) $(SlamValueList)
  640. CloseRegKey $($R1)
  641. ;
  642. ; Stop and restart W3SVC to get the roots picked up.
  643. ;
  644. LibraryProcedure RetVal $(!CILIBHANDLE) RunProgram $(!STF_WINDOWSSYSPATH)\net.exe stop w3svc
  645. LibraryProcedure RetVal $(!CILIBHANDLE) RunProgram $(!STF_WINDOWSSYSPATH)\net.exe start w3svc
  646. AddEnd=+
  647. return
  648. ;**************************************************************************
  649. ;
  650. ; GetValue
  651. ;
  652. ; Checks if key is present, and if so, returns the value
  653. ;
  654. ; $0 Key Handle
  655. ; $1 Key name
  656. ; $2 Value Name
  657. ;
  658. ;**************************************************************************
  659. [GetValue]
  660. set Status = STATUS_FAILED
  661. read-syms RegistryConstants
  662. OpenRegKey $($0) "" $($1) $(!REG_KEY_READ) TempKey
  663. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  664. ; Debug-Output "REGISTRY.INF: OpenRegKey Failed: "$($)" "$($0)" "$($1)" "$($2)
  665. goto end_get_value
  666. endif
  667. GetRegValue $(TempKey), $($2), KeyValue
  668. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  669. ; Debug-Output "REGISTRY.INF: GetRegValue Failed:"$($)
  670. CloseRegKey $(TempKey)
  671. goto end_get_value
  672. endif
  673. set Status = STATUS_SUCCESSFUL
  674. end_get_value = +
  675. return $(Status) $(KeyValue)
  676. ;-----------------------------------------------------------------------
  677. ; ROUTINE: CreateKey
  678. ;
  679. ; DESCRIPTION: Creates a key and fixes the values indicated.
  680. ; Key is Handle\Key1\Key2\...\Keyn. Value list
  681. ; is for Valuen.
  682. ;
  683. ; INPUTS: $0: Handle into registry
  684. ; $1: KeyTreeComponents {Key1Info, Key2Info..}
  685. ; $2: ValueList {Value1Info, Value2Info, Value3Info}
  686. ;
  687. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL
  688. ; STATUS_FAILED
  689. ; STATUS_ERROR_CREATEKEY
  690. ; STATUS_ERROR_CREATEVALUE
  691. ;
  692. ; $R1: Handle to created key
  693. ;
  694. ;------------------------------------------------------------------------
  695. [CreateKey]
  696. ; ifint $(!TestRegVerbose) == 1
  697. ; Debug-Output ".INF: CreateKey $0 = "$($0)
  698. ; Debug-Output ".INF: CreateKey $1 = "$($1)
  699. ; Debug-Output ".INF: CreateKey $2 = "$($2)
  700. ; endif
  701. ;
  702. ; Initialize
  703. ;
  704. set Status = STATUS_FAILED
  705. read-syms RegistryConstants
  706. ;
  707. ; traverse down the keytreecomponents and open/create components as
  708. ; you go along
  709. ;
  710. set BaseHandle = $($0)
  711. set KeyHandle = $(BaseHandle)
  712. ForListDo $($1)
  713. set KeyInfo = $($)
  714. set KeyName = *($(KeyInfo), 1)
  715. ;
  716. ; Try opening the key first
  717. OpenRegKey $(BaseHandle) "" $(KeyName) $(MaskAllAccess) KeyHandle
  718. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  719. ;
  720. ; Key doesn't exist
  721. ;
  722. ; Debug-Output "REGISTRY.INF: Key"$(KeyName)"doesn't exist. Will create key"
  723. set RegLastError = 0
  724. CreateRegKey $(BaseHandle) $(KeyInfo) "" $(MaskAllAccess) "" KeyHandle
  725. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  726. set Status = STATUS_ERROR_CREATEKEY
  727. ; Debug-Output "REGISTRY.INF: Error in creating key"
  728. goto endcreate
  729. endif
  730. endif
  731. ifstr(i) $(BaseHandle) != $($0)
  732. CloseRegKey $(BaseHandle)
  733. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  734. set Status = STATUS_ERROR_CREATEKEY
  735. ; Debug-Output "REGISTRY.INF: Error in closing base handle"
  736. goto endcreate
  737. endif
  738. endif
  739. set BaseHandle = $(KeyHandle)
  740. EndForListDo
  741. ifstr(i) $($2) != {}
  742. shell "" AddValueList $(KeyHandle) $($2)
  743. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  744. set Status = STATUS_ERROR_CREATEVALUE
  745. goto endcreate
  746. endif
  747. endif
  748. set Status = STATUS_SUCCESSFUL
  749. endcreate = +
  750. ifstr(i) $(Status) != STATUS_SUCCESSFUL
  751. ; Debug-Output "REGISTRY.INF: CreateKey Error:"$(Status)
  752. endif
  753. Return $(Status) $(KeyHandle)
  754. ;*************************************************************************
  755. ;
  756. ; SECTION: AddValueList
  757. ;
  758. ; PURPOSE: Given a nested list of value items, add each to the given
  759. ; key. Key is left open.
  760. ;
  761. ; ARGUMENTS: $0 Registry key handle
  762. ; $1 List of value items; for example:
  763. ; { {ValueName1,0,$(!REG_VT_SZ),$(ValueData1)}, +
  764. ; {ValueName2,0,$(!REG_VT_SZ),$(ValueData2)} }
  765. ;
  766. ; RETURNS: $R0 Status
  767. ;
  768. ;
  769. ;*************************************************************************
  770. [AddValueList]
  771. set Status = STATUS_FAILED
  772. read-syms RegistryConstants
  773. ForListDo $($1)
  774. SetRegValue $($0) $($)
  775. ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  776. ; Debug-Output "REGISTRY.INF: CreateValue failed:"$($)
  777. goto end_addvaluelist
  778. endif
  779. EndForListDo
  780. set Status = STATUS_SUCCESSFUL
  781. end_addvaluelist = +
  782. return $(Status)
  783. ;-----------------------------------------------------------------------
  784. ; ROUTINE: QueryUserQuit
  785. ;
  786. ; DESCRIPTION: This routine queries whether the user wants to quit setup
  787. ;
  788. ; INPUTS: None
  789. ;
  790. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL |
  791. ; STATUS_FAILED
  792. ;
  793. ; $R1: UserAction: OK | CANCEL
  794. ;
  795. ;------------------------------------------------------------------------
  796. [QueryUserQuit]
  797. set Status = STATUS_FAILED
  798. set UserAction = CANCEL
  799. ;
  800. ; read in quit message
  801. ;
  802. read-syms ExitWarningDlg$(!STF_LANGUAGE)
  803. ui start "ExitWarning"
  804. ifstr(i) $(DLGEVENT) == "YES"
  805. set Status = STATUS_SUCCESSFUL
  806. set UserAction = "OK"
  807. else-ifstr(i) $(DLGEVENT) == "NO"
  808. set Status = STATUS_SUCCESSFUL
  809. set UserAction = "CANCEL"
  810. else
  811. endif
  812. fin_QueryUserQuit = +
  813. Return $(Status) $(UserAction)
  814. [ExitWarningDlgENG]
  815. DlgType = "MessageBox"
  816. STF_MB_TITLE = "Exit Microsoft Index Server Setup"
  817. STF_MB_TEXT = "Microsoft Index Server Samples are not completely installed."$(LF)$(LF)+
  818. " Are you sure you want to exit Setup?"
  819. STF_MB_TYPE = 3
  820. STF_MB_ICON = 5
  821. STF_MB_DEF = 1
  822. ;-----------------------------------------------------------------------
  823. ; ROUTINE: SetupMessage
  824. ;
  825. ; DESCRIPTION: Puts up a MessageBox
  826. ;
  827. ; INPUTS: $0 LanguageID
  828. ; $1 Message type
  829. ; $2 Message string
  830. ;
  831. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL |
  832. ; STATUS_FAILED
  833. ;
  834. ; $R1: UserAction: OK | CANCEL
  835. ;
  836. ;------------------------------------------------------------------------
  837. [SetupMessage]
  838. set Status = STATUS_FAILED
  839. set UserAction = "CANCEL"
  840. set DlgText = $($2)
  841. ifstr(i) $($1) == "WARNING"
  842. read-syms WarningDlg$($0)
  843. else-ifstr(i) $($1) == "FATAL"
  844. read-syms FatalDlg$($0)
  845. else-ifstr(i) $($1) == "NONFATAL"
  846. read-syms NonfatalDlg$($0)
  847. else-ifstr(i) $($1) == "STATUS"
  848. read-syms StatusDlg$($0)
  849. else-ifstr(i) $($1) == "WARNINGOK"
  850. read-syms WarningOKDlg$($0)
  851. else
  852. goto finish_SetupMessage
  853. endif
  854. ui start "SetupMessage"
  855. ifstr(i) $(DLGEVENT) == "OK"
  856. set Status = STATUS_SUCCESSFUL
  857. set UserAction = $(DLGEVENT)
  858. else-ifstr(i) $(DLGEVENT) == "CANCEL"
  859. set Status = STATUS_SUCCESSFUL
  860. set UserAction = $(DLGEVENT)
  861. else-ifstr(i) $(DLGEVENT) == "YES"
  862. set Status = STATUS_SUCCESSFUL
  863. set UserAction = $(DLGEVENT)
  864. else-ifstr(i) $(DLGEVENT) == "NO"
  865. set Status = STATUS_SUCCESSFUL
  866. set UserAction = $(DLGEVENT)
  867. else
  868. endif
  869. finish_SetupMessage = +
  870. Return $(Status) $(UserAction)
  871. end
  872. [WarningDlgENG]
  873. STF_MB_TITLE = "Setup Message"
  874. DlgType = "MessageBox"
  875. STF_MB_TEXT = $(DlgText)
  876. STF_MB_TYPE = 2
  877. STF_MB_ICON = 5
  878. STF_MB_DEF = 2
  879. [FatalDlgENG]
  880. STF_MB_TITLE = "Setup Message"
  881. DlgType = "MessageBox"
  882. STF_MB_TEXT = $(DlgText)
  883. STF_MB_TYPE = 1
  884. STF_MB_ICON = 3
  885. STF_MB_DEF = 1
  886. [NonfatalDlgENG]
  887. STF_MB_TITLE = "Setup Message"
  888. DlgType = "MessageBox"
  889. STF_MB_TEXT = $(DlgText)
  890. STF_MB_TYPE = 1
  891. STF_MB_ICON = 5
  892. STF_MB_DEF = 1
  893. [StatusDlgENG]
  894. STF_MB_TITLE = "Setup Message"
  895. DlgType = "MessageBox"
  896. STF_MB_TEXT = $(DlgText)
  897. STF_MB_TYPE = 1
  898. STF_MB_ICON = 2
  899. STF_MB_DEF = 1
  900. [WarningOKDlgENG]
  901. DlgType = "MessageBox"
  902. STF_MB_TITLE = "Setup Message"
  903. STF_MB_TEXT = $(DlgText)
  904. STF_MB_TYPE = 3
  905. STF_MB_ICON = 5
  906. STF_MB_DEF = 1
  907. ;**************************************************************************
  908. ;
  909. ; DoURLSection
  910. ;
  911. ; Modifies URLs to point to machine
  912. ;
  913. ; $0 Section name to act upon
  914. ; $1 Target directory into which files in $0 were copied
  915. ;
  916. ;**************************************************************************
  917. [DoURLSection]
  918. set Files = ^($($0), 4)
  919. ForListDo $(Files)
  920. split-string *($(Files), $(#)) "=" Tmp
  921. LibraryProcedure ReturnVal $(!CILIBHANDLE) Replace $($1)\*($(Tmp), 3) machname $(!STF_COMPUTERNAME)
  922. EndForListDo
  923. return
  924. ;-----------------------------------------------------------------------
  925. ; ROUTINE: DoAskPathEx
  926. ;
  927. ; DESCRIPTION: Puts up an EDIT box to prompt for a path
  928. ;
  929. ; INPUTS: $0 LanguageID
  930. ; $1 Message type
  931. ; $2 Message error
  932. ;
  933. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL |
  934. ; STATUS_FAILED
  935. ;
  936. ; $R1: UserAction: OK | CANCEL
  937. ;
  938. ;------------------------------------------------------------------------
  939. [DoAskPathEx]
  940. set Status = STATUS_FAILED
  941. set Src = $($0)
  942. askpath = +
  943. read-syms DisketteDlg$(!STF_LANGUAGE)
  944. ui start "Diskette"
  945. ifstr(i) $(DLGEVENT) == "CONTINUE"
  946. LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(EditTextOut)
  947. ifstr(i) $(IsFullPath) == "NO"
  948. StartWait
  949. LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(EditTextOut)
  950. EndWait
  951. ifstr(i) $(STATUS) == "ERROR"
  952. shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2)
  953. goto askpath
  954. else-ifstr(i) $(STATUS) == "NOT-UNC"
  955. shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2)
  956. goto askpath
  957. else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT"
  958. shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2)
  959. goto askpath
  960. else
  961. set Src = $(STATUS)
  962. endif
  963. else
  964. set Src = $(EditTextOut)
  965. endif
  966. ui pop 1
  967. LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(Src)
  968. ifstr(i) $(STATUS) == "ERROR"
  969. goto finish_DoAskPath
  970. else
  971. set Src = $(STATUS)
  972. set Status = STATUS_SUCCESSFUL
  973. goto finish_DoAskPath
  974. endif
  975. else-ifstr(i) $(DLGEVENT) == "BACK"
  976. ui pop 1
  977. set Status = STATUS_USERCANCEL
  978. goto finish_DoAskPath
  979. else
  980. ui pop 1
  981. goto finish_DoAskPath
  982. endif
  983. finish_DoAskPath = +
  984. Return $(Status) $(Src) $(EditTextOut)
  985. ;-----------------------------------------------------------------------
  986. ; ROUTINE: DoAskVPathEx
  987. ;
  988. ; DESCRIPTION: Puts up an EDIT box to prompt for a virtual path
  989. ;
  990. ; INPUTS: $0 LanguageID
  991. ; $1 Message type
  992. ; $2 Message error
  993. ;
  994. ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL |
  995. ; STATUS_FAILED
  996. ;
  997. ; $R1: UserAction: OK | CANCEL
  998. ;
  999. ;------------------------------------------------------------------------
  1000. [DoAskVPathEx]
  1001. set Status = STATUS_FAILED
  1002. set Src = $($0)
  1003. askvpath = +
  1004. read-syms DisketteDlg$(!STF_LANGUAGE)
  1005. ui start "Diskette"
  1006. ifstr(i) $(DLGEVENT) == "CONTINUE"
  1007. ;
  1008. ; Make sure it has slashes
  1009. ;
  1010. split-string $(EditTextOut) "/" Tmp
  1011. set HasSlash = STATUS_FAILED
  1012. set EndsInSlash = STATUS_FAILED
  1013. set MinusEndSlash = ""
  1014. ForListDo $(Tmp)
  1015. ifstr(i) $($) == "/"
  1016. set HasSlash = STATUS_SUCCESS
  1017. set EndsInSlash = STATUS_SUCCESS
  1018. else
  1019. set EndsInSlash = STATUS_FAILED
  1020. set MinusEndSlash = $(MinusEndSlash)/$($)
  1021. endif
  1022. EndForListDo
  1023. ifstr(i) $(EndsInSlash) == STATUS_SUCCESS
  1024. set EditTextOut = $(MinusEndSlash)
  1025. endif
  1026. ifstr(i) $(HasSlash) != STATUS_SUCCESS
  1027. shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2)
  1028. goto askvpath
  1029. else
  1030. set Src = $(EditTextOut)
  1031. endif
  1032. set Status = STATUS_SUCCESS
  1033. ui pop 1
  1034. else-ifstr(i) $(DLGEVENT) == "BACK"
  1035. ui pop 1
  1036. set Status = STATUS_USERCANCEL
  1037. goto finish_DoAskVPath
  1038. else
  1039. ui pop 1
  1040. goto finish_DoAskVPath
  1041. endif
  1042. finish_DoAskVPath = +
  1043. Return $(Status) $(Src) $(EditTextOut)
  1044. [DisketteDlgENG]
  1045. Caption = "Microsoft Index Server Setup"
  1046. Continue = "Continue"
  1047. Cancel = "Cancel"
  1048. DlgType = "Edit"
  1049. DlgTemplate = "DISKETTE"
  1050. DlgText = $($1)
  1051. Edit1Label = ""
  1052. EditTextIn = $(Src)
  1053. EditFocus = "ALL"
  1054. [ICopyFiles]
  1055. AddSectionFilesToCopyList Files-URL $(SrcPlatDir) $(StartFolder)
  1056. LibraryProcedure STATUS,$(!LIBHANDLE), CheckFileExistance $(SrcDir)news1.htm
  1057. ifstr(i) $(STATUS) == YES
  1058. AddSectionFilesToCopyList Files-SampleHTM $(SrcDir) $(HomeDir)Samples\Search\
  1059. AddSectionFilesToCopyList Files-SampleIDQ $(SrcDir) $(ScriptDir)Samples\Search\
  1060. AddSectionFilesToCopyList Files-AdminIDQ $(SrcDir) $(ScriptDir)SrchAdm\
  1061. else
  1062. AddSectionFilesToCopyList Files-SampleHTM $(SrcDir)NewsVr $(HomeDir)Samples\Search\
  1063. AddSectionFilesToCopyList Files-SampleIDQ $(SrcDir)NewsVr $(ScriptDir)Samples\Search\
  1064. AddSectionFilesToCopyList Files-AdminIDQ $(SrcDir)NewsVr $(ScriptDir)SrchAdm\
  1065. endif
  1066. exit
  1067. [Install-All-Files-Now]
  1068. CopyFilesInCopyList
  1069. exit
  1070. ;
  1071. ; File lists
  1072. ;
  1073. [Files-SampleHTM]
  1074. 1, news1.htm, NOLOG
  1075. 1, news2.htm, NOLOG
  1076. 1, isnread.txt, NOLOG
  1077. [Files-SampleIDQ]
  1078. 1, news1.htw, NOLOG
  1079. 1, news1.htx, NOLOG
  1080. 1, news1.idq, NOLOG
  1081. 1, news2.htw, NOLOG
  1082. 1, news2.htx, NOLOG
  1083. 1, news2.idq, NOLOG
  1084. [Files-AdminIDQ]
  1085. 1, admin.htx, NOLOG, BACKUP=admin.htx.bak
  1086. 1, admin.idq, NOLOG, BACKUP=admin.idq.bak
  1087. [Files-URL]
  1088. 1, ISNQUERY.URL, NOLOG, RENAME="Index Server Sample News Query Form.url"
  1089. 1, ISNREAD.URL, NOLOG, RENAME="Release Notes (Sample News Query Forms).url"