home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 July / VPR9607B.BIN / driver / iodata / rsa_140 / rsa_140.upd / NT / RSA98SB / OEMSETUP.INF next >
INI File  |  1996-02-27  |  65KB  |  1,649 lines

  1. ;-----------------------------------------------------------------------
  2. ; OPTION TYPE
  3. ; -----------
  4. ; This identifies the Option type we are dealing with.  The different
  5. ; possible types are:
  6. ;
  7. ; COMPUTER, VIDEO, POINTER, KEYBOARD, LAYOUT, SCSI, TAPE, PRINTER, ...
  8. ;-----------------------------------------------------------------------
  9.  
  10. [Identification]
  11.     OptionType = POINTER
  12.  
  13. ;-----------------------------------------------------------------------
  14. ; LANGUAGES SUPPORTED
  15. ; -------------------
  16. ;
  17. ; The languages supported by the INF, For every language supported
  18. ; we need to have a separate text section for every displayable text
  19. ; section.
  20. ;
  21. ;-----------------------------------------------------------------------
  22.  
  23. [LanguagesSupported]
  24.     ENG
  25.  
  26.  
  27. ;-----------------------------------------------------------------------
  28. ; OPTION LIST
  29. ; -----------
  30. ; This section lists the Option key names.  These keys are locale
  31. ; independent and used to represent the option in a locale independent
  32. ; manner.
  33. ;
  34. ;-----------------------------------------------------------------------
  35.  
  36. [Options]
  37.     "SerRSA98"    = SerRSA98
  38.  
  39. ;-----------------------------------------------------------------------
  40. ; OPTION TEXT SECTION
  41. ; -------------------
  42. ; These are text strings used to identify the option to the user.  There
  43. ; are separate sections for each language supported.  The format of the
  44. ; section name is "OptionsText" concatenated with the Language represented
  45. ; by the section.
  46. ;
  47. ;-----------------------------------------------------------------------
  48.  
  49. [OptionsTextENG]
  50. ;;    "SerRSA98"    = "PC-9800 シリアルポート(2チャンネル)"
  51.       "SerRSA98"    = "アイ・オー・データ 高速シリアルボード RSA-98シリーズ"
  52.  
  53. [FileConstants]
  54.     !MAXIMUM_ALLOWED   = 33554432
  55.  
  56. ;-----------------------------------------------------------------------------------------
  57. ; RS-232C CARD DRIVERS:
  58. ;
  59. ; Order of the information:
  60. ;
  61. ; Class driver = Type, Group, ErrorControl, Tag, EventMessageFile, TypesSupported
  62. ;
  63. ;-----------------------------------------------------------------------------------------
  64.  
  65. [RsDrivers]
  66. ;;    SerRSA98  = !SERVICE_KERNEL_DRIVER, "Extended base", !SERVICE_ERROR_IGNORE, 3, %SystemRoot%\System32\IoLogMsg.dll, 7, 5, 568
  67.       SerRSA98 = !SERVICE_KERNEL_DRIVER, "Extended base", !SERVICE_ERROR_IGNORE, 3, %SystemRoot%\System32\IoLogMsg.dll, 7, 3, 20704,20704,6
  68.  
  69. ;     IRQ=3, IOBase=01B0h(432)
  70.  
  71. ;---------------------------------------------------------------------------
  72. ; 1. Identify
  73. ;
  74. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  75. ;                as we are choosing currently.
  76. ;
  77. ; INPUT:         None
  78. ;
  79. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  80. ;                $($R1): Option Type (COMPUTER ...)
  81. ;                $($R2): Diskette description
  82. ;---------------------------------------------------------------------------
  83.  
  84. [Identify]
  85.     ;
  86.     ;
  87.     read-syms Identification
  88.  
  89.     set Status     = STATUS_SUCCESSFUL
  90.     set Identifier = $(OptionType)
  91.     set Media      = #("Source Media Descriptions", 1, 1)
  92.  
  93.     Return $(Status) $(Identifier) $(Media)
  94.  
  95.  
  96.  
  97. ;------------------------------------------------------------------------
  98. ; 2. ReturnOptions:
  99. ;
  100. ; DESCRIPTION:   To return the option list supported by this INF and the
  101. ;                localised text list representing the options.
  102. ;
  103. ;
  104. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  105. ;
  106. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  107. ;                                STATUS_NOLANGUAGE
  108. ;                                STATUS_FAILED
  109. ;
  110. ;                $($R1): Option List
  111. ;                $($R2): Option Text List
  112. ;------------------------------------------------------------------------
  113.  
  114. [ReturnOptions]
  115.     ;
  116.     ;
  117.     set Status        = STATUS_FAILED
  118.     set OptionList     = {}
  119.     set OptionTextList = {}
  120.  
  121.     ;
  122.     ; Check if the language requested is supported
  123.     ;
  124.     set LanguageList = ^(LanguagesSupported, 1)
  125.     Ifcontains(i) $($0) in $(LanguageList)
  126.         goto returnoptions
  127.     else
  128.         set Status = STATUS_NOLANGUAGE
  129.         goto finish_ReturnOptions
  130.     endif
  131.  
  132.     ;
  133.     ; form a list of all the options and another of the text representing
  134.     ;
  135.  
  136. returnoptions = +
  137.     set OptionList     = ^(Options, 0)
  138.     set OptionTextList = ^(OptionsText$($0), 1)
  139.     set Status         = STATUS_SUCCESSFUL
  140.  
  141. finish_ReturnOptions = +
  142.     Return $(Status) $(OptionList) $(OptionTextList)
  143.  
  144.  
  145. ;
  146. ; 3. InstallOption:
  147. ;
  148. ; FUNCTION:  To copy files representing Options
  149. ;            To configure the installed option
  150. ;            To update the registry for the installed option
  151. ;
  152. ; INPUT:     $($0):  Language to use
  153. ;            $($1):  OptionID to install
  154. ;            $($2):  SourceDirectory
  155. ;            $($3):  AddCopy  (YES | NO)
  156. ;            $($4):  DoCopy   (YES | NO)
  157. ;            $($5):  DoConfig (YES | NO)
  158. ;
  159. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  160. ;                            STATUS_NOLANGUAGE |
  161. ;                            STATUS_USERCANCEL |
  162. ;                            STATUS_FAILED
  163. ;
  164.  
  165. [InstallOption]
  166.  
  167.     ;
  168.     ; Set default values for
  169.     ;
  170.     set Status = STATUS_FAILED
  171.     set DrivesToFree = {}
  172.     read-syms FileConstants
  173.  
  174.     ;
  175.     ; extract parameters
  176.     ;
  177.     set Option   = $($1)
  178.     set SrcDir   = $($2)
  179.     set AddCopy  = $($3)
  180.     set DoCopy   = $($4)
  181.     set DoConfig = $($5)
  182.  
  183.     ;
  184.     ; Check if the language requested is supported
  185.     ;
  186.     set LanguageList = ^(LanguagesSupported, 1)
  187.     Ifcontains(i) $($0) in $(LanguageList)
  188.     else
  189.         set Status = STATUS_NOLANGUAGE
  190.         goto finish_InstallOption
  191.     endif
  192.     read-syms Strings$($0)
  193.  
  194.     ;
  195.     ; check to see if Option is supported.
  196.     ;
  197.  
  198.     set OptionList = ^(Options, 0)
  199.     ifcontains $(Option) in $(OptionList)
  200.     else
  201. ;       Debug-Output "SCSI.INF: SCSI option is not supported."
  202.         goto finish_InstallOption
  203.     endif
  204.     set OptionList = ""
  205.  
  206.     ;
  207.     ; Option has been defined already
  208.     ;
  209.  
  210.     set RsDriver         =   #(Options,   $(Option),   1)
  211.     set Type             = $(#(RsDrivers, $(RsDriver), 1))
  212.     set Group            =   #(RsDrivers, $(RsDriver), 2)
  213.     set ErrorControl     = $(#(RsDrivers, $(RsDriver), 3))
  214.     set Tag              =   #(RsDrivers, $(RsDriver), 4)
  215.     set EventMessageFile =   #(RsDrivers, $(RsDriver), 5)
  216.     set TypesSupported   =   #(RsDrivers, $(RsDriver), 6)
  217.     set Interrupt        =   #(RsDrivers, $(RsDriver), 7)
  218.     set PortAddress      =   #(RsDrivers, $(RsDriver), 8)
  219.     set TimerPortAddress =   #(RsDrivers, $(RsDriver), 9)
  220.     set TimerValue       =   #(RsDrivers, $(RsDriver), 10)
  221.     set Start            =   $(!SERVICE_AUTO_START)
  222.  
  223. installtheoption = +
  224.  
  225.     ;
  226.     ; Code to add files to copy list
  227.     ;
  228.  
  229.     ifstr(i) $(AddCopy) == "YES"
  230.         set DoActualCopy = NO
  231.         set FileToCheck = #(Files-RsDrivers, $(RsDriver), 2)
  232.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(!STF_WINDOWSSYSPATH)"\drivers\"$(FileToCheck)
  233.         ifstr(i) $(STATUS) == NO
  234.             set DoActualCopy = YES
  235.         endif
  236.  
  237.         ifstr(i) $(DoActualCopy) == NO
  238.             shell "subroutn.inf" DriversExist $($0) $(String1)
  239.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  240.                 goto finish_InstallOption
  241.             endif
  242.  
  243.             ifstr(i) $($R0) == STATUS_CURRENT
  244.             else-ifstr(i) $($R0) == STATUS_NEW
  245.                 set DoActualCopy = YES
  246.             else-ifstr(i) $($R0) == STATUS_USERCANCEL
  247.                 goto finish_InstallOption
  248.             else
  249.                 goto finish_InstallOption
  250.             endif
  251.         endif
  252.  
  253.         ifstr(i) $(DoActualCopy) == YES
  254.  
  255.             shell "subroutn.inf" DoAskSourceEx $(SrcDir) $(String2)
  256.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  257.                 goto finish_InstallOption
  258.             endif
  259.  
  260.             ifstr(i) $($R0) == STATUS_SUCCESSFUL
  261.                 set SrcDir = $($R1)
  262.                 ifstr(i) $($R2) != ""
  263.                     set DrivesToFree = >($(DrivesToFree), $($R2))
  264.                 endif
  265.             else
  266.                 goto finish_InstallOption
  267.             endif
  268.  
  269.             install Install-AddCopyOption
  270.             ifstr(i) $(STF_INSTALL_OUTCOME) != "STF_SUCCESS"
  271.                 goto finish_InstallOption
  272.             endif
  273.         else
  274.             set DoCopy = NO
  275.         endif
  276.  
  277.     endif
  278.  
  279.     ifstr(i) $(DoCopy) == "YES"
  280.         read-syms ProgressCopy$($0)
  281.         install Install-DoCopyOption
  282.         ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  283.             Debug-Output "Copying files failed"
  284.             goto finish_InstallOption
  285.         else-ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_USERQUIT"
  286.             set Status = STATUS_USERCANCEL
  287.             goto finish_InstallOption
  288.         endif
  289.     endif
  290.  
  291.     ifstr(i) $(DoConfig) == "YES"
  292.         ;
  293.         ; first run a privilege check on modifying the setup node
  294.         ;
  295.  
  296.         shell "registry.inf" CheckSetupModify
  297.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  298.             goto finish_InstallOption
  299.         endif
  300.  
  301.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  302.             goto finish_InstallOption
  303.         endif
  304.  
  305.         ;
  306.         ; then make a new RS-232C entry, the entry is created automatically
  307.         ; enabled
  308.         ;
  309.  
  310.         set ServiceNode   = $(RsDriver)
  311.         set ServiceBinary = System32\drivers\#(Files-RsDrivers, $(RsDriver), 2)
  312.  
  313.         set ServicesValues   = { +
  314.                 {Type,           0, $(!REG_VT_DWORD),     $(Type)                  }, +
  315.                 {Start,          0, $(!REG_VT_DWORD),     $(Start)                 }, +
  316.                 {Group,          0, $(!REG_VT_SZ),        $(Group)                 }, +
  317.                 {ErrorControl,   0, $(!REG_VT_DWORD),     $(ErrorControl)          }, +
  318.                 {Tag,            0, $(!REG_VT_DWORD),     $(Tag)                   }, +
  319.                 {BinaryPathName, 0, $(!REG_VT_EXPAND_SZ), $(ServiceBinary)         }  +
  320.                 }
  321.         set ParametersValues = { +
  322.                 {TimerPortAddress,  0, $(!REG_VT_DWORD),     $(TimerPortAddress)     },  +
  323.                 {TimerValue,        0, $(!REG_VT_DWORD),     $(TimerValue)           }  +
  324.                 }
  325. ;        set DeviceValues     = {}
  326.         set RSAValues     = { +
  327.                 {Interrupt,      0, $(!REG_VT_DWORD),     $(Interrupt)             }, +
  328.                 {PortAddress,    0, $(!REG_VT_DWORD),     $(PortAddress)           }  +
  329.                 }
  330.         set EventLogValues   = { +
  331.                 {EventMessageFile, 0, $(!REG_VT_EXPAND_SZ), $(EventMessageFile) }, +
  332.                 {TypesSupported,   0, $(!REG_VT_DWORD),     $(TypesSupported)   }  +
  333.                 }
  334.  
  335. ; fujino 960226
  336. ;        shell "registry.inf"  MakeServicesEntry $(ServiceNode)      +
  337. ;        MakeServicesEntry $(ServiceNode)      +
  338.         shell "" MakeServicesEntry2 $(ServiceNode)      +
  339.                                                 $(ServicesValues)   +
  340.                                                 $(ParametersValues) +
  341. ;                                                $(DeviceValues)     +
  342.                                                 $(RSAValues)     +
  343.                                                 $(EventLogValues)   +
  344.                                                 Parameters
  345.  
  346.  
  347.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  348.             Debug-Output "Couldn't execute MakeServicesEntry in registry.inf"
  349.             goto finish_InstallOption
  350.         endif
  351.  
  352.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  353.             Debug-Output "MakeServicesEntry failed for RS-232C"
  354.             goto finish_InstallOption
  355.         endif
  356.  
  357.         ;
  358.         ; Delete CurrentControlSet\Services\SerRSA98 Value
  359.         ;
  360.         set SerRSA98ServiceName = "SYSTEM\CurrentControlSet\Services\SerRSA98"
  361.         OpenRegKey $(!REG_H_LOCAL) "" $(SerRSA98ServiceName) $(!MAXIMUM_ALLOWED) KeyService
  362.         Ifstr(i) $(KeyService) != $(KeyNull)
  363.             DeleteRegValue $(KeyService) "ImagePath"
  364. ;            DeleteRegValue $(KeyService) "Tag"
  365.             DeleteRegKey $(KeyService) "Security"
  366.             CloseRegKey $(KeyService)
  367.             Debug-Output "SerRSA98 Service Value Deleted(Imagepath, Tag, Security)"
  368.         else
  369.             Debug-Output "SYSTEM\CurrentControlSet\Services\SerRSA98 KeyService Open Error"
  370.         endif
  371.  
  372.  
  373. ;;;;;;;H.K
  374.         set Parameters1 = "SYSTEM\CurrentControlSet\Services\SerRSA98\Parameters"
  375.         set ParametersKey = ""
  376.  
  377. ;;fujino 960226
  378. ;;      OpenRegKey $(KeyService) "" $("Parameters1") $(!MAXIMUM_ALLOWED) ParametersKey
  379.         OpenRegKey $(KeyService) "" $(Parameters1) $(!MAXIMUM_ALLOWED) ParametersKey
  380.  
  381.         Ifstr(i) $(ParametersKey) != $(KeyNull)
  382.             CloseRegKey $(ParametersKey)
  383. ;            Debug-Output "SerRSA98 Service Value Deleted(Imagepath, Tag, Security)"
  384.         else
  385. ;            Debug-Output "SYSTEM\CurrentControlSet\Services\SerRSA98 KeyService Open Error"
  386.         endif
  387.  
  388.         set RSAValues     = { +
  389.                 {Interrupt2,      0, $(!REG_VT_DWORD),     $(Interrupt)             }, +
  390.                 {PortAddress2,    0, $(!REG_VT_DWORD),     $(PortAddress)           }  +
  391.                 }
  392. ;    shell "" AddValueList $(ParametersKey) $(RSAValues)
  393.  
  394.  
  395.  
  396.         set DirRSA = "SYSTEM\CurrentControlSet\Services\SerRSA98\Parameters\RSA"
  397.         set RSAKey = ""
  398.         set RSATmp = {"RSA","",""}
  399.         set NoTitle = 0
  400. ;        CreateRegKey $(ParametersKSey) $(RSATmp) 0 $(!MAXIMUM_ALLOWED) "" RSAKey
  401.  
  402. ;fujino 960226
  403. ;       CreateRegKey $(ParametersKSey) {"RSA",0,GenericClass} "" $(!MAXIMUM_ALLOWED) "" RSAKey
  404. ;        CreateRegKey $(ParametersKSey) {"RSA98",$(NoTitle),GenericClass} "" $(!MAXIMUM_ALLOWED) "" RSAKey
  405.  
  406.         Ifstr(i) $(RSAKey) != $(KeyNull)
  407.             CloseRegKey $(RSAKey)
  408. ;            Debug-Output "SerRSA98 Service Value Deleted(Imagepath, Tag, Security)"
  409.         else
  410. ;            Debug-Output "SYSTEM\CurrentControlSet\Services\SerRSA98 KeyService Open Error"
  411.         endif
  412. ;;;        
  413.  
  414.     endif
  415.  
  416.     set Status = STATUS_SUCCESSFUL
  417. finish_InstallOption = +
  418.     ForListDo $(DrivesToFree)
  419.         LibraryProcedure STATUS,$(!LIBHANDLE), DeleteNetConnection $($) "TRUE"
  420.     EndForListDo
  421.  
  422.     Return $(Status)
  423.  
  424.  
  425. [Install-AddCopyOption]
  426.  
  427.     ;
  428.     ; Add the files to the copy list
  429.     ;
  430.     AddSectionKeyFileToCopyList   Files-RsDrivers                +
  431.                                   $(RsDriver)                    +
  432.                                   $(SrcDir)                      +
  433.                                   $(!STF_WINDOWSSYSPATH)\drivers
  434.  
  435.     exit
  436.  
  437.  
  438. [Install-DoCopyOption]
  439.  
  440.     ;
  441.     ; Copy files in the copy list
  442.     ;
  443.     CopyFilesInCopyList
  444.     exit
  445.  
  446. ;-------------------------------------------------------------------------
  447. ; 4. DeInstallOption:
  448. ;
  449. ; FUNCTION:  To remove files representing Option
  450. ;            To remove the registry entry corresponding to the Option
  451. ;
  452. ; INPUT:     $($0):  Language to use
  453. ;            $($1):  OptionID to install
  454. ;
  455. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  456. ;                            STATUS_NOLANGUAGE |
  457. ;                            STATUS_USERCANCEL |
  458. ;                            STATUS_FAILED
  459. ;-------------------------------------------------------------------------
  460. [DeInstallOption]
  461.     ;
  462.     ; Set default values for
  463.     ;
  464.     set Status   = STATUS_FAILED
  465.     ;
  466.     ; extract parameters
  467.     ;
  468.     set Option   = $($1)
  469.  
  470.     ;
  471.     ; Check if the language requested is supported
  472.     ;
  473.     set LanguageList = ^(LanguagesSupported, 1)
  474.     Ifcontains(i) $($0) in $(LanguageList)
  475.     else
  476.         set Status = STATUS_NOLANGUAGE
  477.         goto finish_DeInstallOption
  478.     endif
  479.     read-syms Strings$($0)
  480.  
  481.     ;
  482.     ; check to see if Option is supported.
  483.     ;
  484.  
  485.     set OptionList = ^(Options, 0)
  486.     ifcontains $(Option) in $(OptionList)
  487.     else
  488.         goto finish_DeInstallOption
  489.     endif
  490.     set OptionList = ""
  491.  
  492.     ;
  493.     ; fetch details about option
  494.     ;
  495.  
  496.     set RsDriver = #(Options, $(Option), 1)
  497.     set MiniportFile   = #(Files-RsDrivers, $(RsDriver), 2)
  498.     set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  499.  
  500.     ;
  501.     ; check to see if file is installed
  502.     ; if not give success
  503.     ;
  504.  
  505.     LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  506.     ifstr(i) $(STATUS) == "NO"
  507.         set Status = STATUS_SUCCESSFUL
  508.         goto finish_DeInstallOption
  509.     endif
  510.  
  511.     shell "registry.inf" GetServicesEntryStart $(RsDriver)
  512.     ifstr(i) $($R0) != "STATUS_SUCCESSFUL"
  513.         ; this could happen if there is no start value or there is no
  514.         ; key, in which case the option is not installed
  515.         set Status = STATUS_SUCCESSFUL
  516.         goto finish_DeInstallOption
  517.     endif
  518.  
  519. ;    ifstr(i) $($R1) == $(!SERVICE_BOOT_START)
  520. ;        shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "WARNING" $(String3)
  521. ;        ifstr(i) $($R0) != STATUS_SUCCESSFUL
  522. ;            goto do_removal
  523. ;        endif
  524. ;        ifstr(i) $($R1) == "CANCEL"
  525. ;            goto finish_DeInstallOption
  526. ;        endif
  527. ;    endif
  528.  
  529. do_removal =+
  530.     ;
  531.     ; disable the registry entry
  532.     ;
  533.  
  534.     shell "registry.inf" RemoveServicesEntry $(RsDriver)
  535.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  536.         goto finish_DeInstallOption
  537.     endif
  538.  
  539.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  540.         goto finish_DeInstallOption
  541.     endif
  542.  
  543.     ;
  544.     ; we won't remove the file because we can only do so during the next boot.
  545.     ; if the user chooses to reinstall the same driver during this boot
  546.     ; he will still end up deleting the driver on next boot. if the file
  547.     ; should be deleted a warning should be put up saying that the user should
  548.     ; not try to reinstall the driver during this boot
  549.     ;
  550.     ;    AddFileToDeleteList $(FilePath)
  551.  
  552.     set Status = STATUS_SUCCESSFUL
  553.  
  554. finish_DeInstallOption =+
  555.     return $(Status)
  556.  
  557.  
  558. ;-------------------------------------------------------------------------
  559. ; 5. GetInstalledOptions:
  560. ;
  561. ; FUNCTION:  To find out the list of options which are installed
  562. ;
  563. ; INPUT:     $($0): Language to Use
  564. ;
  565. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  566. ;                            STATUS_FAILED
  567. ;
  568. ;            $($R1): List of options installed
  569. ;            $($R2): Option installed Text List
  570. ;-------------------------------------------------------------------------
  571. [GetInstalledOptions]
  572.     set Status = STATUS_FAILED
  573.     set InstalledOptions = {}
  574.     set InstalledOptionsText = {}
  575.  
  576.     ;
  577.     ; Check if the language requested is supported
  578.     ;
  579.     set LanguageList = ^(LanguagesSupported, 1)
  580.     Ifcontains(i) $($0) in $(LanguageList)
  581.     else
  582.         set Status = STATUS_NOLANGUAGE
  583.         goto finish_GetInstalledOptions
  584.     endif
  585.  
  586.     set OptionList = ^(Options, 0)
  587.     ForListDo $(OptionList)
  588.         set RsDriver = #(Options, $($), 1)
  589.         set MiniportFile   = #(Files-RsDrivers, $(RsDriver), 2)
  590.         set FilePath       = $(!STF_WINDOWSSYSPATH)"\drivers\"$(MiniportFile)
  591.         LibraryProcedure STATUS,$(!LIBHANDLE),CheckFileExistance $(FilePath)
  592.         ifstr(i) $(STATUS) == "YES"
  593.             shell "registry.inf" GetServicesEntryStart $(RsDriver)
  594.             ifint $($ShellCode) == $(!SHELL_CODE_OK)
  595.                 ifstr(i) $($R0) == STATUS_SUCCESSFUL
  596.                     ifstr(i) $($R1) != $(!SERVICE_DISABLED)
  597.  
  598.                         set OptionText = #(OptionsText$($0), $($), 1)
  599.                         set InstalledOptions     = >($(InstalledOptions), $($))
  600.                         set InstalledOptionsText = >($(InstalledOptionsText), $(OptionText))
  601.  
  602.                     endif
  603.                 endif
  604.             endif
  605.         endif
  606.     EndForListDo
  607.     set Status = STATUS_SUCCESSFUL
  608. finish_GetInstalledOptions =+
  609.     Return $(Status) $(InstalledOptions) $(InstalledOptionsText)
  610.  
  611.  
  612. ;; start registry
  613.  
  614.  
  615. [RegistryConstants]
  616.     MaskAllAccess          = 33554432
  617.     NoTitle                = 0
  618.     RegLastError           = $(!REG_ERROR_SUCCESS)
  619. [WinNTKeyCreate]
  620.     set Status = STATUS_FAILED
  621.     read-syms RegistryConstants
  622.     set KeyPath   = { +
  623.                      {SOFTWARE,       $(NoTitle), $(MaskAllAccess)}, +
  624.                      {Microsoft,      $(NoTitle), $(MaskAllAccess)}, +
  625.                      {"Windows NT",      $(NoTitle), $(MaskAllAccess)}, +
  626.                      {CurrentVersion, $(NoTitle), $(MaskAllAccess)}  +
  627.                     }
  628.     ifstr(i) $(!STF_NTUPGRADE) == "YES"
  629.         set KeyValues = { +
  630.                          {PathName,               $(NoTitle), $(!REG_VT_SZ),    *($($0), 1) },       +
  631.                          {SoftwareType,           $(NoTitle), $(!REG_VT_SZ),    *($($0), 2) },       +
  632.                          {InstallDate,            $(NoTitle), $(!REG_VT_DWORD), *(*($($0), 5), 1) }, +
  633.                          {SourcePath,             $(NoTitle), $(!REG_VT_SZ),    *($($0), 7) },       +
  634.                          {ProductId,              $(NoTitle), $(!REG_VT_SZ),    *($($0), 8) }        +
  635.                         }
  636.     else
  637.         set KeyValues = { +
  638.                          {PathName,               $(NoTitle), $(!REG_VT_SZ),    *($($0), 1) },       +
  639.                          {SoftwareType,           $(NoTitle), $(!REG_VT_SZ),    *($($0), 2) },       +
  640.                          {RegisteredOwner,        $(NoTitle), $(!REG_VT_SZ),    *($($0), 3) },       +
  641.                          {RegisteredOrganization, $(NoTitle), $(!REG_VT_SZ),    *($($0), 4) },       +
  642.                          {InstallDate,            $(NoTitle), $(!REG_VT_DWORD), *(*($($0), 5), 1) }, +
  643.                          {SourcePath,             $(NoTitle), $(!REG_VT_SZ),    *($($0), 7) },       +
  644.                          {ProductId,              $(NoTitle), $(!REG_VT_SZ),    *($($0), 8) }        +
  645.                         }
  646.     endif
  647.     shell "" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  648.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  649.         goto endWinNT
  650.     endif
  651.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  652.         goto endWinNT
  653.     else
  654.         CloseRegKey $($R1)
  655.     endif
  656.     set KeyPath   = { +
  657.                      {System,             $(NoTitle), $(MaskAllAccess)}, +
  658.                      {$(!STF_CONTROLSET), $(NoTitle), $(MaskAllAccess)}, +
  659.                      {Control,            $(NoTitle), $(MaskAllAccess)}, +
  660.                      {ProductOptions,     $(NoTitle), $(MaskAllAccess)}  +
  661.                     }
  662.     set KeyValues = { +
  663.                      {ProductType,        $(NoTitle), $(!REG_VT_SZ), *($($0), 6) } +
  664.                     }
  665.     shell "" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  666.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  667.         goto endWinNT
  668.     endif
  669.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  670.         goto endWinNT
  671.     else
  672.         CloseRegKey $($R1)
  673.     endif
  674.     ifstr(i) $(!STF_NTUPGRADE) != "YES"
  675.         ifstr(i) *($($0), 6) != "WinNT"
  676.             set KeyPath   = { +
  677.                              {System,             $(NoTitle), $(MaskAllAccess)}, +
  678.                              {$(!STF_CONTROLSET), $(NoTitle), $(MaskAllAccess)}, +
  679.                              {Control,            $(NoTitle), $(MaskAllAccess)}, +
  680.                              {"Session Manager",  $(NoTitle), $(MaskAllAccess)}  +
  681.                             }
  682.             set KeyValues = { +
  683.                              {RegisteredProcessors, $(NoTitle), $(!REG_VT_DWORD), 4 } +
  684.                             }
  685.             shell "" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  686.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  687.                 goto endWinNT
  688.             endif
  689.             ifstr(i) $($R0) != STATUS_SUCCESSFUL
  690.                 goto endWinNT
  691.             else
  692.                 CloseRegKey $($R1)
  693.             endif
  694.         endif
  695.     endif
  696.     set Status = STATUS_SUCCESSFUL
  697. endWinNT = +
  698.     Return $(Status)
  699. [WinNTAddPid]
  700.     set Status = STATUS_FAILED
  701.     read-syms RegistryConstants
  702.     set KeyPath   = { +
  703.                      {SOFTWARE,       $(NoTitle), $(MaskAllAccess)}, +
  704.                      {Microsoft,      $(NoTitle), $(MaskAllAccess)}, +
  705.                      {"Windows NT",   $(NoTitle), $(MaskAllAccess)}, +
  706.                      {CurrentVersion, $(NoTitle), $(MaskAllAccess)}  +
  707.                     }
  708.     set KeyValues = { +
  709.                      {ProductId,      $(NoTitle), $(!REG_VT_SZ), *($($0), 1) }        +
  710.                     }
  711.     shell "" CreateKey $(!REG_H_LOCAL) $(KeyPath) $(KeyValues)
  712.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  713.         goto endWinNTAdd
  714.     endif
  715.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  716.         goto endWinNTAdd
  717.     else
  718.         CloseRegKey $($R1)
  719.     endif
  720.     set Status = STATUS_SUCCESSFUL
  721. endWinNTAdd = +
  722.     Return $(Status)
  723. [MakeStartupEntry]
  724.     set Status = STATUS_FAILED
  725.     read-syms RegistryConstants
  726.     set KeyPath   = { +
  727.                      {SOFTWARE,          $(NoTitle), $(MaskAllAccess)}, +
  728.                      {Microsoft,         $(NoTitle), $(MaskAllAccess)}, +
  729.                      {"Windows NT",      $(NoTitle), $(MaskAllAccess)}, +
  730.                      {CurrentVersion,    $(NoTitle), $(MaskAllAccess)}, +
  731.                      {"Program Manager", $(NoTitle), $(MaskAllAccess)}, +
  732.                      {Settings,          $(NoTitle), $(MaskAllAccess)}  +
  733.                     }
  734.     set KeyValues = { +
  735.                      {Startup, $(NoTitle), $(!REG_VT_SZ), $($0)} +
  736.                     }
  737.     shell "" CreateKey $(!REG_H_CUSER) $(KeyPath) $(KeyValues)
  738.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  739.         goto end_MakeStartupEntry
  740.     endif
  741.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  742.         goto end_MakeStartupEntry
  743.     else
  744.         CloseRegKey $($R1)
  745.     endif
  746.     set Status = STATUS_SUCCESSFUL
  747. end_MakeStartupEntry = +
  748.     Return $(Status)
  749. [GetNTSource]
  750.     set Status = STATUS_SUCCESSFUL
  751.     read-syms RegistryConstants
  752.     set NTSource = A:\
  753.     set KeyName = "Software\Microsoft\Windows NT\CurrentVersion"
  754.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  755.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  756.         Debug-Output "REGISTRY.INF: Couldn't open windows nt software key for read access"
  757.         goto end_getntsource
  758.     endif
  759.     GetRegValue $(KeyHandle) "SourcePath" SourcePathValue
  760.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  761.         CloseRegKey $(KeyHandle)
  762.         goto end_getntsource
  763.     endif
  764.     set NTSource =  *($(SourcePathValue), 4)
  765.     CloseRegKey $(KeyHandle)
  766. end_getntsource = +
  767.     Return $(Status) $(NTSource)
  768. [AppendToBootExecute]
  769.     set Status           = STATUS_FAILED
  770.     set AppendLines      = $($0)
  771.     read-syms RegistryConstants
  772.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control\Session Manager"
  773.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MaskAllAccess) KeyHandle
  774.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  775.         Debug-Output "REGISTRY.INF: Couldn't open session manager node for read/write access"
  776.         goto finish_appendbootexecute
  777.     endif
  778.     GetRegValue $(KeyHandle) "BootExecute" BootExecuteValue
  779.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  780.         set BootExecute = {}
  781.     else
  782.         set BootExecute = *($(BootExecuteValue), 4)
  783.     endif
  784.     set NewBootExecute = {}
  785.     ForListDo $(BootExecute)
  786.         set NewBootExecute = >($(NewBootExecute), $($))
  787.     EndForListDo
  788.     ForListDo $(AppendLines)
  789.         set NewBootExecute = >($(NewBootExecute), $($))
  790.     EndForListDo
  791.     set ValueInfo = {BootExecute, $(NoTitle), $(!REG_VT_MULTI_SZ), $(NewBootExecute)}
  792.     SetRegValue $(KeyHandle) $(ValueInfo)
  793.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  794.         CloseRegKey $(KeyHandle)
  795.         Debug-Output "REGISTRY.INF: Couldn't set BootExecute value"
  796.         goto finish_appendbootexecute
  797.     endif
  798.     CloseRegKey $(KeyHandle)
  799.     set Status = STATUS_SUCCESSFUL
  800. finish_appendbootexecute = +
  801.     Return $(Status)
  802. [AppendToSystemPath]
  803.     set Status           = STATUS_FAILED
  804.     read-syms RegistryConstants
  805.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control\Session Manager\Environment"
  806.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MaskAllAccess) KeyHandle
  807.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  808.         Debug-Output "REGISTRY.INF: Couldn't open session manager\environment node for read/write access"
  809.         goto finish_appendsystempath0
  810.     endif
  811.     GetRegValue $(KeyHandle) "Path" PathValue
  812.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  813.         goto finish_appendsystempath1
  814.     endif
  815.     set NewPathValue = *($(PathValue),4)";"$($0)
  816.     set ValueInfo = {"Path", $(NoTitle), $(!REG_VT_EXPAND_SZ), $(NewPathValue)}
  817.     SetRegValue $(KeyHandle) $(ValueInfo)
  818.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  819.         Debug-Output "REGISTRY.INF: Couldn't set Path value"
  820.         goto finish_appendsystempath1
  821.     endif
  822.     set Status = STATUS_SUCCESSFUL
  823. finish_appendsystempath1 = +
  824.     CloseRegKey $(KeyHandle)
  825. finish_appendsystempath0 = +
  826.     Return $(Status)
  827. [EnumeratePagingFiles]
  828.     set Status       = STATUS_FAILED
  829.     set PagingFiles  = {}
  830.     read-syms RegistryConstants
  831.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control\Session Manager\Memory Management"
  832.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  833.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  834.         Debug-Output "REGISTRY.INF: Couldn't open pagefile node for read access"
  835.         goto endenumpagefile
  836.     endif
  837.     GetRegValue $(KeyHandle) "PagingFiles" PagingFilesValue
  838.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  839.         Debug-Output "REGISTRY.INF: Couldn't read PagingFiles value"
  840.         CloseRegKey $(KeyHandle)
  841.         goto endenumpagefile
  842.     endif
  843.     CloseRegKey $(KeyHandle)
  844.     ifstr(i) $(PagingFilesValue) == ""
  845.         set Status = STATUS_SUCCESSFUL
  846.         goto endenumpagefile
  847.     endif
  848.     set PagefileList = *($(PagingFilesValue), 4)
  849.     ForListDo $(PagefileList)
  850.        ifstr(i) $($) != ""
  851.            set Pagefile = $($)
  852.            Split-String $(Pagefile) " " SplitString
  853.            set PagefilePath  = ""
  854.            set PagefileSize  = ""
  855.            ForListDo $(SplitString)
  856.               ifstr(i) $($) != " "
  857.                  ifstr(i) $(PagefilePath) == ""
  858.                      set PagefilePath = $($)
  859.                  else-ifstr(i) $(PagefileSize) == ""
  860.                      set PagefileSize = $($)
  861.                  endif
  862.               endif
  863.            EndForListDo
  864.            ifstr(i) $(PagefilePath) == ""
  865.            else-ifstr(i) $(PagefileSize) == ""
  866.            else
  867.                set PagingFiles = >($(PagingFiles), {$(PagefilePath),$(PagefileSize)})
  868.            endif
  869.        endif
  870.     EndForListDo
  871.     set Status = STATUS_SUCCESSFUL
  872. endenumpagefile = +
  873.     Return $(Status) $(PagingFiles)
  874. [SetPagingFiles]
  875.     set Status       = STATUS_FAILED
  876.     set PagingFiles  = {}
  877.     read-syms RegistryConstants
  878.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control\Session Manager\Memory Management"
  879.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MaskAllAccess) KeyHandle
  880.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  881.         goto endsetpagingfiles
  882.     endif
  883.     set PagefileList = {}
  884.     ForListDo $($0)
  885.         set PagefileList = >($(PagefileList), *($($), 1)" "*($($), 2) )
  886.     EndForListDo
  887.     Debug-Output "REGISTRY.INF: New Paging files are "$(PagefileList)
  888.     set ValueInfo = {PagingFiles, $(NoTitle), $(!REG_VT_MULTI_SZ), $(PagefileList)}
  889.     SetRegValue $(KeyHandle) $(ValueInfo)
  890.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  891.         CloseRegKey $(KeyHandle)
  892.         Debug-Output "REGISTRY.INF: Couldn't set paging files value"
  893.         goto endsetpagingfiles
  894.     endif
  895.     CloseRegKey $(KeyHandle)
  896.     set Status = STATUS_SUCCESSFUL
  897. endsetpagingfiles = +
  898.     Return $(Status)
  899. [MakeQuotaEntries]
  900.     set Status       = STATUS_FAILED
  901.     read-syms RegistryConstants
  902.     set PagedPoolSize     = $($0)
  903.     set RegistrySizeLimit = $($1)
  904.     set MBMultiplier  = 1024
  905.     set-mul MBMultiplier  = $(MBMultiplier) 1024
  906.     set-mul PagedPoolSize     = $(PagedPoolSize)     $(MBMultiplier)
  907.     set-mul RegistrySizeLimit = $(RegistrySizeLimit) $(MBMultiplier)
  908.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control\Session Manager\Memory Management"
  909.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MaskAllAccess) KeyHandle
  910.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  911.         Debug-Output "REGISTRY.INF: Couldn't open memory management key"
  912.         goto end_MakeQuotaEntries
  913.     endif
  914.     set ValueInfo = {PagedPoolSize, $(NoTitle), $(!REG_VT_DWORD), $(PagedPoolSize)}
  915.     SetRegValue $(KeyHandle) $(ValueInfo)
  916.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  917.         CloseRegKey $(KeyHandle)
  918.         Debug-Output "REGISTRY.INF: Couldn't set pagepoolsize value"
  919.         goto end_MakeQuotaEntries
  920.     endif
  921.     CloseRegKey $(KeyHandle)
  922.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control"
  923.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MaskAllAccess) KeyHandle
  924.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  925.         Debug-Output "REGISTRY.INF: Couldn't open control key"
  926.         goto end_MakeQuotaEntries
  927.     endif
  928.     set ValueInfo = {RegistrySizeLimit, $(NoTitle), $(!REG_VT_DWORD), $(RegistrySizeLimit)}
  929.     SetRegValue $(KeyHandle) $(ValueInfo)
  930.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  931.         CloseRegKey $(KeyHandle)
  932.         Debug-Output "REGISTRY.INF: Couldn't set registry size limit value"
  933.         goto end_MakeQuotaEntries
  934.     endif
  935.     CloseRegKey $(KeyHandle)
  936.     set Status = STATUS_SUCCESSFUL
  937. end_MakeQuotaEntries = +
  938.     Return $(Status)
  939. [MakeWOWEntry]
  940.     set Status = STATUS_FAILED
  941.     read-syms  RegistryConstants
  942.     OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\control\WOW" $(MaskAllAccess) WOWKey
  943.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  944.         Debug-Output "REGISTRY.INF: Failed to open layout key"
  945.         goto finish_MakeWOWEntry
  946.     endif
  947.     set wowcmdline = "ntvdm -m -w -f%SystemRoot%\system32 -a %SystemRoot%\system32\"$($0)
  948.     set KeyValues = { +
  949.                     {wowcmdline,   $(NoTitle), $(!REG_VT_EXPAND_SZ), $(wowcmdline)}  +
  950.                     }
  951.     shell "" AddValueList $(WOWKey) $(KeyValues)
  952.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  953.         goto finish_MakeWOWEntry
  954.     endif
  955.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  956.         goto finish_MakeWOWEntry
  957.     endif
  958.     CloseRegKey $(WOWKey)
  959.     set Status = STATUS_SUCCESSFUL
  960. finish_MakeWOWEntry = +
  961.     Return $(Status)
  962. [MakeLayoutEntry]
  963.     set Status = STATUS_FAILED
  964.     read-syms  RegistryConstants
  965.     OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\control\Keyboard Layout" $(MaskAllAccess) LayoutKey
  966.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  967.         Debug-Output "REGISTRY.INF: Failed to open layout key"
  968.         goto finish_MakeLayoutEntry
  969.     endif
  970.     set KeyValues = { +
  971.                       {$($0),   $(NoTitle), $(!REG_VT_SZ), $($1)       }  +
  972.                     }
  973.     shell "" AddValueList $(LayoutKey) $(KeyValues)
  974.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  975.         goto finish_MakeLayoutEntry
  976.     endif
  977.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  978.         goto finish_MakeLayoutEntry
  979.     endif
  980.     CloseRegKey $(LayoutKey)
  981.     LibraryProcedure STATUS, $(!LIBHANDLE), SetCurrentLayout $($0)
  982.     ifstr(i) $(STATUS) != "SUCCESS"
  983.         Debug-Output "REGISTRY.INF: Failed in SetCurrentLayout function"
  984.         goto finish_MakeLayoutEntry
  985.     endif
  986.     set Status = STATUS_SUCCESSFUL
  987. finish_MakeLayoutEntry = +
  988.     Return $(Status)
  989. [MakeLocaleEntry]
  990.     set Status = STATUS_FAILED
  991.     read-syms  RegistryConstants
  992.     ifstr(i) $($1) != "locale.nls"
  993.         OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\control\nls\OEMLocale" $(MaskAllAccess) OEMLocaleKey
  994.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  995.             Debug-Output "REGISTRY.INF: Failed to open OEMLocale key"
  996.             goto finish_MakeLocaleEntry
  997.         endif
  998.         set KeyValues = { +
  999.                           {$($0), $(NoTitle), $(!REG_VT_SZ), $($1)}  +
  1000.                         }
  1001.         shell "" AddValueList $(OEMLocaleKey) $(KeyValues)
  1002.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1003.             Debug-Output "REGISTRY.INF: Failed to find function AddValueList"
  1004.             goto finish_MakeLocaleEntry
  1005.         endif
  1006.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1007.             Debug-Output "REGISTRY.INF: Failed to create OEMLocale value"
  1008.             goto finish_MakeLocaleEntry
  1009.         endif
  1010.         CloseRegKey $(OEMLocaleKey)
  1011.     endif
  1012.     ifstr(i) $(!STF_INSTALL_TYPE) == SETUPBOOTED
  1013.         set ModifyCPL = YES
  1014.     else
  1015.         set ModifyCPL = NO
  1016.     endif
  1017.     LibraryProcedure STATUS, $(!LIBHANDLE), SetCurrentLocale $($0) $(ModifyCPL)
  1018.     ifstr(i) $(STATUS) != "SUCCESS"
  1019.         ifstr(i) $(STATUS) == ERROR_UNSUPPORTED
  1020.             set Status = ERROR_UNSUPPORTED
  1021.         endif
  1022.         Debug-Output "REGISTRY.INF: Failed in SetCurrentLocale function"
  1023.         goto finish_MakeLocaleEntry
  1024.     endif
  1025.     OpenRegKey $(!REG_H_CUSER) "" "Control Panel\International" $(MaskAllAccess) LocaleKey
  1026.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1027.         Debug-Output "REGISTRY.INF: Failed to open cuser international key"
  1028.         goto finish_MakeLocaleEntry
  1029.     endif
  1030.     set KeyValues = { +
  1031.                       {Locale, $(NoTitle), $(!REG_VT_SZ), $($0)        } +
  1032.                     }
  1033.     shell "" AddValueList $(LocaleKey) $(KeyValues)
  1034.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1035.         Debug-Output "REGISTRY.INF: Failed to find function AddValueList"
  1036.         CloseRegKey $(LocaleKey)
  1037.         goto finish_MakeLocaleEntry
  1038.     endif
  1039.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1040.         Debug-Output "REGISTRY.INF: Failed to create Current User Locale value"
  1041.         CloseRegKey $(LocaleKey)
  1042.         goto finish_MakeLocaleEntry
  1043.     endif
  1044.     set KeyValues = {}
  1045.     set Num = 1
  1046.     ForListDo $($2)
  1047.         set KeyValues = >($(KeyValues), {$(Num), $(NoTitle), $(!REG_VT_SZ), $($)})
  1048.     EndForListDo
  1049.     set KeyPath = {{"Sorting Order", $(NoTitle), $(MaskAllAccess)}}
  1050.     shell "" CreateKey $(LocaleKey) $(KeyPath) $(KeyValues)
  1051.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1052.         CloseRegKey $(LocaleKey)
  1053.         goto finish_MakeLocaleEntry
  1054.     endif
  1055.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1056.         CloseRegKey $(LocaleKey)
  1057.         goto finish_MakeLocaleEntry
  1058.     else
  1059.         CloseRegKey $($R1)
  1060.     endif
  1061.     CloseRegKey $(LocaleKey)
  1062.     set Status = STATUS_SUCCESSFUL
  1063. finish_MakeLocaleEntry = +
  1064.     Return $(Status)
  1065. [MakeLanguageEntry]
  1066.     set Status = STATUS_FAILED
  1067.     read-syms  RegistryConstants
  1068.     OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\control\nls\Language" $(MaskAllAccess) LanguageKey
  1069.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1070.         Debug-Output "REGISTRY.INF: Failed to open Language key"
  1071.         goto finish_MakeLanguageEntry
  1072.     endif
  1073.     set KeyValues = { +
  1074.                       {Default, $(NoTitle), $(!REG_VT_SZ), $($0)       }, +
  1075.                       {$($0),   $(NoTitle), $(!REG_VT_SZ), $($1)       }  +
  1076.                     }
  1077.     shell "" AddValueList $(LanguageKey) $(KeyValues)
  1078.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1079.         goto finish_MakeLanguageEntry
  1080.     endif
  1081.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1082.         goto finish_MakeLanguageEntry
  1083.     endif
  1084.     CloseRegKey $(LanguageKey)
  1085.     set Status = STATUS_SUCCESSFUL
  1086. finish_MakeLanguageEntry = +
  1087.     Return $(Status)
  1088. [MakeCodePageEntry]
  1089.     set Status = STATUS_FAILED
  1090.     read-syms  RegistryConstants
  1091.     OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\control\nls\CodePage" $(MaskAllAccess) CodePageKey
  1092.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1093.         Debug-Output "REGISTRY.INF: Failed to open CodePage key"
  1094.         goto finish_MakeCodePageEntry
  1095.     endif
  1096.     set KeyValues = { +
  1097.                       {ACP,   $(NoTitle), $(!REG_VT_SZ), $($0) }, +
  1098.                       {OEMCP, $(NoTitle), $(!REG_VT_SZ), $($2) }, +
  1099.                       {MACCP, $(NoTitle), $(!REG_VT_SZ), $($4) }, +
  1100.                       {$($0), $(NoTitle), $(!REG_VT_SZ), $($1) }, +
  1101.                       {$($2), $(NoTitle), $(!REG_VT_SZ), $($3) }, +
  1102.                       {$($4), $(NoTitle), $(!REG_VT_SZ), $($5) }, +
  1103.                       {OEMHAL,$(NoTitle), $(!REG_VT_SZ), $($8) }  +
  1104.                     }
  1105.     ForListDo $($6)
  1106.        set CodePageValue = {$($), $(NoTitle), $(!REG_VT_SZ), *($($7), $(#)) }
  1107.        set KeyValues = >($(KeyValues), $(CodePageValue))
  1108.     EndForListDo
  1109.     shell "" AddValueList $(CodePageKey) $(KeyValues)
  1110.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1111.         goto finish_MakeCodePageEntry
  1112.     endif
  1113.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1114.         goto finish_MakeCodePageEntry
  1115.     endif
  1116.     CloseRegKey $(CodePageKey)
  1117.     set Status = STATUS_SUCCESSFUL
  1118. finish_MakeCodePageEntry = +
  1119.     Return $(Status)
  1120. [MakeFontEntries]
  1121.     set Status = STATUS_FAILED
  1122.     read-syms  RegistryConstants
  1123.     set OemFontFile   = $($0)
  1124.     set WoaFontFile   = $($1)
  1125.     set Cga40FontFile = $($2)
  1126.     set Cga80FontFile = $($3)
  1127.     set Ega40FontFile = $($4)
  1128.     set Ega80FontFile = $($5)
  1129.     set FixFontFile   = $($6)
  1130.     set SysFontFile   = $($7)
  1131.     set MSShellDlgFontFile = $($8)
  1132.     set DlgFontFileNameFile = $($9)
  1133.     set TaggedFontName = $($10)
  1134.     set CourFontFile = $($11)
  1135.     set SerifFontFile = $($12)
  1136.     set SmallFontFile = $($13)
  1137.     install Install-Ini-Font-Alter
  1138.     ifstr(i) $(STF_INSTALL_OUTCOME) == "STF_FAILURE"
  1139.         goto finish_MakeFontEntries
  1140.     endif
  1141.     set Status = STATUS_SUCCESSFUL
  1142. finish_MakeFontEntries = +
  1143.     Return $(Status)
  1144. [Install-Ini-Font-Alter]
  1145.     ReplaceIniKeyValue "win.ini",    GRE_Initialize,   "OEMFONT.FON",  $(OemFontFile)
  1146.     ReplaceIniKeyValue "system.ini", boot.description, "oemfonts.fon", $(OemFontFile)
  1147.     ReplaceIniKeyValue "system.ini", 386Enh,           "woafont",      $(WoaFontFile)
  1148.     ReplaceIniKeyValue "system.ini", 386Enh,           "CGA40WOA.FON", $(Cga40FontFile)
  1149.     ReplaceIniKeyValue "system.ini", 386Enh,           "CGA80WOA.FON", $(Cga80FontFile)
  1150.     ReplaceIniKeyValue "system.ini", 386Enh,           "EGA40WOA.FON", $(Ega40FontFile)
  1151.     ReplaceIniKeyValue "system.ini", 386Enh,           "EGA80WOA.FON", $(Ega80FontFile)
  1152.     ReplaceIniKeyValue "win.ini",    GRE_Initialize,   "FIXEDFON.FON",  $(FixFontFile)
  1153.     ReplaceIniKeyValue "win.ini",    GRE_Initialize,   "FONTS.FON",  $(SysFontFile)
  1154.     ReplaceIniKeyValue "win.ini",    FontSubstitutes,  "MS Shell Dlg",  $(MSShellDlgFontFile)
  1155.     ReplaceIniKeyValue "win.ini",    Fonts, "MS Sans Serif 8,10,12,14,18,24 (VGA res)",  $(DlgFontFileNameFile)
  1156.     ReplaceIniKeyValue "win.ini",    Fonts, "Courier 10,12,15 (VGA res)",  $(CourFontFile)
  1157.     ReplaceIniKeyValue "win.ini",    Fonts, "MS Serif 8,10,12,14,18,24 (VGA res)",  $(SerifFontFile)
  1158.     ReplaceIniKeyValue "win.ini",    Fonts, "Small Fonts (VGA res)",  $(SmallFontFile)
  1159.     ifstr(i) $(TaggedFontName) == ""
  1160.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Arial TRK"
  1161.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Courier New TRK"
  1162.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Times New Roman TRK"
  1163.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Arial CE"
  1164.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Courier New CE"
  1165.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Times New Roman CE"
  1166.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Arial CYR"
  1167.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Courier New CYR"
  1168.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Times New Roman CYR"
  1169.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Arial Greek"
  1170.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Courier New Greek"
  1171.         RemoveIniKey   "win.ini",    FontSubstitutes,  "Times New Roman Greek"
  1172.     endif
  1173.     ifstr(i) $(TaggedFontName) == "CE"
  1174.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Arial CE", "Arial"
  1175.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Courier New CE", "Courier New"
  1176.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Times New Roman CE", "Times New Roman"
  1177.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Arial CYR", "Arial"
  1178.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Courier New CYR", "Courier New"
  1179.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Times New Roman CYR", "Times New Roman"
  1180.     endif
  1181.     ifstr(i) $(TaggedFontName) == "CYR"
  1182.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Arial CYR", "Arial"
  1183.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Courier New CYR", "Courier New"
  1184.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Times New Roman CYR", "Times New Roman"
  1185.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Arial CE", "Arial"
  1186.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Courier New CE", "Courier New"
  1187.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Times New Roman CE", "Times New Roman"
  1188.     endif
  1189.     ifstr(i) $(TaggedFontName) == "Greek"
  1190.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Arial Greek", "Arial"
  1191.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Courier New Greek", "Courier New"
  1192.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Times New Roman Greek", "Times New Roman"
  1193.     endif
  1194.     ifstr(i) $(TaggedFontName) == "TRK"
  1195.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Arial TRK", "Arial"
  1196.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Courier New TRK", "Courier New"
  1197.         ReplaceIniKeyValue "win.ini" FontSubstitutes,  "Times New Roman TRK", "Times New Roman"
  1198.     endif
  1199.     exit
  1200.  
  1201. ; fujino 960226
  1202. ; [MakeServicesEntry]
  1203. [MakeServicesEntry2]
  1204.     set Status = STATUS_FAILED
  1205.     read-syms RegistryConstants
  1206.     Debug-Output "REGISTRY.INF: Creating Services node: "$($0)
  1207.     OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\services" $(MaskAllAccess) ServicesKey
  1208.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1209.         Debug-Output "REGISTRY.INF: Failed to open services key"
  1210.         goto finish_MakeServicesEntry
  1211.     endif
  1212.     set StandardSet = { Type,           +
  1213.                         Start,          +
  1214.                         ErrorControl,   +
  1215.                         Group,          +
  1216.                         Dependencies,   +
  1217.                         StartName,      +
  1218.                         Password,       +
  1219.                         BinaryPathName, +
  1220.                         DisplayName     +
  1221.                       }
  1222.     ForListDo $(StandardSet)
  1223.         set $($) = ""
  1224.     EndForListDo
  1225.     set KeyValues = {}
  1226.     ForListDo $($1)
  1227.        set Var   = *($($), 1)
  1228.        set Value = *($($), 4)
  1229.        ifcontains(i) $(Var) in $(StandardSet)
  1230.            set $(Var) = $(Value)
  1231.        else
  1232.            set KeyValues = >($(KeyValues), $($))
  1233.        endif
  1234.     EndForListDo
  1235.     set Error = NO
  1236.     ForListDo { Type, Start, ErrorControl, BinaryPathName }
  1237.         ifstr(i) $($($)) == ""
  1238.             set Error = YES
  1239.         endif
  1240.     EndForListDo
  1241.     ifstr(i) $(Error) == YES
  1242.         Debug-Output "REGISTRY.INF: MakeServicesEntry was not passed in one of the three values: Type, Start, ErrorControl"
  1243.         CloseRegKey $(ServicesKey)
  1244.         goto finish_MakeServicesEntry
  1245.     endif
  1246.     set ServiceName = $($0)
  1247.     LibraryProcedure STATUS, $(!LIBHANDLE), SetupCreateService $(ServiceName)      +
  1248.                                                                $(DisplayName)      +
  1249.                                                                $(Type)             +
  1250.                                                                $(Start)            +
  1251.                                                                $(ErrorControl)     +
  1252.                                                                $(BinaryPathName)   +
  1253.                                                                $(Group)            +
  1254.                                                                $(Dependencies)     +
  1255.                                                                $(StartName)        +
  1256.                                                                $(Password)
  1257.     ifstr(i) $(STATUS) != "SUCCESS"
  1258.         Debug-Output "REGISTRY.INF: MakeServicesEntry: SetupCreateService function failed"
  1259.         CloseRegKey $(ServicesKey)
  1260.         goto finish_MakeServicesEntry
  1261.     endif
  1262.     set KeyPath   = {{$($0), $(NoTitle), $(MaskAllAccess)}}
  1263.     shell "" CreateKey $(ServicesKey) $(KeyPath) $(KeyValues)
  1264.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1265.         Debug-Output "REGISTRY.INF: Failed to shell CreateKey."
  1266.         CloseRegKey $(ServicesKey)
  1267.         goto error_MakeServicesEntry
  1268.     endif
  1269.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1270.         Debug-Output "REGISTRY.INF: Failed to create services node."
  1271.         CloseRegKey $(ServicesKey)
  1272.         goto error_MakeServicesEntry
  1273.     endif
  1274.     set MiniportKey = $($R1)
  1275.     ifstr(i) $($2) != ""
  1276.         set KeyPath   = {{$($5), $(NoTitle), $(MaskAllAccess)}}
  1277.         set KeyValues = $($2)
  1278.         shell "" CreateKey $(MiniportKey) $(KeyPath) $(KeyValues)
  1279.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1280.             CloseRegKey $(ServicesKey)
  1281.             CloseRegKey $(MiniportKey)
  1282.             goto error_MakeServicesEntry
  1283.         endif
  1284.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1285.             CloseRegKey $(ServicesKey)
  1286.             CloseRegKey $(MiniportKey)
  1287.             goto error_MakeServicesEntry
  1288.         endif
  1289.         set ParametersKey = $($R1)
  1290.  
  1291. ;fujino 960226
  1292.  ;       ForListDo $($3)
  1293.             set-sub DeviceNum = $(#) 1
  1294.  
  1295. ;fujino  960226
  1296. ;           set EntryName = "Device"$(DeviceNum)
  1297. ;            set EntryName = "RSA"$(DeviceNum)
  1298.             set EntryName = "RSA1"
  1299.  
  1300.             set KeyPath   = {{$(EntryName), $(NoTitle), $(MaskAllAccess)}}
  1301.             set KeyValues = $($3)
  1302.             shell "" CreateKey $(ParametersKey) $(KeyPath) $(KeyValues)
  1303.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1304.                 CloseRegKey $(ServicesKey)
  1305.                 CloseRegKey $(MiniportKey)
  1306.                 CloseRegKey $(ParametersKey)
  1307.                 goto error_MakeServicesEntry
  1308.             endif
  1309.             ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1310.                 CloseRegKey $(ServicesKey)
  1311.                 CloseRegKey $(MiniportKey)
  1312.                 CloseRegKey $(ParametersKey)
  1313.                 goto error_MakeServicesEntry
  1314.             endif
  1315.             CloseRegKey $($R1)
  1316.  
  1317. ; fujino 960226
  1318. ;       EndForListDo
  1319.  
  1320.         CloseRegKey $(ParametersKey)
  1321.     endif
  1322.     CloseRegKey $(MiniportKey)
  1323.     ifstr(i) $($4) != {}
  1324.         OpenRegKey $(ServicesKey) "" "eventlog\system" $(MaskAllAccess) EventLogKey
  1325.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1326.             Debug-Output "REGISTRY.INF: Failed to open eventlog key"
  1327.             CloseRegKey $(ServicesKey)
  1328.             goto error_MakeServicesEntry
  1329.         endif
  1330.         set KeyPath   = {{$($0), $(NoTitle), $(MaskAllAccess)}}
  1331.         set KeyValues = $($4)
  1332.         shell "" CreateKey $(EventLogKey) $(KeyPath) $(KeyValues)
  1333.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1334.             CloseRegKey $(ServicesKey)
  1335.             CloseRegKey $(EventLogKey)
  1336.             goto error_MakeServicesEntry
  1337.         endif
  1338.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1339.             CloseRegKey $(ServicesKey)
  1340.             CloseRegKey $(EventLogKey)
  1341.             goto error_MakeServicesEntry
  1342.         endif
  1343.         CloseRegKey $($R1)
  1344.         CloseRegKey $(EventLogKey)
  1345.     endif
  1346.     CloseRegKey $(ServicesKey)
  1347.     set Status = STATUS_SUCCESSFUL
  1348.     goto finish_MakeServicesEntry
  1349. error_MakeServicesEntry = +
  1350.     shell "" ModifyServicesEntry $($0) $(!SERVICE_DISABLED)
  1351. finish_MakeServicesEntry = +
  1352.     Return $(Status)
  1353. [GetServicesEntryStart]
  1354.     set Status     = STATUS_FAILED
  1355.     set StartValue = ""
  1356.     read-syms RegistryConstants
  1357.     Debug-Output "REGISTRY.INF: Get Services node Start value: "$($0)
  1358.     set KeyName = "system\"$(!STF_CONTROLSET)"\services\"$($0)
  1359.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(!REG_KEY_READ) KeyHandle
  1360.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1361.         Debug-Output "REGISTRY.INF: Couldn't open services node for read access"
  1362.         goto finish_GetServicesEntryStart
  1363.     endif
  1364.     GetRegValue $(KeyHandle) "Start" StartValueList
  1365.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1366.         Debug-Output "REGISTRY.INF: Couldn't read Start value"
  1367.         CloseRegKey $(KeyHandle)
  1368.         goto finish_GetServicesEntryStart
  1369.     endif
  1370.     CloseRegKey $(KeyHandle)
  1371.     set StartValue = *($(StartValueList), 4)
  1372.     set Status = STATUS_SUCCESSFUL
  1373. finish_GetServicesEntryStart = +
  1374.     Return $(Status) $(StartValue)
  1375. [RemoveServicesEntry]
  1376.     set Status = STATUS_FAILED
  1377.     read-syms RegistryConstants
  1378.     Debug-Output "REGISTRY.INF: Removing Services node: "$($0)
  1379.     shell "" ModifyServicesEntry $($0) $(!SERVICE_DISABLED)
  1380.     Return $($R0)
  1381. [MakeSetupKey]
  1382.     set Status = STATUS_FAILED
  1383.     read-syms  RegistryConstants
  1384.     OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\control" $(MaskAllAccess) ControlKey
  1385.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1386.         Debug-Output "REGISTRY.INF: Failed to open services key"
  1387.         goto finish_MakeSetupKey
  1388.     endif
  1389.     set KeyPath   = { +
  1390.                      {"Setup", $(NoTitle), $(MaskAllAccess)} +
  1391.                     }
  1392.     set KeyValues = {}
  1393.     shell "" CreateKey $(ControlKey) $(KeyPath) $(KeyValues)
  1394.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1395.         CloseRegKey $(ControlKey)
  1396.         goto finish_MakeSetupKey
  1397.     endif
  1398.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1399.         CloseRegKey $(ControlKey)
  1400.         goto finish_MakeSetupKey
  1401.     endif
  1402.     CloseRegKey $($R1)
  1403.     CloseRegKey $(ControlKey)
  1404.     set Status = STATUS_SUCCESSFUL
  1405. finish_MakeSetupKey = +
  1406.     Return $(Status)
  1407. [CheckSetupModify]
  1408.     set Status = STATUS_FAILED
  1409.     read-syms  RegistryConstants
  1410.     LibraryProcedure STATUS, $(!LIBHANDLE), TestAdmin
  1411.     ifstr(i) $(STATUS) == "YES"
  1412.         set Status = STATUS_SUCCESSFUL
  1413.     endif
  1414.     Return $(Status)
  1415. [MakeSetupOptionEntry]
  1416.     set Status = STATUS_FAILED
  1417.     read-syms  RegistryConstants
  1418.     OpenRegKey $(!REG_H_LOCAL) "" "system\"$(!STF_CONTROLSET)"\control" $(MaskAllAccess) ControlKey
  1419.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1420.         Debug-Output "REGISTRY.INF: Failed to open services key"
  1421.         goto finish_MakeSetupOptionEntry
  1422.     endif
  1423.     set KeyPath   = { +
  1424.                      {"Setup", $(NoTitle), $(MaskAllAccess)} +
  1425.                     }
  1426.     set KeyValues = { +
  1427.                       {$($0), $(NoTitle), $(!REG_VT_SZ), $($1)} +
  1428.                     }
  1429.     shell "" CreateKey $(ControlKey) $(KeyPath) $(KeyValues)
  1430.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1431.         CloseRegKey $(ControlKey)
  1432.         goto finish_MakeSetupOptionEntry
  1433.     endif
  1434.     ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1435.         CloseRegKey $(ControlKey)
  1436.         goto finish_MakeSetupOptionEntry
  1437.     endif
  1438.     CloseRegKey $($R1)
  1439.     CloseRegKey $(ControlKey)
  1440.     set Status = STATUS_SUCCESSFUL
  1441. finish_MakeSetupOptionEntry = +
  1442.     Return $(Status)
  1443. [ResetSetupProgressValue]
  1444.     set Status = STATUS_FAILED
  1445.     read-syms  RegistryConstants
  1446.     OpenRegKey $(!REG_H_LOCAL) "" "system\setup" $(MaskAllAccess) SetupKey
  1447.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1448.         Debug-Output "REGISTRY.INF: Failed to open Setup key"
  1449.         goto finish_ResetSetupProgressValue
  1450.     endif
  1451.     set ValueInfo = {SystemSetupInProgress, $(NoTitle), $(!REG_VT_DWORD), 0}
  1452.     SetRegValue $(SetupKey) $(ValueInfo)
  1453.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1454.         CloseRegKey $(SetupKey)
  1455.         Debug-Output "REGISTRY.INF: Couldn't set SystemSetupInProgress value"
  1456.         goto finish_ResetSetupProgressValue
  1457.     endif
  1458.     ifstr(i) $(!STF_NTUPGRADE) == "YES"
  1459.         set ValueInfo = {UpgradeInProgress, $(NoTitle), $(!REG_VT_DWORD), 0}
  1460.         SetRegValue $(SetupKey) $(ValueInfo)
  1461.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1462.             CloseRegKey $(SetupKey)
  1463.             Debug-Output "REGISTRY.INF: Couldn't set UpgradeInProgress value"
  1464.             goto finish_ResetSetupProgressValue
  1465.         endif
  1466.     endif
  1467.     CloseRegKey $(SetupKey)
  1468.     set Status = STATUS_SUCCESSFUL
  1469. finish_ResetSetupProgressValue = +
  1470.     Return $(Status)
  1471. [ModifyServicesEntry]
  1472.     read-syms RegistryConstants
  1473.     set Status = STATUS_FAILED
  1474.     set StartValue = $($1)
  1475.     LibraryProcedure STATUS, $(!LIBHANDLE), SetupChangeServiceStart $($0) $(StartValue)
  1476.     ifstr(i) $(STATUS) != "SUCCESS"
  1477.         Debug-Output "REGISTRY.INF: ModifyServicesEntry: SetupChangeServiceStart function failed"
  1478.         goto finish_ModifyServicesEntry
  1479.     endif
  1480.     set Status = STATUS_SUCCESSFUL
  1481. finish_ModifyServicesEntry = +
  1482.     Return $(Status)
  1483. [CreateKey]
  1484.     set Status = STATUS_FAILED
  1485.     read-syms RegistryConstants
  1486.     set BaseHandle = $($0)
  1487.     set KeyHandle  = $(BaseHandle)
  1488.     ForListDo $($1)
  1489.         set KeyInfo = $($)
  1490.         set KeyName = *($(KeyInfo), 1)
  1491.         OpenRegKey $(BaseHandle) "" $(KeyName) $(MaskAllAccess) KeyHandle
  1492.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1493.             Debug-Output "REGISTRY.INF: Key"$(KeyName)"doesn't exist.  Will create key"
  1494.             set RegLastError = 0
  1495.             CreateRegKey $(BaseHandle) $(KeyInfo) "" $(MaskAllAccess) "" KeyHandle
  1496.             ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1497.                 set Status = STATUS_ERROR_CREATEKEY
  1498.                 Debug-Output "REGISTRY.INF: Error in creating key"
  1499.                 goto endcreate
  1500.             endif
  1501.         endif
  1502.         ifstr(i) $(BaseHandle) != $($0)
  1503.             CloseRegKey $(BaseHandle)
  1504.             ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1505.                 set Status = STATUS_ERROR_CREATEKEY
  1506.                 Debug-Output "REGISTRY.INF: Error in closing base handle"
  1507.                 goto endcreate
  1508.             endif
  1509.         endif
  1510.         set BaseHandle = $(KeyHandle)
  1511.     EndForListDo
  1512.     ifstr(i) $($2) != {}
  1513.         shell "" AddValueList $(KeyHandle) $($2)
  1514.         ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1515.             set Status = STATUS_ERROR_CREATEVALUE
  1516.             goto endcreate
  1517.         endif
  1518.     endif
  1519.     set Status = STATUS_SUCCESSFUL
  1520. endcreate = +
  1521.     ifstr(i) $(Status) != STATUS_SUCCESSFUL
  1522.         Debug-Output "REGISTRY.INF: CreateKey Error:"$(Status)
  1523.     endif
  1524.     Return $(Status) $(KeyHandle)
  1525. [AddValueList]
  1526.    set Status = STATUS_FAILED
  1527.    read-syms RegistryConstants
  1528.    ForListDo $($1)
  1529.        SetRegValue $($0) $($)
  1530.        ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1531.            Debug-Output "REGISTRY.INF: CreateValue failed:"$($)
  1532.            goto end_addvaluelist
  1533.        endif
  1534.    EndForListDo
  1535.    set Status = STATUS_SUCCESSFUL
  1536. end_addvaluelist = +
  1537.    return $(Status)
  1538. [EnableCrashDump]
  1539.     OpenRegKey $(!REG_H_LOCAL) "" system\currentcontrolset\control\CrashControl $(!REG_KEY_SET_VALUE) CrashControlKey
  1540.     ifstr $(CrashControlKey) != ""
  1541.         shell "" AddValueList $(CrashControlKey) {{LogEvent        ,0,$(!REG_VT_DWORD),1},+
  1542.                                                   {SendAlert       ,0,$(!REG_VT_DWORD),1},+
  1543.                                                   {CrashDumpEnabled,0,$(!REG_VT_DWORD),1},+
  1544.                                                   {AutoReboot      ,0,$(!REG_VT_DWORD),1}}
  1545.         CloseRegKey $(CrashControlKey)
  1546.     endif
  1547.     return
  1548. [FixQuotaEntries]
  1549.     set Status       = STATUS_SUCCESSFUL
  1550.     read-syms RegistryConstants
  1551.     set OldPagedPoolSize = 0
  1552.     set OldRegistrySizeLimit = 0
  1553.     set NewPagedPoolSize     = 0
  1554.     set NewRegistrySizeLimit = 0
  1555.     set BogusPagedPoolSize     = 48
  1556.     set BogusRegistrySizeLimit = 24
  1557.     set MBMultiplier  = 1024
  1558.     set-mul MBMultiplier  = $(MBMultiplier) 1024
  1559.     set-mul BogusPagedPoolSize     = $(BogusPagedPoolSize)     $(MBMultiplier)
  1560.     set-mul BogusRegistrySizeLimit = $(BogusRegistrySizeLimit) $(MBMultiplier)
  1561.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control\Session Manager\Memory Management"
  1562.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MaskAllAccess) KeyHandle
  1563.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1564.         Debug-Output "REGISTRY.INF: Couldn't open memory management key"
  1565.         set Status = STATUS_FAILED
  1566.         goto fix_next_entry
  1567.     endif
  1568.     GetRegValue $(KeyHandle) "PagedPoolSize" OldPagedPoolSizeInfo
  1569.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1570.         Debug-Output "REGISTRY.INF: Couldn't read PagedPoolSize value"
  1571.         set Status = STATUS_FAILED
  1572.         goto close_first_handle
  1573.     endif
  1574.     set OldPagedPoolSize = *($(OldPagedPoolSizeInfo), 4)
  1575.     ifint $(OldPagedPoolSize) == $(BogusPagedPoolSize)
  1576.         set ValueInfo = {PagedPoolSize, $(NoTitle), $(!REG_VT_DWORD), $(NewPagedPoolSize)}
  1577.         SetRegValue $(KeyHandle) $(ValueInfo)
  1578.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1579.             set Status = STATUS_FAILED
  1580.             Debug-Output "REGISTRY.INF: Couldn't set PagePoolSize value"
  1581.         endif
  1582.     endif
  1583. close_first_handle = +
  1584.     CloseRegKey $(KeyHandle)
  1585. fix_next_entry = +
  1586.     set KeyName = "System\"$(!STF_CONTROLSET)"\Control"
  1587.     OpenRegKey $(!REG_H_LOCAL) "" $(KeyName) $(MaskAllAccess) KeyHandle
  1588.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1589.         set Status = STATUS_FAILED
  1590.         Debug-Output "REGISTRY.INF: Couldn't open control key"
  1591.         goto end_FixQuotaEntries
  1592.     endif
  1593.     GetRegValue $(KeyHandle) "RegistrySizeLimit" OldRegistrySizeLimitInfo
  1594.     ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1595.         Debug-Output "REGISTRY.INF: Couldn't read RegistrySizeLimit value"
  1596.         set Status = STATUS_FAILED
  1597.         goto close_second_handle
  1598.     endif
  1599.     set OldRegistrySizeLimit = *($(OldRegistrySizeLimitInfo), 4)
  1600.     ifint $(OldRegistrySizeLimit) == $(BogusRegistrySizeLimit)
  1601.         set ValueInfo = {RegistrySizeLimit, $(NoTitle), $(!REG_VT_DWORD), $(RegistrySizeLimit)}
  1602.         SetRegValue $(KeyHandle) $(ValueInfo)
  1603.         ifint $(RegLastError) != $(!REG_ERROR_SUCCESS)
  1604.             set Status = STATUS_FAILED
  1605.             Debug-Output "REGISTRY.INF: Couldn't set RegistrySizeLimit value"
  1606.         endif
  1607.     endif
  1608. close_second_handle = +
  1609.     CloseRegKey $(KeyHandle)
  1610. end_FixQuotaEntries = +
  1611.     Return $(Status)
  1612.  
  1613.  
  1614.  
  1615.  
  1616. ;; end registry.inf
  1617.  
  1618. ;**************************************************************************
  1619. ; PROGRESS GUAGE VARIABLES
  1620. ;**************************************************************************
  1621.  
  1622. [ProgressCopyENG]
  1623.     ProCaption   = "Windows NT セットアップ"
  1624.     ProCancel    = "キャンセル"
  1625.     ProCancelMsg = "Windows NT は正しく組み込まれていません。"+
  1626.                    "ファイルのコピーを中止しますか?"
  1627.     ProCancelCap = "セットアップ メッセージ"
  1628.     ProText1     = "コピー元:"
  1629.     ProText2     = "コピー先:"
  1630.  
  1631. [StringsENG]
  1632.     String1 = "RSA-98シリーズ"
  1633.     String2 = "RSAー98シリーズ ファイルへのドライブ名からのフルパスを入力してください。"+
  1634. ;              "セットアップ フロッピー ディスクからファイルを組み込む場合は、"+
  1635. ;              "ドライブ名 (A: など) を入力してください。"+
  1636. ;              "セットアップは適切なディスクを挿入するよう指示します。"+
  1637.               "これらの操作が終わったら[続行]を選んでください。"
  1638. ;    String3 = "シリアルポート(2チャンネル)を削除すると、システムは"+
  1639. ;              "使用不可になる可能性があります。削除してもよろしいですか?"
  1640.  
  1641. [Source Media Descriptions]
  1642. ;;    1  = "PC-9800 シリアルポート(2チャンネル) Controller Drivers Disk 1 of 1"  , TAGFILE = disk1
  1643. ;      1  = "アイ・オー・データ 高速シリアルボード RSA98 Controller Drivers Disk 1 of 1"  , TAGFILE = disk1
  1644.       1  = "アイ・オー・データ 高速シリアルボード RSA-98シリーズ サポートソフトウェアディスク"
  1645.  
  1646. [Files-RsDrivers]
  1647. ;;SerRSA98 = 1,SerRSA98.sys , SIZE=999
  1648.   SerRSA98 = 1,SerRSA98.sys , SIZE=999
  1649.