;*********************************************************************** ; IIS Content Index install script ;*********************************************************************** ;*********************************************************************** ; SOURCE MEDIA DESCRIPTION ; ------------------------ ; This is only here because we must have _something_ in this slot... ; ;*********************************************************************** [Source Media Descriptions] 1 = "Disk containing HitHighlighting Sample Files for News Server ." [RegistryConstants] MaskAllAccess = 33554432 NoTitle = 0 RegLastError = $(!REG_ERROR_SUCCESS) REG_VT_BINARY = 3 ;define this ourselves as it is not defd for us ;************************************************************************ ; CONFIGURATION CHOICES ; --------------------- ; the sections below contain the different choices supported for ; the configuration items shown. an id section establishes the ; language independent IDs supported by nt setup. for each language ; supported a text section displays the text used for the different ; choices ;************************************************************************ ;******************************** ; PLATFORM INDEPENDENT CHOICES ;******************************** ;---------------------------------------------------- ; LANGUAGE CHOICES-- this is all you get,,, ;---------------------------------------------------- [LanguageID] LANGID_ENG = ENG ;---------------------------------------------------- ; PROCESSOR CHOICES ;---------------------------------------------------- [ProcessorID] ProcessorID_I386 = I386 ProcessorID_I486 = I486 ProcessorID_I586 = I586 ProcessorID_R4000 = R4000 ProcessorID_Alpha = Alpha_AXP ProcessorID_PPC601 = PPC601 ProcessorID_PPC603 = PPC603 ProcessorID_PPC604 = PPC604 ProcessorID_PPC620 = PPC620 ;---------------------------------------------------- ; PLATFORM CHOICES ;---------------------------------------------------- [PlatformID] PlatformID_I386 = I386 PlatformID_Mips = Mips PlatformID_Alpha = Alpha PlatformID_ppc = ppc ;************************************************************** ; UI VARIABLES ;************************************************************** [ProcessorVar] STF_PROCESSOR = "" ? $(LIBHANDLE) GetProcessor STF_PLATFORM = "" [LocaleVar] [LanguageVar] ; ; Language to Use For interaction with user ; STF_LANGUAGE = "" ? $(LIBHANDLE) GetLanguage [UiVars] ; ; Computer name ; STF_COMPUTERNAME = "" ? $(!LIBHANDLE) GetMyComputerName ; ; Destination Particulars ; WinSysDir = "" ? $(!LIBHANDLE) GetWindowsNtSysDir ; ; Source location ; SrcDir = $(!STF_SRCDIR) UsrRootPerms = "UNKNOWN" ; ; Windows NT Directory ; STF_WINDOWSPATH = "" ? $(!LIBHANDLE) GetWindowsNtDir STF_WINDOWSSYSPATH = "" ? $(!LIBHANDLE) GetWindowsNtSysDir STF_WINDOWSVERSION = "" ? $(!LIBHANDLE) GetWindowsNtVersion REG_VT_BINARY = 3 ;define this ourselves as it is not defd for us ; ; Installation mode ; STF_INSTALL_MODE = "1" [EnvironmentVars] ; ; user environment variables in the current user's profile ; that we are concerned about PathEnvVar = {} ? $(LIBHANDLE) GetEnvVar $(PRIVILEGES) Path InitEnvVar = {} ? $(LIBHANDLE) GetEnvVar $(PRIVILEGES) init [VarsPlatformCommon] ; ; Installation options ; ; ; Options to disable ; DisableList = {} [VarsI386] ; [VarsMips] ; [VarsAlpha] ; [Varsppc] ; [StringsENG] String1 = "Setup cannot install on the current processor."$(!LF)$(!LF)+ "Cannot proceed with install." String3 = "Microsoft Index Server files not found."$(!LF)+ "Please enter the directory path to the Microsoft Index Server files." String5 = "Path does not exist. Please enter a path to an existing directory." String6 = "Error processing path entered. Please reenter the path." String19 = "Microsoft Index Server Samples require prior installation of Microsoft Index Server" String20 = "Please enter the full physical path of the IIS scripts directory into which "+ "Microsoft Index Server sample scripts should be copied. Then choose Continue."$(!LF)+ "A virtual root may also be added to map this directory." String21 = "Please enter the full physical path of the IIS virtual root into which "+ "Microsoft Index Server sample HTML pages should be copied. Then choose Continue."$(!LF)+ "A virtual root may also be added to map this directory." ;-------------------- ; BILLBOARD MESSAGES ;-------------------- [BillboardsENG] ;*************************************************************************** ; DIALOGS ; ------- ; the following sections contain the dialogs used to interact with the user. ; for each language supported there is a different dialog section. ;*************************************************************************** ;----------------------------------------------- ; WELCOME DIALOG ;----------------------------------------------- [WelcomeDlgENG] DlgType = Info DlgTemplate = WELCOME Caption = "Microsoft Index Server 1.1 Samples Installation" DlgText = "Welcome to Setup."$(LF)$(LF)+ "This Setup program installs sample pages demonstrating the use "+ "of Microsoft Index Server 1.1 together with Microsoft News Server."$(LF)$(LF)+ "To install samples on your computer now, click Continue "+ "or press Enter."$(LF)$(LF)+ "To exit Setup without installing, click Exit "+ "or press F3." Continue = &Continue Exit = E&xit Help = &Help HelpContext = 1 ;-------------------------------------------------------------- ; SETUP DONE - RESTART DIALOG ;-------------------------------------------------------------- [SetupDoneDlgENG] DlgType = "Info" DlgTemplate = "RESTART" Caption = "Microsoft Index Server Samples Setup" DlgText = "Microsoft Index Server Samples are now installed. "+ "A sample search page is located at:"$(LF)$(LF)+ " http://"$(STF_COMPUTERNAME)$(HomeVDir)"/Samples/Search/news1.htm"$(LF)$(LF) Windows = "Exit to &Windows" ;-------------------------------------------------------------- ; SETUP NOT DONE - RESTART DIALOG ;-------------------------------------------------------------- [SetupNotDoneDlgENG] DlgType = "Info" DlgTemplate = "NONFATAL" Caption = "Microsoft Index Server Samples Setup" DlgText = "Microsoft Index Server Samples have not been installed."$(LF)$(LF)+ "Please exit back to Windows NT." Windows = "Exit to &Windows" ;************************************************************************** ; DLL LOAD and FREE ; the following section contain commands to load specific dll libraries and ; to free them ;************************************************************************** ;---------------------------------------------- ; a) DETECT LIBRARY ;---------------------------------------------- [LoadSetupLibrary] LoadLibrary "x" $(STF_CWDDIR)setupdll.dll LIBHANDLE exit [FreeSetupLibrary] FreeLibrary $(LIBHANDLE) exit [LoadCiSetupLibrary] LoadLibrary "x" $(SrcPlatDir)cistp.dll CILIBHANDLE exit [FreeCiSetupLibrary] FreeLibrary $(CILIBHANDLE) exit ;************************************************************************** ; PROGRESS GUAGE VARIABLES ;************************************************************************** [ProgressCopyENG] ProCaption = "Microsoft Index Server Samples Setup" ProCancel = "Cance&l" ProCancelMsg = "Microsoft Index Server Samples Setup are not correctly installed. Are you sure "+ "you want to cancel copying files?" ProCancelCap = "Setup Message" ProText1 = "Copying:" ProText2 = "To:" ;************************************************************************** ; SHELL COMMANDS SCRIPT ;************************************************************************** [Shell Commands] ; ; Initialize the app, by setting the caption and loading the support library ; set TestCopy = 0 set TestReg = 0 ;-sc set TestRegVerbose = 0 set-title "Microsoft Index Server Samples Setup" set Exit_Code = $(!SETUP_ERROR_GENERAL) install LoadSetupLibrary StartWait ; ; read general constants ; set-subst LF = "\n" set-subst MQ = \047 ;047=' in octal meta-quote set-subst DQ = \042 ;042=" in octal double-quote ; ; read the platform independent choices ; read-syms LanguageID read-syms ProcessorID read-syms PlatformID ; ; read the default language and try to detect the language ; read-syms LanguageVar detect LanguageVar ; ; read and detect the processor we are working on ; read-syms ProcessorVar detect ProcessorVar read-syms Strings$(!STF_LANGUAGE) detect Strings$(!STF_LANGUAGE) ; ; Check processor type, see if it is supported, if so what platform does it ; belong to. ; ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I386) set STF_PLATFORM = $(PlatformID_I386) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I486) set STF_PLATFORM = $(PlatformID_I386) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_I586) set STF_PLATFORM = $(PlatformID_I386) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_R4000) set STF_PLATFORM = $(PlatformID_Mips) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_Alpha) set STF_PLATFORM = $(PlatformID_Alpha) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC601) set STF_PLATFORM = $(PlatformID_ppc) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC603) set STF_PLATFORM = $(PlatformID_ppc) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC604) set STF_PLATFORM = $(PlatformID_ppc) else-ifstr(i) $(STF_PROCESSOR) == $(ProcessorID_PPC620) set STF_PLATFORM = $(PlatformID_ppc) else shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String1) ui pop 1 goto setupnotdone endif read-syms RegistryConstants ; ; read the UI Variables and detect their setting on the current machine ; read-syms UiVars detect UiVars read-syms Vars$(STF_PLATFORM) read-syms VarsPlatformCommon ;Makesure all our paths have '\' at the end LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcDir) ifstr(i) $(STATUS) != "ERROR" set SrcDir = $(STATUS) endif LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(WinSysDir) ifstr(i) $(STATUS) != "ERROR" set WinSysDir = $(STATUS) endif ; ; Append processor architecture to source dir ; set SrcPlatDir = $(SrcDir)$(STF_PLATFORM) LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcPlatDir) ifstr(i) $(STATUS) != "ERROR" set SrcPlatDir = $(STATUS) endif EndWait set StartFolder = $(STF_WINDOWSPATH)"\Profiles\All Users\Start Menu\Programs\Microsoft Index Server (Common)" welcome =+ read-syms WelcomeDlg$(STF_LANGUAGE) ui start "WelcomeMe" ifstr(i) $(DLGEVENT) == "CONTINUE" ui pop 1 goto setsource else-ifstr(i) $(DLGEVENT) == "EXIT" shell "" QueryUserQuit ifstr(i) $($R1) == "OK" ui pop 1 goto setupnotdone else goto welcome endif else goto end endif querysource =+ shell "" DoAskPathEx $(SrcDir) $(String3) $(String6) ifint $($ShellCode) != $(!SHELL_CODE_OK) goto setupnotdone endif ifstr(i) $($R0) == STATUS_SUCCESSFUL set SrcDir = $($R1) LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcDir) ifstr(i) $(STATUS) != "ERROR" set SrcDir = $(STATUS) endif set SrcPlatDir = $(SrcDir)$(STF_PLATFORM) LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(SrcPlatDir) ifstr(i) $(STATUS) != "ERROR" set SrcPlatDir = $(STATUS) endif else goto setupnotdone endif setsource =+ ; ; Check for proper location ; set FileToCheck = $(SrcPlatDir)news1.htm LibraryProcedure STATUS,$(!LIBHANDLE), CheckFileExistance $(FileToCheck) ifstr(i) $(STATUS) == YES goto loadcilib else ; ; Try platform independent location ; set FileToCheck = $(SrcDir)news1.htm LibraryProcedure STATUS,$(!LIBHANDLE), CheckFileExistance $(FileToCheck) ifstr(i) $(STATUS) == YES set SrcPlatDir = $(SrcDir) goto loadcilib else goto querysource endif endif loadcilib =+ install LoadCiSetupLibrary setdestination =+ ; ; Code should go here to set destination for sample .htm, .idq, and .htx files. ; shell "" GetIISDirs ifstr(i) $($R0) != STATUS_SUCCESSFUL shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String19) ui pop 1 goto setupnotdone endif set ScriptDir = $($R1) set HomeDir = $($R2) set IsDefScriptDir = $($R3) set IsDefHomeDir = $($R4) LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(ScriptDir) ifstr(i) $(STATUS) != "ERROR" set ScriptDir = $(STATUS) endif LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(HomeDir) ifstr(i) $(STATUS) != "ERROR" set HomeDir = $(STATUS) endif setscript =+ set DefScriptDir = $(ScriptDir) LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(DefScriptDir) ifstr(i) $(STATUS) != "ERROR" set DefScriptDir = $(STATUS) endif shell "" DoAskPathEx $(ScriptDir) $(String20) $(String6) ifstr(i) $($R0) == STATUS_SUCCESSFUL set ScriptDir = $($R1) else goto setupnotdone endif LibraryProcedure IsFullPath $(!LIBHANDLE) CheckPathFullPathSpec $(ScriptDir) ifstr(i) $(IsFullPath) == "No" shell "" SetupMessage $(!STF_LANGUAGE) NONFATAL $(String5) ui pop 1 goto setscript endif shell "" DoMakeDir $(ScriptDir)Samples ; ; Clean up from previous install (if any) ; ifstr(i) $(IsDefScriptDir) == STATUS_SUCCESSFUL shell "" RemoveVRoot /Scripts/samples/search shell "" RemoveVRoot /Scripts/srchadm else ifstr(i) $(ScriptDir) != $(DefScriptDir) shell "" RemoveVRoot /Scripts/samples/search shell "" RemoveVRoot /Scripts/srchadm endif endif ; ; Did the user use a non-default script dir? ; ifstr(i) $(ScriptDir) != $(DefScriptDir) set ScriptVDir = "/Scripts" shell "" AddVRoot $(ScriptVDir)/samples/search $(ScriptDir)Samples\Search "4" shell "" AddVRoot $(ScriptVDir)/srchadm $(ScriptDir)srchadm "4" ;shell "" DoAskVPathEx $(ScriptVDir) $(String25) $(String6) ;ifstr(i) $($R0) == STATUS_SUCCESS ; set ScriptVDir = $($R1) ;else ; goto setupnotdone ;endif endif ; ; Set admin permissions on admin scripts ; shell "" DoMakeDir $(ScriptDir)srchadm LibraryProcedure RetVal $(!CILIBHANDLE) ApplySystemAcl $(ScriptDir)srchadm sethome =+ set DefHomeDir = $(HomeDir) LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(DefHomeDir) ifstr(i) $(STATUS) != "ERROR" set DefHomeDir = $(STATUS) endif shell "" DoAskPathEx $(HomeDir) $(String21) $(String6) ifstr(i) $($R0) == STATUS_SUCCESSFUL set HomeDir = $($R1) else goto setupnotdone endif LibraryProcedure IsFullPath $(!LIBHANDLE) CheckPathFullPathSpec $(HomeDir) ifstr(i) $(IsFullPath) == "No" shell "" SetupMessage $(!STF_LANGUAGE) NONFATAL $(String5) ui pop 1 goto sethome endif ;Make sure all our paths have '\' at the end LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(ScriptDir) ifstr(i) $(STATUS) != "ERROR" set ScriptDir = $(STATUS) endif LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(HomeDir) ifstr(i) $(STATUS) != "ERROR" set HomeDir = $(STATUS) endif shell "" DoMakeDir $(HomeDir)Samples ; ; Clean up from previous install (if any) ; shell "" RemoveVRoot /SearchHelp shell "" RemoveVRoot /srchadm ifstr(i) $(IsDefHomeDir) == STATUS_SUCCESSFUL shell "" RemoveVRoot /samples/search else ifstr(i) $(HomeDir) != $(DefHomeDir) shell "" RemoveVRoot /samples/search endif endif ; ; Did the user use a non-default home dir? ; ifstr(i) $(HomeDir) != $(DefHomeDir) set HomeVDir = "/" shell "" AddVRoot $(HomeVDir)samples/search $(HomeDir)Samples\Search "1" ;shell "" DoAskVPathEx $(HomeVDir) $(String26) $(String6) ;ifstr(i) $($R0) == STATUS_SUCCESS ; set HomeVDir = $($R1) ;else ; goto setupnotdone ;endif endif ; ; Setup root for admin. ; shell "" DoMakeDir $(HomeDir)srchadm LibraryProcedure RetVal $(!CILIBHANDLE) ApplySystemAcl $(HomeDir)srchadm shell "" AddVRoot /srchadm $(HomeDir)srchadm "1" finish = + install ICopyFiles install Install-All-Files-Now ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_SUCCESS" goto dosamples else shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" $(String4) ui pop 1 goto setupnotdone endif dosamples=+ shell "" DoURLSection "Files-URL" $(StartFolder) shell "" AddCiNewsRoot setupdone=+ set Exit_Code = $(!SETUP_ERROR_SUCCESS) read-syms SetupDoneDlg$(!STF_LANGUAGE) ui start "DoneWithThis" ifstr(i) $(DLGEVENT) == "CONTINUE" ui pop 1 goto end else goto end endif setupnotdone=+ read-syms SetupNotDoneDlg$(!STF_LANGUAGE) EndWait ui start "NotDoneMakingAMess" ifstr(i) $(DLGEVENT) == "CONTINUE" ui pop 1 goto end else goto end endif end = + install FreeSetupLibrary install FreeCiSetupLibrary exit ;***************************************************************** ; * ; INSTALLATION SUPPORT ROUTINES * ; * ;***************************************************************** ;************************************************************************** ; ; GetIISDirs ; ; Attempts to locate Script and Home directories for IIS ; ; Returns: $R0: Status: STATUS_SUCCESSFUL ; STATUS_FAILED ; ; $R1: Script directory ; ; $R2: Home directory ; ;************************************************************************** [GetIISDirs] set Script = "" set Home = "" ; ; First, check for service ; set hKey = $(!REG_H_LOCAL) shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc" "Start" ifstr(i) $($R0) != STATUS_SUCCESSFUL goto FailIIS endif shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/Scripts" ifstr(i) $($R0) == STATUS_SUCCESSFUL split-string *($($R1),4) "," Tmp set Script = *($(Tmp),1) endif shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/Scripts," ifstr(i) $($R0) == STATUS_SUCCESSFUL split-string *($($R1),4) "," Tmp set Script = *($(Tmp),1) endif shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/" ifstr(i) $($R0) == STATUS_SUCCESSFUL split-string *($($R1),4) "," Tmp set Home = *($(Tmp),1) endif shell "" GetValue $(hKey) "system\currentcontrolset\services\w3svc\parameters\virtual roots" "/," ifstr(i) $($R0) == STATUS_SUCCESSFUL split-string *($($R1),4) "," Tmp set Home = *($(Tmp),1) endif set Status = STATUS_SUCCESSFUL goto DoneIIS FailIIS =+ set Status = STATUS_FAILED DoneIIS =+ return $(Status) $(Script) $(Home) ;************************************************************************** ; ; AddCiNewsRoot ; ;************************************************************************** [AddCiNewsRoot] set Script = "" set Home = "" set hKey = $(!REG_H_LOCAL) ; ; First, lookup NNTP roots ; OpenRegKey $(hKey) "" "system\currentcontrolset\services\nntpsvc\parameters\virtual roots" $(!REG_KEY_READ) TempKey ifint $(RegLastError) != $(!REG_ERROR_SUCCESS) ; Debug-Output "REGISTRY.INF: OpenRegKey Failed: "$($)" "$($0)" "$($1)" "$($2) goto AddEnd endif EnumRegValue $(TempKey), NNTPRoots ; ; Adjust them to /$CiNews roots ; set SlamValueList = {} ForListDo $(NNTPRoots) set Virtual = *($($),1) split-string *($($),4) "," Tmp Set Physical = *($(Tmp),1) ;shell "" SetupMessage $(!STF_LANGUAGE) "FATAL" "Virtual: "$(Virtual)" Physical: "$(Physical) set SlamValueList = >($(SlamValueList), { "/$CiNews"$(Virtual), $(!NoTitle), $(!REG_VT_SZ), $(Physical)",,"}) EndForListDo ; ; Find NNTP home ; ;shell "" GetValue $(hKey) "system\currentcontrolset\services\nntpsvc\parameters\virtual roots" "/" ;ifstr(i) $($R0) == STATUS_SUCCESSFUL ; split-string *($($R1),4) "," Tmp ; set Home = *($(Tmp),1) ;endif ;shell "" GetValue $(hKey) "system\currentcontrolset\services\nntpsvc\parameters\virtual roots" "/," ;ifstr(i) $($R0) == STATUS_SUCCESSFUL ; split-string *($($R1),4) "," Tmp ; set Home = *($(Tmp),1) ;endif ; ; Set equivalent Web home ; ;build up our KeyList set OurKeyList = {} set OurKeyList = >($(OurKeyList), {"system", $(!NoTitle), $(!MaskAllAccess)}) set OurKeyList = >($(OurKeyList), {"currentcontrolset", $(!NoTitle), $(!MaskAllAccess)}) set OurKeyList = >($(OurKeyList), {"services", $(!NoTitle), $(!MaskAllAccess)}) set OurKeyList = >($(OurKeyList), {"w3svc", $(!NoTitle), $(!MaskAllAccess)}) set OurKeyList = >($(OurKeyList), {"parameters", $(!NoTitle), $(!MaskAllAccess)}) set OurKeyList = >($(OurKeyList), {"virtual roots", $(!NoTitle), $(!MaskAllAccess)}) ;build up Value List ;set SlamValueList = {} ;set SlamValueList = >($(SlamValueList), { "/$CiNews", $(!NoTitle), $(!REG_VT_SZ), $(Home)",,4"}) shell "" CreateKey $(hKey) $(OurKeyList) $(SlamValueList) CloseRegKey $($R1) ; ; Stop and restart W3SVC to get the roots picked up. ; LibraryProcedure RetVal $(!CILIBHANDLE) RunProgram $(!STF_WINDOWSSYSPATH)\net.exe stop w3svc LibraryProcedure RetVal $(!CILIBHANDLE) RunProgram $(!STF_WINDOWSSYSPATH)\net.exe start w3svc AddEnd=+ return ;************************************************************************** ; ; GetValue ; ; Checks if key is present, and if so, returns the value ; ; $0 Key Handle ; $1 Key name ; $2 Value Name ; ;************************************************************************** [GetValue] set Status = STATUS_FAILED read-syms RegistryConstants OpenRegKey $($0) "" $($1) $(!REG_KEY_READ) TempKey ifint $(RegLastError) != $(!REG_ERROR_SUCCESS) ; Debug-Output "REGISTRY.INF: OpenRegKey Failed: "$($)" "$($0)" "$($1)" "$($2) goto end_get_value endif GetRegValue $(TempKey), $($2), KeyValue ifint $(RegLastError) != $(!REG_ERROR_SUCCESS) ; Debug-Output "REGISTRY.INF: GetRegValue Failed:"$($) CloseRegKey $(TempKey) goto end_get_value endif set Status = STATUS_SUCCESSFUL end_get_value = + return $(Status) $(KeyValue) ;----------------------------------------------------------------------- ; ROUTINE: CreateKey ; ; DESCRIPTION: Creates a key and fixes the values indicated. ; Key is Handle\Key1\Key2\...\Keyn. Value list ; is for Valuen. ; ; INPUTS: $0: Handle into registry ; $1: KeyTreeComponents {Key1Info, Key2Info..} ; $2: ValueList {Value1Info, Value2Info, Value3Info} ; ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL ; STATUS_FAILED ; STATUS_ERROR_CREATEKEY ; STATUS_ERROR_CREATEVALUE ; ; $R1: Handle to created key ; ;------------------------------------------------------------------------ [CreateKey] ; ifint $(!TestRegVerbose) == 1 ; Debug-Output ".INF: CreateKey $0 = "$($0) ; Debug-Output ".INF: CreateKey $1 = "$($1) ; Debug-Output ".INF: CreateKey $2 = "$($2) ; endif ; ; Initialize ; set Status = STATUS_FAILED read-syms RegistryConstants ; ; traverse down the keytreecomponents and open/create components as ; you go along ; set BaseHandle = $($0) set KeyHandle = $(BaseHandle) ForListDo $($1) set KeyInfo = $($) set KeyName = *($(KeyInfo), 1) ; ; Try opening the key first OpenRegKey $(BaseHandle) "" $(KeyName) $(MaskAllAccess) KeyHandle ifint $(RegLastError) != $(!REG_ERROR_SUCCESS) ; ; Key doesn't exist ; ; Debug-Output "REGISTRY.INF: Key"$(KeyName)"doesn't exist. Will create key" set RegLastError = 0 CreateRegKey $(BaseHandle) $(KeyInfo) "" $(MaskAllAccess) "" KeyHandle ifint $(RegLastError) != $(!REG_ERROR_SUCCESS) set Status = STATUS_ERROR_CREATEKEY ; Debug-Output "REGISTRY.INF: Error in creating key" goto endcreate endif endif ifstr(i) $(BaseHandle) != $($0) CloseRegKey $(BaseHandle) ifint $(RegLastError) != $(!REG_ERROR_SUCCESS) set Status = STATUS_ERROR_CREATEKEY ; Debug-Output "REGISTRY.INF: Error in closing base handle" goto endcreate endif endif set BaseHandle = $(KeyHandle) EndForListDo ifstr(i) $($2) != {} shell "" AddValueList $(KeyHandle) $($2) ifstr(i) $($R0) != STATUS_SUCCESSFUL set Status = STATUS_ERROR_CREATEVALUE goto endcreate endif endif set Status = STATUS_SUCCESSFUL endcreate = + ifstr(i) $(Status) != STATUS_SUCCESSFUL ; Debug-Output "REGISTRY.INF: CreateKey Error:"$(Status) endif Return $(Status) $(KeyHandle) ;************************************************************************* ; ; SECTION: AddValueList ; ; PURPOSE: Given a nested list of value items, add each to the given ; key. Key is left open. ; ; ARGUMENTS: $0 Registry key handle ; $1 List of value items; for example: ; { {ValueName1,0,$(!REG_VT_SZ),$(ValueData1)}, + ; {ValueName2,0,$(!REG_VT_SZ),$(ValueData2)} } ; ; RETURNS: $R0 Status ; ; ;************************************************************************* [AddValueList] set Status = STATUS_FAILED read-syms RegistryConstants ForListDo $($1) SetRegValue $($0) $($) ifint $(RegLastError) != $(!REG_ERROR_SUCCESS) ; Debug-Output "REGISTRY.INF: CreateValue failed:"$($) goto end_addvaluelist endif EndForListDo set Status = STATUS_SUCCESSFUL end_addvaluelist = + return $(Status) ;----------------------------------------------------------------------- ; ROUTINE: QueryUserQuit ; ; DESCRIPTION: This routine queries whether the user wants to quit setup ; ; INPUTS: None ; ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL | ; STATUS_FAILED ; ; $R1: UserAction: OK | CANCEL ; ;------------------------------------------------------------------------ [QueryUserQuit] set Status = STATUS_FAILED set UserAction = CANCEL ; ; read in quit message ; read-syms ExitWarningDlg$(!STF_LANGUAGE) ui start "ExitWarning" ifstr(i) $(DLGEVENT) == "YES" set Status = STATUS_SUCCESSFUL set UserAction = "OK" else-ifstr(i) $(DLGEVENT) == "NO" set Status = STATUS_SUCCESSFUL set UserAction = "CANCEL" else endif fin_QueryUserQuit = + Return $(Status) $(UserAction) [ExitWarningDlgENG] DlgType = "MessageBox" STF_MB_TITLE = "Exit Microsoft Index Server Setup" STF_MB_TEXT = "Microsoft Index Server Samples are not completely installed."$(LF)$(LF)+ " Are you sure you want to exit Setup?" STF_MB_TYPE = 3 STF_MB_ICON = 5 STF_MB_DEF = 1 ;----------------------------------------------------------------------- ; ROUTINE: SetupMessage ; ; DESCRIPTION: Puts up a MessageBox ; ; INPUTS: $0 LanguageID ; $1 Message type ; $2 Message string ; ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL | ; STATUS_FAILED ; ; $R1: UserAction: OK | CANCEL ; ;------------------------------------------------------------------------ [SetupMessage] set Status = STATUS_FAILED set UserAction = "CANCEL" set DlgText = $($2) ifstr(i) $($1) == "WARNING" read-syms WarningDlg$($0) else-ifstr(i) $($1) == "FATAL" read-syms FatalDlg$($0) else-ifstr(i) $($1) == "NONFATAL" read-syms NonfatalDlg$($0) else-ifstr(i) $($1) == "STATUS" read-syms StatusDlg$($0) else-ifstr(i) $($1) == "WARNINGOK" read-syms WarningOKDlg$($0) else goto finish_SetupMessage endif ui start "SetupMessage" ifstr(i) $(DLGEVENT) == "OK" set Status = STATUS_SUCCESSFUL set UserAction = $(DLGEVENT) else-ifstr(i) $(DLGEVENT) == "CANCEL" set Status = STATUS_SUCCESSFUL set UserAction = $(DLGEVENT) else-ifstr(i) $(DLGEVENT) == "YES" set Status = STATUS_SUCCESSFUL set UserAction = $(DLGEVENT) else-ifstr(i) $(DLGEVENT) == "NO" set Status = STATUS_SUCCESSFUL set UserAction = $(DLGEVENT) else endif finish_SetupMessage = + Return $(Status) $(UserAction) end [WarningDlgENG] STF_MB_TITLE = "Setup Message" DlgType = "MessageBox" STF_MB_TEXT = $(DlgText) STF_MB_TYPE = 2 STF_MB_ICON = 5 STF_MB_DEF = 2 [FatalDlgENG] STF_MB_TITLE = "Setup Message" DlgType = "MessageBox" STF_MB_TEXT = $(DlgText) STF_MB_TYPE = 1 STF_MB_ICON = 3 STF_MB_DEF = 1 [NonfatalDlgENG] STF_MB_TITLE = "Setup Message" DlgType = "MessageBox" STF_MB_TEXT = $(DlgText) STF_MB_TYPE = 1 STF_MB_ICON = 5 STF_MB_DEF = 1 [StatusDlgENG] STF_MB_TITLE = "Setup Message" DlgType = "MessageBox" STF_MB_TEXT = $(DlgText) STF_MB_TYPE = 1 STF_MB_ICON = 2 STF_MB_DEF = 1 [WarningOKDlgENG] DlgType = "MessageBox" STF_MB_TITLE = "Setup Message" STF_MB_TEXT = $(DlgText) STF_MB_TYPE = 3 STF_MB_ICON = 5 STF_MB_DEF = 1 ;************************************************************************** ; ; DoURLSection ; ; Modifies URLs to point to machine ; ; $0 Section name to act upon ; $1 Target directory into which files in $0 were copied ; ;************************************************************************** [DoURLSection] set Files = ^($($0), 4) ForListDo $(Files) split-string *($(Files), $(#)) "=" Tmp LibraryProcedure ReturnVal $(!CILIBHANDLE) Replace $($1)\*($(Tmp), 3) machname $(!STF_COMPUTERNAME) EndForListDo return ;----------------------------------------------------------------------- ; ROUTINE: DoAskPathEx ; ; DESCRIPTION: Puts up an EDIT box to prompt for a path ; ; INPUTS: $0 LanguageID ; $1 Message type ; $2 Message error ; ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL | ; STATUS_FAILED ; ; $R1: UserAction: OK | CANCEL ; ;------------------------------------------------------------------------ [DoAskPathEx] set Status = STATUS_FAILED set Src = $($0) askpath = + read-syms DisketteDlg$(!STF_LANGUAGE) ui start "Diskette" ifstr(i) $(DLGEVENT) == "CONTINUE" LibraryProcedure IsFullPath, $(!LIBHANDLE), CheckPathFullPathSpec $(EditTextOut) ifstr(i) $(IsFullPath) == "NO" StartWait LibraryProcedure STATUS, $(!LIBHANDLE), ProcessForUNC $(EditTextOut) EndWait ifstr(i) $(STATUS) == "ERROR" shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2) goto askpath else-ifstr(i) $(STATUS) == "NOT-UNC" shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2) goto askpath else-ifstr(i) $(STATUS) == "UNC-FAILCONNECT" shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2) goto askpath else set Src = $(STATUS) endif else set Src = $(EditTextOut) endif ui pop 1 LibraryProcedure STATUS, $(!LIBHANDLE), AppendBackSlash $(Src) ifstr(i) $(STATUS) == "ERROR" goto finish_DoAskPath else set Src = $(STATUS) set Status = STATUS_SUCCESSFUL goto finish_DoAskPath endif else-ifstr(i) $(DLGEVENT) == "BACK" ui pop 1 set Status = STATUS_USERCANCEL goto finish_DoAskPath else ui pop 1 goto finish_DoAskPath endif finish_DoAskPath = + Return $(Status) $(Src) $(EditTextOut) ;----------------------------------------------------------------------- ; ROUTINE: DoAskVPathEx ; ; DESCRIPTION: Puts up an EDIT box to prompt for a virtual path ; ; INPUTS: $0 LanguageID ; $1 Message type ; $2 Message error ; ; OUTPUTS: $R0: Status: STATUS_SUCCESSFUL | ; STATUS_FAILED ; ; $R1: UserAction: OK | CANCEL ; ;------------------------------------------------------------------------ [DoAskVPathEx] set Status = STATUS_FAILED set Src = $($0) askvpath = + read-syms DisketteDlg$(!STF_LANGUAGE) ui start "Diskette" ifstr(i) $(DLGEVENT) == "CONTINUE" ; ; Make sure it has slashes ; split-string $(EditTextOut) "/" Tmp set HasSlash = STATUS_FAILED set EndsInSlash = STATUS_FAILED set MinusEndSlash = "" ForListDo $(Tmp) ifstr(i) $($) == "/" set HasSlash = STATUS_SUCCESS set EndsInSlash = STATUS_SUCCESS else set EndsInSlash = STATUS_FAILED set MinusEndSlash = $(MinusEndSlash)/$($) endif EndForListDo ifstr(i) $(EndsInSlash) == STATUS_SUCCESS set EditTextOut = $(MinusEndSlash) endif ifstr(i) $(HasSlash) != STATUS_SUCCESS shell "" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $($2) goto askvpath else set Src = $(EditTextOut) endif set Status = STATUS_SUCCESS ui pop 1 else-ifstr(i) $(DLGEVENT) == "BACK" ui pop 1 set Status = STATUS_USERCANCEL goto finish_DoAskVPath else ui pop 1 goto finish_DoAskVPath endif finish_DoAskVPath = + Return $(Status) $(Src) $(EditTextOut) [DisketteDlgENG] Caption = "Microsoft Index Server Setup" Continue = "Continue" Cancel = "Cancel" DlgType = "Edit" DlgTemplate = "DISKETTE" DlgText = $($1) Edit1Label = "" EditTextIn = $(Src) EditFocus = "ALL" [ICopyFiles] AddSectionFilesToCopyList Files-URL $(SrcPlatDir) $(StartFolder) LibraryProcedure STATUS,$(!LIBHANDLE), CheckFileExistance $(SrcDir)news1.htm ifstr(i) $(STATUS) == YES AddSectionFilesToCopyList Files-SampleHTM $(SrcDir) $(HomeDir)Samples\Search\ AddSectionFilesToCopyList Files-SampleIDQ $(SrcDir) $(ScriptDir)Samples\Search\ AddSectionFilesToCopyList Files-AdminIDQ $(SrcDir) $(ScriptDir)SrchAdm\ else AddSectionFilesToCopyList Files-SampleHTM $(SrcDir)NewsVr $(HomeDir)Samples\Search\ AddSectionFilesToCopyList Files-SampleIDQ $(SrcDir)NewsVr $(ScriptDir)Samples\Search\ AddSectionFilesToCopyList Files-AdminIDQ $(SrcDir)NewsVr $(ScriptDir)SrchAdm\ endif exit [Install-All-Files-Now] CopyFilesInCopyList exit ; ; File lists ; [Files-SampleHTM] 1, news1.htm, NOLOG 1, news2.htm, NOLOG 1, isnread.txt, NOLOG [Files-SampleIDQ] 1, news1.htw, NOLOG 1, news1.htx, NOLOG 1, news1.idq, NOLOG 1, news2.htw, NOLOG 1, news2.htx, NOLOG 1, news2.idq, NOLOG [Files-AdminIDQ] 1, admin.htx, NOLOG, BACKUP=admin.htx.bak 1, admin.idq, NOLOG, BACKUP=admin.idq.bak [Files-URL] 1, ISNQUERY.URL, NOLOG, RENAME="Index Server Sample News Query Form.url" 1, ISNREAD.URL, NOLOG, RENAME="Release Notes (Sample News Query Forms).url"