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.

1224 lines
46 KiB

  1. [Identification]
  2. OptionType = NetService
  3. [LanguagesSupported]
  4. ENG
  5. [Options]
  6. NWWKSTA
  7. [FileConstants]
  8. UtilityInf = "UTILITY.INF"
  9. subroutineinf = "SUBROUTN.INF"
  10. SoftwareType = "service"
  11. Exit_Code = 0
  12. NetwareEventDLL = "%SystemRoot%\System32\nwevent.dll"
  13. Manufacturer = "Microsoft"
  14. ProductMajorVersion = "3"
  15. ProductMinorVersion = "1"
  16. ProductVersion = $(ProductMajorVersion)"."$(ProductMinorVersion)
  17. ProductNWWKSTAName = "NWCWorkstation"
  18. ProductNWWKSTAImagePath = "%SystemRoot%\System32\nwsvc.exe"
  19. NetRuleNWWKSTAType = "nwWsta nwcWorkstation"
  20. NetRuleNWWKSTAClass = {"nwcWorkstation basic"}
  21. NetRuleNWWKSTABindable = {"nwcWorkstation nwlinkipxTransport non non 100"}
  22. NetRuleNWWKSTAUse = $(SoftwareType)" no no"
  23. NetRuleNWWKSTABindForm = """NwcWorkstation"" yes yes container"
  24. ProductNWRDRName = "NwRdr"
  25. ProductNWRDRImagePath = "\SystemRoot\System32\drivers\nwrdr.sys"
  26. ProductProviderImagePath = "%SystemRoot%\System32\nwprovau.dll"
  27. ProviderName = $(ProductNWWKSTAName)
  28. ProductKeyName = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(Product$(Option)Name)"\CurrentVersion"
  29. ParamKeyName = $(!NTN_ServiceBase)"\"$(Product$(Option)Name)"\Parameters"
  30. LSAKeyName = "System\CurrentControlSet\Control\LSA"
  31. [GeneralConstants]
  32. from = ""
  33. to = ""
  34. ExitCodeOk = 0
  35. ExitCodeCancel = 1
  36. ExitCodeFatal = 2
  37. KeyNull = ""
  38. MAXIMUM_ALLOWED = 33554432
  39. RegistryErrorIndex = NO_ERROR
  40. KeyProduct = ""
  41. KeyParameters = ""
  42. TRUE = 1
  43. FALSE = 0
  44. NoTitle = 0
  45. ExitState = "Active"
  46. OldVersionExisted = $(FALSE)
  47. DriverPath = $(!STF_NTPATH)\drivers
  48. [date]
  49. Now = {} ? $(!LIBHANDLE) GetSystemDate
  50. [DetectDiskSpace]
  51. VolumeList = {} ? $(!LIBHANDLE) GetHardDriveLetters
  52. VolumeFreeList = {} ? $(!LIBHANDLE) GetHardDriveFreeSpace
  53. VolumeFSList = {} ? $(!LIBHANDLE) GetHardDriveFileSystems
  54. [DetectSystemMemory]
  55. SystemMemory = "" ? $(!LIBHANDLE) GetMemorySize
  56. [Identify]
  57. read-syms Identification
  58. set Status = STATUS_SUCCESSFUL
  59. set Identifier = $(OptionType)
  60. set Media = #("Source Media Descriptions", 1, 1)
  61. Return $(Status) $(Identifier) $(Media)
  62. [ReturnOptions]
  63. set Status = STATUS_FAILED
  64. set OptionList = {}
  65. set OptionTextList = {}
  66. set LanguageList = ^(LanguagesSupported, 1)
  67. Ifcontains(i) $($0) in $(LanguageList)
  68. goto returnoptions
  69. else
  70. set Status = STATUS_NOLANGUAGE
  71. goto finish_ReturnOptions
  72. endif
  73. returnoptions = +
  74. set OptionList = ^(Options, 1)
  75. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  76. set OptionTextList = ^(OptionsWINNTText$($0), 1)
  77. else
  78. set OptionTextList = ^(OptionsLANMANNTText$($0), 1)
  79. endif
  80. set Status = STATUS_SUCCESSFUL
  81. finish_ReturnOptions = +
  82. Return $(Status) $(OptionList) $(OptionTextList)
  83. [InstallOption]
  84. set Option = $($1)
  85. set SrcDir = $($2)
  86. set AddCopy = $($3)
  87. set DoCopy = $($4)
  88. set DoConfig = $($5)
  89. set LanguageList = ^(LanguagesSupported, 1)
  90. Ifcontains(i) $($0) NOT-IN $(LanguageList)
  91. Return STATUS_NOLANGUAGE
  92. endif
  93. Debug-Output "OEMNSVNW.INF: STF_CWDDIR is: "$(!STF_CWDDIR)
  94. Debug-Output "OEMNSVNW.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  95. set-subst LF = "\n"
  96. set-subst CR = "\r"
  97. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  98. read-syms Workstation$(!STF_LANGUAGE)
  99. else
  100. read-syms Gateway$(!STF_LANGUAGE)
  101. endif
  102. read-syms GeneralConstants
  103. read-syms FileConstants
  104. read-syms DialogConstants$(!STF_LANGUAGE)
  105. ifstr(i) $(!NTN_Origination) == "NCPA"
  106. set Continue = $(OK)
  107. endif
  108. read-syms FileConstants$(!STF_LANGUAGE)
  109. detect date
  110. detect DetectSystemMemory
  111. detect DetectDiskSpace
  112. set-title $(FunctionTitle)
  113. set to = Begin
  114. set from = Begin
  115. set CommonStatus = STATUS_SUCCESSFUL
  116. EndWait
  117. Begin = +
  118. Ifstr(i) $(!NTN_InstallMode) == deinstall
  119. set OEM_ABANDON_OPTIONS = { $(ProductNWWKSTAName), +
  120. $(ProductNWRDRName)}
  121. set StartLabel = removeadapter
  122. else-Ifstr(i) $(!NTN_InstallMode) == Update
  123. set StartLabel = UpgradeSoftware
  124. else-Ifstr(i) $(!NTN_InstallMode) == bind
  125. set StartLabel = bindingadapter
  126. else-Ifstr(i) $(!NTN_InstallMode) == configure
  127. Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  128. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  129. Debug-Output "OEMNSVNW.INF: ShellCode error: cannot get an error string."
  130. goto ShellCodeError
  131. endif
  132. set Error = $($R0)
  133. set from = end
  134. set to = end
  135. goto nonfatalinfo
  136. else
  137. set StartLabel = installadapter
  138. set OEM_ABANDON_OPTIONS = {}
  139. endif
  140. set DoWKSTA = FALSE
  141. set DoRDR = FALSE
  142. set DoNWLINK = FALSE
  143. set DoMUP = FALSE
  144. Ifstr(i) $(Option) == NWWKSTA
  145. set DoWKSTA = TRUE
  146. set DoRDR = TRUE
  147. set DoNWLINK = TRUE
  148. set DoMUP = TRUE
  149. Else-ifstr(i) $(Option) == RDR
  150. Set DoRDR = TRUE
  151. Else
  152. Debug-Output "OEMNSVWK.INF: Unrecognized option"
  153. Endif
  154. set from = $(fatal)
  155. set to = $(fatal)
  156. goto $(StartLabel)
  157. installadapter = +
  158. GetDriveInPath NtDrive $(!STF_WINDOWSSYSPATH)
  159. Shell "" GetFilesSize
  160. set RequiredSize = $($R0)
  161. ForListDo $(VolumeList)
  162. set CurrentVolume = *($(VolumeList), $(#))
  163. set CurrentVolumeFree = *($(VolumeFreeList), $(#))
  164. Ifstr(i) $(CurrentVolume) == $(NtDrive)
  165. set-mul CurrentVolumeFree = $(CurrentVolumeFree) 1024
  166. Ifint $(CurrentVolumeFree) < $(RequiredSize)
  167. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(NotEnoughSpace)
  168. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  169. goto ShellCodeError
  170. endif
  171. goto end
  172. else
  173. goto AfterCheckSpace
  174. endif
  175. EndIf
  176. EndForListDo
  177. AfterCheckSpace = +
  178. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NWLINKIPX" $(MAXIMUM_ALLOWED) BS_KeyServices
  179. Ifstr $(BS_KeyServices) == $(KeyNull)
  180. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(InstallNWLINKFirst)
  181. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  182. goto ShellCodeError
  183. endif
  184. goto end
  185. endif
  186. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  187. Ifstr $(KeyProduct) != $(KeyNull)
  188. CloseRegKey $(KeyProduct)
  189. Shell $(UtilityInf), VerExistedDlg, $(Product$(Option)Title),+
  190. $(ProductVersion)
  191. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  192. Debug-Output "OEMNSVNW.INF: ShellCode error: cannot get an error string."
  193. goto ShellCodeError
  194. endif
  195. goto end
  196. endif
  197. CloseRegKey $(KeyProduct)
  198. ;
  199. ; Make sure Mup exists
  200. ;
  201. ifstr(i) $(DoMUP) == TRUE
  202. ;
  203. ; Check whether MUP exists or not.
  204. ; If exists, continue.
  205. ; Otherwise, popup a dialog and end
  206. ;
  207. Debug-Output "OEMNSVNW.INF: check MUP registry"
  208. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Mup" $(MAXIMUM_ALLOWED) MupKey
  209. Ifstr $(MupKey) == $(KeyNull)
  210. ;
  211. ; Mup does not exist. So, end NWCS setup.
  212. ;
  213. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(InstallNTWKSTAFirst)
  214. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  215. goto ShellCodeError
  216. endif
  217. goto end
  218. endif
  219. ;
  220. ; It exists. So, continue.
  221. ;
  222. CloseRegKey $(MupKey)
  223. endif
  224. ;
  225. ; Check to make sure that NETWAREWORKSTATION is not there
  226. ;
  227. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\NetwareWorkstation" $(MAXIMUM_ALLOWED) BS_KeyServices
  228. Ifstr $(BS_KeyServices) == $(KeyNull)
  229. ;
  230. ; Good. Let check the "Mark for deletion" service controller problem.
  231. ;
  232. Shell $(UtilityInf), CreateService, +
  233. "NetwareWorkstation", +
  234. $(ProductNWWKSTADisplayName), +
  235. $(ProductNWWKSTAImagePath), "autoserviceshare", "NetworkProvider", {}, "",+
  236. $(NetwareEventDLL)
  237. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  238. Debug-Output "OEMNSVNW.INF: ShellCode error"
  239. goto ShellCodeError
  240. endif
  241. debug-output $($R0)
  242. set RegistryErrorIndex = $($R0)
  243. ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  244. ;
  245. ; it is still there
  246. ;
  247. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(RemoveAndReboot)
  248. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  249. goto ShellCodeError
  250. endif
  251. goto end
  252. else
  253. Shell $(UtilityInf) RemoveService "NetwareWorkstation" "YES"
  254. endif
  255. else
  256. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(RemoveAndReboot)
  257. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  258. goto ShellCodeError
  259. endif
  260. CloseRegKey $(BS_KeyServices)
  261. goto end
  262. endif
  263. goto nextstep
  264. nextstep = +
  265. StartWait
  266. Ifstr(i) $(!NTN_InstallMode) == install
  267. Ifint $(OldVersionExisted) == $(FALSE)
  268. goto installproduct
  269. endif
  270. endif
  271. goto writeparameters
  272. installproduct = +
  273. CloseRegKey $(ParamKeyName)
  274. ifstr(i) $(!NTN_InstallMode) == "install"
  275. Ifstr(i) $(DoCopy) == "YES"
  276. Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  277. Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  278. Goto ShellCodeError
  279. Else-Ifstr(i) $($R0) == STATUS_FAILED
  280. Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  281. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  282. goto ShellCodeError
  283. endif
  284. set Error = $($R0)
  285. Goto fatal
  286. Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  287. Goto successful
  288. Endif
  289. Set SrcDir = $($R1)
  290. Endif
  291. install "Install-nwcfgdll"
  292. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  293. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  294. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  295. goto ShellCodeError
  296. endif
  297. set Error = $($R0)
  298. goto fatal
  299. endif
  300. endif
  301. set OEM_ABANDON_ON = TRUE
  302. LoadLibrary "nw" $(!STF_CWDDIR)\nwcfg.dll !NWCFG_HANDLE
  303. Set FLibraryErrCtl = 1
  304. ;
  305. ; Check the version number
  306. ;
  307. LibraryProcedure Result $(!NWCFG_HANDLE), GetKernelVersion
  308. ifint *($(Result),3) < 528
  309. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(UpgradeFirst)
  310. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  311. goto ShellCodeError
  312. endif
  313. goto end
  314. FreeLibrary $(!NWCFG_HANDLE)
  315. else-ifint *($(Result),3) > 529
  316. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(NotDaytona)
  317. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  318. goto ShellCodeError
  319. endif
  320. goto end
  321. FreeLibrary $(!NWCFG_HANDLE)
  322. endif
  323. ifstr(i) $(!NTN_InstallMode) == "install"
  324. install "Install-Option"
  325. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  326. Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  327. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  328. goto ShellCodeError
  329. endif
  330. set Error = $($R0)
  331. goto fatal
  332. endif
  333. endif
  334. LibraryProcedure Result $(!NWCFG_HANDLE), SetFileSysChangeValue
  335. LibraryProcedure Result $(!NWCFG_HANDLE), AddNetwarePrinterProvidor
  336. Set FLibraryErrCtl = 0
  337. ;
  338. ; Change netware to the top provider
  339. ;
  340. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\Print\Providers" $(MAXIMUM_ALLOWED) PrintProviderKey
  341. Ifstr $(PrintProviderKey) != $(KeyNull)
  342. GetRegValue $(PrintProviderKey),"Order",OrderInfo
  343. set OrderList = *($(OrderInfo),4)
  344. set NewOrderList = {$(ProductProviderName)}
  345. ForListDo $(OrderList)
  346. ifstr(i) $($) != $(ProductProviderName)
  347. set NewOrderList = >($(NewOrderList),$($))
  348. endif
  349. EndForListDo
  350. SetRegValue $(PrintProviderKey) {"Order",$(NoTitle),$(!REG_VT_MULTI_SZ),$(NewOrderList)}
  351. CloseRegKey $(PrintProviderKey)
  352. endif
  353. ;
  354. ; Set Authentication packages
  355. ;
  356. OpenRegKey $(!REG_H_LOCAL) "" $(LSAKeyName) $(MAXIMUM_ALLOWED) LSAKey
  357. Ifstr $(LSAKey) != $(KeyNull)
  358. GetRegValue $(LSAKey),"Authentication Packages", PackagesInfo
  359. set Packages = *($(PackagesInfo), 4)
  360. ifcontains(i) "nwprovau" in $(Packages)
  361. ; don't do it
  362. debug-output "Authentication Packages already exist."
  363. else
  364. ifstr(i) $(Packages) == ""
  365. set Packages = {"nwprovau"}
  366. else
  367. set Packages = >($(Packages),"nwprovau")
  368. endif
  369. SetRegValue $(LSAKey) {"Authentication Packages",$(NoTitle),$(!REG_VT_MULTI_SZ),$(Packages)}
  370. endif
  371. CloseRegKey $(LSAKey)
  372. endif
  373. ifstr(i) $(DoWKSTA) == TRUE
  374. Debug-Output "OEMNSVNW.INF: Install Workstation in registry."
  375. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(ProductNWWKSTAName))
  376. Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  377. $(ProductNWWKSTAName), +
  378. $(ProductNWWKSTAName), +
  379. $(ProductNWWKSTADisplayName), $(STF_CONTEXTINFNAME), +
  380. $(ProductNWWKSTAImagePath), "autoserviceshare", "NetworkProvider", {}, "",+
  381. $(NetwareEventDLL)
  382. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  383. Debug-Output "OEMNSVNW.INF: ShellCode error"
  384. goto ShellCodeError
  385. endif
  386. set RegistryErrorIndex = $($R0)
  387. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  388. EndWait
  389. Debug-Output "OEMNSVNW.INF: Registry error: add software components"
  390. CloseRegKey $($R1)
  391. CloseRegKey $($R2)
  392. CloseRegKey $($R3)
  393. CloseRegKey $($R4)
  394. CloseRegKey $($R5)
  395. goto fatalregistry
  396. endif
  397. Set SoftProductKey = $($R1)
  398. Set SoftNetRuleKey = $($R2)
  399. Set SoftServiceKey = $($R3)
  400. Set SoftParameterKey = $($R4)
  401. Set SoftLinkageKey = $($R5)
  402. set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  403. {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  404. {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  405. {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductNWWKSTATitle)},+
  406. {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductNWWKSTADescription)},+
  407. {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductNWWKSTAName)},+
  408. {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  409. Shell $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  410. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  411. Debug-Output "OEMNSVNW.INF: ShellCode error."
  412. goto ShellCodeError
  413. endif
  414. set RegistryErrorIndex = $($R0)
  415. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  416. EndWait
  417. Debug-Output "OEMNSVNW.INF: registry error: add value list."
  418. CloseRegKey $(SoftProductKey)
  419. CloseRegKey $(SoftNetRuleKey)
  420. CloseRegKey $(SoftServiceKey)
  421. CloseRegKey $(SoftLinkageKey)
  422. CloseRegKey $(SoftParameterKey)
  423. goto fatalregistry
  424. endif
  425. set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleNWWKSTAType)},+
  426. {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleNWWKSTAClass)}, +
  427. {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleNWWKSTAUse)}, +
  428. {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleNWWKSTABindForm)}, +
  429. {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleNWWKSTABindable)}, +
  430. {InfOption,$(NoTitle),$(!REG_VT_SZ),NWWKSTA}}
  431. Shell $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  432. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  433. Debug-Output "OEMNSVNW.INF: ShellCode error."
  434. goto ShellCodeError
  435. endif
  436. set RegistryErrorIndex = $($R0)
  437. CloseRegKey $(SoftProductKey)
  438. CloseRegKey $(SoftNetRuleKey)
  439. CloseRegKey $(SoftServiceKey)
  440. Shell "" AddParameterKey $(SoftParameterKey)
  441. CloseRegKey $(SoftParameterKey)
  442. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  443. CloseRegKey $(SoftLinkageKey)
  444. EndWait
  445. Debug-Output "OEMNSVNW.INF: Registry error: add value list."
  446. goto fatalregistry
  447. endif
  448. set NewValueList = {{OtherDependencies,$(NoTitle),$(!REG_VT_MULTI_SZ),{"Mup"}}}
  449. Shell $(UtilityInf), AddValueList, $(SoftLinkageKey), $(NewValueList)
  450. CloseRegKey $(SoftLinkageKey)
  451. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  452. Debug-Output "OEMNSVNW.INF: ShellCode error."
  453. goto ShellCodeError
  454. endif
  455. set RegistryErrorIndex = $($R0)
  456. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  457. EndWait
  458. Debug-Output "OEMNSVNW.INF: registry error: add value list."
  459. goto fatalregistry
  460. endif
  461. ; Remove autoexec.nt statements
  462. ;
  463. Set FLibraryErrCtl = 1
  464. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "REM Install network redirector"$(LF)
  465. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\nw16"$(LF)
  466. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\vwipxspx"$(LF)
  467. ;
  468. ; Setup string in autoexec.nt
  469. ;
  470. LibraryProcedure Result $(!NWCFG_HANDLE), AppendSzToFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "REM Install network redirector"$(CR)$(LF)
  471. LibraryProcedure Result $(!NWCFG_HANDLE), AppendSzToFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\nw16"$(CR)$(LF)
  472. LibraryProcedure Result $(!NWCFG_HANDLE), AppendSzToFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\vwipxspx"$(CR)$(LF)
  473. Set FLibraryErrCtl = 0
  474. endif
  475. ifstr(i) $(DoNWLINK) == TRUE
  476. ;
  477. ; Increase the reference counter
  478. ;
  479. Shell "utility.inf", IncrementRefCount, "Software\Microsoft\NWLINKIPX\CurrentVersion"
  480. endif
  481. ifstr(i) $(DoRDR) == TRUE
  482. Debug-Output "OEMNSVNW.INF: Install Rdr registry"
  483. Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(ProductNWRDRName))
  484. Shell $(UtilityInf), CreateService, $(ProductNWRDRName), +
  485. $(ProductNWRDRDisplayName), $(ProductNWRDRImagePath), +
  486. "system", "Network", {}, "", +
  487. $(NetwareEventDLL)
  488. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  489. Debug-Output "OEMNSVNW.INF: ShellCode error"
  490. goto ShellCodeError
  491. endif
  492. set RegistryErrorIndex = $($R0)
  493. set NWRdrServiceKey = $($R1)
  494. CloseRegKey $($R2)
  495. CloseRegKey $($R3)
  496. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  497. EndWait
  498. Debug-Output "OEMNSVNW.INF: Registry error: add software components"
  499. goto fatalregistry
  500. endif
  501. ;
  502. ; Add performance monitoring info
  503. ;
  504. CreateRegKey $(NWRdrServiceKey) {"Performance",$(NoTitle),GenericClass} "" +
  505. $(MAXIMUM_ALLOWED) "" KeyPerformance
  506. set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),"Perfnw.dll"},+
  507. {Open,$(NoTitle),$(!REG_VT_SZ),"OpenNetWarePerformanceData"},+
  508. {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectNetWarePerformanceData"},+
  509. {Close,$(NoTitle),$(!REG_VT_SZ),"CloseNetWarePerformanceData"}}
  510. Shell $(UtilityInf), AddValueList, $(KeyPerformance), $(NewValueList)
  511. set RegistryErrorIndex = $($R0)
  512. CloseRegKey $(KeyPerformance)
  513. CloseRegKey $(NWRdrServiceKey)
  514. ;
  515. ; Create performance help information
  516. ;
  517. LibraryProcedure Result $(!NWCFG_HANDLE), GetKernelVersion
  518. ifint *($(Result),3) < 529
  519. Set FLibraryErrCtl = 1
  520. LibraryProcedure STATUS $(!NWCFG_HANDLE), lodctr $(!STF_WINDOWSSYSPATH)\nwperf.ini
  521. ; Ignore the error code for now
  522. Set FLibraryErrCtl = 0
  523. else
  524. StartDetachedProcess STATUS "" "" $(!STF_WINDOWSSYSPATH)"\lodctr.exe" "nwperf.ini"
  525. ifstr(i) $(STATUS) == "ERROR"
  526. debug-output "Cannot detached process"
  527. endif
  528. endif
  529. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  530. EndWait
  531. Debug-Output "OEMNSVNW.INF: Registry error: add performance information"
  532. goto fatalregistry
  533. endif
  534. Debug-Output "OEMNSVNW.INF: Add NetworkProvider"
  535. Shell $(UtilityInf), AddNetworkProvider, $(ProviderName), +
  536. $(ProductProviderImagePath), $(ProductProviderName), "nwrdr"
  537. set RegistryErrorIndex = $($R0)
  538. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  539. EndWait
  540. Debug-Output "OEMNSVNW.INF: Registry error: add software components"
  541. goto fatalregistry
  542. endif
  543. ;
  544. ; Put netware provider to the top of the order list
  545. ;
  546. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\NetworkProvider\Order" $(MAXIMUM_ALLOWED) NetProviderKey
  547. Ifstr $(NetProviderKey) != $(KeyNull)
  548. GetRegValue $(NetProviderKey),"ProviderOrder",OrderInfo
  549. set OrderList = *($(OrderInfo),4)
  550. Split-String $(OrderList), ",", ProviderList
  551. set NewOrderList = $(ProductNWWKSTAName)
  552. ForListDo $(ProviderList)
  553. ifstr(i) $($) != ","
  554. ifstr(i) $($) != $(ProductNWWKSTAName)
  555. set NewOrderList = $(NewOrderList)","$($)
  556. endif
  557. endif
  558. EndForListDo
  559. SetRegValue $(NetProviderKey) {"ProviderOrder",$(NoTitle),$(!REG_VT_SZ),$(NewOrderList)}
  560. CloseRegKey $(NetProviderKey)
  561. endif
  562. Shell "" AddShortName
  563. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProviderName)"\networkprovider" $(MAXIMUM_ALLOWED) ProviderKey
  564. ifstr(i) $(ProviderKey) != ""
  565. set NewValueList = {{Class,$(NoTitle),$(!REG_VT_DWORD),3}}
  566. Shell $(UtilityInf) AddValueList $(ProviderKey) $(NewValueList)
  567. endif
  568. CloseRegKey $(ProviderKey)
  569. LibraryProcedure Status1, $(!LIBHANDLE), CheckFileExistance, $(!STF_WINDOWSSYSPATH)"\novell.cpl"
  570. ifstr(i) $(Status1) == "YES"
  571. LibraryProcedure Status2, $(!LIBHANDLE), RenFile, $(!STF_WINDOWSSYSPATH)"\novell.cpl", $(!STF_WINDOWSSYSPATH)"\novell.bak"
  572. endif
  573. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\WOW" $(MAXIMUM_ALLOWED) WowKey
  574. ifstr(i) $(WowKey) != ""
  575. GetRegValue $(WowKey),"KnownDLLS", KnownDLLsInfo
  576. Split-String *($(KnownDLLsInfo),4), " ", KnownDLLsList
  577. Ifcontains(i) "netware.drv" not-in $(KnownDLLsList)
  578. ifstr(i) *($(KnownDLLsInfo),4) == ""
  579. set KnownDLLs = "netware.drv"
  580. else
  581. set KnownDLLs = *($(KnownDLLsInfo),4)" netware.drv"
  582. endif
  583. SetRegValue $(WowKey) {"KnownDLLS",$(NoTitle),$(!REG_VT_SZ),$(KnownDLLs)}
  584. endif
  585. CloseRegKey $(WowKey)
  586. endif
  587. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\LanmanServer\Parameters" $(MAXIMUM_ALLOWED) ServerParmKey
  588. ifstr(i) $(ServerParmKey) != ""
  589. SetRegValue $(ServerParmKey) {"EnableSharedNetDrives",$(NoTitle),$(!REG_VT_DWORD),1}
  590. CloseRegKey $(ServerParmKey)
  591. endif
  592. endif
  593. writeparameters = +
  594. FreeLibrary $(!NWCFG_HANDLE)
  595. EndWait
  596. goto successful
  597. ConfigureBrowser = +
  598. goto successful
  599. bindingadapter =+
  600. set Error = "Binding: Sorry, not yet implemented."
  601. goto fatal
  602. removeadapter = +
  603. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\WOW" $(MAXIMUM_ALLOWED) WowKey
  604. ifstr(i) $(WowKey) != ""
  605. GetRegValue $(WowKey),"KnownDLLS", KnownDLLsInfo
  606. Split-String *($(KnownDLLsInfo),4), " ", KnownDLLsList
  607. set KnownDLLs = ""
  608. Ifcontains(i) "netware.drv" in $(KnownDLLsList)
  609. ForListDo $(KnownDLLsList)
  610. ifstr(i) $($) != " "
  611. ifstr(i) $($) != "netware.drv"
  612. ifstr(i) $(KnownDLLs) == ""
  613. set KnownDLLs = $($)
  614. else
  615. set KnownDLLs = $(KnownDLLs)" "$($)
  616. endif
  617. endif
  618. endif
  619. EndForListDo
  620. else
  621. set KnownDLLs = *($(KnownDLLsInfo),4)
  622. endif
  623. SetRegValue $(WowKey) {"KnownDLLS",$(NoTitle),$(!REG_VT_SZ),$(KnownDLLs)}
  624. CloseRegKey $(WowKey)
  625. endif
  626. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\LanmanServer\Parameters" $(MAXIMUM_ALLOWED) ServerParmKey
  627. ifstr(i) $(ServerParmKey) != ""
  628. SetRegValue $(ServerParmKey) {"EnableSharedNetDrives",$(NoTitle),$(!REG_VT_DWORD),0}
  629. CloseRegKey $(ServerParmKey)
  630. endif
  631. LoadLibrary "nw" $(!STF_CWDDIR)\nwcfg.dll !NWCFG_HANDLE
  632. Set FLibraryErrCtl = 1
  633. LibraryProcedure Result $(!NWCFG_HANDLE), DeleteNetwarePrinterProvidor
  634. LibraryProcedure Result $(!NWCFG_HANDLE), DeleteGatewayPassword
  635. Set FLibraryErrCtl = 0
  636. LibraryProcedure Result $(!NWCFG_HANDLE), GetKernelVersion
  637. ifint *($(Result),3) < 529
  638. Set FLibraryErrCtl = 1
  639. LibraryProcedure STATUS $(!NWCFG_HANDLE), unlodctr nwrdr
  640. ; Ignore the error code for now
  641. Set FLibraryErrCtl = 0
  642. else
  643. StartDetachedProcess STATUS "" "" $(!STF_WINDOWSSYSPATH)"\unlodctr.exe" "nwrdr"
  644. ifstr(i) $(STATUS) == "ERROR"
  645. debug-output "Cannot detached process"
  646. endif
  647. endif
  648. ;
  649. ; remove Authentication Packages
  650. ;
  651. OpenRegKey $(!REG_H_LOCAL) "" $(LSAKeyName) $(MAXIMUM_ALLOWED) LSAKey
  652. Ifstr $(LSAKey) != $(KeyNull)
  653. GetRegValue $(LSAKey),"Authentication Packages", PackagesInfo
  654. set Packages = *($(PackagesInfo), 4)
  655. ifcontains(i) "nwprovau" not-in $(Packages)
  656. ; don't do it
  657. ; something wrong....
  658. debug-output "Authentication Packages does not exist.."
  659. else
  660. set NewPackages = {}
  661. ForListDo $(Packages)
  662. ifstr(i) $($) != "nwprovau"
  663. ifstr(i) $(NewPackages) == {}
  664. set NewPackages = {$($)}
  665. else
  666. set NewPackages = >($(NewPackages),$($))
  667. endif
  668. endif
  669. EndForListDo
  670. SetRegValue $(LSAKey) {"Authentication Packages",$(NoTitle),$(!REG_VT_MULTI_SZ),$(NewPackages)}
  671. endif
  672. CloseRegKey $(LSAKey)
  673. endif
  674. ifcontains(i) $(ProductNWWKSTAName) in $(OEM_ABANDON_OPTIONS)
  675. Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  676. $(ProductNWWKSTAName)
  677. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  678. Debug-Output "OEMNSVNW.INF: ShellCode error"
  679. goto ShellCodeError
  680. endif
  681. set RegistryErrorIndex = $($R0)
  682. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  683. goto fatalregistry
  684. endif
  685. endif
  686. ForListDo {$(ProductNWRDRName)}
  687. ifcontains(i) $($) in $(OEM_ABANDON_OPTIONS)
  688. Shell $(UtilityInf), RemoveService, $($), "YES"
  689. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  690. Debug-Output "OEMNSVNW.INF: ShellCode error"
  691. goto ShellCodeError
  692. endif
  693. set RegistryErrorIndex = $($R0)
  694. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  695. goto fatalregistry
  696. endif
  697. endif
  698. EndForListDo
  699. Shell "UTILITY.INF", DecrementRefCount, "Software\Microsoft\NWLINKIPX\CurrentVersion"
  700. ;
  701. ; Remove autoexec.nt statements
  702. ;
  703. Set FLibraryErrCtl = 1
  704. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "REM Install network redirector"$(LF)
  705. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\nw16"$(LF)
  706. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\vwipxspx"$(LF)
  707. Set FLibraryErrCtl = 0
  708. Shell $(UtilityInf) RemoveNetworkProvider $(ProviderName)
  709. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  710. Debug-Output "OEMNSVNW.INF: ShellCode error"
  711. goto ShellCodeError
  712. endif
  713. set RegistryErrorIndex = $($R0)
  714. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  715. goto fatalregistry
  716. endif
  717. ;
  718. ; Remove ShrotName
  719. ;
  720. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\NetworkProvider\ShortName" $(MAXIMUM_ALLOWED) ShortNameKey
  721. ifstr $(ShortNameKey) != $(KeyNull)
  722. DeleteRegValue $(ShortNameKey) "NW"
  723. else
  724. ;
  725. ; we must be able to open the provider key
  726. ;
  727. debug-output "something wrong..."
  728. endif
  729. FreeLibrary $(!NWCFG_HANDLE)
  730. Install "RestoreFiles"
  731. Set FLibraryErrCtl = 1
  732. LibraryProcedure Status1, $(!LIBHANDLE), DelFile, $(!STF_WINDOWSSYSPATH)"\nwc.bak"
  733. LibraryProcedure Status1, $(!LIBHANDLE), DelFile, $(!STF_WINDOWSSYSPATH)"\nwapi32.bak"
  734. LibraryProcedure Status1, $(!LIBHANDLE), RenFile, $(!STF_WINDOWSSYSPATH)"\nwc.cpl" $(!STF_WINDOWSSYSPATH)"\nwc.bak"
  735. LibraryProcedure Status1, $(!LIBHANDLE), RenFile, $(!STF_WINDOWSSYSPATH)"\nwapi32.dll" $(!STF_WINDOWSSYSPATH)"\nwapi32.bak"
  736. Set FLibraryErrCtl = 0
  737. Shell "" RemoveBackupFiles
  738. goto end
  739. UpgradeSoftware = +
  740. LoadLibrary "nw" $(!STF_CWDDIR)\nwcfg.dll !NWCFG_HANDLE
  741. LibraryProcedure Result $(!NWCFG_HANDLE), GetKernelVersion
  742. ifint *($(Result),3) > 528
  743. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "NONFATAL", $(NotDaytona)
  744. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  745. goto ShellCodeError
  746. endif
  747. goto end
  748. endif
  749. FreeLibrary $(!NWCFG_HANDLE)
  750. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName)"\NetRules" $(MAXIMUM_ALLOWED) KeyNetRules
  751. Ifstr $(KeyNetRules) != $(KeyNull)
  752. GetRegValue $(KeyNetRules),"InfName", InfNameInfo
  753. set !UG_Filename = *($(InfNameInfo), 4)
  754. CloseRegKey $(KeyNetRules)
  755. else
  756. Split-String $(!NTN_Infname), "\", FilenameList
  757. QueryListSize ListSize $(FilenameList)
  758. set !UG_Filename = *($(FilenameList), $(ListSize))
  759. endif
  760. Install "Install-Update"
  761. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  762. goto fatal
  763. endif
  764. set AddCopy = "YES"
  765. set DoCopy = "YES"
  766. install "Install-nwcfgdll"
  767. ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  768. goto fatal
  769. endif
  770. LoadLibrary "nw" $(!STF_CWDDIR)\nwcfg.dll !NWCFG_HANDLE
  771. OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  772. Ifstr $(KeyProduct) != $(KeyNull)
  773. CloseRegKey $(KeyProduct)
  774. ;
  775. ; Check whether we are update beta 1 or beta 2.
  776. ; Beta 2 will have a Performance key under \nwcworkstation\parameters
  777. ;
  778. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\Nwrdr\Performance" $(MAXIMUM_ALLOWED) KeyPerformance
  779. Ifstr $(KeyPerformance) != $(KeyNull)
  780. ;
  781. ; We are upgrading beta 2. Do nothing
  782. ;
  783. CloseRegKey $(KeyPerformance)
  784. Set FLibraryErrCtl = 1
  785. LibraryProcedure Result $(!NWCFG_HANDLE), DeleteGatewayPassword
  786. Set FLibraryErrCtl = 0
  787. LibraryProcedure Result $(!NWCFG_HANDLE), GetKernelVersion
  788. ifint *($(Result),3) < 529
  789. Set FLibraryErrCtl = 1
  790. LibraryProcedure STATUS $(!NWCFG_HANDLE), unlodctr nwrdr
  791. LibraryProcedure STATUS $(!NWCFG_HANDLE), lodctr $(!STF_WINDOWSSYSPATH)\nwperf.ini
  792. Set FLibraryErrCtl = 0
  793. endif
  794. else
  795. ;
  796. ; We are upgrading beta 1. Do the followings:
  797. ; 1. Add SetFileSysChangeValue call out.
  798. ; 2. Add "vwipxspx" to autoexec.nt
  799. ; 3. Add Performance stuff
  800. ; 4. Add lodctr
  801. ; 5. Change the provider device name
  802. ; 6. rename novell.cpl
  803. ; 7. Add WOW's known DLL
  804. ; 8. Add EnableShareNetDrivers
  805. ; 9. Change name
  806. ; 10. Change class type
  807. ;
  808. ;
  809. ; Do 1. Add SetFileSysChangeValue
  810. ;
  811. LibraryProcedure Result $(!NWCFG_HANDLE), SetFileSysChangeValue
  812. ; Do 2. Remove autoexec.nt statements
  813. ;
  814. Set FLibraryErrCtl = 1
  815. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "REM Install network redirector"$(LF)
  816. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\nw16"$(LF)
  817. LibraryProcedure Result $(!NWCFG_HANDLE), RemoveSzFromFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\vwipxspx"$(LF)
  818. ;
  819. ; Setup string in autoexec.nt
  820. ;
  821. LibraryProcedure Result $(!NWCFG_HANDLE), AppendSzToFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "REM Install network redirector"$(CR)$(LF)
  822. LibraryProcedure Result $(!NWCFG_HANDLE), AppendSzToFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\nw16"$(CR)$(LF)
  823. LibraryProcedure Result $(!NWCFG_HANDLE), AppendSzToFile, $(!STF_WINDOWSSYSPATH)"\autoexec.nt", "lh %SystemRoot%\system32\vwipxspx"$(CR)$(LF)
  824. Set FLibraryErrCtl = 0
  825. ;
  826. ; Do 3. Add performance stuff
  827. ;
  828. OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\nwrdr" $(MAXIMUM_ALLOWED) KeyNwrdr
  829. CreateRegKey $(KeyNwrdr) {"Performance",$(NoTitle),GenericClass} "" +
  830. $(MAXIMUM_ALLOWED) "" KeyPerformance
  831. set NewValueList = {{Library,$(NoTitle),$(!REG_VT_SZ),"Perfnw.dll"},+
  832. {Open,$(NoTitle),$(!REG_VT_SZ),"OpenNetWarePerformanceData"},+
  833. {Collect,$(NoTitle),$(!REG_VT_SZ),"CollectNetWarePerformanceData"},+
  834. {Close,$(NoTitle),$(!REG_VT_SZ),"CloseNetWarePerformanceData"}}
  835. Shell $(UtilityInf), AddValueList, $(KeyPerformance), $(NewValueList)
  836. set RegistryErrorIndex = $($R0)
  837. CloseRegKey $(KeyPerformance)
  838. CloseRegKey $(KeyNwrdr)
  839. ;
  840. ; Do 4. Add lodctr
  841. ;
  842. LibraryProcedure Result $(!NWCFG_HANDLE), GetKernelVersion
  843. ifint *($(Result),3) < 529
  844. Set FLibraryErrCtl = 1
  845. LibraryProcedure STATUS $(!NWCFG_HANDLE), lodctr $(!STF_WINDOWSSYSPATH)\nwperf.ini
  846. ; Ignore the error code for now
  847. Set FLibraryErrCtl = 0
  848. endif
  849. Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  850. EndWait
  851. Debug-Output "OEMNSVNW.INF: Registry error: add performance information"
  852. goto fatalregistry
  853. endif
  854. ;
  855. ; Do 6. rename novell.cpl
  856. ;
  857. LibraryProcedure Status1, $(!LIBHANDLE), CheckFileExistance, $(!STF_WINDOWSSYSPATH)"\novell.cpl"
  858. ifstr(i) $(Status1) == "YES"
  859. LibraryProcedure Status2, $(!LIBHANDLE), RenFile, $(!STF_WINDOWSSYSPATH)"\novell.cpl", $(!STF_WINDOWSSYSPATH)"\novell.bak"
  860. endif
  861. ;
  862. ; Do 7. Add WOW's known DLL
  863. ;
  864. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\WOW" $(MAXIMUM_ALLOWED) WowKey
  865. ifstr(i) $(WowKey) != ""
  866. GetRegValue $(WowKey),"KnownDLLS", KnownDLLsInfo
  867. Split-String *($(KnownDLLsInfo),4), " ", KnownDLLsList
  868. Ifcontains(i) "netware.drv" not-in $(KnownDLLsList)
  869. ifstr(i) *($(KnownDLLsInfo),4) == ""
  870. set KnownDLLs = "netware.drv"
  871. else
  872. set KnownDLLs = *($(KnownDLLsInfo),4)" netware.drv"
  873. endif
  874. SetRegValue $(WowKey) {"KnownDLLS",$(NoTitle),$(!REG_VT_SZ),$(KnownDLLs)}
  875. endif
  876. CloseRegKey $(WowKey)
  877. endif
  878. endif
  879. endif
  880. ;
  881. ; Do 5. Change the provider device name
  882. ;
  883. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\NWCWorkstation\networkprovider" $(MAXIMUM_ALLOWED) ProviderKey
  884. ifstr(i) $(ProviderKey) != ""
  885. SetRegValue $(ProviderKey) {Devicename,$(NoTitle),$(!REG_VT_SZ),"\device\nwrdr"}
  886. SetRegValue $(ProviderKey) {Name,$(NoTitle),$(!REG_VT_SZ),$(ProductProviderName)}
  887. CloseRegKey $(ProviderKey)
  888. endif
  889. ;
  890. ; Do 8. Add EnableShareNetDrivers
  891. ;
  892. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\LanmanServer\Parameters" $(MAXIMUM_ALLOWED) ServerParmKey
  893. ifstr(i) $(ServerParmKey) != ""
  894. SetRegValue $(ServerParmKey) {"EnableSharedNetDrives",$(NoTitle),$(!REG_VT_DWORD),1}
  895. CloseRegKey $(ServerParmKey)
  896. endif
  897. ;
  898. ; do 9. Change name
  899. ;
  900. OpenRegKey $(!REG_H_LOCAL) "" "Software\Microsoft\NWCWorkstation\CurrentVersion" $(MAXIMUM_ALLOWED) CurrentVersionKey
  901. ifstr(i) $(CurrentVersionKey) != ""
  902. SetRegValue $(CurrentVersionKey) {"Description",$(NoTitle),$(!REG_VT_SZ),$(NWType)}
  903. SetRegValue $(CurrentVersionKey) {"Title",$(NoTitle),$(!REG_VT_SZ),$(NWType)}
  904. CloseRegKey $(CurrentVersionKey)
  905. endif
  906. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Services\NWCWorkstation" $(MAXIMUM_ALLOWED) nwcKey
  907. ifstr(i) $(nwcKey) != ""
  908. SetRegValue $(nwcKey) {"DisplayName",$(NoTitle),$(!REG_VT_SZ),$(NWType)}
  909. CloseRegKey $(nwcKey)
  910. endif
  911. Set FLibraryErrCtl = 1
  912. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\Print\Providers" $(MAXIMUM_ALLOWED) PrintProviderKey
  913. ifstr(i) $(PrintProviderKey) != ""
  914. GetRegValue $(PrintProviderKey) "Order" OrderInfo
  915. ifcontains(i) $(OldPrintProviderName) in *($(OrderInfo),4)
  916. ; spool is not started
  917. DeleteRegKey $(PrintProviderKey) $(OldPrintProviderName)
  918. OpenRegKey $(PrintProviderKey) "" $(ProductProviderName) $(MAXIMUM_ALLOWED) ProductProviderKey
  919. ifstr $(ProductProviderKey) == $(KeyNull)
  920. CreateRegKey $(PrintProviderKey) {$(ProductProviderName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ProductProviderKey
  921. endif
  922. ifstr $(ProductProviderKey) != $(KeyNull)
  923. SetRegValue $(ProductProviderKey) {"Name",$(NoTitle),$(!REG_VT_SZ),"nwprovau.dll"}
  924. endif
  925. ;
  926. ; Change it to top provider
  927. ;
  928. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\Print\Providers" $(MAXIMUM_ALLOWED) PrintProviderKey
  929. Ifstr $(PrintProviderKey) != $(KeyNull)
  930. GetRegValue $(PrintProviderKey),"Order",OrderInfo
  931. set OrderList = *($(OrderInfo),4)
  932. set NewOrderList = {$(ProductProviderName)}
  933. ForListDo $(OrderList)
  934. ifstr(i) $($) != $(OldPrintProviderName)
  935. ifstr(i) $($) != $(ProductProviderName)
  936. set NewOrderList = >($(NewOrderList),$($))
  937. endif
  938. endif
  939. EndForListDo
  940. SetRegValue $(PrintProviderKey) {"Order",$(NoTitle),$(!REG_VT_MULTI_SZ),$(NewOrderList)}
  941. CloseRegKey $(PrintProviderKey)
  942. endif
  943. endif
  944. endif
  945. Set FLibraryErrCtl = 0
  946. Shell "" AddShortName
  947. FreeLibrary $(!NWCFG_HANDLE)
  948. goto end
  949. successful = +
  950. goto end
  951. warning = +
  952. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  953. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  954. goto ShellCodeError
  955. endif
  956. ifstr(i) $($R1) == "OK"
  957. goto $(to)
  958. else-ifstr(i) $($R1) == "CANCEL"
  959. goto $(from)
  960. else
  961. goto end
  962. endif
  963. nonfatalinfo = +
  964. Set CommonStatus = STATUS_USERCANCEL
  965. Set Severity = STATUS
  966. goto nonfatalmsg
  967. nonfatal = +
  968. Set Severity = NONFATAL
  969. goto nonfatalmsg
  970. nonfatalmsg = +
  971. ifstr(i) $(Error) == ""
  972. Set Severity = NONFATAL
  973. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  974. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  975. goto ShellCodeError
  976. endif
  977. set Error = $($R0)
  978. endif
  979. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  980. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  981. goto ShellCodeError
  982. endif
  983. ifstr(i) $($R1) == "OK"
  984. goto $(from)
  985. else
  986. goto "end"
  987. endif
  988. fatalregistry = +
  989. Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  990. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  991. goto ShellCodeError
  992. endif
  993. set Error = $($R0)
  994. goto fatal
  995. fatal = +
  996. ifstr(i) $(Error) == ""
  997. Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  998. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  999. goto ShellCodeError
  1000. endif
  1001. set Error = $($R0)
  1002. endif
  1003. Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1004. ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1005. goto ShellCodeError
  1006. endif
  1007. goto setfailed
  1008. ShellCodeError = +
  1009. set DlgType = "MessageBox"
  1010. set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1011. set STF_MB_TEXT = $(ShellCodeErrorText)
  1012. set STF_MB_TYPE = 1
  1013. set STF_MB_ICON = 3
  1014. set STF_MB_DEF = 1
  1015. ui start "Error Message"
  1016. goto setfailed
  1017. setfailed = +
  1018. set CommonStatus = STATUS_FAILED
  1019. ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1020. set OEM_ABANDON_ON = FALSE
  1021. goto removeadapter
  1022. endif
  1023. goto end
  1024. end = +
  1025. goto term
  1026. term = +
  1027. Return $(CommonStatus)
  1028. [RestoreFiles]
  1029. AddSectionFilesToCopyList Restore-Oldexe $(!STF_WINDOWSSYSPATH) $(!STF_WINDOWSSYSPATH)
  1030. AddSectionFilesToCopyList Restore-Oldsys $(!STF_WINDOWSSYSPATH)\drivers $(!STF_WINDOWSSYSPATH)\drivers
  1031. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1032. CopyFilesInCopyList
  1033. Exit
  1034. [Install-nwcfgdll]
  1035. set STF_VITAL = ""
  1036. ifstr(i) $(AddCopy) == "YES"
  1037. AddSectionFilesToCopyList Files-nwcfgdll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1038. endif
  1039. ifstr(i) $(DoCopy) == "YES"
  1040. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1041. CopyFilesInCopyList
  1042. endif
  1043. Exit
  1044. [Install-Option]
  1045. set STF_VITAL = ""
  1046. ifstr(i) $(AddCopy) == "YES"
  1047. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1048. AddSectionFilesToCopyList Files-Drivers $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1049. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  1050. AddSectionFilesToCopyList Files-WINNTHelp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1051. else
  1052. AddSectionFilesToCopyList Files-NTASHelp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1053. endif
  1054. endif
  1055. ifstr(i) $(DoCopy) == "YES"
  1056. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1057. CopyFilesInCopyList
  1058. endif
  1059. ifstr(i) $(DoConfig) == "YES"
  1060. endif
  1061. Exit
  1062. [Install-Update]
  1063. set STF_VITAL = ""
  1064. AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1065. AddSectionFilesToCopyList Files-Drivers $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1066. AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1067. ifstr(i) $(!STF_PRODUCT) == "WINNT"
  1068. AddSectionFilesToCopyList Files-WINNTHelp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1069. else
  1070. AddSectionFilesToCopyList Files-NTASHelp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1071. endif
  1072. set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1073. CopyFilesInCopyList
  1074. Exit
  1075. [AddShortName]
  1076. read-syms GeneralConstants
  1077. read-syms FileConstants
  1078. read-syms FileConstants$(!STF_LANGUAGE)
  1079. ;
  1080. ; Create Short name
  1081. ;
  1082. OpenRegKey $(!REG_H_LOCAL) "" "System\CurrentControlSet\Control\NetworkProvider" $(MAXIMUM_ALLOWED) NetProviderKey
  1083. ifstr $(NetProviderKey) != $(KeyNull)
  1084. OpenRegKey $(NetProviderKey) "" "ShortName" $(MAXIMUM_ALLOWED) ShortNameKey
  1085. ifstr $(ShortNameKey) == $(KeyNull)
  1086. ;
  1087. ; Create short key if we cannot open it
  1088. ;
  1089. CreateRegKey $(NetProviderKey) {"ShortName",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" ShortNameKey
  1090. endif
  1091. ifstr $(ShortNameKey) != $(KeyNull)
  1092. SetRegValue $(ShortNameKey) {"NW",$(NoTitle),$(!REG_VT_SZ),$(ProductProviderName)}
  1093. endif
  1094. else
  1095. ;
  1096. ; we must be able to open the provider key
  1097. ;
  1098. debug-output "something wrong..."
  1099. endif
  1100. return
  1101. [AddParameterKey]
  1102. read-syms GeneralConstants
  1103. set SoftParameterKey = $($0)
  1104. CreateRegKey $(SoftParameterKey) {"Logon",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" LogonKey
  1105. CreateRegKey $(SoftParameterKey) {"Option",$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" OptionKey
  1106. Set FLibraryErrCtl = 1
  1107. ;
  1108. ; 2 is the equal to SetValue
  1109. ;
  1110. LibraryProcedure Result $(!NWCFG_HANDLE), SetEverybodyPermission, $(OptionKey), 2
  1111. Set FLibraryErrCtl = 0
  1112. CloseRegKey $(LogonKey)
  1113. CloseRegKey $(OptionKey)
  1114. Return
  1115. [GetFilesSize]
  1116. set FileSizeList = >(^(Files-Drivers,3),^(Files-NWWKSTA,3))
  1117. set TotalSize = 0
  1118. ForListDo $(FileSizeList)
  1119. ForListDo $($)
  1120. Debug-Output $($)
  1121. Split-String $($) "=" SplitString
  1122. set Size = *($(SplitString),3)
  1123. set-add TotalSize = $(TotalSize) $(Size)
  1124. EndForListDo
  1125. EndForListDo
  1126. set-div SizeInK = $(TotalSize) 1024
  1127. return $(SizeInK)
  1128. [Files-Inf]
  1129. 1, oemsetup.inf, SIZE=1000, RENAME=$(!UG_Filename)