Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3068 lines
103 KiB

  1. ;------------------------------------------------------------------------
  2. ; Copyright(c) 1992-93 Microsoft Corporation
  3. ;
  4. ; Services for Macintosh Setup INF File.
  5. ;
  6. ; Author: KrishG
  7. ;
  8. ; Revision History: 3/3/93 - Changed for Custom/Express removal
  9. ;------------------------------------------------------------------------
  10. [Identification]
  11. OptionType = NetService
  12. [Options]
  13. SFM
  14. [FileConstants]
  15. ProductFullInfName = "oemnsvsm.inf"
  16. Manufacturer = "Microsoft"
  17. ProductMajorVersion = 4
  18. ProductMinorVersion = 0
  19. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  20. ProductOpSupport = 134 ; 0x0086 ; Display,Removable,Properties,Not Updatable
  21. ; flag indicates AppleTalk has been installed for the first time.
  22. IsInitialInstall = 0
  23. SFMUnattended = 0
  24. ;------------------------------------------------------------------------
  25. ; SFM Software Data
  26. ;------------------------------------------------------------------------
  27. ProductSFMName = "SFM"
  28. ; AppleTalk Transport Product Descriptions /Net Rules
  29. ProductATALKName = "AppleTalk"
  30. ProductATALKImagePath = "%SystemRoot%\system32\drivers\sfmatalk.sys"
  31. ProductATALKSvcType = "kernel"
  32. ProductATALKType = "transport"
  33. ProductATALKEventDll = "%SystemRoot%\system32\sfmatmsg.dll"
  34. NetRuleATALKType = "appletalk appletalktransport"
  35. NetRuleATALKUse = $(ProductATALKType)" none none"
  36. NetRuleATALKBindForm = """appletalk"" yes yes container"
  37. NetRuleATALKClass = {"appletalktransport basic "}
  38. NetRuleATALKBindList = {"appletalktransport ndisDriver non non 100", +
  39. "appletalktransport ltkndisDriver non exclusive 100" }
  40. ;------------------------------------------------------------------------
  41. ; Afp Server Service and Server Product Descriptions /Net Rules
  42. ;------------------------------------------------------------------------
  43. ProductAFPSVCName = "MacFile"
  44. ProductAFPSVCImagePath = "%SystemRoot%\system32\sfmsvc.exe"
  45. ProductAFPSVCType = "service"
  46. ProductAFPSVCEventDll = "%SystemRoot%\system32\sfmmsg.dll"
  47. NetRuleAFPSVCType = "MacFile lmNetService"
  48. NetRuleAFPSVCUse = "service"
  49. ProductAFPSRVRName = "MacSrv"
  50. ProductAFPSRVRImagePath = "%SystemRoot%\system32\drivers\sfmsrv.sys"
  51. ProductAFPSRVREventDll = "%SystemRoot%\system32\sfmmsg.dll"
  52. ;------------------------------------------------------------------------
  53. ; Macintosh Print Server Product Descriptions /Net Rules
  54. ;------------------------------------------------------------------------
  55. ProductMACPRINTName = "MacPrint"
  56. ProductMACPRINTImagePath = "%SystemRoot%\system32\sfmprint.exe"
  57. ProductMACPRINTType = "service"
  58. ProductMACPRINTEventDll = "%SystemRoot%\system32\sfmprint.exe"
  59. ProductMonitorDll = "sfmmon.dll"
  60. ProductMonitorEventDll = "%SystemRoot%\system32\sfmmon.dll"
  61. ;------------------------------------------------------------------------
  62. ; Dll And File Names
  63. ;---------------------------------------------------------------------
  64. UtilDll = "sfmutil.dll"
  65. ResDll = "sfmres.dll"
  66. IconsInfFile = "sfmicons.inf"
  67. !UamResSrcFile = "sfmuam.rsc"
  68. !UamInfoSrcFile = "sfmuam.ifo"
  69. !UamResDestFile = "MS UAM:Afp_Resource"
  70. !UamInfoDestFile = "MS UAM:Afp_AfpInfo"
  71. !UamReadMeSrcFile = "sfmuam.txt"
  72. ; !UamReadMeDestFile = "ReadMe.UAM"
  73. NtNetIniFileName = $(!STF_WINDOWSSYSPATH)"\ntnet.ini"
  74. WinFileIniFileName = $(!STF_WINDOWSSYSPATH)"\winfile.ini"
  75. AfpMgrCplFile = "sfmmgr.cpl"
  76. SrvMgrIniSection = "SMAddons"
  77. WinFileIniSection = "Addons"
  78. TypeCreatorMapFile = "sfmmap.inf"
  79. AtWinSockDll = "sfmwshat.dll"
  80. PSprintProcFile = "sfmpsprt.dll"
  81. PSprintProc = "SFMPSPRT"
  82. ;------------------------------------------------------------------------
  83. ; Product Key Names, Registry Key Names of Interest
  84. ;-------------------------------------------------------------------------
  85. !ProductKeyBase = $(!NTN_SoftwareBase)"\"$(Manufacturer)
  86. !ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSFMName)"\CurrentVersion"
  87. !ProductATALKKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductATALKName)
  88. !ProductKeyLinkage = $(!NTN_ServiceBase)"\"$(ProductATALKName)"\Linkage"
  89. !PrintMonKeyName = "SYSTEM\CurrentControlSet\Control\Print\Monitors"
  90. !EventLogKey = $(!NTN_ServiceBase)"\EventLog\Application"
  91. ;------------------------------------------------------------------------
  92. ; Performance data
  93. ;------------------------------------------------------------------------
  94. AfpPerfLibraryName = "sfmctrs.dll"
  95. AfpPerfOpenFunction = "OpenAfpPerformanceData"
  96. AfpPerfCloseFunction = "CloseAfpPerformanceData"
  97. AfpPerfCollectFunction = "CollectAfpPerformanceData"
  98. AfpCounterFileName = "sfmctrs.ini"
  99. AfpEventLogName = "sfmctrs"
  100. AtalkPerfLibraryName = "atkctrs.dll"
  101. AtalkPerfOpenFunction = "OpenAtkPerformanceData"
  102. AtalkPerfCloseFunction = "CloseAtkPerformanceData"
  103. AtalkPerfCollectFunction = "CollectAtkPerformanceData"
  104. AtalkCounterFileName = "atkctrs.ini"
  105. AtalkEventLogName = "atkctrs"
  106. !PerfKeyName = "Performance"
  107. [GeneralConstants]
  108. UtilInf = "UTILITY.INF"
  109. SubInf = "SUBROUTN.INF"
  110. !KeyNull = ""
  111. !ACCESS = 33554432
  112. !SERVICE_NO_CHANGE = 4294967295
  113. RegistryErrorIndex = NO_ERROR
  114. KeyProduct = ""
  115. KeyParameters = ""
  116. TRUE = 1
  117. FALSE = 0
  118. NoTitle = 0
  119. !UamCopyStatus = TRUE
  120. ; !DebugOutputControl = 0
  121. [date]
  122. Now = {} ? $(!LIBHANDLE) GetSystemDate
  123. [AvailableSystemMemory]
  124. SystemMemory = "" ? $(!LIBHANDLE) GetMemorySize
  125. MinSystemMemory = 2048
  126. [FSAndDiskSpace]
  127. VolumeList = {} ? $(!LIBHANDLE) GetHardDriveLetters
  128. VolumeFreeList = {} ? $(!LIBHANDLE) GetHardDriveFreeSpace
  129. VolumeFSList = {} ? $(!LIBHANDLE) GetHardDriveFileSystems
  130. [VolList]
  131. VolumeFSList = {} ? $(!LIBHANDLE) GetHardDriveFileSystems
  132. VolumeList = {} ? $(!LIBHANDLE) GetHardDriveLetters
  133. [ExtensionIds]
  134. XCEL1ID = {"ID=1"}
  135. XCEL2ID = {"ID=2"}
  136. XCEL3ID = {"ID=3"}
  137. XCEL4ID = {"ID=4"}
  138. XCEL5ID = {"ID=5"}
  139. XCEL6ID = {"ID=6"}
  140. XCEL7ID = {"ID=7"}
  141. XCEL8ID = {"ID=8"}
  142. XCEL9ID = {"ID=9"}
  143. XCEL10ID = {"ID=10"}
  144. XCEL11ID = {"ID=11"}
  145. XCEL12ID = {"ID=12"}
  146. XCEL13ID = {"ID=13"}
  147. MSWD1ID = {"ID=14"}
  148. MSWD2ID = {"ID=15"}
  149. MSPJ1ID = {"ID=16"}
  150. MSPJ2ID = {"ID=17"}
  151. MSPJ3ID = {"ID=18"}
  152. MSPJ4ID = {"ID=19"}
  153. MSPJ5ID = {"ID=20"}
  154. MSPJ6ID = {"ID=5016"}
  155. ALD31ID = {"ID=21"}
  156. ALD32ID = {"ID=22"}
  157. ALD33ID = {"ID=23"}
  158. MOREID = {"ID=24"}
  159. FOX+ID = {"ID=25"}
  160. ALD41ID = {"ID=26"}
  161. ALD42ID = {"ID=27"}
  162. ALD43ID = {"ID=28"}
  163. ARTZID = {"ID=29"}
  164. SIT!ID = {"ID=30"}
  165. PPT2ID = {"ID=31"}
  166. PPT3ID = {"ID=32"}
  167. L123ID = {"ID=33"}
  168. LMANID = {"ID=34"}
  169. TTXTID = {"ID=35"}
  170. FOXX1ID = {"ID=5000"}
  171. FOXX2ID = {"ID=5001"}
  172. FOXX3ID = {"ID=5002"}
  173. FOXX4ID = {"ID=5003"}
  174. FOXX5ID = {"ID=5004"}
  175. FOXX6ID = {"ID=5005"}
  176. FOXX7ID = {"ID=5006"}
  177. FOXX8ID = {"ID=5007"}
  178. FOXX9ID = {"ID=5008"}
  179. FOXX10ID = {"ID=5009"}
  180. FOXX11ID = {"ID=5010"}
  181. FOXX12ID = {"ID=5011"}
  182. FOXX13ID = {"ID=5012"}
  183. FOXX14ID = {"ID=5013"}
  184. FOXX15ID = {"ID=5014"}
  185. FOXX16ID = {"ID=5015"}
  186. [Identify]
  187. read-syms Identification
  188. set Status = STATUS_SUCCESSFUL
  189. set Identifier = $(OptionType)
  190. set Media = #("Source Media Descriptions", 1, 1)
  191. Return $(Status) $(Identifier) $(Media)
  192. [ReturnOptions]
  193. set Status = STATUS_FAILED
  194. set OptionList = {}
  195. set OptionTextList = {}
  196. set LanguageList = ^(LanguagesSupported, 1)
  197. Ifcontains(i) $($0) in $(LanguageList)
  198. goto returnoptions
  199. else
  200. set Status = STATUS_NOLANGUAGE
  201. goto finish_ReturnOptions
  202. endif
  203. returnoptions = +
  204. set OptionList = ^(Options, 1)
  205. set OptionTextList = ^(OptionsText$($0), 1)
  206. set Status = STATUS_SUCCESSFUL
  207. finish_ReturnOptions = +
  208. Return $(Status) $(OptionList) $(OptionTextList)
  209. [InstallOption]
  210. set Status = STATUS_FAILED
  211. set Option = $($1)
  212. set SrcDir = $($2)
  213. Set AddCopy = $($3)
  214. Set DoCopy = $($4)
  215. Set DoConfig = $($5)
  216. set LanguageList = ^(LanguagesSupported, 1)
  217. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  218. return STATUS_NOLANGUAGE
  219. EndIf
  220. set-subst LF = "\n"
  221. set-subst CR = "\r"
  222. read-syms GeneralConstants
  223. read-syms FileConstants
  224. read-syms DialogConstants$(!STF_LANGUAGE)
  225. read-syms FileConstants$(!STF_LANGUAGE)
  226. detect date
  227. set-title $(FunctionTitle)
  228. set CommonStatus = STATUS_SUCCESSFUL
  229. Debug-Output "SFMSETUP: Install Mode = "$(!NTN_InstallMode)
  230. Debug-Output "SFMSETUP: Origin = "$(!NTN_Origination)
  231. Debug-Output "SFMSETUP: Phase = "$(!NTN_InstallPhase)
  232. Debug-Output "SFMSETUP: Context INF = "$(!STF_CONTEXTINFNAME)
  233. Begin = +
  234. Set REMOVE_SOFTWARE = {}
  235. Set REMOVE_SERVICES = {}
  236. IfStr(i) $(!NTN_InstallMode) == deinstall
  237. Set StartLabel = Removesfm
  238. Set REMOVE_SOFTWARE = { $(ProductATALKName),+
  239. $(ProductAFPSVCName),+
  240. $(ProductMACPRINTName)+
  241. }
  242. Set REMOVE_SERVICES = {$(ProductAFPSRVRName)}
  243. LoadLibrary "x" $(!STF_CWDDIR)$(UtilDll) !UTILHANDLE
  244. else-Ifstr(i) $(!NTN_InstallMode) == Update
  245. set StartLabel = Upgradesfm
  246. else-Ifstr(i) $(!NTN_InstallMode) == configure
  247. set StartLabel = Configuresfm
  248. else-Ifstr(i) $(!NTN_InstallMode) == bind
  249. set StartLabel = Bindingssfm
  250. else-Ifstr(i) $(!NTN_InstallMode) == install
  251. set StartLabel = Installsfm
  252. else
  253. Set StartLabel = end
  254. endif
  255. goto $(StartLabel)
  256. ;------------------------------------------------------------------
  257. ; Install the product
  258. ;------------------------------------------------------------------
  259. Installsfm = +
  260. Set FLibraryErrCtl = 1
  261. ; Detect if we are already installed. If installed, ask the user to
  262. ; use the update option. Otherwise ask the user to input the
  263. ; location of the SFM files
  264. OpenRegKey $(!REG_H_LOCAL) "" $(!ProductKeyName) $(!ACCESS) KeyProduct
  265. Ifstr $(KeyProduct) != $(!KeyNull)
  266. GetRegValue $(KeyProduct) $(MajorVersion) VersionInfo
  267. set VersionMajor = *($(VersionInfo), 4)
  268. GetRegValue $(KeyProduct) $(MinorVersion) VersionInfo
  269. set VersionMinor = *($(VersionInfo), 4)
  270. set InstalledVersion = $(VersionMajor)"."$(VersionMinor)
  271. ifstr(i) $(ProductVersion) == $(InstalledVersion)
  272. read-syms MiscErrorString1$(!STF_LANGUAGE)
  273. Set Text = $(Version)$(ProductVersion)
  274. Shell $(SubInf), SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(Text)$(ErrorString)
  275. goto end
  276. EndIf
  277. EndIf
  278. ifstr(i) $(!NTN_InstallMode) == "install"
  279. Ifstr(i) $(DoCopy) == "YES"
  280. Shell $(UtilInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  281. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  282. Goto ShellCodeError
  283. Else-Ifstr(i) $($R0) == STATUS_FAILED
  284. Shell $(UtilInf) RegistryErrorString "ASK_SOURCE_FAIL"
  285. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  286. goto ShellCodeError
  287. endif
  288. set Error = $($R0)
  289. Goto end
  290. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  291. Goto end
  292. Endif
  293. Set SrcDir = $($R1)
  294. Endif
  295. Endif
  296. read-syms AvailableSystemMemory
  297. detect AvailableSystemMemory
  298. Ifint $(SystemMemory) < $(MinSystemMemory)
  299. read-syms MiscErrorString2(!STF_LANGUAGE)
  300. shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(ErrorString)
  301. goto end
  302. EndIf
  303. read-syms FSAndDiskSpace
  304. detect FSAndDiskSpace
  305. GetDriveInPath NtDrive $(!STF_WINDOWSSYSPATH)
  306. ; Check if the user has any NTFS Volumes or not
  307. Set NTFSVolExists = FALSE
  308. Set !NTFSVolumeList = {}
  309. ForListDo $(VolumeFSList)
  310. Ifstr(i) $($) == "NTFS"
  311. Set NTFSVolExists = TRUE
  312. Set NTFSVolumeList = >($(NTFSVolumeList),*($(VolumeList),$(#)))
  313. EndIf
  314. EndForListDo
  315. Ifstr(i) $(!STF_GUI_UNATTENDED) != YES
  316. Ifstr(i) $(NTFSVolExists) == FALSE
  317. Debug-Output "OEMNSVSM.INF:Install Phase = "$(!NTN_InstallPhase)
  318. Ifstr(i) $(!NTN_InstallPhase) == primary
  319. read-syms NTFSFormatHappening$(!STF_LANGUAGE)
  320. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  321. Else
  322. read-syms AFPString1$(!STF_LANGUAGE)
  323. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  324. EndIf
  325. EndIf
  326. Endif
  327. ;
  328. ; Check if there is enough space in the Windows NT System Drive.
  329. ; If not enough space, tell the user ot make some space and retry
  330. ;
  331. readvollist = +
  332. ForListDo $(VolumeList)
  333. set CurrentVolume = *($(VolumeList), $(#))
  334. set CurrentVolumeFree = *($(VolumeFreeList), $(#))
  335. Ifstr(i) $(CurrentVolume) == $(NtDrive)
  336. Ifint $(CurrentVolumeFree) < $(RequiredSfmSize)
  337. read-syms SetupSpaceDlg$(!STF_LANGUAGE)
  338. ui start "SetupSpaceDlg"
  339. Ifstr(i) $(DLGEVENT) == "RETRY"
  340. read-syms FSAndDiskSpace
  341. detect FSAndDiskSpace
  342. goto readvollist
  343. else
  344. goto initialsetupcancel
  345. EndIf
  346. EndIf
  347. EndIf
  348. EndForListDo
  349. ;------------------------------------------------------------------
  350. ; Copy the SFM Files
  351. ;------------------------------------------------------------------
  352. CopySfmFiles = +
  353. install "Install-Initial"
  354. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  355. read-syms StatusRemoveSfm$(!STF_LANGUAGE)
  356. Shell $(SubInf) PushBillBoard NETSTATUSDLG $(Status)
  357. Shell "" RemoveSfmFiles "INSTALL"
  358. Shell $(SubInf) PopBillBoard
  359. goto usercancel
  360. endif
  361. ; add our inf file to the ReviewPrograms List of NCPA so that
  362. ; we will be called last for review bindings.
  363. Shell "" AddInfToReviewProgramsList
  364. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  365. Debug-Output "error shelling AddInfToReviewProgramsList."
  366. goto ShellCodeError
  367. endif
  368. ifstr(i) $($R0) != STATUS_SUCCESSFUL
  369. Debug-Output "error returned by AddInfToReviewProgramsList."
  370. endif
  371. LoadLibrary "x" $(!STF_CWDDIR)$(UtilDll) !UTILHANDLE
  372. Set Result = ""
  373. Set FLibraryErrCtl = 1
  374. StartInstall = +
  375. Set REMOVE_FLAG = TRUE
  376. ; this flag is used to determine if AppleTalk print monitor should be
  377. ; installed by SFM setup. If AppleTalk was previously installed and
  378. ; the user is attempting to isntall SFM on top of it, then the PrintMon
  379. ; was previously installed as well.
  380. set PrintMonInstalled = FALSE
  381. read-syms StatusInstallSfm$(!STF_LANGUAGE)
  382. Shell $(SubInf) PushBillBoard NETSTATUSDLG $(Status)
  383. StartWait
  384. Set ThisOption = "SFM"
  385. Shell $(UtilInf), InstallSoftwareProduct, $(Manufacturer),$(Product$(ThisOption)Name), $(ProductFullInfName)
  386. ifint $(ShellCode) != 0
  387. goto ShellCodeError
  388. endif
  389. set RegistryErrorIndex = $($R0)
  390. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  391. CloseRegKey $($R1)
  392. CloseRegKey $($R2)
  393. goto fatalregistry
  394. Endif
  395. Set SfmProductKey = $($R1)
  396. Set SfmNetRuleKey = $($R2)
  397. ; set product key information in the registry
  398. set NewValueList = +
  399. {{SoftwareType,0,$(!REG_VT_SZ),"service")},+
  400. {Infname,0,$(!REG_VT_SZ),$(ProductFullInfName)},+
  401. {Title,0,$(!REG_VT_SZ), $(Product$(ThisOption)Title)},+
  402. {Description,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+
  403. {MajorVersion,0,$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  404. {MinorVersion,0,$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  405. {InstalledComponents,$(NoTitle),$(!REG_VT_MULTI_SZ),$(TobeInstalledList)},+
  406. {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}, +
  407. {InstallDate,0,$(!REG_VT_DWORD),*($(Now),1)}}
  408. Shell $(UtilInf), AddValueList, $(SfmProductKey), $(NewValueList)
  409. ifint $(ShellCode) != 0
  410. goto ShellCodeError
  411. endif
  412. set RegistryErrorIndex = $($R0)
  413. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  414. CloseRegKey $(SfmProductKey)
  415. CloseRegKey $(SfmNetRuleKey)
  416. goto fatalregistry
  417. endif
  418. Set NewValueList = {{InfOption,$(NoTitle),$(!REG_VT_SZ),$(ThisOption)}, +
  419. {Infname,$(NoTitle),$(!REG_VT_SZ),$(ProductFullInfName)}}
  420. Shell $(UtilInf), AddValueList, $(SfmNetRuleKey), $(NewValueList)
  421. ifint $(ShellCode) != 0
  422. goto ShellCodeError
  423. endif
  424. set RegistryErrorIndex = $($R0)
  425. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  426. CloseRegKey $(SfmProductKey)
  427. CloseRegKey $(SfmNetRuleKey)
  428. goto fatalregistry
  429. Endif
  430. CloseRegKey $(SfmProductKey)
  431. CloseRegKey $(SfmNetRuleKey)
  432. Set ThisOption = ATALK
  433. Set REMOVE_SOFTWARE = >($(REMOVE_SOFTWARE), $(Product$(ThisOption)Name))
  434. Set Atalk_DependList = {}
  435. Set FLibraryErrCtl = 1
  436. Shell $(UtilInf), AddSoftwareComponent,+
  437. $(Manufacturer), +
  438. $(Product$(ThisOption)Name),+
  439. $(Product$(ThisOption)Name), +
  440. $(Product$(ThisOption)DisplayName), +
  441. $(ProductFullInfName),+
  442. $(Product$(ThisOption)ImagePath),+
  443. "kernelautostart", "PNP_TDI",+
  444. $(Atalk_DependList), "",+
  445. $(Product$(ThisOption)EventDll)
  446. Set FLibraryErrCtl = 0
  447. Set RegistryErrorIndex = $($R0)
  448. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  449. ; If AppleTalk already exists, then this means the user is trying
  450. ; to install SFM on top of an AppleTalk install.
  451. ; Let us set the Review flag of AppleTalk to 0 so that review bindings
  452. ; happens only once. set the MonitorInstalled flag to TRUE to indicate
  453. ; that the print monitor was previously installed.
  454. ifstr(i) $(RegistryErrorIndex) == SERVICE_ALREADY_EXISTS
  455. OpenRegKey $(!REG_H_LOCAL) "" +
  456. $(!NTN_SoftwareBase)"\Microsoft\AppleTalk\CurrentVersion" +
  457. $(!ACCESS) AtalkKey
  458. Ifstr(i) $(AtalkKey) != $(!KeyNull)
  459. SetRegValue $(AtalkKey) {Review,0,$(!REG_VT_DWORD),0}
  460. CloseRegKey $(AtalkKey)
  461. endif
  462. set PrintMonInstalled = TRUE
  463. goto InstallAFPSVC
  464. endif
  465. CloseRegKey $($R1)
  466. CloseRegKey $($R2)
  467. CloseRegKey $($R3)
  468. CloseRegKey $($R4)
  469. CloseRegKey $($R5)
  470. goto fatalregistry
  471. EndIf
  472. ; At this point:
  473. ; $R1 contains the product version key handle;
  474. ; $R2 contains the NetRules subkey handle;
  475. ; $R3 contains the new Services key handle; and
  476. ; $R4 contains the Parameters key
  477. ; $R5 contains the Linkage Key
  478. ;
  479. Set AtkVersKey = $($R1)
  480. Set AtkNetRuleKey = $($R2)
  481. Set AtkSvcKey = $($R3)
  482. Set AtalkParameters = $($R4)
  483. Set AtkLinkageKey = $($R5)
  484. set NewValueList = +
  485. {{SoftwareType,0,$(!REG_VT_SZ),$(Product$(ThisOption)Type)},+
  486. {Title,0,$(!REG_VT_SZ),$(Product$(ThisOption)Title)},+
  487. {Description,0,$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+
  488. {PathName,0,$(!REG_VT_SZ),"%SystemRoot%\system32"},+
  489. {ServiceName,0,$(!REG_VT_SZ),$(Product$(ThisOption)Name)},+
  490. {Hidden,0,$(!REG_VT_DWORD),1},+
  491. {InstallDate,0,$(!REG_VT_DWORD),*($(Now),1)}}
  492. Shell $(UtilInf), AddValueList, $(AtkVersKey), $(NewValueList)
  493. set RegistryErrorIndex = $($R0)
  494. Ifstr $(RegistryErrorIndex) != NO_ERROR
  495. CloseRegKey $(AtkVersKey)
  496. CloseRegKey $(AtkNetRuleKey)
  497. CloseRegKey $(AtkSvcKey)
  498. CloseRegKey $(AtkLinkageKey)
  499. CloseRegKey $(AtalkParameters)
  500. goto fatalregistry
  501. EndIf
  502. set NewValueList = +
  503. {{type,0,$(!REG_VT_SZ),$(NetRule$(ThisOption)Type)}, +
  504. {use,0,$(!REG_VT_SZ),$(NetRule$(ThisOption)Use)}, +
  505. {bindform,0,$(!REG_VT_SZ),$(NetRule$(ThisOption)BindForm)}, +
  506. {class,0, $(!REG_VT_MULTI_SZ),$(NetRule$(ThisOption)Class)}, +
  507. {bindable,0, $(!REG_VT_MULTI_SZ), $(NetRule$(ThisOption)BindList)},+
  508. {InfOption,0,$(!REG_VT_SZ),$(ThisOption)}, +
  509. {Infname,0,$(!REG_VT_SZ),$(ProductFullInfName)} }
  510. Shell $(UtilInf), AddValueList, $(AtkNetRuleKey), $(NewValueList)
  511. set RegistryErrorIndex = $($R0)
  512. Ifstr $(RegistryErrorIndex) != NO_ERROR
  513. CloseRegKey $(AtkVersKey)
  514. CloseRegKey $(AtkNetRuleKey)
  515. CloseRegKey $(AtkSvcKey)
  516. CloseRegKey $(AtkLinkageKey)
  517. CloseRegKey $(AtalkParameters)
  518. goto fatalregistry
  519. EndIf
  520. ;
  521. ; Create the Adapters Key
  522. ; CODEWORK - Localize ?
  523. ;
  524. CreateRegKey $(AtkSvcKey), {"Adapters",0,GenericClass},+
  525. "", $(!ACCESS), "" , KeyAdapters
  526. ; write global parameters
  527. Set DesiredZone = ""
  528. Set UnattendInstallMode = 0
  529. Ifstr(i) $(!STF_UNATTENDED) == YES
  530. set UnattendInstallMode = 1
  531. Debug-Output "SFMSETUP: UnattendInstallMode(1) = "$(UnattendInstallMode)
  532. endif
  533. Ifstr(i) $(!STF_GUI_UNATTENDED) == YES
  534. set UnattendInstallMode = 1
  535. Debug-Output "SFMSETUP: UnattendInstallMode(2) = "$(UnattendInstallMode)
  536. endif
  537. set NewValueList = +
  538. {{EnableRouter,0,$(!REG_VT_DWORD),0},+
  539. {InitialInstall,0, $(!REG_VT_DWORD),1},+
  540. {Unattended,0, $(!REG_VT_DWORD),$(UnattendInstallMode)},+
  541. {DesiredZone,0,$(!REG_VT_SZ),$(DesiredZone)}}
  542. Shell $(UtilInf), AddValueList, $(AtalkParameters), $(NewValueList)
  543. set RegistryErrorIndex = $($R0)
  544. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  545. CloseRegKey $(KeyAdapters)
  546. goto fatalregistry
  547. EndIf
  548. ; Add WinSock Support to AppleTalk
  549. Set WinAtalkDll = "%SystemRoot%\System32\"$(AtWinSockDll)
  550. Set MaxSockAddrLen = 8
  551. Set MinSockAddrLen = 6
  552. Shell $(UtilInf) AddWinsockInfo $(Product$(ThisOption)Name), +
  553. $(WinAtalkDll), +
  554. $(MaxSockAddrLen),+
  555. $(MinSockAddrLen)
  556. ifstr(i) $($R0) != NO_ERROR
  557. read-syms AtalkString1$(!STF_LANGUAGE)
  558. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  559. Endif
  560. ; Add the performance data to the AppleTalk\performance service key
  561. Shell "" CreatePerfKey $(AtkSvcKey) $(AtalkPerfLibraryName) +
  562. $(AtalkCounterFileName) $(AtalkPerfOpenFunction) +
  563. $(AtalkPerfCloseFunction) $(AtalkPerfCollectFunction)
  564. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  565. Set RegistryErrorIndex = $($R1)
  566. goto fatalregistry
  567. EndIf
  568. ; Add the performance dll to the EventLog
  569. Shell "" CreateEventLogKey $(AtalkEventLogName) $(AtalkPerfLibraryName)
  570. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  571. Set RegistryErrorIndex = $($R1)
  572. goto fatalregistry
  573. EndIf
  574. Shell "utility.inf" AddRpcProtocol ncacn_at_dsp rpclt1.dll rpclt1.dll
  575. ; close all open keys
  576. CloseAtkKeys = +
  577. CloseRegKey $(AtkVersKey)
  578. CloseRegKey $(AtkNetRuleKey)
  579. CloseRegKey $(AtkSvcKey)
  580. CloseRegKey $(AtkLinkageKey)
  581. CloseRegKey $(AtalkParameters)
  582. CloseRegKey $(KeyAdapters)
  583. InstallAFPSVC =+
  584. ; Install AFPSVC
  585. Set ThisOption = AFPSVC
  586. Set REMOVE_SOFTWARE = >($(REMOVE_SOFTWARE), $(Product$(ThisOption)Name))
  587. Set REMOVE_SERVICES = >($(REMOVE_SERVICES), $(ProductAFPSRVRName))
  588. Set FLibraryErrCtl = 1
  589. Shell $(UtilInf), AddSoftwareComponent, +
  590. $(Manufacturer), +
  591. $(Product$(ThisOption)Name),+
  592. $(Product$(ThisOption)Name), +
  593. $(Product$(ThisOption)DisplayName), +
  594. $(ProductFullInfName),+
  595. $(Product$(ThisOption)ImagePath),+
  596. "autoserviceshare", "",+
  597. {"AppleTalk","LanManWorkStation"}, "",+
  598. $(Product$(ThisOption)EventDll)
  599. Set FLibraryErrCtl = 0
  600. Ifint $(ShellCode) != 0
  601. goto ShellCodeError
  602. endif
  603. set RegistryErrorIndex = $($R0)
  604. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  605. CloseRegKey $($R1)
  606. CloseRegKey $($R2)
  607. CloseRegKey $($R3)
  608. CloseRegKey $($R4)
  609. CloseRegKey $($R5)
  610. goto fatalregistry
  611. endif
  612. ;
  613. ; At this point:
  614. ; $R1 contains the product version key handle;
  615. ; $R2 contains the NetRules subkey handle;
  616. ; $R3 contains the new Services key handle; and
  617. ; $R4 contains the Parameters key
  618. ;
  619. Set McProductKey = $($R1)
  620. Set McNetRuleKey = $($R2)
  621. Set McServiceKey = $($R3)
  622. set McParameters = $($R4)
  623. Set McLinkageKey = $($R5)
  624. set NewValueList = +
  625. {{SoftwareType,0 ,$(!REG_VT_SZ),$(Product$(ThisOption)Type)},+
  626. {Title,0,$(!REG_VT_SZ),$(Product$(ThisOption)Title)},+
  627. {Description,0,$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+
  628. {PathName,0,$(!REG_VT_SZ),"%SystemRoot%\system32"},+
  629. {ServiceName,0,$(!REG_VT_SZ),$(Product$(ThisOption)Name)},+
  630. {Hidden,0,$(!REG_VT_DWORD),1},+
  631. {InstallDate,0,$(!REG_VT_DWORD),*($(Now),1)}}
  632. Shell $(UtilInf),AddValueList,$(McProductKey),$(NewValueList)
  633. ifint $(ShellCode) != 0
  634. goto ShellCodeError
  635. endif
  636. set RegistryErrorIndex = $($R0)
  637. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  638. CloseRegKey $(McProductKey)
  639. CloseRegKey $(McNetRuleKey)
  640. CloseRegKey $(McServiceKey)
  641. CloseRegKey $(McParameters)
  642. CloseRegKey $(McLinkageKey)
  643. goto fatalregistry
  644. Endif
  645. set NewValueList = +
  646. {{InfOption,$(NoTitle),$(!REG_VT_SZ),$(ThisOption)}, +
  647. {Infname ,$(NoTitle),$(!REG_VT_SZ),$(ProductFullInfName)}}
  648. Shell $(UtilInf), AddValueList, $(McNetRuleKey), $(NewValueList)
  649. ifint $(ShellCode) != 0
  650. goto ShellCodeError
  651. endif
  652. set RegistryErrorIndex = $($R0)
  653. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  654. CloseRegKey $(McProductKey)
  655. CloseRegKey $(McNetRuleKey)
  656. CloseRegKey $(McServiceKey)
  657. CloseRegKey $(McParameters)
  658. CloseRegKey $(McLinkageKey)
  659. goto fatalregistry
  660. endif
  661. CreateRegKey $(McParameters) {"Type_Creators",0,GenericClass} "" +
  662. $(!ACCESS) "" KeyTypeCreator
  663. CreateRegKey $(McParameters) {"Extensions",0,GenericClass} "" +
  664. $(!ACCESS) "" KeyExtensions
  665. CreateRegKey $(McParameters) {"Icons",0,GenericClass} "" +
  666. $(!ACCESS) "" KeyIcons
  667. CreateRegKey $(McParameters) {"Volumes",$(NoTitle),GenericClass} "" +
  668. $(!ACCESS) "" KeyVolumeList
  669. Shell $(!STF_CWDDIR)$(IconsInfFile) ReadIconVariables
  670. set NewValueList = +
  671. {{LMANDEXE,0,$(!REG_VT_MULTI_SZ),$(!LMANDEXE)},+
  672. {LMANTEXT,0, $(!REG_VT_MULTI_SZ),$(!LMANTEXT)},+
  673. {SRVRSRVR,0, $(!REG_VT_MULTI_SZ),$(!SRVRSRVR)}}
  674. Shell $(UtilInf),AddValueList,$(KeyIcons),$(NewValueList)
  675. ifint $(ShellCode) != 0
  676. goto ShellCodeError
  677. endif
  678. set RegistryErrorIndex = $($R0)
  679. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  680. CloseRegKey $(McProductKey)
  681. CloseRegKey $(McNetRuleKey)
  682. CloseRegKey $(McServiceKey)
  683. CloseRegKey $(McParameters)
  684. CloseRegKey $(McLinkageKey)
  685. goto fatalregistry
  686. endif
  687. ; Set TypeCreator Mappings
  688. read-syms TCComments$(!STF_LANGUAGE)
  689. Shell $(!STF_CWDDIR)$(TypeCreatorMapFile) ReadTypeCreatorMappings
  690. Set NewValueList = +
  691. {{1,0,$(!REG_VT_MULTI_SZ),$(!XCEL1CREATOR)},+
  692. {2,0,$(!REG_VT_MULTI_SZ),$(!XCEL2CREATOR)},+
  693. {3,0,$(!REG_VT_MULTI_SZ),$(!XCEL3CREATOR)},+
  694. {4,0,$(!REG_VT_MULTI_SZ),$(!XCEL4CREATOR)},+
  695. {5,0,$(!REG_VT_MULTI_SZ),$(!XCEL5CREATOR)},+
  696. {6,0,$(!REG_VT_MULTI_SZ),$(!XCEL6CREATOR)},+
  697. {7,0,$(!REG_VT_MULTI_SZ),$(!XCEL7CREATOR)},+
  698. {8,0,$(!REG_VT_MULTI_SZ),$(!XCEL8CREATOR)},+
  699. {9,0,$(!REG_VT_MULTI_SZ),$(!XCEL9CREATOR)},+
  700. {10,0,$(!REG_VT_MULTI_SZ),$(!XCEL10CREATOR)},+
  701. {11,0,$(!REG_VT_MULTI_SZ),$(!XCEL11CREATOR)},+
  702. {12,0,$(!REG_VT_MULTI_SZ),$(!XCEL12CREATOR)},+
  703. {13,0,$(!REG_VT_MULTI_SZ),$(!XCEL13CREATOR)},+
  704. {14,0,$(!REG_VT_MULTI_SZ),$(!MSWD1CREATOR)},+
  705. {15,0,$(!REG_VT_MULTI_SZ),$(!MSWD2CREATOR)},+
  706. {16,0,$(!REG_VT_MULTI_SZ),$(!MSPJ1CREATOR)},+
  707. {17,0,$(!REG_VT_MULTI_SZ),$(!MSPJ2CREATOR)},+
  708. {18,0,$(!REG_VT_MULTI_SZ),$(!MSPJ3CREATOR)},+
  709. {19,0,$(!REG_VT_MULTI_SZ),$(!MSPJ4CREATOR)},+
  710. {20,0,$(!REG_VT_MULTI_SZ),$(!MSPJ5CREATOR)},+
  711. {5016,0,$(!REG_VT_MULTI_SZ),$(!MSPJ6CREATOR)},+
  712. {21,0,$(!REG_VT_MULTI_SZ),$(!ALD31CREATOR)},+
  713. {22,0,$(!REG_VT_MULTI_SZ),$(!ALD32CREATOR)},+
  714. {23,0,$(!REG_VT_MULTI_SZ),$(!ALD33CREATOR)},+
  715. {24,0,$(!REG_VT_MULTI_SZ),$(!MORECREATOR)},+
  716. {25,0,$(!REG_VT_MULTI_SZ),$(!FOX+CREATOR)},+
  717. {26,0,$(!REG_VT_MULTI_SZ),$(!ALD41CREATOR)},+
  718. {27,0,$(!REG_VT_MULTI_SZ),$(!ALD42CREATOR)},+
  719. {28,0,$(!REG_VT_MULTI_SZ),$(!ALD43CREATOR)},+
  720. {29,0,$(!REG_VT_MULTI_SZ),$(!ARTZCREATOR)},+
  721. {30,0,$(!REG_VT_MULTI_SZ),$(!SIT!CREATOR)},+
  722. {31,0,$(!REG_VT_MULTI_SZ),$(!PPT2CREATOR)},+
  723. {32,0,$(!REG_VT_MULTI_SZ),$(!PPT3CREATOR)},+
  724. {33,0,$(!REG_VT_MULTI_SZ),$(!L123CREATOR)},+
  725. {34,0,$(!REG_VT_MULTI_SZ),$(!LMANCREATOR)},+
  726. {35,0,$(!REG_VT_MULTI_SZ),$(!TTXTCREATOR)},+
  727. {5000,0,$(!REG_VT_MULTI_SZ),$(!FOXX1CREATOR)},+
  728. {5001,0,$(!REG_VT_MULTI_SZ),$(!FOXX2CREATOR)},+
  729. {5002,0,$(!REG_VT_MULTI_SZ),$(!FOXX3CREATOR)},+
  730. {5003,0,$(!REG_VT_MULTI_SZ),$(!FOXX4CREATOR)},+
  731. {5004,0,$(!REG_VT_MULTI_SZ),$(!FOXX5CREATOR)},+
  732. {5005,0,$(!REG_VT_MULTI_SZ),$(!FOXX6CREATOR)},+
  733. {5006,0,$(!REG_VT_MULTI_SZ),$(!FOXX7CREATOR)},+
  734. {5007,0,$(!REG_VT_MULTI_SZ),$(!FOXX8CREATOR)},+
  735. {5008,0,$(!REG_VT_MULTI_SZ),$(!FOXX9CREATOR)},+
  736. {5009,0,$(!REG_VT_MULTI_SZ),$(!FOXX10CREATOR)},+
  737. {5010,0,$(!REG_VT_MULTI_SZ),$(!FOXX11CREATOR)},+
  738. {5011,0,$(!REG_VT_MULTI_SZ),$(!FOXX12CREATOR)},+
  739. {5012,0,$(!REG_VT_MULTI_SZ),$(!FOXX13CREATOR)},+
  740. {5013,0,$(!REG_VT_MULTI_SZ),$(!FOXX14CREATOR)},+
  741. {5014,0,$(!REG_VT_MULTI_SZ),$(!FOXX15CREATOR)},+
  742. {5015,0,$(!REG_VT_MULTI_SZ),$(!FOXX16CREATOR)},+
  743. {5100,0,$(!REG_VT_MULTI_SZ),$(!MSWD3CREATOR)},+
  744. {5101,0,$(!REG_VT_MULTI_SZ),$(!MSWD4CREATOR)}}
  745. Shell $(UtilInf),AddValueList,$(KeyTypeCreator),$(NewValueList)
  746. ifint $(ShellCode) != 0
  747. goto ShellCodeError
  748. endif
  749. set RegistryErrorIndex = $($R0)
  750. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  751. CloseRegKey $(McProductKey)
  752. CloseRegKey $(McNetRuleKey)
  753. CloseRegKey $(McServiceKey)
  754. CloseRegKey $(McParameters)
  755. CloseRegKey $(McLinkageKey)
  756. goto fatalregistry
  757. endif
  758. ; Set Extensions
  759. read-syms ExtensionIds
  760. Set NewValueList = +
  761. {{XLC,0,$(!REG_VT_MULTI_SZ),$(XCEL1ID)},+
  762. {XLS,0,$(!REG_VT_MULTI_SZ),$(XCEL2ID)},+
  763. {XLM,0,$(!REG_VT_MULTI_SZ),$(XCEL3ID)},+
  764. {XLW,0,$(!REG_VT_MULTI_SZ),$(XCEL4ID)},+
  765. {XLA,0,$(!REG_VT_MULTI_SZ),$(XCEL5ID)},+
  766. {XLT,0,$(!REG_VT_MULTI_SZ),$(XCEL6ID)},+
  767. {SLK,0,$(!REG_VT_MULTI_SZ),$(XCEL7ID)},+
  768. {WKS,0,$(!REG_VT_MULTI_SZ),$(XCEL8ID)},+
  769. {WK1,0,$(!REG_VT_MULTI_SZ),$(XCEL9ID)},+
  770. {CSV,0,$(!REG_VT_MULTI_SZ),$(XCEL10ID)},+
  771. {DIF,0,$(!REG_VT_MULTI_SZ),$(XCEL11ID)},+
  772. {DOC,0,$(!REG_VT_MULTI_SZ),$(MSWD1ID)},+
  773. {MCW,0,$(!REG_VT_MULTI_SZ),$(MSWD1ID)},+
  774. {WRD,0,$(!REG_VT_MULTI_SZ),$(MSWD2ID)},+
  775. {RTF,0,$(!REG_VT_MULTI_SZ),$(MSWD2ID)},+
  776. {STY,0,$(!REG_VT_MULTI_SZ),$(MSWD2ID)},+
  777. {GLY,0,$(!REG_VT_MULTI_SZ),$(MSWD2ID)},+
  778. {TXT,0,$(!REG_VT_MULTI_SZ),$(MSWD2ID)},+
  779. {MPP,0,$(!REG_VT_MULTI_SZ),$(MSPJ1ID)},+
  780. {MPX,0,$(!REG_VT_MULTI_SZ),$(MSPJ2ID)},+
  781. {MPC,0,$(!REG_VT_MULTI_SZ),$(MSPJ3ID)},+
  782. {MPV,0,$(!REG_VT_MULTI_SZ),$(MSPJ4ID)},+
  783. {MPW,0,$(!REG_VT_MULTI_SZ),$(MSPJ5ID)},+
  784. {MPT,0,$(!REG_VT_MULTI_SZ),$(MSPJ6ID)},+
  785. {PM4,0,$(!REG_VT_MULTI_SZ),$(ALD41ID)},+
  786. {PT4,0,$(!REG_VT_MULTI_SZ),$(ALD42ID)},+
  787. {TEM,0,$(!REG_VT_MULTI_SZ),$(ALD42ID)},+
  788. {TPL,0,$(!REG_VT_MULTI_SZ),$(ALD42ID)},+
  789. {TIF,0,$(!REG_VT_MULTI_SZ),$(ALD43ID)},+
  790. {RDY,0,$(!REG_VT_MULTI_SZ),$(MOREID)},+
  791. {PUB,0,$(!REG_VT_MULTI_SZ),$(ALD31ID)},+
  792. {EPS,0,$(!REG_VT_MULTI_SZ),$(ARTZID)},+
  793. {SIT,0,$(!REG_VT_MULTI_SZ),$(SIT!ID)},+
  794. {PPT,0,$(!REG_VT_MULTI_SZ),$(PPT3ID)},+
  795. {WK3,0,$(!REG_VT_MULTI_SZ),$(L123ID)},+
  796. {UAM,0,$(!REG_VT_MULTI_SZ),$(TTXTID)},+
  797. {EXE,0,$(!REG_VT_MULTI_SZ),$(LMANID)},+
  798. {DLL,0,$(!REG_VT_MULTI_SZ),$(LMANID)},+
  799. {COM,0,$(!REG_VT_MULTI_SZ),$(LMANID)},+
  800. {BAT,0,$(!REG_VT_MULTI_SZ),$(LMANID)},+
  801. {CMD,0,$(!REG_VT_MULTI_SZ),$(LMANID)},+
  802. {SYS,0,$(!REG_VT_MULTI_SZ),$(LMANID)},+
  803. {DBF,0,$(!REG_VT_MULTI_SZ),$(FOXX1ID)},+
  804. {FPT,0,$(!REG_VT_MULTI_SZ),$(FOXX2ID)},+
  805. {IDX,0,$(!REG_VT_MULTI_SZ),$(FOXX3ID)},+
  806. {CDX,0,$(!REG_VT_MULTI_SZ),$(FOXX4ID)},+
  807. {PRG,0,$(!REG_VT_MULTI_SZ),$(FOXX5ID)},+
  808. {FRX,0,$(!REG_VT_MULTI_SZ),$(FOXX6ID)},+
  809. {FRT,0,$(!REG_VT_MULTI_SZ),$(FOXX7ID)},+
  810. {LBX,0,$(!REG_VT_MULTI_SZ),$(FOXX8ID)},+
  811. {LBT,0,$(!REG_VT_MULTI_SZ),$(FOXX9ID)},+
  812. {SCX,0,$(!REG_VT_MULTI_SZ),$(FOXX10ID)},+
  813. {SCT,0,$(!REG_VT_MULTI_SZ),$(FOXX11ID)},+
  814. {MNX,0,$(!REG_VT_MULTI_SZ),$(FOXX12ID)},+
  815. {MNT,0,$(!REG_VT_MULTI_SZ),$(FOXX13ID)},+
  816. {QPR,0,$(!REG_VT_MULTI_SZ),$(FOXX14ID)},+
  817. {PJX,0,$(!REG_VT_MULTI_SZ),$(FOXX15ID)},+
  818. {PJT,0,$(!REG_VT_MULTI_SZ),$(FOXX16ID)}}
  819. Shell $(UtilInf),AddValueList,$(KeyExtensions),$(NewValueList)
  820. ifint $(ShellCode) != 0
  821. goto ShellCodeError
  822. endif
  823. set RegistryErrorIndex = $($R0)
  824. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  825. CloseRegKey $(McProductKey)
  826. CloseRegKey $(McNetRuleKey)
  827. CloseRegKey $(McServiceKey)
  828. CloseRegKey $(McParameters)
  829. CloseRegKey $(McLinkageKey)
  830. goto fatalregistry
  831. endif
  832. Ifstr(i) $(NTFSVolExists) == TRUE
  833. Ifstr(i) $(!UamCopyStatus) == TRUE
  834. Shell "" DoUAMInstall "INSTALL"
  835. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  836. Goto ShellCodeError
  837. EndIf
  838. EndIf
  839. EndIf
  840. ; set ClearText for password to ON per Jameelh - ramc
  841. SetRegValue $(McParameters) {ServerOptions,0,$(!REG_VT_DWORD),3}
  842. ; close the registry keys
  843. CloseRegKey $(McProductKey)
  844. CloseRegKey $(McNetRuleKey)
  845. CloseRegKey $(McServiceKey)
  846. CloseRegKey $(McParameters)
  847. CloseRegKey $(McLinkageKey)
  848. CloseRegKey $(KeyTypeCreator)
  849. CloseRegKey $(KeyExtensions)
  850. CloseRegKey $(KeyIcons)
  851. CloseRegKey $(KeyVolumeList)
  852. Set Afp_DependList = {"+TDI"}
  853. Set FLibraryErrCtl = 1
  854. Shell $(UtilInf) CreateService,+
  855. $(ProductAFPSRVRName),$(ProductAFPSRVRDisplayName),+
  856. $(ProductAFPSRVRImagePath),"system",+
  857. "Network", $(Afp_DependList),"",+
  858. $(ProductAFPSRVREventDll)
  859. Set FLibraryErrCtl = 0
  860. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  861. goto ShellCodeError
  862. endif
  863. set RegistryErrorIndex = $($R0)
  864. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  865. goto fatalregistry
  866. endif
  867. Set AfpSrvSvcKey = $($R1)
  868. ; Add the performance data to the MacSrv\performance service key
  869. Shell "" CreatePerfKey $(AfpSrvSvcKey) $(AfpPerfLibraryName) +
  870. $(AfpCounterFileName) $(AfpPerfOpenFunction) +
  871. $(AfpPerfCloseFunction) $(AfpPerfCollectFunction)
  872. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  873. Set RegistryErrorIndex = $($R1)
  874. goto fatalregistry
  875. EndIf
  876. ; Add the performance dll to the EventLog
  877. Shell "" CreateEventLogKey $(AfpEventLogName) $(AfpPerfLibraryName)
  878. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  879. Set RegistryErrorIndex = $($R1)
  880. goto fatalregistry
  881. EndIf
  882. CloseRegKey $($R1)
  883. CloseRegKey $($R2)
  884. CloseRegKey $($R3)
  885. ; WRITE Private Profile String in NTNET.INI
  886. Set IniFile = $(NtNetIniFileName)
  887. Set IniString = $(AfpMgrCplFile)
  888. Set IniSection = $(SrvMgrIniSection)
  889. Set FLibraryErrCtl = 1
  890. LibraryProcedure IniStatus $(!UTILHANDLE) WriteAfpMgrIniStrings, $(IniSection), $(IniString), $(IniFile)
  891. Set FLibraryErrCtl = 0
  892. ifstr(i) $(IniStatus) == "FAILED"
  893. read-syms AFPString3$(!STF_LANGUAGE)
  894. shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  895. EndIf
  896. ; Do the same thing for File Manager
  897. Set IniFile = $(WinFileIniFileName)
  898. Set IniString = $(AfpMgrCplFile)
  899. Set IniSection = $(WinFileIniSection)
  900. Set FLibraryErrCtl = 1
  901. LibraryProcedure IniStatus $(!UTILHANDLE) WriteAfpMgrIniStrings, $(IniSection), $(IniString), $(IniFile)
  902. Set FLibraryErrCtl = 0
  903. ifstr(i) $(IniStatus) == "FAILED"
  904. read-syms AFPString2$(!STF_LANGUAGE)
  905. shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  906. EndIf
  907. Set ThisOption = MACPRINT
  908. Set REMOVE_SOFTWARE = >($(REMOVE_SOFTWARE), $(Product$(ThisOption)Name))
  909. Set FLibraryErrCtl = 1
  910. Shell $(UtilInf), AddSoftwareComponent, +
  911. $(Manufacturer), +
  912. $(Product$(ThisOption)Name), +
  913. $(Product$(ThisOption)Name),+
  914. $(Product$(ThisOption)DisplayName), +
  915. $(ProductFullInfName), +
  916. $(Product$(ThisOption)ImagePath),+
  917. "serviceauto", "", +
  918. {"AppleTalk", "Spooler"},"",+
  919. $(Product$(ThisOption)EventDll) "", +
  920. "Application", ""
  921. Set FLibraryErrCtl = 0
  922. ifint $(ShellCode) != 0
  923. goto ShellCodeError
  924. EndIf
  925. set RegistryErrorIndex = $($R0)
  926. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  927. CloseRegKey $($R1)
  928. CloseRegKey $($R2)
  929. CloseRegKey $($R3)
  930. CloseRegKey $($R4)
  931. CloseRegKey $($R5)
  932. goto fatalregistry
  933. EndIf
  934. ;
  935. ; At this point:
  936. ; $R1 contains the product version key handle;
  937. ; $R2 contains the NetRules subkey handle;
  938. ; $R3 contains the new Services key handle; and
  939. ; $R4 contains the Parameters key
  940. ;
  941. Set MpProductKey = $($R1)
  942. Set MpNetRuleKey = $($R2)
  943. Set MpServiceKey = $($R3)
  944. Set MpParameters = $($R4)
  945. Set MpLinkageKey = $($R5)
  946. set NewValueList = +
  947. {{SoftwareType,0,$(!REG_VT_SZ),$(Product$(ThisOption)Type)},+
  948. {Title,0,$(!REG_VT_SZ),$(Product$(ThisOption)Title)},+
  949. {Description,0,$(!REG_VT_SZ),$(Product$(ThisOption)Description)},+
  950. {PathName,$(NoTitle),$(!REG_VT_SZ),"%SystemRoot%\system32"},+
  951. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(Product$(ThisOption)Name)},+
  952. {Hidden,0,$(!REG_VT_DWORD),1},+
  953. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  954. Shell $(UtilInf),AddValueList,$(MpProductKey),$(NewValueList)
  955. ifint $(ShellCode) != 0
  956. goto ShellCodeError
  957. EndIf
  958. set RegistryErrorIndex = $($R0)
  959. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  960. CloseRegKey $(MpProductKey)
  961. CloseRegKey $(MpNetRuleKey)
  962. CloseRegKey $(MpServiceKey)
  963. CloseRegKey $(MpParameters)
  964. CloseRegKey $(MpLinkageKey)
  965. goto fatalregistry
  966. EndIf
  967. set NewValueList = {{InfOption,0,$(!REG_VT_SZ),$(ThisOption)}, +
  968. {Infname,0,$(!REG_VT_SZ),$(ProductFullInfName)}}
  969. Shell $(UtilInf), AddValueList, $(MpNetRuleKey), $(NewValueList)
  970. ifint $(ShellCode) != 0
  971. goto ShellCodeError
  972. EndIf
  973. set RegistryErrorIndex = $($R0)
  974. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  975. CloseRegKey $(MpProductKey)
  976. CloseRegKey $(MpNetRuleKey)
  977. CloseRegKey $(MpParameters)
  978. CloseRegKey $(MpLinkageKey)
  979. CloseRegKey $(MpServiceKey)
  980. goto fatalregistry
  981. EndIf
  982. set NewValueList = {{OtherDependencies,0,$(!REG_VT_MULTI_SZ),{"AppleTalk"}}}
  983. Shell $(UtilInf), AddValueList $(MpLinkageKey), $(NewValueList)
  984. ifint $(ShellCode) != 0
  985. goto ShellCodeError
  986. EndIf
  987. set RegistryErrorIndex = $($R0)
  988. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  989. CloseRegKey $(MpProductKey)
  990. CloseRegKey $(MpNetRuleKey)
  991. CloseRegKey $(MpParameters)
  992. CloseRegKey $(MpLinkageKey)
  993. CloseRegKey $(MpServiceKey)
  994. goto fatalregistry
  995. EndIf
  996. ; Close all keys
  997. CloseRegKey $(MpProductKey)
  998. CloseRegKey $(MpNetRuleKey)
  999. CloseRegKey $(MpParameters)
  1000. CloseRegKey $(MpLinkageKey)
  1001. CloseRegKey $(MpServiceKey)
  1002. ; Add additional EventLogging Entries for MacPrint
  1003. Set MacPrintEventLogKey = $(!EventLogKey)"\"$(ThisOption)
  1004. OpenRegKey $(!REG_H_LOCAL) "" $(MacPrintEventLogKey) $(!ACCESS) MacEvntLogKey
  1005. ifstr(i) $(MacEvntLogKey) != $(!KeyNull)
  1006. Set EventFile = $(ProductMACPRINTEventDll)
  1007. Set NewValueList = +
  1008. {{CategoryMessageFile,0,$(!REG_VT_EXPAND_SZ),$(EventFile)}, +
  1009. {CategoryCount,0,$(!REG_VT_DWORD),5}}
  1010. Shell $(UtilInf) AddValueList, $(MacEvntLogKey), $(NewValueList)
  1011. ifint $(ShellCode) != 0
  1012. goto ShellCodeError
  1013. EndIf
  1014. set RegistryErrorIndex = $($R0)
  1015. CloseRegKey $(MacEvntLogKey)
  1016. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1017. goto fatalregistry
  1018. EndIf
  1019. Else
  1020. read-syms MacPrintString2$(!STF_LANGUAGE)
  1021. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1022. EndIf
  1023. ; Add the AppleTalk Print Monitor Stuff only if it was not installed
  1024. ; by the AppleTalk installer.
  1025. ifstr(i) $(PrintMonInstalled) == FALSE
  1026. Set AddMonStatus = ""
  1027. Set FLibraryErrCtl = 1
  1028. LibraryProcedure AddMonStatus $(!UTILHANDLE) SfmAddPrintMonitor $(!AtalkMonName)
  1029. Set FLibraryErrCtl = 0
  1030. ifstr(i) $(AddMonStatus) == "FAILED"
  1031. read-syms MacPrintString4$(!STF_LANGUAGE)
  1032. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1033. EndIf
  1034. ; Set up Event Loggin for the AppleTalk Monitor
  1035. OpenRegKey $(!REG_H_LOCAL) "" $(!EventLogKey) $(!ACCESS) EvntLogKey
  1036. ifstr(i) $(EvntLogKey) != $(!KeyNull)
  1037. CreateRegKey $(EvntLogKey) +
  1038. {$(!AtalkMonEventLogName),0,GenericClass} "" +
  1039. $(!ACCESS) "" AtalkMonKey
  1040. Set EventFile = "%SystemRoot%\system32\sfmmon.dll"
  1041. Set NewValueList = +
  1042. {{CategoryMessageFile,0,$(!REG_VT_EXPAND_SZ),$(EventFile)},+
  1043. {EventMessageFile,0,$(!REG_VT_EXPAND_SZ),$(EventFile)},+
  1044. {CategoryCount,0,$(!REG_VT_DWORD),4},+
  1045. {TypesSupported,0,$(!REG_VT_DWORD),7}}
  1046. Shell $(UtilInf) AddValueList $(AtalkMonKey) $(NewValueList)
  1047. ifint $(ShellCode) != 0
  1048. goto ShellCodeError
  1049. EndIf
  1050. set RegistryErrorIndex = $($R0)
  1051. CloseRegKey $(AtalkMonKey)
  1052. CloseRegKey $(EvntLogKey)
  1053. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1054. goto fatalregistry
  1055. EndIf
  1056. Else
  1057. read-syms MacPrintString10$(!STF_LANGUAGE)
  1058. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1059. EndIf
  1060. EndIf
  1061. ; Install PSTODIB Stuff
  1062. Set PrintProcDir = ""
  1063. Set FLibraryErrCtl = 1
  1064. LibraryProcedure PrintProcDir $(!UTILHANDLE) GetPrintProcDir
  1065. Set FLibraryErrCtl = 0
  1066. ifstr(i) $(PrintProcDir) == "FAILED"
  1067. read-syms MacPrintString6$(!STF_LANGUAGE)
  1068. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1069. goto pstodibdone
  1070. Endif
  1071. ; Copy PSPRINT.DLL to the Print Processor Directory
  1072. Set !PrintProcDir = $(PrintProcDir)
  1073. install "Install-PSPrint"
  1074. ; Call AddPrintProcessor to add the PrintProcessor to system
  1075. Set FLibraryErrCtl = 1
  1076. LibraryProcedure Status $(!UTILHANDLE) AddPrintProc $(PSprintProcFile) $(PSprintProc)
  1077. Set FLibraryErrCtl = 0
  1078. ifstr(i) $(Status) != SUCCESS
  1079. read-syms MacPrintString3$(!STF_LANGUAGE)
  1080. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1081. EndIf
  1082. pstodibdone = +
  1083. install "Install-WinFile-Icon"
  1084. EndWait
  1085. FreeLibrary $(!UTILHANDLE)
  1086. Shell $(SubInf) PopBillBoard
  1087. goto successful
  1088. ;=============================Install Section End=========================
  1089. ;=============================Configure Section Begin=========================
  1090. Configuresfm = +
  1091. OpenRegKey $(!REG_H_LOCAL) "" $(!ProductKeyLinkage) $(!ACCESS) LinkageKey
  1092. ifstr(i) $(LinkageKey) != $(!KeyNull)
  1093. GetRegValue $(LinkageKey) "Bind" BindList
  1094. ifstr(i) $(BindList) == ""
  1095. read-syms AtalkString3$(!STF_LANGUAGE)
  1096. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1097. goto endconfigui
  1098. endif
  1099. else
  1100. Set RegistryErrorIndex = $($R0)
  1101. goto fatalregistry
  1102. EndIf
  1103. LoadLibrary "x" $(!STF_CWDDIR)sfmatcfg.dll ATHANDLE
  1104. Set FLibraryErrCtl = 1
  1105. Set atcfgresult = ""
  1106. Debug-Output "SFMSETUP: SFMUnattended"$(SFMUnattended)
  1107. Debug-Output "SFMSETUP: IsInitialInstall"$(IsInitialInstall)
  1108. LibraryProcedure atcfgresult, $(ATHANDLE),EnterAtalkConfigDLL $(!STF_HWND) $(IsInitialInstall) $(SFMUnattended)
  1109. FreeLibrary $(ATHANDLE)
  1110. endconfigui = +
  1111. Set CommonStatus = STATUS_USERCANCEL
  1112. goto usercancel
  1113. ;=============================Configure Section End=========================
  1114. ;=============================Bindings Section Begin=========================
  1115. Bindingssfm = +
  1116. Set DefaultPortRemoved = FALSE
  1117. ; remove all service dependencies of AppleTalk on Adapters (leaving only
  1118. ; the group dependency). This is needed so that if there are two net cards
  1119. ; on the system and one fails to load (docking station scenario), then
  1120. ; AppleTalk will still be able to start.
  1121. Shell "" RemoveAllServiceDependencies "AppleTalk"
  1122. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\AppleTalk\Linkage" $(!ACCESS) LinkageKey
  1123. Ifstr(i) $(LinkageKey) == $(!KeyNull)
  1124. Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1125. Goto fatalregistry
  1126. Endif
  1127. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\AppleTalk\Parameters" $(!ACCESS) BindParmKey
  1128. Ifstr(i) $(BindParmKey) == $(!KeyNull)
  1129. Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1130. Goto fatalregistry
  1131. Endif
  1132. Set BindList = {}
  1133. Set ExportList = {}
  1134. Set RouteList = {}
  1135. GetRegValue $(LinkageKey) "Bind" BindList
  1136. GetRegValue $(LinkageKey) "Export" ExportList
  1137. GetRegValue $(LinkageKey) "Route" RouteList
  1138. GetRegValue $(LinkageKey) "Exclude" ExcludeList
  1139. QueryListSize BindCount $(BindList)
  1140. IfInt $(BindCount) == 0
  1141. Goto endbinding
  1142. Endif
  1143. set NewBindList = {}
  1144. set NewExportList = {}
  1145. set NewRouteList = {}
  1146. ForListDo *($(BindList),4)
  1147. Split-String $($), "\", BindInfo
  1148. set NewBindList = >($(NewBindList), *($(BindInfo),4))
  1149. EndForListDo
  1150. Debug-Output "OEMNSVSM.INF: Review bindings NewBindList "$(NewBindList)
  1151. ForListDo *($(ExportList),4)
  1152. set NewExportList = >($(NewExportList), $($))
  1153. EndForListDo
  1154. ForListDo *($(RouteList),4)
  1155. set NewRouteList = >($(NewRouteList), $($))
  1156. EndForListDo
  1157. ForListDo *($(ExcludeList),4)
  1158. set NewExcludeList = >($(NewExcludeList), $($))
  1159. EndForListDo
  1160. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\AppleTalk\Adapters" $(!ACCESS) AdapterKey
  1161. Ifstr(i) $(AdapterKey) == $(!KeyNull)
  1162. Set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1163. Goto fatalregistry
  1164. Endif
  1165. set AdapterList = ""
  1166. EnumRegKey $(AdapterKey) AdapterList
  1167. Set AtalkAdapterList = {}
  1168. ForListDo $(AdapterList)
  1169. Set AtalkAdapterList = >($(AtalkAdapterList), *($($),1))
  1170. EndForListDo
  1171. QueryListSize AdapterCount $(AtalkAdapterList)
  1172. Set fAddingFirstAdapter = FALSE
  1173. ifint $(AdapterCount) == 0
  1174. Set fAddingFirstAdapter = TRUE
  1175. EndIf
  1176. Set NewBindings = ""
  1177. Set TobeUsedBindList = {}
  1178. Set TobeUsedExportList = {}
  1179. Set TobeUsedRouteList = {}
  1180. ForListDo $(NewBindList)
  1181. IfContains(i) $($) not-in $(AtalkAdapterList)
  1182. Set NewBindings = TRUE
  1183. Set TobeUsedBindList = >($(TobeUsedBindList),"\Device\"$($))
  1184. Set TobeUsedExportList = >($(TobeUsedExportList),*($(NewExportList),$(#)))
  1185. Set TobeUsedRouteList = >($(TobeUsedRouteList),*($(NewRouteList),$(#)))
  1186. Shell "" CreateAtalkConfig $($) $(AdapterKey)
  1187. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1188. CloseRegKey $(AdapterKey)
  1189. Set RegistryErrorIndex = $($R1)
  1190. goto fatalregistry
  1191. EndIf
  1192. Else
  1193. Set TobeUsedBindList = >($(TobeUsedBindList),"\Device\"$($))
  1194. Set TobeUsedExportList = >($(TobeUsedExportList),*($(NewExportList),$(#)))
  1195. Set TobeUsedRouteList = >($(TobeUsedRouteList),*($(NewRouteList),$(#)))
  1196. Endif
  1197. EndForListDo
  1198. set NewValueList = {{Bind,0,$(!REG_VT_MULTI_SZ),$(TobeUsedBindList)}, +
  1199. {Export,0,$(!REG_VT_MULTI_SZ),$(TobeUsedExportList)}, +
  1200. {Route,0,$(!REG_VT_MULTI_SZ),$(TobeUsedRouteList)}}
  1201. Ifstr(i) $(NewBindings) == TRUE
  1202. Shell $(UtilInf), AddValueList, $(LinkageKey), $(NewValueList)
  1203. set RegistryErrorIndex = $($R0)
  1204. CloseRegKey $(LinkageKey)
  1205. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1206. goto fatalregistry
  1207. EndIf
  1208. EndIf
  1209. ; Add the Default Port
  1210. Set DefaultPort = {}
  1211. Set MediaTypeList = {}
  1212. GetRegValue $(BindParmKey) "DefaultPort" DefaultPort
  1213. Ifstr(i) $(DefaultPort) != {}
  1214. goto removeadapters
  1215. EndIf
  1216. finddefaultport = +
  1217. ForListDo $(TobeUsedBindList)
  1218. Split-String $($) "\" PortName
  1219. Shell "" FindMediaType *($(PortName),4)
  1220. Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  1221. Set MediaTypeList = >($(MediaTypeList), $($R1))
  1222. EndIf
  1223. EndForListDo
  1224. Ifcontains(i) "1" in $(MediaTypeList)
  1225. ForListDo $(MediaTypeList)
  1226. Ifint $($) == 1
  1227. Set DefaultPort = *($(TobeUsedBindList),$(#))
  1228. goto defportdone
  1229. EndIf
  1230. EndForListDo
  1231. else-ifcontains(i) "2" in $(MediaTypeList)
  1232. ForListDo $(MediaTypeList)
  1233. Ifint $($) == 2
  1234. Set DefaultPort = *($(TobeUsedBindList),$(#))
  1235. goto defportdone
  1236. EndIf
  1237. EndForListDo
  1238. else-ifcontains(i) "3" in $(MediaTypeList)
  1239. ForListDo $(MediaTypeList)
  1240. Ifint $($) == 3
  1241. Set DefaultPort = *($(TobeUsedBindList),$(#))
  1242. goto defportdone
  1243. EndIf
  1244. EndForListDo
  1245. else-ifcontains(i) "4" in $(MediaTypeList)
  1246. ForListDo $(MediaTypeList)
  1247. Ifint $($) == 4
  1248. Set DefaultPort = *($(TobeUsedBindList),$(#))
  1249. goto defportdone
  1250. EndIf
  1251. EndForListDo
  1252. else-ifcontains(i) "5" in $(MediaTypeList)
  1253. Set DefaultPort = *($(TobeUsedBindList),1)
  1254. else
  1255. read-syms NoAdaptersFound$(!STF_LANGUAGE)
  1256. Shell $(SubInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(ErrorString)
  1257. Set DefaultPort = ""
  1258. Set NewValueList = {{DefaultPort,0,$(!REG_VT_SZ),$(DefaultPort)}}
  1259. Shell $(UtilInf), AddValueList, $(BindParmKey), $(NewValueList)
  1260. set RegistryErrorIndex = $($R0)
  1261. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1262. goto fatalregistry
  1263. EndIf
  1264. goto endbinding
  1265. Endif
  1266. defportdone = +
  1267. Set NewValueList = {{DefaultPort,0,$(!REG_VT_SZ),$(DefaultPort)}}
  1268. Shell $(UtilInf), AddValueList, $(BindParmKey), $(NewValueList)
  1269. set RegistryErrorIndex = $($R0)
  1270. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1271. goto fatalregistry
  1272. EndIf
  1273. goto startconfig
  1274. removeadapters = +
  1275. Split-String *($(DefaultPort),4) "\" PortName
  1276. Debug-Output "OEMNSVSM.INF:Review Bindings PortName "*($(PortName),4)
  1277. ForListDo $(AtalkAdapterList)
  1278. Debug-Output "OEMNSVSM.INF:Review Bindings Adapter "$($)
  1279. Ifcontains(i) $($) not-in $(NewBindList)
  1280. DeleteRegKey $(AdapterKey) $($)
  1281. Ifstr(i) $($) == *($(PortName),4)
  1282. read-syms RemoveDefaultPort$(!STF_LANGUAGE)
  1283. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(ErrorString)
  1284. Set DefaultPortRemoved = TRUE
  1285. goto finddefaultport
  1286. Endif
  1287. EndIf
  1288. EndForListDo
  1289. ; if this is the first time configuration start appletalk and launch config
  1290. ; if the default port has been removed and other adapters are available
  1291. ; start appletalk
  1292. startconfig = +
  1293. Set DoConfig = 0
  1294. GetRegValue $(BindParmKey) "InitialInstall" DoConfig
  1295. Set IsInitialInstall = *($(DoConfig),4)
  1296. Set DoUnattended = 0
  1297. GetRegValue $(BindParmKey) "Unattended" DoUnattended
  1298. Set SFMUnattended = *($(DoUnattended),4)
  1299. Debug-Output "SFMSETUP: SFMUnattended(start config)"$(SFMUnattended)
  1300. Debug-Output "Config State = "$(DoConfig)
  1301. Debug-Output "Unattend State = "$(DoUnattended)
  1302. ifint $(IsInitialInstall) == 1
  1303. goto startsvc
  1304. EndIf
  1305. ifstr(i) $(DefaultPortRemoved) == TRUE
  1306. goto startsvc
  1307. endif
  1308. ifstr(i) $(fAddingFirstAdapter) == TRUE
  1309. goto startsvc
  1310. endif
  1311. goto endbinding
  1312. startsvc = +
  1313. Set FLibraryErrCtl = 1
  1314. read-syms StatusStartingAppleTalk$(!STF_LANGUAGE)
  1315. Shell $(SubInf) PushBillBoard NETSTATUSDLG $(Status)
  1316. StartWait
  1317. Set WaitStarted = 1
  1318. LibraryProcedure START_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), STARTSVC, AppleTalk
  1319. Shell $(SubInf) PopBillBoard
  1320. Set START_STATUS = *($(START_RESULT),1)
  1321. Debug-Output "OEMNSVSM.INF: Start AppleTalk; result was: "$(START_STATUS)
  1322. Ifint $(START_STATUS) != 0
  1323. EndWait
  1324. Set WaitStarted = 0
  1325. LibraryProcedure START_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), ERRORMSG, $(START_STATUS)
  1326. Set ATALK_ERROR_MESSAGE = *($(START_RESULT),2)
  1327. read-syms CannotStartAtalk$(!STF_LANGUAGE)
  1328. Set ErrorString = $(ATALK_ERROR_MESSAGE)$(ErrorSuffix)
  1329. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(ErrorString)
  1330. Else
  1331. ; start the afd driver
  1332. LibraryProcedure START_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), STARTSVC, Afd
  1333. Set START_STATUS = *($(START_RESULT),1)
  1334. Debug-Output "OEMNSVSM.INF: Start Afd result was: "$(START_STATUS)
  1335. Ifint $(START_STATUS) != 0
  1336. EndWait
  1337. Set WaitStarted = 0
  1338. LibraryProcedure START_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), ERRORMSG, $(START_STATUS)
  1339. Set ATALK_ERROR_MESSAGE = *($(START_RESULT),2)
  1340. read-syms CannotStartAfd$(!STF_LANGUAGE)
  1341. Set ErrorString = $(ATALK_ERROR_MESSAGE)$(ErrorSuffix)
  1342. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(ErrorString)
  1343. goto endbinding
  1344. EndIf
  1345. ; Now start the NDIS group.
  1346. LibraryProcedure START_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), STARTSVC, +NDIS
  1347. Set START_STATUS = *($(START_RESULT),1)
  1348. Debug-Output "OEMNSVSM.INF: Start +NDIS result was: "$(START_STATUS)
  1349. Ifint $(START_STATUS) != 0
  1350. EndWait
  1351. Set WaitStarted = 0
  1352. LibraryProcedure START_RESULT $(!NCPA_HANDLE), CPlSetup $(!STF_HWND), ERRORMSG, $(START_STATUS)
  1353. Set ATALK_ERROR_MESSAGE = *($(START_RESULT),2)
  1354. read-syms CannotStartAtalk$(!STF_LANGUAGE)
  1355. Set ErrorString = $(ATALK_ERROR_MESSAGE)$(ErrorSuffix)
  1356. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(ErrorString)
  1357. goto endbinding
  1358. EndIf
  1359. ; Launch the AppleTalk Transport Configuration
  1360. LoadLibrary "x" $(!STF_CWDDIR)sfmatcfg.dll ATHANDLE
  1361. Set FLibraryErrCtl = 1
  1362. Set atcfgresult = ""
  1363. Debug-Output "SFMSETUP: SFMUnattended(1)"$(SFMUnattended)
  1364. LibraryProcedure atcfgresult, $(ATHANDLE),EnterAtalkConfigDLL $(!STF_HWND) $(IsInitialInstall) $(SFMUnattended)
  1365. FreeLibrary $(ATHANDLE)
  1366. EndWait
  1367. EndIf
  1368. endbinding = +
  1369. ifint $(IsInitialInstall) == 1
  1370. SetRegValue $(BindParmKey) {InitialInstall,0,$(!REG_VT_DWORD),0}
  1371. EndIf
  1372. ifint $(SFMUnattended) == 1
  1373. SetRegValue $(BindParmKey) {Unattended,0,$(!REG_VT_DWORD),0}
  1374. EndIf
  1375. CloseRegKey $(BindParmKey)
  1376. goto end
  1377. ;=============================Bindings Section End=========================
  1378. Removesfm = +
  1379. ; Remove the SMAddons String in regnet.ini. This is done first, because
  1380. ; we remove the util dll in "SfmRemoveFiles". If RemoveFiles failed,
  1381. ; the SMAddons section will be restored to it's former shape.
  1382. Set FLibraryErrCtl = 1
  1383. Ifcontains(i) "MacFile" in $(REMOVE_SOFTWARE)
  1384. Set IniFile = $(NtNetIniFileName)
  1385. Set IniSection = $(SrvMgrIniSection)
  1386. Set Result = ""
  1387. Set FLibraryErrCtl = 1
  1388. LibraryProcedure Result, $(!UTILHANDLE), WriteAfpMgrIniStrings, $(IniSection), NULL, $(IniFile)
  1389. Set FLibraryErrCtl = 0
  1390. ifstr(i) $(Result) == "FAILED"
  1391. endif
  1392. ; Remove the file manager addons also
  1393. Set IniFile = $(WinFileIniFileName)
  1394. Set IniSection = $(WinFileIniSection)
  1395. Set FLibraryErrCtl = 1
  1396. LibraryProcedure Result, $(!UTILHANDLE), WriteAfpMgrIniStrings, $(IniSection), NULL, $(IniFile)
  1397. Set FLibraryErrCtl = 0
  1398. EndIf
  1399. ; Remove OEMNSVSM.INF from the review programs list of NCPA
  1400. Shell "" RemoveInfFromReviewPrograms
  1401. ; remove the WinSock information
  1402. Shell $(UtilInf), RemoveWinsockInfo, $(ProductATALKName)
  1403. ;
  1404. ; Remove rpc
  1405. ;
  1406. Shell "utility.inf" RemoveRpcProtocol ncacn_at_dsp
  1407. ; remove the sfm files
  1408. read-syms StatusRemoveSfm$(!STF_LANGUAGE)
  1409. Shell $(SubInf) PushBillBoard NETSTATUSDLG $(Status)
  1410. Shell "" RemoveSfmFiles "REMOVE"
  1411. Shell $(SubInf) PopBillBoard
  1412. OpenRegKey $(!REG_H_LOCAL) "" $(!ProductKeyBase) $(!ACCESS) ProductKey
  1413. Ifstr $(ProductKey) == $(!KeyNull)
  1414. set RegistryErrorIndex = UNABLE_ACCESS_CONFIGURE_SERVICE
  1415. goto fatalregistry
  1416. endif
  1417. DeleteRegTree $(ProductKey) $(ProductSFMName)
  1418. CloseRegKey $(ProductKey)
  1419. ForListDo $(REMOVE_SOFTWARE)
  1420. debug-output "Removing component: "$($)
  1421. Shell $(UtilInf), RemoveSoftwareComponent, $(Manufacturer), $($)
  1422. EndForListDo
  1423. ForListDo $(REMOVE_SERVICES)
  1424. debug-output "Removing component service: "$($)
  1425. Shell $(UtilInf), RemoveService, $($), "YES"
  1426. EndForListDo
  1427. ; Use Deletemonitor Api
  1428. Ifcontains(i) "MACPRINT" in $(REMOVE_SOFTWARE)
  1429. Set DelMonStatus = ""
  1430. Set FLibraryErrCtl = 1
  1431. LibraryProcedure DelMonStatus $(!UTILHANDLE) SfmDeletePrintMonitor $(!AtalkMonName)
  1432. Set FLibraryErrCtl = 0
  1433. ifstr(i) $(DelMonStatus) == "FAILED"
  1434. read-syms MacPrintString7$(!STF_LANGUAGE)
  1435. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1436. EndIf
  1437. OpenRegKey $(!REG_H_LOCAL) "" $(!EventLogKey) $(!ACCESS) LogKey
  1438. Ifstr(i) $(LogKey) == $(!KeyNull)
  1439. Set RegistryErrorIndex = $($R0)
  1440. goto fatalregistry
  1441. EndIf
  1442. Set AtalkMonKey = $(!AtalkMonEventLogName)
  1443. DeleteRegTree $(LogKey) $(AtalkMonKey)
  1444. Set MacPrintKey = "MACPRINT"
  1445. DeleteRegTree $(LogKey) $(MacPrintKey)
  1446. CloseRegKey $(LogKey)
  1447. ; Delete the PSPRINT Print Processor
  1448. Set DelStatus = ""
  1449. Set FLibraryErrCtl = 1
  1450. LibraryProcedure DelStatus $(!UTILHANDLE) DeletePrintProc "\\"$(!STF_COMPUTERNAME) SFMPSPRT
  1451. Set FLibraryErrCtl = 0
  1452. Ifstr(i) $(DelStatus) == FAILED
  1453. read-syms MacPrintString5$(!STF_LANGUAGE)
  1454. Shell $(SubInf) SetupMessage "NONFATAL" $(ErrorString)
  1455. EndIf
  1456. EndIf
  1457. Ifcontains(i) "AppleTalk" in $(REMOVE_SOFTWARE)
  1458. Shell $(UtilInf) UpdateWinsockService "AppleTalk" FALSE
  1459. EndIf
  1460. Ifstr(i) $($R0) != NO_ERROR
  1461. read-syms AtalkString2$(!STF_LANGUAGE)
  1462. Shell $(SubInf) SetupMessage "NONFATAL" $(ErrorString)
  1463. EndIf
  1464. install "Remove-WinFile-Icon"
  1465. FreeLibrary $(!UTILHANDLE)
  1466. Set FLibraryErrCtl = 1
  1467. LibraryProcedure Status, $(!LIBHANDLE), DelFile $(!STF_CWDDIR)$(UtilDll)
  1468. Set FLibraryErrCtl = 0
  1469. goto end
  1470. Upgradesfm = +
  1471. Debug-Output "In Upgradesfm"
  1472. OpenRegKey $(!REG_H_LOCAL) "" $(!ProductKeyName) $(!ACCESS) KeyProduct
  1473. Ifstr $(KeyProduct) != $(!KeyNull)
  1474. Debug-Output "Opened "$(!ProductKeyName)
  1475. ifstr(i) $(Option) != "SFM"
  1476. ; Bug 45543
  1477. Debug-Output "OEMNSVSM.INF: Not running upgrade on option: "$Option)
  1478. CloseRegKey $(KeyProduct)
  1479. set CommonStatus = STATUS_NOEFFECT
  1480. goto end
  1481. endif
  1482. install "Remove-WinFile-Icon"
  1483. install "Install-WinFile-Icon"
  1484. GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1485. set Version = *($(VersionInfo), 4)
  1486. Split-String $(!NTN_Infname), "\", FilenameList
  1487. QueryListSize ListSize $(FilenameList)
  1488. set !UG_Filename = *($(FilenameList), $(ListSize))
  1489. install Install-Update
  1490. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1491. goto fatal
  1492. endif
  1493. ; load the sfmutil.dll
  1494. LoadLibrary "x" $(!STF_CWDDIR)$(UtilDll) !UTILHANDLE
  1495. ; Update the UAM - copy UAM to correct place and update registry
  1496. Shell "" DoUamInstall "INSTALL"
  1497. FreeLibrary $(!UTILHANDLE)
  1498. ;
  1499. ; between NT 3.1 and 3.5 the adapter numbers have changed from
  1500. ; 0x to X. For example, ELNKII01 has now become ELNKII1.
  1501. ; We have to account for this change, otherwise, the user will
  1502. ; see an alarming popup that the default adapter has been removed
  1503. ; and he may not see the appletalk zones.
  1504. ; Change the AppleTalk adapter numbers from 0x to X
  1505. ; also modify the PortName in each AppleTalk adapter from 0x to X
  1506. ; and modify the DefaultPort parameter from 0x to X
  1507. LoadLibrary "x" $(!STF_CWDDIR)sfmatcfg.dll ATHANDLE
  1508. LibraryProcedure STATUS, $(ATHANDLE), ChangeAdapterNum
  1509. FreeLibrary $(ATHANDLE)
  1510. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1511. Goto ShellCodeError
  1512. EndIf
  1513. ; Add the performance data that was not available in NT Ver 3.10
  1514. ; Add the performance data to the AppleTalk\performance service key
  1515. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductATALKName) +
  1516. $(!ACCESS) AtkSvcKey
  1517. Ifstr $(AtkSvcKey) != $(!KeyNull)
  1518. Shell "" CreatePerfKey $(AtkSvcKey) $(AtalkPerfLibraryName) +
  1519. $(AtalkCounterFileName) $(AtalkPerfOpenFunction) +
  1520. $(AtalkPerfCloseFunction) $(AtalkPerfCollectFunction)
  1521. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1522. CloseRegKey $(AtkSvcKey)
  1523. Set RegistryErrorIndex = $($R1)
  1524. goto fatalregistry
  1525. EndIf
  1526. ; Add the performance dll to the EventLog
  1527. Shell "" CreateEventLogKey $(AtalkEventLogName) +
  1528. $(AtalkPerfLibraryName)
  1529. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1530. CloseRegKey $(AtkSvcKey)
  1531. Set RegistryErrorIndex = $($R1)
  1532. goto fatalregistry
  1533. EndIf
  1534. ; Change group membership to PNP_TDI
  1535. Debug-Output "OEMNSVSM.INF: Changing Group membership."
  1536. SetRegValue $(AtkSvcKey) {Group, $(NoTitle), $(!REG_VT_SZ), "PNP_TDI" }
  1537. ; Get rid of the NDIS dependency in OtherDependencies.
  1538. OpenRegKey $(AtkSvcKey) "" "Linkage" $(!ACCESS) AtkLinkageKey
  1539. Ifstr $(AtkLinkageKey) != $(!KeyNull)
  1540. Debug-Output "OEMNSVSM.INF: Deleting OtherDependencies"
  1541. DeleteRegValue $(AtkLinkageKey) "OtherDependencies"
  1542. CloseRegKey $(AtkLinkageKey)
  1543. Endif
  1544. CloseRegKey $(AtkSvcKey)
  1545. Else
  1546. Debug-Output "OEMNSVSM.INF: error opening ATALK service key."
  1547. EndIf
  1548. ;
  1549. ; add rpc stuff
  1550. ;
  1551. Shell "utility.inf" AddRpcProtocol ncacn_at_dsp rpclt1.dll rpclt1.dll
  1552. ; Add the performance data to the MacSrv\performance service key
  1553. OpenRegKey $(!REG_H_LOCAL) "" +
  1554. $(!NTN_ServiceBase)"\"$(ProductAFPSRVRName) +
  1555. $(!ACCESS) AfpSrvSvcKey
  1556. Ifstr $(AfpSrvSvcKey) != $(!KeyNull)
  1557. Shell "" CreatePerfKey $(AfpSrvSvcKey) $(AfpPerfLibraryName) +
  1558. $(AfpCounterFileName) $(AfpPerfOpenFunction) +
  1559. $(AfpPerfCloseFunction) $(AfpPerfCollectFunction)
  1560. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1561. Set RegistryErrorIndex = $($R1)
  1562. goto fatalregistry
  1563. EndIf
  1564. CloseRegKey $(AfpSrvSvcKey)
  1565. ; Add the performance dll to the EventLog
  1566. Shell "" CreateEventLogKey $(AfpEventLogName) $(AfpPerfLibraryName)
  1567. Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  1568. Set RegistryErrorIndex = $($R1)
  1569. goto fatalregistry
  1570. EndIf
  1571. Else
  1572. Debug-Output "OEMNSVSM.INF: error opening AFPSRV service key."
  1573. EndIf
  1574. ; Fix Atalk Software key values
  1575. set KeyCurrentVersion = ""
  1576. set SoftKeyName = $(!ProductKeyBase)"\"$(ProductATALKName)"\CurrentVersion"
  1577. OpenRegKey $(!REG_H_LOCAL) "" $(SoftKeyName) $(!ACCESS) KeyCurrentVersion
  1578. ifstr $(KeyCurrentVersion) == ""
  1579. Debug-Output "OEMNSVSM.INF: Update Software values: couldn't open "$(SoftKeyName)
  1580. else
  1581. SetRegValue $(KeyCurrentVersion) {Title,0,$(!REG_VT_SZ),$(ProductATALKTitle)}
  1582. SetRegValue $(KeyCurrentVersion) {Description,0,$(!REG_VT_SZ),$(ProductATALKDescription)}
  1583. CloseRegKey $(KeyCurrentVersion)
  1584. endif
  1585. ; Fix MacPrint Software key SoftwareType
  1586. set KeyCurrentVersion = ""
  1587. set MacPrintSoftKeyName = $(!ProductKeyBase)"\"$(ProductMACPRINTName)"\CurrentVersion"
  1588. OpenRegKey $(!REG_H_LOCAL) "" $(MacPrintSoftKeyName) $(!ACCESS) KeyCurrentVersion
  1589. ifstr $(KeyCurrentVersion) == ""
  1590. Debug-Output "OEMNSVSM.INF:UpdateSoftwareType: couldn't open "$(MacPrintSoftKeyName)
  1591. else
  1592. SetRegValue $(KeyCurrentVersion) {SoftwareType, 0, $(!REG_VT_SZ), "service" }
  1593. SetRegValue $(KeyCurrentVersion) {Title,0,$(!REG_VT_SZ),$(ProductMACPRINTTitle)}
  1594. SetRegValue $(KeyCurrentVersion) {Description,0,$(!REG_VT_SZ),$(ProductMACPRINTDescription)}
  1595. CloseRegKey $(KeyCurrentVersion)
  1596. endif
  1597. ; Fix SFM Software key SoftwareType
  1598. set KeyCurrentVersion = ""
  1599. OpenRegKey $(!REG_H_LOCAL) "" $(!ProductKeyName) $(!ACCESS) KeyCurrentVersion
  1600. ifstr $(KeyCurrentVersion) == ""
  1601. Debug-Output "OEMNSVSM.INF:UpdateSoftwareType: couldn't open " $(!ProductKeyName)
  1602. else
  1603. SetRegValue $(KeyCurrentVersion) {SoftwareType, 0, $(!REG_VT_SZ), "service" }
  1604. SetRegValue $(KeyCurrentVersion) {Title,0,$(!REG_VT_SZ),$(ProductSFMTitle)}
  1605. SetRegValue $(KeyCurrentVersion) {Description,0,$(!REG_VT_SZ),$(ProductSFMDescription)}
  1606. ;
  1607. ; Update description and op support
  1608. ;
  1609. SetRegValue $(KeyCurrentVersion) {OperationsSupport,$(NoTitle),$(!REG_VT_DWORD),$(ProductOpSupport)}
  1610. CloseRegKey $(KeyCurrentVersion)
  1611. endif
  1612. ; Add the Spooler dependency to the MacPrint service
  1613. OpenRegKey $(!REG_H_LOCAL) "" +
  1614. $(!NTN_ServiceBase)\$(ProductMACPRINTName) +
  1615. $(!ACCESS) MacPrintSvcKey
  1616. Ifstr $(MacPrintSvcKey) != $(!KeyNull)
  1617. Debug-Output "OEMNSVSM.INF: Changing group dependency of MACPRINT"
  1618. set newDependList = {"Spooler"}
  1619. set TmpList = {}
  1620. GetRegValue $(MacPrintSvcKey) "DependOnService" TmpList
  1621. ifint $(RegLastError) == 0
  1622. Debug-Output "OEMNSVSM.INF old depend List "*($(TmpList), 4)
  1623. ForListDo *($(TmpList),4)
  1624. ifstr(i) $($) != "Spooler"
  1625. set newDependList = >($(newDependList), $($))
  1626. endif
  1627. EndForListDo
  1628. endif
  1629. Debug-Output "OEMNSVSM.INF: new depend List "$(newDependList)
  1630. LibraryProcedure Result, $(!LIBHANDLE), SetupChangeServiceConfig, $(ProductMACPRINTName) $(!SERVICE_NO_CHANGE), $(!SERVICE_NO_CHANGE), $(!SERVICE_NO_CHANGE), "", "", $(newDependList), "", "", ""
  1631. ; Add the OtherDependencies as well
  1632. OpenRegKey $(MacPrintSvcKey) "" "Linkage" $(!ACCESS) LinkageKey
  1633. Ifstr $(LinkageKey) != $(!KeyNull)
  1634. set newDependList = {"Spooler"}
  1635. set TmpList = {}
  1636. GetRegValue $(LinkageKey) "OtherDependencies" TmpList
  1637. Debug-Output "OEMNSVSM.INF: old other depend List "*($(TmpList), 4)
  1638. ifint $(RegLastError) == 0
  1639. ForListDo *($(TmpList),4)
  1640. ifstr(i) $($) != "Spooler"
  1641. set newDependList = >($(newDependList), $($))
  1642. endif
  1643. EndForListDo
  1644. endif
  1645. Debug-Output "OEMNSVSM.INF: new other depend List "$(newDependList)
  1646. SetRegValue $(LinkageKey) {OtherDependencies,0,$(!REG_VT_MULTI_SZ),$(newDependList)}
  1647. CloseRegKey $(LinkageKey)
  1648. else
  1649. Debug-Output "OEMNSVSM.INF: error opening MACPRINT linkage key."
  1650. endif
  1651. CloseRegKey $(MacPrintSvcKey)
  1652. ; Remove the bogus MacFile netrules
  1653. set MacFileNetRules = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductAFPSVCName)"\CurrentVersion\NetRules"
  1654. OpenRegKey $(!REG_H_LOCAL) "" $(MacFileNetRules) $(!ACCESS) NetRuleKey
  1655. Ifstr $(NetRuleKey) != $(!KeyNull)
  1656. Debug-Output "OEMNSVSM.INF: Removing bogus MacFile netrules"
  1657. DeleteRegValue $(NetRuleKey) "type"
  1658. DeleteRegValue $(NetRuleKey) "use"
  1659. CloseRegKey $(NetRuleKey)
  1660. EndIf
  1661. Else
  1662. Debug-Output "OEMNSVSM.INF: error opening MACPRINT service key."
  1663. EndIf
  1664. SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)}
  1665. SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)}
  1666. CloseRegKey $(KeyProduct)
  1667. ;
  1668. ; Delete cache section for NCPA
  1669. ;
  1670. Set MaskAllAccess = 33554432
  1671. Set NewInfName = "oemnsvsm.inf"
  1672. Set CacheKey = "SOFTWARE\Microsoft\Ncpa\InfOptions"
  1673. Set CacheValue = "oemnxpsm.inf"
  1674. OpenRegKey $(!REG_H_LOCAL) "" $(CacheKey) $(MaskAllAccess) Cache
  1675. Ifint $(RegLastError) == $(!REG_ERROR_SUCCESS)
  1676. DeleteRegTree $(Cache) $(CacheValue)
  1677. CloseRegKey $(Cache)
  1678. endif
  1679. ;
  1680. ; remove old inf file, oemnxpsm.inf from Post-Review bindings. This is because the name changed
  1681. ;
  1682. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_SoftwareBase)"\Microsoft\Ncpa\CurrentVersion" $(!ACCESS) NCPA
  1683. ifstr(i) $(NCPA) != $(!KeyNull)
  1684. GetRegValue $(NCPA) "ReviewPrograms" BindList
  1685. ifcontains(i) "OEMNXPSM.INF" in *($(BindList),4)
  1686. debug-output "Removing old inf, oemnxpsm.inf from post-review list"
  1687. ; create a new bind list without the old nf name
  1688. set NewBindList = {}
  1689. ForListDo *($(BindList),4)
  1690. ifstr(i) $($) != "OEMNXPSM.INF"
  1691. set NewBindList = >($(NewBindList), $($))
  1692. else
  1693. ; don't allow duplicates in the list of the new inf name
  1694. ifcontains(i) "OEMNSVSM.INF" not-in *($(BindList),4)
  1695. set NewBindList = >($(NewBindList), "OEMNSVSM.INF")
  1696. endif
  1697. endif
  1698. EndForListDo
  1699. SetRegValue $(NCPA) {"ReviewPrograms", 0, +
  1700. $(!REG_VT_MULTI_SZ),$(NewBindList)}
  1701. endif
  1702. CloseRegKey $(NCPA)
  1703. endif
  1704. ; Upgrade The NetRules Use value for PNP.
  1705. OpenRegKey $(!REG_H_LOCAL) "" +
  1706. $(!NTN_SoftwareBase)"\Microsoft\AppleTalk\CurrentVersion\NetRules" +
  1707. $(!ACCESS) AtalkNetRulesKey
  1708. Ifstr(i) $(AtalkNetRulesKey) != $(!KeyNull)
  1709. SetRegValue $(AtalkNetRulesKey) {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleATALKUse)}
  1710. CloseRegKey $(AtalkNetRulesKey)
  1711. endif
  1712. ; Update winsock mappings
  1713. Shell $(UtilInf) UpdateWinsockMappings $(ProductATALKName) "%SystemRoot%\System32\"$(AtWinSockDll)
  1714. set RegistryErrorIndex = $($R0)
  1715. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1716. Debug-Output "OEMNSVSM.INF: Registry error: Add Winsock Info."
  1717. Endif
  1718. else
  1719. ;
  1720. ;
  1721. ;
  1722. ;
  1723. ;
  1724. OpenRegKey $(!REG_H_LOCAL) "" $(!ProductATALKKeyName) $(!ACCESS) KeyATalkProduct
  1725. ifstr(i) $(KeyATalkProduct) != $(!KeyNull)
  1726. LoadLibrary "x" $(!STF_CWDDIR)sfmutil.dll !UTILHANDLE
  1727. Shell $(UtilInf), RemoveSoftwareComponent, $(Manufacturer), $(ProductATALKName)
  1728. Set DelMonStatus = ""
  1729. Set FLibraryErrCtl = 1
  1730. LibraryProcedure DelMonStatus $(!UTILHANDLE) SfmDeletePrintMonitor $(!AtalkMonName)
  1731. Set FLibraryErrCtl = 0
  1732. ifstr(i) $(DelMonStatus) == "FAILED"
  1733. read-syms AtalkString5$(!STF_LANGUAGE)
  1734. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  1735. EndIf
  1736. OpenRegKey $(!REG_H_LOCAL) "" $(!EventLogKey) $(!ACCESS) LogKey
  1737. Ifstr(i) $(LogKey) != $(!KeyNull)
  1738. Set AtalkMonKey = $(!AtalkMonEventLogName)
  1739. DeleteRegTree $(LogKey) $(AtalkMonKey)
  1740. CloseRegKey $(LogKey)
  1741. endif
  1742. Shell $(UtilInf), RemoveWinsockInfo, $(ProductATALKName)
  1743. Shell "utility.inf" RemoveRpcProtocol ncacn_at_dsp
  1744. FreeLibrary $(!UTILHANDLE)
  1745. CloseRegKey $(KeyATalkProduct)
  1746. else
  1747. Debug-Output "OEMNSVSM.INF: error opening prodcut key."
  1748. Set RegistryErrorIndex = $($R0)
  1749. goto fatalregistry
  1750. endif
  1751. endif
  1752. goto end
  1753. successful = +
  1754. Set Status = STATUS_SUCCESSFUL
  1755. goto end
  1756. fatalregistry = +
  1757. EndWait
  1758. Shell $(UtilInf) RegistryErrorString $(RegistryErrorIndex)
  1759. IfInt $(ShellCode) != 0
  1760. goto ShellCodeError
  1761. Endif
  1762. set Error = $($R0)
  1763. goto fatal
  1764. fatal = +
  1765. Ifint $(BillboardVisible) != 0
  1766. Shell $(SubInf) PopBillboard
  1767. Set BillboardVisible = 0
  1768. Endif
  1769. read-syms MiscErrorString3$(!STF_LANGUAGE)
  1770. Shell $(SubInf) SetupMessage, $(!STF_LANGUAGE), "FATAL",$(ErrorString)$(Error)
  1771. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1772. goto ShellCodeError
  1773. endif
  1774. goto failed
  1775. ShellCodeError = +
  1776. read-syms ShellingError$(!STF_LANGUAGE)
  1777. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "FATAL" $(ErrorString)
  1778. failed = +
  1779. set CommonStatus = STATUS_FAILED
  1780. ifstr(i) $(REMOVE_FLAG) == TRUE
  1781. set REMOVE_FLAG = FALSE
  1782. goto Removesfm
  1783. endif
  1784. goto end
  1785. initialsetupcancel = +
  1786. Set CommonStatus = STATUS_USERCANCEL
  1787. goto end
  1788. usercancel = +
  1789. Set CommonStatus = STATUS_USERCANCEL
  1790. end = +
  1791. Return $(CommonStatus)
  1792. ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1793. [BindingsReview]
  1794. ; This routine is invoked by NCPA when we list OEMNSVSM.INF in the
  1795. ; ReviewPrograms list in SOFTWARE\Microsoft\NCPA registry key
  1796. ; we do this to ensure that we are the last to be called for review
  1797. ; bindings.
  1798. ;
  1799. ; extract parameters
  1800. ;
  1801. set Option = $($1)
  1802. set SrcDir = $($2)
  1803. set AddCopy = $($3)
  1804. set DoCopy = $($4)
  1805. set DoConfig = $($5)
  1806. set Language = $(!STF_LANGUAGE)
  1807. set SaveInstallMode = $(!NTN_InstallMode)
  1808. ; force the bind mode
  1809. set !NTN_InstallMode = bind
  1810. Shell "" InstallOption $(Language) $(Option) $(SrcDir) $(AddCopy) $(DoCopy) $(DoConfig)
  1811. ; restore install mode
  1812. set !NTN_InstallMode = $(SaveInstallMode)
  1813. set Status = $($R0)
  1814. Return $(Status)
  1815. [AddInfToReviewProgramsList]
  1816. ; Add OEMNSVSM.INF to SOFTWARE\Microsoft\NCPA\ReviewPrograms list
  1817. Debug-Output "AddInfToReviewPrograms: entry"
  1818. set Status = STATUS_FAILED
  1819. set KeyNull = ""
  1820. set NcpaKeyName = $(!NTN_SoftwareBase)"\Microsoft\Ncpa\CurrentVersion"
  1821. set newList = {"OEMNSVSM.INF"}
  1822. OpenRegKey $(!REG_H_LOCAL) "" $(NcpaKeyName) $(!ACCESS) KeyNcpa
  1823. Ifstr(i) $(KeyNcpa) != $(KeyNull)
  1824. GetRegValue $(KeyNcpa) "ReviewPrograms" TmpList
  1825. ifint $(RegLastError) == 0
  1826. Debug-Output "AddInf: old List "*($(TmpList), 4)
  1827. ForListDo *($(TmpList),4)
  1828. ifstr(i) $($) != "OEMNSVSM.INF"
  1829. set newList = >($(newList), $($))
  1830. endif
  1831. EndForListDo
  1832. Debug-Output "OEMNSVSM.INF: AddInf: new List "$(newList)
  1833. SetRegValue $(KeyNcpa) {ReviewPrograms, 0, +
  1834. $(!REG_VT_MULTI_SZ),$(newList)}
  1835. CloseRegKey $(KeyNcpa)
  1836. Set Status = STATUS_SUCCESSFUL
  1837. endif
  1838. else
  1839. Debug-Output "AddInfToReviewPrograms: error opening ncpa key."
  1840. endif
  1841. Debug-Output "AddInfToReviewPrograms: exit"
  1842. return $(Status)
  1843. [RemoveInfFromReviewPrograms]
  1844. ; remove OEMNSVSM.INF from SOFTWARE\Microsoft\NCPA\ReviewPrograms list
  1845. Debug-Output "RemoveInfFromReviewPrograms: entry"
  1846. set Status = STATUS_FAILED
  1847. set KeyNull = ""
  1848. set NcpaKeyName = $(!NTN_SoftwareBase)"\Microsoft\Ncpa\CurrentVersion"
  1849. set newList = {}
  1850. OpenRegKey $(!REG_H_LOCAL) "" $(NcpaKeyName) $(!ACCESS) KeyNcpa
  1851. Ifstr(i) $(KeyNcpa) != $(KeyNull)
  1852. GetRegValue $(KeyNcpa) "ReviewPrograms" TmpList
  1853. ifint $(RegLastError) == 0
  1854. Debug-Output "RemoveInf: old List "*($(TmpList), 4)
  1855. ForListDo *($(TmpList),4)
  1856. ifstr(i) $($) != "OEMNSVSM.INF"
  1857. set newList = >($(newList), $($))
  1858. endif
  1859. EndForListDo
  1860. Debug-Output "AddInf: new List "$(newList)
  1861. SetRegValue $(KeyNcpa) {ReviewPrograms, 0, +
  1862. $(!REG_VT_MULTI_SZ),$(newList)}
  1863. CloseRegKey $(KeyNcpa)
  1864. Set Status = STATUS_SUCCESSFUL
  1865. endif
  1866. else
  1867. Debug-Output "RemoveInfFromReviewPrograms: error opening ncpa key."
  1868. endif
  1869. Debug-Output "RemoveInfFromReviewPrograms: exit"
  1870. return $(Status)
  1871. ;-------------------------------------------------------------
  1872. ; ROUTINE : CreatePerfKey
  1873. ; DESCRIPTION : Creates the perf key for the service named &
  1874. ; : loads the counters to the registry.
  1875. ; ARGUMENTS : $0: ServiceKey
  1876. ; : $1: perf counters dll name
  1877. ; : $2: perf counters file name
  1878. ; : $3: open routine name
  1879. ; : $4: close routine name
  1880. ; : $5: collect routine name
  1881. ;
  1882. ; RETURNS : R0: STATUS_SUCCESSFUL | STATUS_FAILED
  1883. ; : R1: RegistryErrorIndex, if error
  1884. ;
  1885. ;------------------------------------------------------------
  1886. [CreatePerfKey]
  1887. Set Status = STATUS_FAILED
  1888. Set ServiceKey = $($0)
  1889. Set PerfDll = $($1)
  1890. Set PerfCounterFileName = $($2)
  1891. Set PerfOpen = $($3)
  1892. Set PerfClose = $($4)
  1893. Set PerfCollect = $($5)
  1894. set KeyPerformance = $(!KeyNull)
  1895. OpenRegKey $(ServiceKey) "" $(!PerfKeyName) $(!ACCESS) KeyPerformance
  1896. ifstr $(KeyPerformance) == $(!KeyNull)
  1897. CreateRegKey $(ServiceKey) {$(!PerfKeyName),$(NoTitle),GenericClass} +
  1898. "" $(!ACCESS) "" KeyPerformance
  1899. ifstr $(KeyPerformance) == $(!KeyNull)
  1900. Debug-Output "Error creating Performance key"
  1901. Set RegistryErrorIndex = $($R0)
  1902. return $(Status) $(RegistryErrorIndex)
  1903. endif
  1904. endif
  1905. set NewValueList = +
  1906. {{Library ,$(NoTitle),$(!REG_VT_SZ),$(PerfDll)},+
  1907. {Open, $(NoTitle),$(!REG_VT_SZ),$(PerfOpen)},+
  1908. {Close, $(NoTitle),$(!REG_VT_SZ),$(PerfClose)},+
  1909. {Collect, $(NoTitle),$(!REG_VT_SZ),$(PerfCollect)}}
  1910. Shell utility.inf, AddValueList, $(KeyPerformance), $(NewValueList)
  1911. set RegistryErrorIndex = $($R0)
  1912. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1913. set RegistryErrorIndex = ERROR
  1914. endif
  1915. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1916. CloseRegKey $(KeyPerformance)
  1917. Debug-Output "OEMNSVSM.INF: error adding perf values"
  1918. return STATUS_FAILED $(RegistryErrorIndex)
  1919. endif
  1920. CloseRegKey $(KeyPerformance)
  1921. Set Status = STATUS_SUCCESSFUL
  1922. return $(Status) $(RegistryErrorIndex)
  1923. ;-------------------------------------------------------------
  1924. ; ROUTINE : CreateEventLogKey
  1925. ; DESCRIPTION : Creates the application event log key
  1926. ; ARGUMENTS : $0: Application name
  1927. ; : $1: perf counters dll name
  1928. ;
  1929. ; RETURNS : R0: STATUS_SUCCESSFUL | STATUS_FAILED
  1930. ; : R1: RegistryErrorIndex, if error
  1931. ;
  1932. ;------------------------------------------------------------
  1933. [CreateEventLogKey]
  1934. Set Status = STATUS_FAILED
  1935. Set Service = $($0)
  1936. Set PerfDll = $($1)
  1937. Set EventLogKeyName = $(!EventLogKey)"\"$(Service)
  1938. OpenRegKey $(!REG_H_LOCAL) "" $(EventLogKeyName) $(!ACCESS) EvntLogKey
  1939. ifstr $(EvntLogKey) == $(!KeyNull)
  1940. OpenRegKey $(!REG_H_LOCAL) "" $(!EventLogKey) $(!ACCESS) EvntKey
  1941. ifstr(i) $(EvntKey) != $(!KeyNull)
  1942. CreateRegKey $(EvntKey) {$(Service),0,GenericClass} +
  1943. "" $(!ACCESS) "" EvntLogKey
  1944. ifstr $(EvntLogKey) == $(!KeyNull)
  1945. Debug-Output "Error creating eventlog key"
  1946. Set RegistryErrorIndex = $($R0)
  1947. CloseRegKey $(EvntKey)
  1948. return $(Status) $(RegistryErrorIndex)
  1949. endif
  1950. endif
  1951. CloseRegKey $(EvntKey)
  1952. endif
  1953. Set NewValueList = +
  1954. {{EventMessageFile,0,$(!REG_VT_EXPAND_SZ),$(PerfDll)}, +
  1955. {TypeSupported,0,$(!REG_VT_DWORD),7}}
  1956. Shell utility.inf, AddValueList, $(EvntLogKey), $(NewValueList)
  1957. set RegistryErrorIndex = $($R0)
  1958. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1959. set RegistryErrorIndex = ERROR
  1960. endif
  1961. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1962. CloseRegKey $(EvntLogKey)
  1963. Debug-Output "Error adding values to eventlog key"
  1964. return $(Status) $(RegistryErrorIndex)
  1965. EndIf
  1966. CloseRegKey $(EvntLogKey)
  1967. set Status = STATUS_SUCCESSFUL
  1968. Debug-Output "OEMNSVSM.INF: created the eventlog key"
  1969. return $(Status) $(RegistryErrorIndex)
  1970. ;-------------------------------------------------------------
  1971. ; ROUTINE : RemoveAllServiceDependencies
  1972. ; DESCRIPTION : Removes any service dependencies for
  1973. ; the specified service
  1974. ; ARGUMENTS : $0: Service name
  1975. ;
  1976. ; RETURNS : R0: STATUS_SUCCESSFUL
  1977. ;
  1978. ;------------------------------------------------------------
  1979. [RemoveAllServiceDependencies]
  1980. Debug-Output "RemoveAllServiceDependencies: entry"
  1981. set Status = STATUS_SUCCESSFUL
  1982. Set KeyNull = ""
  1983. set DependentService = $(!NTN_ServiceBase)\$($0)
  1984. set DependentName = $($0)
  1985. set KeyService = $(KeyNull)
  1986. OpenRegKey $(!REG_H_LOCAL) "" $(DependentService) $(!ACCESS) KeyService
  1987. ifstr $(KeyService) != $(KeyNull)
  1988. set newDependList = {}
  1989. GetRegValue $(KeyService) "DeleteFlag" DeleteFlagValue
  1990. ; make sure the service is not marked for deletion
  1991. ifint $(RegLastError) != 0
  1992. GetRegValue $(KeyService) "DependOnService" ServiceList
  1993. ifint $(RegLastError) == 0
  1994. Debug-Output "RemoveAllServiceDependencies: old DependOnService List "*($(ServiceList), 4)
  1995. ; get any existing group dependencies
  1996. GetRegValue $(KeyService) "DependOnGroup" GrpList
  1997. ifint $(RegLastError) == 0
  1998. ForListDo *($(GrpList),4)
  1999. set grp = "+"$($)
  2000. set newDependList = >($(newDependList), $(grp))
  2001. EndForListDo
  2002. endif
  2003. Debug-Output "RemoveAllServiceDependencies: new DependOnService List "$(newDependList)
  2004. ; now set only the group dependency
  2005. LibraryProcedure Result, $(!LIBHANDLE), +
  2006. SetupChangeServiceConfig, $(DependentName) +
  2007. $(!SERVICE_NO_CHANGE), $(!SERVICE_NO_CHANGE), +
  2008. $(!SERVICE_NO_CHANGE), "", "", +
  2009. $(newDependList), "", "", ""
  2010. endif
  2011. endif
  2012. CloseRegKey $(KeyService)
  2013. else
  2014. Debug-Output "RemoveAllServiceDependencies: failed to open service key "$(DependentService)
  2015. endif
  2016. Debug-Output "RemoveAllServiceDependencies: exit"
  2017. return $(Status)
  2018. ;-------------------------------------------------------------
  2019. ; ROUTINE : Find MediaType
  2020. ; DESCRIPTION : Gets the media type of the card
  2021. ; RETURNS : R0: STATUS_SUCCESSFUL | STATUS_FAILED
  2022. ; : R1: RegistryErrorIndex, if error, else media type
  2023. ;
  2024. ;------------------------------------------------------------
  2025. [FindMediaType]
  2026. Set Status = STATUS_FAILED
  2027. Set CardName = $(!NTN_ServiceBase)"\"$($0)"\Parameters"
  2028. OpenRegKey $(!REG_H_LOCAL) "" $(CardName) $(!ACCESS) CardKey
  2029. Ifstr(i) $(CardKey) == $(!KeyNull)
  2030. Set RegistryErrorIndex = $($R0)
  2031. Return $(Status) $(RegistryErrorIndex)
  2032. EndIf
  2033. GetRegValue $(CardKey) "MediaType" MediaTypeList
  2034. Set MediaType = *($(MediaTypeList),4)
  2035. Set Status = STATUS_SUCCESSFUL
  2036. Return $(Status) $(MediaType)
  2037. ;-------------------------------------------------------------
  2038. ; ROUTINE : CreateAtalkConfig
  2039. ; DESCRIPTION : Creates the registry entries for AppleTalk
  2040. ; RETURNS : R0: STATUS_SUCCESSFUL | STATUS_FAILED
  2041. ; : R1: RegistryErrorIndex
  2042. ;
  2043. ;------------------------------------------------------------
  2044. [CreateAtalkConfig]
  2045. Set AdapterName = $($0)
  2046. Set KeyAdapters = $($1)
  2047. Set RetStatus = STATUS_SUCCESSFUL
  2048. read-syms GeneralConstants
  2049. CreateRegKey $(KeyAdapters) {$(AdapterName), 0, GenericClass} "" $(!ACCESS) "", TempKeyAdapters
  2050. Shell "" FindMediaType $($0)
  2051. Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  2052. Set MediaType = $($R1)
  2053. else
  2054. Set RegistryErrorIndex = $($R1)
  2055. Set RetStatus = $($R0)
  2056. goto return
  2057. EndIf
  2058. set PortName = $($0)"@"$(!STF_COMPUTERNAME)
  2059. set ZoneList = {""}
  2060. set AarpRetries = 10
  2061. set DefaultZone = ""
  2062. set NewValueList = +
  2063. {{"AarpRetries",0,$(!REG_VT_DWORD),$(AarpRetries)}, +
  2064. {"DefaultZone", 0,$(!REG_VT_SZ),$(DefaultZone)},+
  2065. {"NetworkRangeUpperEnd",0,$(!REG_VT_DWORD),0 },+
  2066. {"NetworkRangeLowerEnd",0,$(!REG_VT_DWORD),0 },+
  2067. {"ZoneList",0,$(!REG_VT_MULTI_SZ),$(ZoneList)},+
  2068. {"SeedingNetwork", 0,$(!REG_VT_DWORD),0},+
  2069. {"DdpCheckSums", 0,$(!REG_VT_DWORD),0},+
  2070. {"PortName",0,$(!REG_VT_SZ),$(PortName)}}
  2071. Shell $(UtilInf),AddValueList, $(TempKeyAdapters), $(NewValueList)
  2072. set RegistryErrorIndex = $($R0)
  2073. Ifstr $(RegistryErrorIndex) != NO_ERROR
  2074. CloseRegKey $(TmpKeyAdapters)
  2075. Set RetStatus = STATUS_FAILED
  2076. EndIf
  2077. return = +
  2078. Return $(RetStatus) $(RegistryErrorIndex)
  2079. ;-------------------------------------------------------------------------
  2080. ;
  2081. ; DO UAM INSTALL
  2082. ;
  2083. ;-------------------------------------------------------------------------
  2084. [DoUAMInstall]
  2085. Set Status = STATUS_FAILED
  2086. Set Mode = $($0)
  2087. read-syms DialogConstants$(!STF_LANGUAGE)
  2088. read-syms VolList
  2089. detect VolList
  2090. Set NTFSVolumeList = {}
  2091. ; loop thru the volume list and find the first NTFS Volume
  2092. ForListDo $(VolumeFSList)
  2093. Ifstr(i) $($) == "NTFS"
  2094. Set NTFSExists = TRUE
  2095. Set NTFSVolumeList = >($(NTFSVolumeList),*($(VolumeList),$(#)))
  2096. EndIf
  2097. EndForListDo
  2098. Ifstr(i) $(NTFSExists) != TRUE
  2099. read-syms AFPString12$(!STF_LANGUAGE)
  2100. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2101. goto enduam
  2102. EndIf
  2103. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\MacFile\Parameters\Volumes" $(!ACCESS) KeyVol
  2104. ifstr(i) $(KeyVol) == $(!KeyNull)
  2105. read-syms AFPString11$(!STF_LANGUAGE)
  2106. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2107. goto enduam
  2108. endif
  2109. Ifstr(i) $(Mode) == "INSTALL"
  2110. Set UAMDrive = *($(NTFSVolumeList),1)
  2111. read-syms UAMVars$(!STF_LANGUAGE)
  2112. EndIf
  2113. install "CreateUAMDir"
  2114. Set Result = ""
  2115. Set FLibraryErrCtl = 1
  2116. LibraryProcedure Result, $(!UTILHANDLE), CopyUamFiles, +
  2117. $(!STF_CWDDIR)$(!UamResSrcFile), +
  2118. $(UAMPath)"\"$(!AppleShareFolder)"\"$(!UamResDestFile)
  2119. Set FLibraryErrCtl = 0
  2120. ifstr(i) $(Result) == "FAILED"
  2121. read-syms UamFileNotCopied1$(!STF_LANGUAGE)
  2122. Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2123. Set Status = STATUS_USERCANCEL
  2124. goto enduam
  2125. EndIf
  2126. Set Result = ""
  2127. Set FLibraryErrCtl = 1
  2128. LibraryProcedure Result,$(!UTILHANDLE), CopyUamFiles, +
  2129. $(!STF_CWDDIR)$(!UamInfoSrcFile), +
  2130. $(UAMPath)"\"$(!AppleShareFolder)"\"$(!UamInfoDestFile)
  2131. Set FLibraryErrCtl = 0
  2132. ifstr(i) $(Result) == "FAILED"
  2133. read-syms UamFileNotCopied1$(!STF_LANGUAGE)
  2134. Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2135. Set Status = STATUS_USERCANCEL
  2136. goto enduam
  2137. EndIf
  2138. ; copy the UAM Readme
  2139. Set Result = ""
  2140. Set FLibraryErrCtl = 1
  2141. LibraryProcedure Result, $(!UTILHANDLE),CopyUamFiles,+
  2142. $(!STF_CWDDIR)$(!UamReadMeSrcFile), +
  2143. $(UAMPath)"\"$(!AppleShareFolder)"\"$(!UamReadMeDestFile)
  2144. Set FLibraryErrCtl = 0
  2145. ifstr(i) $(Result) == "FAILED"
  2146. read-syms UamFileNotCopied1$(!STF_LANGUAGE)
  2147. Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2148. Set Status = STATUS_USERCANCEL
  2149. goto enduam
  2150. EndIf
  2151. Set VolProperties = {"MAXUSES=1000", "PROPERTIES=163841","PASSWORD="}
  2152. Set VolProperties = >($(VolProperties),"PATH="$(UAMPath))
  2153. set NewValueList = +
  2154. {{$(!UAMVolumeName),0, $(!REG_VT_MULTI_SZ),$(VolProperties)}}
  2155. Shell "utility.inf" AddValueList $(KeyVol) $(NewValueList)
  2156. set RegistryErrorIndex = $($R0)
  2157. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2158. CloseRegKey $(KeyVol)
  2159. Set Status = STATUS_FAILED
  2160. goto enduam
  2161. EndIf
  2162. ;
  2163. ; Set the Default Security on the UAM Directory
  2164. ;
  2165. Set Result = ""
  2166. Set FLibraryErrCtl = 1
  2167. LibraryProcedure Result, $(!UTILHANDLE),SfmSetUamSecurity $(UAMPath)
  2168. Set FLibraryErrCtl = 0
  2169. ifstr(i) $(Result) == "FAILED"
  2170. read-syms UamSecurityNotSet$(!STF_LANGUAGE)
  2171. Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2172. endif
  2173. Set Status = STATUS_SUCCESSFUL
  2174. enduam = +
  2175. Return $(Status) $(RegistryErrorIndex)
  2176. [RemoveSfmFiles]
  2177. ;
  2178. ; Attempt to remove all SFM Files. If unable to remove the file
  2179. ; add it to the reboot list. The file will be deleted on next reboot.
  2180. ;
  2181. Set Status = STATUS_SUCCESSFUL
  2182. Set Mode = $($0)
  2183. Set RemoveList = {}
  2184. Set DelOnRebootList = {}
  2185. ; ATALK Files
  2186. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATALKSYS, 1))
  2187. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATALKMSG, 1))
  2188. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATCONFIG, 1))
  2189. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATWINSOCK, 1))
  2190. ; AFP SVC AND SERVER FILES
  2191. Set RemoveList = >($(RemoveList), #(Files-RemoveList, AFPSVCEXE, 1))
  2192. Set RemoveList = >($(RemoveList), #(Files-RemoveList, AFPSVCMSG, 1))
  2193. Set RemoveList = >($(RemoveList), #(Files-RemoveList, AFPSRVR, 1))
  2194. Set RemoveList = >($(RemoveList), #(Files-RemoveList, AFPSVCAPI, 1))
  2195. Set RemoveList = >($(RemoveList), #(Files-RemoveList, AFPSVCMGR, 1))
  2196. ; MACPRINT AND PSTODIB FILES
  2197. Set RemoveList = >($(RemoveList), #(Files-RemoveList, PSTODIB1, 1))
  2198. Set RemoveList = >($(RemoveList), #(Files-RemoveList, PSTODIB2, 1))
  2199. Set RemoveList = >($(RemoveList), #(Files-RemoveList, PSTODIB3, 1))
  2200. Set RemoveList = >($(RemoveList), #(Files-RemoveList, PSTODIB4, 1))
  2201. Set RemoveList = >($(RemoveList), #(Files-RemoveList, MACPRINT, 1))
  2202. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATALKMON, 1))
  2203. ; INF, UAM and Setup Dll's
  2204. Set RemoveList = >($(RemoveList), #(Files-RemoveList, AFPICONS, 1))
  2205. Set RemoveList = >($(RemoveList), #(Files-RemoveList, AFPTYPECRTR, 1))
  2206. Set RemoveList = >($(RemoveList), #(Files-RemoveList, UAMRES, 1))
  2207. Set RemoveList = >($(RemoveList), #(Files-RemoveList, UAMINF, 1))
  2208. Set RemoveList = >($(RemoveList), #(Files-RemoveList, UAMTXT, 1))
  2209. Set RemoveList = >($(RemoveList), #(Files-RemoveList, SFMRES, 1))
  2210. ; Help File
  2211. Set RemoveList = >($(RemoveList), #(Files-RemoveList, SFMHELP, 1))
  2212. ; PerfMon files
  2213. Set RemoveList = >($(RemoveList), #(Files-RemoveList, SFMCTRSDLL, 1))
  2214. Set RemoveList = >($(RemoveList), #(Files-RemoveList, SFMCTRNMH, 1))
  2215. Set RemoveList = >($(RemoveList), #(Files-RemoveList, SFMCTRSINI, 1))
  2216. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATKCTRSDLL, 1))
  2217. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATKCTRNMH, 1))
  2218. Set RemoveList = >($(RemoveList), #(Files-RemoveList, ATKCTRSINI, 1))
  2219. ForListDo $(RemoveList)
  2220. Set DelStatus = ""
  2221. Debug-Output "Deleting File "$($)
  2222. Set FLibraryErrCtl = 1
  2223. Ifstr(i) $(Mode) == "REMOVE"
  2224. LibraryProcedure DelStatus $(!UTILHANDLE), DelFile $($)
  2225. ifstr(i) $(DelStatus) == "FAILED"
  2226. Set DelOnRebootList = >($(DelOnRebootList), $($))
  2227. EndIf
  2228. else
  2229. LibraryProcedure DelStatus $(!LIBHANDLE), DelFile $($)
  2230. EndIf
  2231. Set FLibraryErrCtl = 0
  2232. EndForListDo
  2233. ForListDo $(DelOnRebootList)
  2234. Ifstr(i) $(Mode) == "REMOVE"
  2235. Debug-Output "File to remove on reboot = "$($)
  2236. AddFileToDeleteList $($)
  2237. else
  2238. Set FLibraryErrCtl = 1
  2239. LibraryProcedure DelStatus $(!LIBHANDLE), DelFile $($)
  2240. Set FLibraryErrCtl = 0
  2241. EndIf
  2242. EndForListDo
  2243. Return $(Status)
  2244. [Install-PSPrint]
  2245. AddSectionFilesToCopyList Files-PRINTPROC $(!STF_CWDDIR) $(!PrintProcDir)
  2246. CopyFilesInCopyList
  2247. Exit
  2248. [CreateUAMDir]
  2249. CreateDir $(UAMPath)
  2250. CreateDir $(UAMPath)"\"$(!AppleShareFolder)
  2251. Exit
  2252. [Install-Update]
  2253. set STF_VITAL = ""
  2254. AddSectionFilesToCopyList Files-SFM $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2255. AddSectionFilesToCopyList Files-SFMDrivers $(SrcDir) $(!STF_WINDOWSSYSPATH)"\drivers"
  2256. AddSectionFilesToCopyList Files-UAM $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2257. CopyFilesInCopyList
  2258. Exit
  2259. [Install-Initial]
  2260. set STF_VITAL = ""
  2261. set OLDCOPYSTATE = $(!STF_NCPA_FLUSH_COPYLIST)
  2262. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  2263. AddSectionFilesToCopyList Files-SFM $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2264. AddSectionFilesToCopyList Files-SFMDrivers $(SrcDir) $(!STF_WINDOWSSYSPATH)"\drivers"
  2265. AddSectionFilesToCopyList Files-UAM $(SrcDir) $(!STF_WINDOWSSYSPATH)
  2266. CopyFilesInCopyList
  2267. set !STF_NCPA_FLUSH_COPYLIST = $(OLDCOPYSTATE)
  2268. Exit
  2269. [Install-WinFile-Icon]
  2270. CreateCommonProgManGroup $(GroupName), ""
  2271. RemoveCommonProgManItem $(GroupName), $(IconName)
  2272. CreateCommonProgManItem $(GroupName), $(IconName), winfile.exe, winfile.exe, ""
  2273. ShowCommonProgManGroup $(GroupName), 6
  2274. exit
  2275. [Remove-WinFile-Icon]
  2276. RemoveCommonProgManItem $(GroupName), $(IconName)
  2277. exit
  2278. [Files-RemoveList]
  2279. ATALKSYS = $(!STF_WINDOWSSYSPATH)\drivers\sfmatalk.sys
  2280. ATALKMSG = $(!STF_WINDOWSSYSPATH)\sfmatmsg.dll
  2281. ATCONFIG = $(!STF_WINDOWSSYSPATH)\sfmatcfg.dll
  2282. ATWINSOCK = $(!STF_WINDOWSSYSPATH)\sfmwshat.dll
  2283. AFPSVCEXE = $(!STF_WINDOWSSYSPATH)\sfmsvc.exe
  2284. AFPSVCMSG = $(!STF_WINDOWSSYSPATH)\sfmmsg.dll
  2285. AFPSVCAPI = $(!STF_WINDOWSSYSPATH)\sfmapi.dll
  2286. AFPSVCMGR = $(!STF_WINDOWSSYSPATH)\sfmmgr.cpl
  2287. AFPSRVR = $(!STF_WINDOWSSYSPATH)\drivers\sfmsrv.sys
  2288. AFPICONS = $(!STF_WINDOWSSYSPATH)\sfmicons.inf
  2289. AFPTYPECRTR = $(!STF_WINDOWSSYSPATH)\sfmmap.inf
  2290. UAMINF = $(!STF_WINDOWSSYSPATH)\sfmuam.ifo
  2291. UAMRES = $(!STF_WINDOWSSYSPATH)\sfmuam.rsc
  2292. UAMTXT = $(!STF_WINDOWSSYSPATH)\sfmuam.txt
  2293. MACPRINT = $(!STF_WINDOWSSYSPATH)\sfmprint.exe
  2294. ATALKMON = $(!STF_WINDOWSSYSPATH)\sfmmon.dll
  2295. PSTODIB1 = $(!STF_WINDOWSSYSPATH)\sfmpsexe.exe
  2296. PSTODIB2 = $(!STF_WINDOWSSYSPATH)\sfmpsfnt.dll
  2297. PSTODIB3 = $(!STF_WINDOWSSYSPATH)\sfmpsprt.dll
  2298. PSTODIB4 = $(!STF_WINDOWSSYSPATH)\sfmpsdib.dll
  2299. SFMHELP = $(!STF_WINDOWSSYSPATH)\sfmmgr.hlp
  2300. SFMRES = $(!STF_WINDOWSSYSPATH)\sfmres.dll
  2301. SFMCTRSDLL = $(!STF_WINDOWSSYSPATH)\sfmctrs.dll
  2302. SFMCTRNMH = $(!STF_WINDOWSSYSPATH)\sfmctrnm.h
  2303. SFMCTRSINI = $(!STF_WINDOWSSYSPATH)\sfmctrs.ini
  2304. ATKCTRSDLL = $(!STF_WINDOWSSYSPATH)\atlkctrs.dll
  2305. ATKCTRNMH = $(!STF_WINDOWSSYSPATH)\atlkctrnm.h
  2306. ATKCTRSINI = $(!STF_WINDOWSSYSPATH)\atlkctrs.ini
  2307. [UamGetLanguage]
  2308. STF_LANGUAGE = "" ? $(!LIBHANDLE) GetLanguage
  2309. [UAMINSTALL]
  2310. ;
  2311. ; This section is called when the initial installation failed to
  2312. ; install the UAM and the user use's setup /i oemnsvsm.inf /c uaminstall
  2313. ;
  2314. ; Load SetupDll.dll to get entry points
  2315. LoadLibrary "x" $(!STF_CWDDIR)setupdll.dll !LIBHANDLE
  2316. read-syms UamGetLanguage
  2317. detect UamGetLanguage
  2318. ; read all general and dialog constants
  2319. read-syms GeneralConstants
  2320. read-syms FileConstants
  2321. read-syms FileConstants$(STF_LANGUAGE)
  2322. Debug-Output "UAMINSTALL: Language = "$(STF_LANGUAGE)
  2323. ; Detect file system information
  2324. read-syms FSAndDiskSpace
  2325. detect FSAndDiskSpace
  2326. Set NTFSVolExists = FALSE
  2327. Set NTFSVolumeList = {}
  2328. ForListDo $(VolumeFSList)
  2329. Ifstr(i) $($) == "NTFS"
  2330. Set NTFSVolExists = TRUE
  2331. Set NTFSVolumeList = >($(NTFSVolumeList),*($(VolumeList),$(#)))
  2332. EndIf
  2333. EndForListDo
  2334. Ifstr(i) $(NTFSVolExists) == FALSE
  2335. read-syms UamFileNotCopied1$(STF_LANGUAGE)
  2336. Shell $(SubInf) SetupMessage $(STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2337. goto uaminstalldone
  2338. EndIf
  2339. LoadLibrary "y" $(!STF_CWDDIR)sfmutil.dll !UTILHANDLE
  2340. Set !NTN_ServiceBase = "SYSTEM\CurrentControlSet\Services"
  2341. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\MacFile\Parameters\Volumes" $(!ACCESS) KeyVol
  2342. ifstr(i) $(KeyVol) == $(!KeyNull)
  2343. read-syms AFPString11$(!STF_LANGUAGE)
  2344. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2345. goto uaminstalldone
  2346. endif
  2347. Set UAMDrive = *($(NTFSVolumeList),1)
  2348. read-syms UAMVars$(!STF_LANGUAGE)
  2349. install "CreateUAMDir"
  2350. Set Result = ""
  2351. Set FLibraryErrCtl = 1
  2352. LibraryProcedure Result,+
  2353. $(!UTILHANDLE), +
  2354. CopyUamFiles, +
  2355. $(!STF_CWDDIR)$(!UamResSrcFile), +
  2356. $(UAMPath)"\"$(!AppleShareFolder)"\"$(!UamResDestFile)
  2357. Set FLibraryErrCtl = 0
  2358. ifstr(i) $(Result) == "FAILED"
  2359. read-syms UamFileNotCopied1$(!STF_LANGUAGE)
  2360. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2361. goto uaminstalldone
  2362. EndIf
  2363. Set Result = ""
  2364. Set FLibraryErrCtl = 1
  2365. LibraryProcedure Result,+
  2366. $(!UTILHANDLE),+
  2367. CopyUamFiles, +
  2368. $(!STF_CWDDIR)$(!UamInfoSrcFile) +
  2369. $(UAMPath)"\"$(!AppleShareFolder)"\"$(!UamInfoDestFile)
  2370. Set FLibraryErrCtl = 0
  2371. ifstr(i) $(Result) == "FAILED"
  2372. read-syms UamFileNotCopied1$(!STF_LANGUAGE)
  2373. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2374. goto uaminstalldone
  2375. EndIf
  2376. ; copy the UAM Readme
  2377. Set Result = ""
  2378. Set FLibraryErrCtl = 1
  2379. LibraryProcedure Result, +
  2380. $(!UTILHANDLE), +
  2381. CopyUamFiles, +
  2382. $(!STF_CWDDIR)$(!UamReadMeSrcFile) +
  2383. $(UAMPath)"\"$(!AppleShareFolder)"\"$(!UamReadMeDestFile)
  2384. Set FLibraryErrCtl = 0
  2385. ifstr(i) $(Result) == "FAILED"
  2386. read-syms UamFileNotCopied1$(!STF_LANGUAGE)
  2387. Shell $(SubInf) SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2388. goto uaminstalldone
  2389. EndIf
  2390. Set VolProperties = {"MAXUSES=1000", "PROPERTIES=163841","PASSWORD="}
  2391. Set VolProperties = >($(VolProperties),"PATH="$(UAMPath))
  2392. set NewValueList = +
  2393. {{$(!UAMVolumeName), 0, $(!REG_VT_MULTI_SZ),$(VolProperties)}}
  2394. Shell $(UtilInf) AddValueList $(KeyVol) $(NewValueList)
  2395. set RegistryErrorIndex = $($R0)
  2396. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  2397. CloseRegKey $(KeyVol)
  2398. EndIf
  2399. Set Result = ""
  2400. Set FLibraryErrCtl = 1
  2401. LibraryProcedure Result, $(!UTILHANDLE),SfmSetUamSecurity $(UAMPath)
  2402. Set FLibraryErrCtl = 0
  2403. ifstr(i) $(Result) == "FAILED"
  2404. read-syms UamSecurityNotSet$(!STF_LANGUAGE)
  2405. Shell "subroutn.inf" SetupMessage $(!STF_LANGUAGE) "NONFATAL" $(ErrorString)
  2406. endif
  2407. uaminstalldone = +
  2408. FreeLibrary $(!LIBHANDLE)
  2409. FreeLibrary $(!UTILHANDLE)
  2410. exit