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.

1345 lines
50 KiB

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