|
|
1.1 root 1: '***********************************************************************
2: '* RPC SDK Install
3: '* Copyright (C) - 1992 by Microsoft
4: '*
5: '* Written By - Steven Zeck
6: '**************************************************************************
7:
8: '$DEFINE NODEBUG ''Define for script development/debugging
9:
10: '$INCLUDE 'setupapi.inc'
11: '$INCLUDE 'msdetect.inc'
12:
13: CONST TRUE = -1
14: CONST FALSE = 0
15:
16: ''Dialog ID's
17: CONST ASKQUIT = 200
18: CONST DlgGetPath = 310
19: CONST HlpGetPath = 311
20: CONST DlgRegPath = 1700
21: CONST HlpRegPath = 1701
22: CONST DlgDosPath = 2000
23: CONST HlpDosPath = 2001
24: CONST EXITFAILURE = 400
25: CONST EXITQUIT = 600
26:
27: ' Conditionaly set the dialogs for full SDK versus runtime only.
28:
29: '$ifndef RUNTIMEINSTALL
30:
31: CONST DlgWelcome = 100
32: CONST DlgInstallOptions = 800
33: CONST HlpInstallOptions = 801
34: CONST EXITSUCCESS = 700
35: '$else
36: CONST DlgWelcome = 2600
37: CONST DlgInstallOptions = 2400
38: CONST HlpInstallOptions = 2401
39: CONST EXITSUCCESS = 2800
40:
41: '$endif
42:
43: CONST DlgSdkOption = 1200
44: CONST HlpSdkOption = 1201
45: CONST DlgRuntimeOption = 1400
46: CONST HlpRuntimeOption = 1401
47: CONST DlgTransport = 1600
48: CONST HlpTransport = 1601
49: CONST DlgNetBiosOptions = 2200
50: CONST HlpNetBiosOptions = 2201
51: CONST DlgNetBiosProtocols = 2300
52: CONST HlpNetBiosProtocols = 2301
53: CONST DlgNewProtocol = 2100
54: CONST HlpNewProtocol = 2101
55: CONST DlgAutoPath = 2400
56: CONST HlpAutoPath = 2401
57: CONST BADPATH = 6400
58:
59: ''Bitmap ID
60: CONST LOGO = 1
61:
62: CONST LanType_LANMAN = 6
63:
64: Type LAN_DETECT
65: iType As Integer
66: iMajor As Integer
67: iMinor As Integer
68: iRev As Integer
69: fEnhance As Integer
70: End Type
71:
72: GLOBAL BasePath$ ''Default destination directory.
73: GLOBAL RegPath$ ''Default destination directory.
74: GLOBAL DosPath$ ''Default destination directory.
75: Global CustomInstall ''Custom install option
76: Global SrcDir$
77: Global AllTransports
78: Global MSDOSRuntime
79: Global MSDOSSDK
80: Global WindowsRuntime
81: Global WindowsSDK
82: Global NetBiosTransport
83: Global SamplesSDK
84: Global HelpFiles
85: GLOBAL CUIDLL$
86: GLOBAL HELPPROC$
87:
88: DECLARE Function GetPath(Dialog%, Path$) AS INTEGER
89: DECLARE FUNCTION GetTransport() As INTEGER
90: DECLARE Sub CopyList(ListIn$, ListOut$, Truncate%)
91: DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
92: DECLARE FUNCTION GetCheck (index%) AS INTEGER
93: DECLARE FUNCTION BoolToOnOff (Bool%) AS String
94: DECLARE FUNCTION GetWinRunSize () AS String
95: DECLARE FUNCTION GetWinSize () AS String
96: DECLARE FUNCTION GetDosSize () AS String
97: DECLARE FUNCTION GetDosRunSize () AS String
98: DECLARE FUNCTION GetHlpSize () AS String
99: DECLARE FUNCTION GetSampleSize () AS String
100: DECLARE FUNCTION GetTransportSize () AS String
101: DECLARE FUNCTION FormatSize ()AS String
102:
103:
104: INIT:
105: CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
1.1.1.2 ! root 106: HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
1.1 root 107:
108: SetBitmap CUIDLL$, LOGO
1.1.1.2 ! root 109: SetTitle "RPC - Software Development Kit Install"
1.1 root 110:
111: szInf$ = GetSymbolValue("STF_SRCINFPATH")
112: if szInf$ = "" THEN
113: szInf$ = GetSymbolValue("STF_CWDDIR") + "RPCSDK.INF"
114: end if
115: ReadInfFile szInf$
1.1.1.2 ! root 116: SetAbout "RPC SDK Install", "By stevez - Version 0.09"
1.1 root 117:
118: CustomInstall = FALSE
119: AllTransports = TRUE
120: MSDOSRuntime = TRUE
121:
122: '$ifndef WINDOWS_ONLY
123: MSDOSSDK = TRUE
124: '$endif
125:
126: '$ifndef MSDOS_ONLY
127: WindowsRuntime = TRUE
128: '$endif
129:
130: WindowsSDK = TRUE
131: NetBiosTransport = TRUE
132: SamplesSDK = TRUE
133: HelpFiles = TRUE
134:
135: Dim Detect As LAN_DETECT
136: BasePath$ = "C:\c700"
137: RegPath$="C:\"
138: DosPath$="C:\DOS"
139: WinPath$=GetWindowsDir
140: SrcDir$ = GetSymbolValue("STF_SRCDIR")
141:
142: ' If the path contains lanman, make that the default DOS DLL directory.
143:
144: path$ = Ucase$(GetEnvVariableValue ("PATH"))+";"
145:
146: i% = 1
147: while i% < len(path$)
148:
149: iEnd = instr(i%, path$, ";")
150: cPath$ = mid$(path, i%, iEnd - i%)
151:
152: if instr (cPath$, "LANMAN") or instr(cPath$, "\NETPROG") then
153: DosPath$ = cPath$
154: end if
155:
156: if instr (cPath$, "\C700\") then
157: BasePath$ = mid$(cPath$, 1, 1)+":\C700"
158: end if
159:
160: i% = iEnd + 1
161: wend
162:
163:
164: '$ifdef DEBUG
165:
1.1.1.2 ! root 166: SrcDir$ = "\install\sdk.new\nsetup"
1.1 root 167: ' DosPath$="C:\c700\DOS"
168: WinPath$="C:\c700\WIN"
169:
170: '$endif ''DEBUG
171:
172: WELCOME:
173: sz$ = UIStartDlg(CUIDLL$, DlgWelcome, "FInfoDlgProc", 0, "")
174: if sz$ = "CONTINUE" THEN
175: UIPop 1
176: else
177: GOSUB ASKQUIT
178: GOTO WELCOME
179: end if
180:
181:
182: OPTION:
183: if not CustomInstall then
184: SetSymbolValue "RadioDefault", "1"
185: else
186: SetSymbolValue "RadioDefault", "2"
187: end if
188:
189: RESTART_OPTION:
190: sz$ = UIStartDlg(CUIDLL$, DlgInstallOptions, "FRadioDlgProc", HlpInstallOptions, HELPPROC$)
191: Index$ = GetSymbolValue("ButtonChecked")
192:
193: if sz$ = "CONTINUE" THEN
194: UIPop(1)
195: elseif sz$ = "REACTIVATE" THEN
196: GOTO RESTART_OPTION
197: else
198: GOSUB ASKQUIT
199: GOTO OPTION
200: end if
201:
202: if Index$ = "2" then
203: CustomInstall = TRUE
204: else
205: CustomInstall = FALSE
206:
207: '$ifndef RUNTIMEINSTALL
208: i% = GetPath(DlgGetPath, BasePath$)
209: '$else
210: i% = GetPath(DlgDosPath, DosPath$)
211: '$endif
212:
213: if i% then
1.1.1.2 ! root 214: goto NETBIOS
! 215:
! 216: ' If you want to default to netbios always, remove
! 217: ' the preceeding goto. This removes an additional dialog.
! 218:
! 219: AddListItem "NetBiosMap", "nb=0"
1.1 root 220: goto FullInstall
221: else
222: goto OPTION
223: end if
224: end if
225:
226:
227: '$ifndef RUNTIMEINSTALL
228:
229: SDK_OPTION:
230:
231: RemoveSymbol "CheckItemsState"
232: RemoveSymbol "DriveStatusText"
233:
234: AddListItem "CheckItemsState", BoolToOnOff(SamplesSDK )
235: AddListItem "CheckItemsState", BoolToOnOff(MSDOSSDK)
236: AddListItem "CheckItemsState", BoolToOnOff(WindowsSDK )
237: AddListItem "CheckItemsState", BoolToOnOff(HelpFiles)
238:
239: AddListItem "DriveStatusText", BasePath$
240:
241: RESTART_SDK_OPTION:
242:
243: RemoveSymbol "StatusItemsText"
244: AddListItem "StatusItemsText", GetDosSize()
245: AddListItem "StatusItemsText", GetWinSize()
246: AddListItem "StatusItemsText", GetSampleSize()
247: AddListItem "StatusItemsText", GetHlpSize()
248:
249: sz$ = UIStartDlg(CUIDLL$, DlgSdkOption, "FCustInstDlgProc", HlpSdkOption, HELPPROC$)
250:
251: if sz$ = "CONTINUE" THEN
252: UIPop(1)
253:
254: elseif sz$ = "BACK" THEN
255: UIPop(1)
256: GOTO OPTION
257:
258: elseif sz$ = "REACTIVATE" THEN
259: GOTO RESTART_SDK_OPTION
260:
261: elseif sz$ = "PATH" THEN
262:
263: i% = GetPath(DlgGetPath ,BasePath$)
264: ReplaceListItem "DriveStatusText", 1, BasePath$
265: GOTO RESTART_SDK_OPTION
266:
267: elseif sz$ = "CHK1" THEN
268:
269: SamplesSDK = GetCheck(1)
270: GOTO RESTART_SDK_OPTION
271:
272: elseif sz$ = "CHK2" THEN
273:
274: MSDOSSDK = GetCheck(2)
275: GOTO RESTART_SDK_OPTION
276:
277: elseif sz$ = "CHK3" THEN
278:
279: WindowsSDK = GetCheck(3)
280: GOTO RESTART_SDK_OPTION
281:
282: elseif sz$ = "CHK4" THEN
283:
284: HelpFiles = GetCheck(4)
285: GOTO RESTART_SDK_OPTION
286:
287: else
288: GOSUB ASKQUIT
289: GOTO RESTART_SDK_OPTION
290: end if
291:
292: MSDOSRuntime = MSDOSSDK
293: WindowsRuntime = WindowsSDK
294:
295: if MSDOSSDK = FALSE and WindowsSDK = FALSE then
296: i% = DoMsgBox("You must chose either MS-DOS or Windows.", "Include and Library Support", MB_OK+MB_TASKMODAL+MB_ICONHAND)
297: goto SDK_OPTION
298:
299: end if
300: '$endif
301:
302: RUNTIME_OPTION:
303:
304: RemoveSymbol "CheckItemsState"
305:
306: AddListItem "CheckItemsState", BoolToOnOff(MSDOSRuntime)
307: AddListItem "CheckItemsState", BoolToOnOff(WindowsRuntime)
308: AddListItem "CheckItemsState", BoolToOnOff(AllTransports)
309:
310: RESTART_RUNTIME_OPTION:
311:
312: RemoveSymbol "StatusItemsText"
313:
314: AddListItem "StatusItemsText", RegPath$
315: AddListItem "StatusItemsText", DosPath$
316: AddListItem "StatusItemsText", GetDosRunSize()
317: AddListItem "StatusItemsText", GetWinRunSize()
318: AddListItem "StatusItemsText", GetTransportSize()
319:
320: sz$ = UIStartDlg(CUIDLL$, DlgRuntimeOption, "FCustInstDlgProc", HlpRuntimeOption, HELPPROC$)
321:
322: if sz$ = "CONTINUE" THEN
323: UIPop(1)
324:
325: elseif sz$ = "BACK" THEN
326: UIPop(1)
327:
328: '$ifndef RUNTIMEINSTALL
329:
330: GOTO SDK_OPTION
331: '$else
332: GOTO OPTION
333: '$endif
334:
335: elseif sz$ = "REACTIVATE" THEN
336: GOTO RESTART_RUNTIME_OPTION
337:
338: elseif sz$ = "CHK1" THEN
339: MSDOSRuntime = GetCheck(1)
340: GOTO RESTART_RUNTIME_OPTION
341:
342: elseif sz$ = "CHK2" THEN
343: WindowsRuntime = GetCheck(2)
344: GOTO RESTART_RUNTIME_OPTION
345:
346: elseif sz$ = "CHK3" THEN
347:
348: if GetListItem("CheckItemsState", 3) = "ON" then
349: AllTransports = TRUE
350: else
351: AllTransports = FALSE
352: RemoveSymbol "SelectedTransports"
353: end if
354:
355: GOTO RESTART_RUNTIME_OPTION
356:
357: elseif sz$ = "BTN1" THEN
358:
359: i% = GetPath(DlgRegPath ,RegPath$)
360: ReplaceListItem "StatusItemsText", 1, RegPath$
361:
362: GOTO RESTART_RUNTIME_OPTION
363:
364: elseif sz$ = "BTN2" THEN
365:
366: i% = GetPath(DlgDosPath ,DosPath$)
367: ReplaceListItem "StatusItemsText", 2, DosPath$
368:
369: GOTO RESTART_RUNTIME_OPTION
370:
371: elseif sz$ = "BTN3" THEN
372:
373:
374: if GetTransport() and AllTransports then
375: Alltransports = FALSE
376: ReplaceListItem "CheckItemsState", 3, "OFF"
377: end if
378:
379: GOTO RESTART_RUNTIME_OPTION
380:
381: else
382: GOSUB ASKQUIT
383: GOTO RESTART_RUNTIME_OPTION
384:
385: end if
386:
387: NetBiosTransport = AllTransports
388:
389: ' Scan the selected transport for a NetBios name
390:
391: for i% = 1 to GetListLength("SelectedTransports") step 1
392:
393: if instr(GetListItem("SelectedTransports", i%), "NetBios") then
394: NetBiosTransport = TRUE
395: end if
396: next
397:
398:
399: if not NetBiosTransport then
400: goto FullInstall
401: end if
402:
403: NETBIOS:
404: SetSymbolValue "RadioDefault", "1"
405:
406: RESTART_NETBIOS_OPTION:
407: sz$ = UIStartDlg(CUIDLL$, DlgNetBiosOptions, "FRadioDlgProc", HlpNetBiosOptions, HELPPROC$)
408: Index$ = GetSymbolValue("ButtonChecked")
409:
410: if sz$ = "CONTINUE" THEN
411: UIPop(1)
412: elseif sz$ = "REACTIVATE" THEN
413: GOTO RESTART_NETBIOS_OPTION
414:
415: elseif sz$ = "BACK" THEN
1.1.1.2 ! root 416:
! 417: UIPop(1)
! 418: if CustomInstall then
! 419: GOTO RUNTIME_OPTION
! 420: else
! 421: goto RESTART_OPTION
! 422: end if
1.1 root 423:
424: else
425: GOSUB ASKQUIT
426: GOTO NETBIOS
427: end if
428:
1.1.1.2 ! root 429:
1.1 root 430: if Index$ = "1" then
1.1.1.2 ! root 431:
! 432: AddListItem "NetBiosMap", "nb=0"
! 433: goto FullInstall
! 434:
! 435: elseif Index$ = "2" then
! 436:
! 437: AddListItem "NetBiosMap", "tcpip=0"
1.1 root 438: goto FullInstall
1.1.1.2 ! root 439:
1.1 root 440: end if
441:
442:
443: NETBIOS_PROTOCOL:
444:
445: RemoveSymbol "ListItemsIn"
446:
447: RESTART_NETBIOS_PROTOCOL:
448: sz$ = UIStartDlg(CUIDLL$, DlgNetBiosProtocols, "FListDlgProc", HlpNetBiosProtocols, HELPPROC$)
449:
450: if sz$ = "CONTINUE" THEN
451: UIPop 1
452:
453: elseif sz$ = "REACTIVATE" THEN
454: GOTO RESTART_NETBIOS_OPTION
455:
456: elseif sz$ = "BACK" THEN
457:
458: GET_LANA:
459: sz$ = UIStartDlg(CUIDLL$, DlgNewProtocol, "FNameOrgDlgProc", HlpNewProtocol, HELPPROC$)
460:
461: if sz$ = "CONTINUE" then
462:
463: t$ = GetSymbolValue("OrgOut")
464:
465: if len(t$) <> 1 or mid$(t$, 1) < "0" or mid$(t$, 1) > "9" then
466: i% = DoMsgBox("Bad value for Lana #, use 0 to 9", "NetBios Protocol", MB_OK+MB_TASKMODAL+MB_ICONHAND)
467: goto GET_LANA
468: else
469: NewProto$ = GetSymbolValue("NameOut") + "=" + t$
470: AddListItem "ListItemsIn", NewProto$
471:
472: end if
473: end if
474:
475: UIPop (2)
476: GOTO RESTART_NETBIOS_PROTOCOL
477:
478: elseif sz$ = "CANCEL" THEN
479: UIPop (1)
480: GOTO RESTART_NETBIOS_OPTION
481:
482: elseif sz$ = "EXIT" THEN
483:
484: OldProto$ = GetSymbolValue("ListItemsOut")
485: RemoveSymbol "ListTmp"
486:
487: for i% = 1 to GetListLength("ListItemsIn") step 1
488: if OldProto$ <> GetListItem("ListItemsIn", i%) then
489:
490: AddListItem "ListTmp", GetListItem("ListItemsIn", i%)
491: end if
492: next
493:
494: CopyList "ListItemsIn", "ListTmp", TRUE
495:
496: UIPop (2)
497: GOTO RESTART_NETBIOS_PROTOCOL
498: end if
499:
500: CopyList "NetBiosMap", "ListItemsOut", TRUE
501:
502:
503: FullInstall:
504:
505: group$ = "Microsoft C/C++ 7.0"
506:
507: '$ifndef RUNTIMEINSTALL
508:
509: CreateDir BasePath$, cmoNone
510: CreateDir MakePath(BasePath$, "rpc"), cmoNone
511:
512: AddSectionFilesToCopyList "Base", SrcDir$, MakePath(BasePath$, "rpc")
513:
514:
515: ' Install the SDK files first.
516:
517: CreateDir MakePath(BasePath$, "include"), cmoNone
518:
519: AddSectionFilesToCopyList "include", SrcDir$, MakePath(BasePath$, "include")
520: AddSectionFilesToCopyList "bin", SrcDir$, MakePath(BasePath$, "bin")
521:
522: if WindowsSDK then
523: AddSectionFilesToCopyList "winclude", SrcDir$, MakePath(BasePath$, "include\win")
524: AddSectionFilesToCopyList "wlib", SrcDir$, MakePath(BasePath$, "lib")
525:
526: CreateProgmanGroup group$, "", cmoNone
527: ShowProgmanGroup group$, 1, cmoNone
528: CreateProgmanItem group$, "RPC ReadMe", "notepad "+MakePath(BasePath$, "rpc\readme.txt"), "", cmoOverWrite
529:
530: end if
531:
532: if MSDOSSDK then
533: AddSectionFilesToCopyList "dinclude", SrcDir$, MakePath(BasePath$, "include\dos")
534: AddSectionFilesToCopyList "dlib", SrcDir$, MakePath(BasePath$, "lib")
535: end if
536:
537: if SamplesSDK then
538:
539: if MSDOSSDK and HelpFiles then
540: AddSectionFilesToCopyList "dHelp", SrcDir$, MakePath(BasePath$, "help")
541: end if
542:
543: if WindowsSDK and HelpFiles then
544: AddSectionFilesToCopyList "wHelp", SrcDir$, MakePath(BasePath$, "help")
545:
546: CreateProgmanItem group$, "RPC API Reference", "winhelp "+MakePath(BasePath$, "help\rpc10wh.hlp"), "", cmoOverWrite
547: CreateProgmanItem group$, "RPC MIDL Reference", "winhelp "+MakePath(BasePath$, "help\midl10wh.hlp"), "", cmoOverWrite
548: end if
549:
550: CreateDir MakePath(BasePath$, "rpc\samples"), cmoNone
551:
552: Open MakePath(BasePath$, "rpc\samples\makefile.dos") for Output As 1
553: print #1, "# Nmake include file for MS-DOS sample applications"
554: print #1,
555: print #1, "OSINCLUDE="+MakePath(BasePath$, "include\dos")
556: close #1
557:
558: Open MakePath(BasePath$, "rpc\samples\makefile.win") for Output As 1
559: print #1, "# Nmake include file for Windows sample applications"
560: print #1,
561: print #1, "OSINCLUDE="+MakePath(BasePath$, "include\win")
562: close #1
563:
564:
565: if WindowsSDK then
566: AddSectionFilesToCopyList "wsample2", SrcDir$, MakePath(BasePath$, "rpc\samples\whello")
567: AddSectionFilesToCopyList "wsample11", SrcDir$, MakePath(BasePath$, "rpc\samples\mandel")
568: end if
569:
570: if MSDOSSDK then
571: CreateDir MakePath(BasePath$, "rpc\samples\data"), cmoNone
572: CreateDir MakePath(BasePath$, "rpc\samples\handles"), cmoNone
573:
574: AddSectionFilesToCopyList "sample1", SrcDir$, MakePath(BasePath$, "rpc\samples\hello")
575: AddSectionFilesToCopyList "sample3", SrcDir$, MakePath(BasePath$, "rpc\samples\data\dunion")
576: AddSectionFilesToCopyList "sample4", SrcDir$, MakePath(BasePath$, "rpc\samples\data\inout")
577: AddSectionFilesToCopyList "sample5", SrcDir$, MakePath(BasePath$, "rpc\samples\data\xmit")
578: AddSectionFilesToCopyList "sample6", SrcDir$, MakePath(BasePath$, "rpc\samples\doctor")
579: AddSectionFilesToCopyList "sample7", SrcDir$, MakePath(BasePath$, "rpc\samples\handles\auto")
580: AddSectionFilesToCopyList "sample8", SrcDir$, MakePath(BasePath$, "rpc\samples\handles\cxhndl")
581: AddSectionFilesToCopyList "sample9", SrcDir$, MakePath(BasePath$, "rpc\samples\handles\usrdef")
582: AddSectionFilesToCopyList "sample10",SrcDir$, MakePath(BasePath$, "rpc\samples\dict")
583:
584: end if
585:
586: end if
587:
588: '$endif
589:
590:
591: ' Update the list of transports to install.
592:
593: if AllTransports then
594: RemoveSymbol "SelectedTransports"
595: end if
596:
597: if WindowsRuntime then
598: AddSectionFilesToCopyList "wruntime", SrcDir$, MakePath(WinPath$, "system")
599:
1.1.1.2 ! root 600: WinSysPath$ = MakePath(WinPath$, "system")
1.1 root 601:
1.1.1.2 ! root 602: verdllPath$ = FindFileInTree("ver.dll", WinSysPath$)
1.1 root 603:
1.1.1.2 ! root 604: if verdllPath$ = "" then
! 605: AddSectionFilesToCopyList "wruntime", SrcDir$, WinSysPath$
! 606: endif
! 607:
! 608: NetapiPath$ = FindTargetOnEnvVar("netapi.dll", "PATH")
! 609:
! 610: if NetapiPath$ <> "" then
! 611: i% = DoMsgBox("If your netapi.dll is an older version, it will be renamed to netapi.old and a newer version installed.", "Note on Netapi.dll", MB_OK)
! 612: AddSectionFilesToCopyList "wnetapi", SrcDir$, mid$(NetapiPath$, 1, len(NetapiPath$) - len("\netapi.dll"))
! 613: BackupFile NetapiPath$, "netapi.old"
1.1 root 614: else
1.1.1.2 ! root 615: WinballNetapiPath$ = FindTargetOnEnvVar("netapi.dll", WinSysPath$)
! 616: if WinballNetapiPath$ <> "" then
! 617: AddSectionFilesToCopyList "dummynetapi", SrcDir$, WinSysPath$
! 618: else
! 619: i% = DoMsgBox("Setup assumes you are running Windows For WorkGroups, so netapi.dll won't be updated.", "Note on Netapi.dll", MB_OK)
! 620: endif
1.1 root 621: end if
622:
623: if AllTransports then
624: MakeListFromSectionKeys "SelectedTransports", "wtrans"
625: end if
1.1.1.2 ! root 626:
1.1 root 627: end if
628:
629: if MSDOSRuntime then
630:
631: CreateDir DosPath$, cmoNone
632: AddSectionFilesToCopyList "druntime", SrcDir$, DosPath$
633:
634: if AllTransports then
635: MakeListFromSectionKeys "ListTmp", "dtrans"
636: CopyList "SelectedTransports", "ListTmp", FALSE
637: end if
638:
639: end if
640:
641:
642: ' For each transport selected, add to the DOS or Windows copylist.
643:
644: for i% = 1 to GetListLength("SelectedTransports") step 1
645:
646: tran$ = GetListItem("SelectedTransports", i%)
647:
648: if instr (tran$, "DOS") then
649: AddSectionKeyFileToCopyList "dtrans", tran$, SrcDir$, DosPath$
650: else
651: AddSectionKeyFileToCopyList "wtrans", tran$, SrcDir$, MakePath(WinPath$, "system")
652:
653: end if
654: next
655:
656:
657: ' Now write the registry file with the NSI values and the
658: ' transport to protocol mappings.
659:
660: KeyPrefix$ = "\Root\Software\Microsoft\Rpc"
661:
662: CreateDir RegPath$, cmoNone
663: Open MakePath(RegPath$, "rpcreg.dat") for Output As 1
664:
665: print #1, KeyPrefix$+"\NameService\Protocol=ncacn_np"
666: print #1, KeyPrefix$+"\NameService\NetworkAddress=\\."
667: print #1, KeyPrefix$+"\NameService\Endpoint=\pipe\locator"
668: print #1, KeyPrefix$+"\NameService\DefaultSyntax=1"
669:
670: ' For each transport add the mapping for the protocols.
671:
672: for i% = 1 to GetListLength("SelectedTransports") step 1
673:
674: tran$ = GetListItem("SelectedTransports", i%)
675:
676: Start = instr(tran$, "(")+1
677: mapping$ = mid$(tran$, Start, len(tran$) - Start)
678:
679: 'Since we have DOS and windows mappings, there can be duplicates
680: 'make sure the mapping is only added once.
681:
682: for n% = 1 to GetListLength("MappedProtocols") step 1
683: if mapping$ = GetListItem("MappedProtocols", n%) then
684: goto NextMapping
685: end if
686: next
687:
688: AddListItem "MappedProtocols", mapping$
689:
690: ' NetBios protocols get special mappings for each protocol
691:
692: if instr(mapping$, "rpcltc5") then
693: for n% = 1 to GetListLength("NetBiosMap") step 1
694:
695: NbMap$ = GetListItem("NetBiosMap", n%)
696: prot$ = mid$(NbMap$, 1, instr(NbMap$, "=")-1)
697: dll$ = mid$(mapping$, instr(mapping$, "="))
698:
699: print #1, KeyPrefix$+"\ClientProtocols\ncacn_nb_"+prot$+dll$
700: next
701: else
702: print #1, KeyPrefix$+"\ClientProtocols\ncacn_"+mapping$
703: end if
704:
705: NextMapping:
706: next
707:
708:
709: 'For NetBios, build the protocol to lan adapter mappings.
710:
711: if NetBiosTransport then
712: for n% = 1 to GetListLength("NetBiosMap") step 1
713:
714: NbMap$ = GetListItem("NetBiosMap", n%)
715: prot$ = mid$(NbMap$, 1, instr(NbMap$, "=")-1) + "0"
716: lana$ = mid$(NbMap$, instr(NbMap$, "="))
717:
718: print #1, KeyPrefix$+"\NetBios\ncacn_nb_"+prot$+lana$
719: next
720: end if
721:
722: Close #1
723:
724: ' Update the users autoexec file if needed.
725:
726: AutoExec$ = "C:\"
727:
728: if UCase$(RegPath$) <> "C:\" and GetEnvVariableValue ("RPC_REG_DATA_FILE") <> UCase$(RegPath$) then
729: UpdateReg = TRUE
730: else
731: UpdateReg = FALSE
732: end if
733:
734: UpdatePath = FALSE
735:
736: if MSDOSRuntime then
737:
738: ' i% = DoMsgBox("Path: "+path$, "DOS path: "+DosPath$, MB_OK+MB_TASKMODAL+MB_ICONHAND)
739:
740: if instr(path$, Ucase$(DosPath$)) = 0 then
741: UpdatePath = TRUE
742: end if
743: end if
744:
745: if UpdateReg or UpdatePath then
746:
747: ' Get the path to the autoexec file if not in "C:\"
748:
749: AutoExec$ = AutoExec$+"Autoexec.bat"
750:
751: while DoesFileExist(AutoExec$, femExists) = 0
752:
753: if not GetPath(DlgAutoPath, AutoExec$) then
754: goto noAutoExec
755: end if
756: wend
757:
758: newPath$ = "SET PATH=%PATH%;"+DosPath$
759:
760: ' Insert the new information by merging the new info while
761: ' copying the autoexec file.
762:
763: AutoExecRpc$ = mid$(AutoExec$, 1, len(AutoExec$)-3)+"rpc"
764:
765: Open AutoExec$ for Input As 1
766: Open AutoExecRpc$ for Output As 2
767:
768: while not eof(1)
769: line input #1, Buffer$
770:
771: if len(Buffer$) = 0 then
772: print #2, Buffer$
773:
774: elseif UpdatePath and instr (Ucase$(Buffer$), Ucase$(Newpath$)) then
775: UpdatePath = FALSE
776:
777: elseif UpdateReg and instr(Ucase$(Buffer$), "RPC_REG_DATA_FILE") then
778: UpdateReg = FALSE
779:
780: else
781: print #2, Buffer$
782:
783: end if
784:
785: wend
786:
787:
788: ' Append any needed values to the autoexe file
789:
790: if UpdateReg then
791: print #2, "set RPC_REG_DATA_FILE="+RegPath$
792: end if
793:
794: if UpdatePath then
795: print #2, NewPath$
796: end if
797:
798: Close #1, #2
799:
800: if UpdateReg = FALSE and UpdatePath = FALSE then
801: RemoveFile AutoExecRpc$, cmoNone
802: goto NoAutoExec
803: end if
804:
805: i% = DoMsgBox("In order for the runtime to function, setup needs to change your autoexec.bat file. Do you want setup to update this file?", "Update Autoexec.bat", 4+MB_TASKMODAL+32)
806:
807: if i% = 6 then
808: BackupFile AutoExec$, "Autoexec.bak"
809: CopyFile AutoExecRpc$, AutoExec$, cmoOverwrite, FALSE
810: RemoveFile AutoExecRpc$, cmoNone
811: else
812: i% = DoMsgBox("An updated auotexec.bat file is in the file "+AutoExecRpc$, "New Autoexec.bat", MB_OK+MB_TASKMODAL)
813: end if
814:
815: endif
816:
817: NoAutoExec:
818:
819: ' DumpCopyList "c:\tmp\t"
820: CopyFilesInCopyList
821:
1.1.1.2 ! root 822: if verdllPath$ = "" then
! 823: verdllPath$ = FindFileInTree("ver.dll", WinSysPath$)
! 824: RemoveFile verdllPath$, cmoVital
! 825: endif
1.1 root 826:
827: '$ifdef SystemNetApi
828:
829: if ReStartListEmpty() = 0 then
830:
831: SetRestartDir BasePath$
832: i% = DoMsgBox("Setup will now restart Windows to complete installation. Close any MS-DOS applications before continuing.", "Restart Windows", MB_OK+MB_TASKMODAL)
833:
834: i% = ExitExecRestart()
835: i% = DoMsgBox("Restart failed. Run _mssetup.bat from the "+BasePath$+" directory from MS-DOS prompt.", "Restart Windows", MB_OK+MB_TASKMODAL+MB_ICONHAND)
836: end if
837:
838: '$endif
839:
840:
841: QUIT:
842: ON ERROR GOTO ERRQUIT
843:
844: if ERR = 0 THEN
845: dlg% = EXITSUCCESS
846:
847: elseif ERR = STFQUIT THEN
848: dlg% = EXITQUIT
849:
850: else
851: dlg% = EXITFAILURE
852: end if
853:
854: QUITL1:
855: while UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "") = "REACTIVATE"
856: wend
857:
858: UIPop 1
859:
860: END
861:
862: ERRQUIT:
863: i% = DoMsgBox("Setup sources were corrupted, email stevez!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
864: END
865:
866:
867: ASKQUIT:
868: sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
869:
870: if sz$ = "EXIT" THEN
871: UIPopAll
872: ERROR STFQUIT
873: elseif sz$ = "REACTIVATE" THEN
874: GOTO ASKQUIT
875: else
876: UIPop 1
877: end if
878: RETURN
879:
880: Function GetPath(Dialog%, Path$) Static AS INTEGER
881:
882: SetSymbolValue "EditTextIn", Path$
883: SetSymbolValue "EditFocus", "END"
884:
885: sz$ = UIStartDlg(CUIDLL$, Dialog%, "FEditDlgProc", Dialog% + 1, HELPPROC$)
886: NewPath$ = GetSymbolValue("EditTextOut")
887:
888: GetPath = FALSE
889:
890: if sz$ = "CONTINUE" THEN
891: Path$ = NewPath$
892: GetPath = TRUE
893: end if
894:
895: UIPop (1)
896:
897: end function
898:
899:
900: function GetTransport() Static as INTEGER
901:
902: RemoveSymbol "ListItemsIn"
903:
904: if WindowsRuntime then
905: MakeListFromSectionKeys "ListItemsIn", "wtrans"
906: end if
907:
908: if MSDOSRuntime then
909:
910: MakeListFromSectionKeys "ListTmp", "dtrans"
911: CopyList "ListItemsIn", "ListTmp", FALSE
912: end if
913:
914: GetTransport = FALSE
915:
916: RESTART_RUNTIME_OPTION:
917: sz$ = UIStartDlg(CUIDLL$, DlgTransport, "FMultiDlgProc", HlpTransport, HELPPROC$)
918:
919: if sz$ = "CONTINUE" THEN
920: GetTransport = TRUE
921:
922: elseif sz$ = "REACTIVATE" THEN
923: GOTO RESTART_RUNTIME_OPTION
924:
925: end if
926:
927: CopyList "SelectedTransports" , "ListItemsOut", TRUE
928:
929: UIPop(1)
930:
931: end function
932:
933:
934: '**
935: '** Purpose:
936: '** Appends a file name to the end of a directory path,
937: '** inserting a backslash character as needed.
938: '** Arguments:
939: '** szDir$ - full directory path (with optional ending "\")
940: '** szFile$ - filename to append to directory
941: '** Returns:
942: '** Resulting fully qualified path name.
943: '*************************************************************************
944:
945: FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
946: if szDir$ = "" THEN
947: MakePath = szFile$
948: elseif szFile$ = "" THEN
949: MakePath = szDir$
950: elseif MID$(szDir$, LEN(szDir$), 1) = "\" THEN
951: MakePath = szDir$ + szFile$
952: else
953: MakePath = szDir$ + "\" + szFile$
954: end if
955: END FUNCTION
956:
957: FUNCTION GetCheck (index%) STATIC AS INTEGER
958:
959: if GetListItem("CheckItemsState", index%) = "ON" then
960: GetCheck = TRUE
961: else
962: GetCheck = FALSE
963: end if
964:
965: END FUNCTION
966:
967:
968: Sub CopyList(ListOut$, ListIn$, Truncate%) static
969:
970: if Truncate% <> 0 then
971: RemoveSymbol ListOut$
972: end if
973:
974: for i% = 1 to GetListLength(ListIn$) step 1
975: AddListItem ListOut$, GetListItem(ListIn$, i%)
976: next
977:
978: end sub
979:
980: function BoolToOnOff (Bool%) static AS String
981:
982: if Bool% then
983: BoolToOnOff$ = "ON"
984: else
985: BoolToOnOff$ = "OFF"
986: end if
987:
988: end function
989:
990: function FormatSize () static AS String
991:
992: cbMore& = GetCopyListCost ("", "Cost", "")
993: cbSize = val(GetListItem("Cost", asc(BasePath$) - asc("A") + 1)) / 1024
994:
995: if cbSize then
996: FormatSize = str$(cbSize)+"K"
997: else
998: FormatSize = ""
999: end if
1000:
1001: ClearCopyList
1002:
1003: end function
1004:
1005:
1006: function GetSampleSize () static AS String
1007:
1008:
1009: if SamplesSDK and MSDOSSDK then
1010: AddSectionFilesToCopyList "sample1", SrcDir$, BasePath$
1011: AddSectionFilesToCopyList "sample3", SrcDir$, BasePath$
1012: AddSectionFilesToCopyList "sample4", SrcDir$, BasePath$
1013: AddSectionFilesToCopyList "sample5", SrcDir$, BasePath$
1014: AddSectionFilesToCopyList "sample6", SrcDir$, BasePath$
1015: AddSectionFilesToCopyList "sample7", SrcDir$, BasePath$
1016: AddSectionFilesToCopyList "sample8", SrcDir$, BasePath$
1017: AddSectionFilesToCopyList "sample9", SrcDir$, BasePath$
1018: AddSectionFilesToCopyList "sample10",SrcDir$, BasePath$
1019: end if
1020:
1021: if SamplesSDK and WindowsSDK then
1022: AddSectionFilesToCopyList "wsample2", SrcDir$, BasePath$
1023: AddSectionFilesToCopyList "wsample11",SrcDir$, BasePath$
1024: end if
1025:
1026: GetSampleSize = FormatSize()
1027:
1028: end function
1029:
1030: function GetDosSize () static AS String
1031:
1032: if MSDOSSDK then
1033: AddSectionFilesToCopyList "include", SrcDir$, BasePath$
1034: AddSectionFilesToCopyList "dinclude", SrcDir$, BasePath$
1035: AddSectionFilesToCopyList "dlib", SrcDir$, BasePath$
1036: end if
1037:
1038: GetDosSize = FormatSize()
1039:
1040: end function
1041:
1042: function GetDosRunSize () static AS String
1043:
1044: if MSDOSRuntime then
1045: AddSectionFilesToCopyList "druntime", SrcDir$, BasePath$
1046: end if
1047:
1048: GetDosRunSize = FormatSize()
1049:
1050: end function
1051:
1052: function GetWinSize () static AS String
1053:
1054: if WindowsSDK then
1055: AddSectionFilesToCopyList "include", SrcDir$, BasePath$
1056: AddSectionFilesToCopyList "winclude", SrcDir$, BasePath$
1057: AddSectionFilesToCopyList "wlib", SrcDir$, BasePath$
1058: end if
1059:
1060: GetWinSize = FormatSize()
1061:
1062: end function
1063:
1064: function GetWinRunSize () static AS String
1065:
1066: if WindowsRuntime then
1067: AddSectionFilesToCopyList "wruntime", SrcDir$, BasePath$
1068: end if
1069:
1070: GetWinRunSize = FormatSize()
1071:
1072: end function
1073:
1074:
1075: function GetTransportSize () static AS String
1076:
1077: if AllTransports then
1078: RemoveSymbol "SelectedTransports"
1079: end if
1080:
1081: if WindowsRuntime and AllTransports then
1082: MakeListFromSectionKeys "SelectedTransports", "wtrans"
1083: end if
1084:
1085: if MSDOSRuntime and AllTransports then
1086:
1087: MakeListFromSectionKeys "ListTmp", "dtrans"
1088: CopyList "SelectedTransports", "ListTmp", FALSE
1089: end if
1090:
1091: for i% = 1 to GetListLength("SelectedTransports") step 1
1092:
1093: tran$ = GetListItem("SelectedTransports", i%)
1094:
1095: if instr (tran$, "DOS") then
1096: AddSectionKeyFileToCopyList "dtrans", tran$, SrcDir$, BasePath$
1097: else
1098: AddSectionKeyFileToCopyList "wtrans", tran$, SrcDir$, BasePath$
1099:
1100: end if
1101: next
1102:
1103: GetTransportSize = FormatSize()
1104:
1105: end function
1106:
1107:
1108: function GetHlpSize () static AS String
1109:
1110: if HelpFiles then
1111:
1112: if MSDOSSDK then
1113: AddSectionFilesToCopyList "dHelp", SrcDir$, BasePath$
1114: end if
1115:
1116: if WindowsSDK then
1117: AddSectionFilesToCopyList "wHelp", SrcDir$, BasePath$
1118: end if
1119:
1120: end if
1121:
1122: GetHlpSize = FormatSize()
1123:
1124: end function
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.