/*:VRX Main */ /* Main */ Main: /* Process the arguments. Get the parent window. */ parse source . calledAs . parent = "" argCount = arg() argOff = 0 if( calledAs \= "COMMAND" )then do if argCount >= 1 then do parent = arg(1) argCount = argCount - 1 argOff = 1 end end; else do call VROptions 'ImplicitNames' call VROptions 'NoEchoQuit' end InitArgs.0 = argCount if( argCount > 0 )then do i = 1 to argCount InitArgs.i = arg( i + argOff ) end drop calledAs argCount argOff /* Load the windows */ call VRInit parse source . . spec _VREPrimaryWindowPath = , VRParseFileName( spec, "dpn" ) || ".VRW" _VREPrimaryWindow = , VRLoad( parent, _VREPrimaryWindowPath ) drop parent spec if( _VREPrimaryWindow == "" )then do call VRMessage "", "Cannot load window:" VRError(), , "Error!" _VREReturnValue = 32000 signal _VRELeaveMain end /* Process events */ call Init signal on halt do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) ) _VREEvent = VREvent() interpret _VREEvent end _VREHalt: _VREReturnValue = Fini() call VRDestroy _VREPrimaryWindow _VRELeaveMain: call VRFini exit _VREReturnValue VRLoadSecondary: __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 ) if __vrlsWait then do call VRFlush end __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) ) if __vrlsHWnd = '' then signal __vrlsDone if __vrlsWait \= 1 then signal __vrlsDone call VRSet __vrlsHWnd, 'WindowMode', 'Modal' __vrlsTmp = __vrlsWindows.0 if( DataType(__vrlsTmp) \= 'NUM' ) then do __vrlsTmp = 1 end else do __vrlsTmp = __vrlsTmp + 1 end __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd ) __vrlsWindows.0 = __vrlsTmp do while( VRIsValidObject( VRWindow() ) = 1 ) __vrlsEvent = VREvent() interpret __vrlsEvent end __vrlsTmp = __vrlsWindows.0 __vrlsWindows.0 = __vrlsTmp - 1 call VRWindow __vrlsWindows.__vrlsTmp __vrlsHWnd = '' __vrlsDone: return __vrlsHWnd /*:VRX BeginInstallProcess */ BeginInstallProcess: PROCEDURE EXPOSE consts. adapters. /* Get the selected options from the main window. */ consts.!volume = STRIP( WORD( VRGet('CB_DRIVES', 'Value'), 1 )) consts.!servertype = VRGet('CB_SERVERTYPE', 'Selected') consts.!hostid = TRANSLATE( STRIP( VRGet('EF_HOSTID', 'Value'))) consts.!domain = TRANSLATE( STRIP( VRGet('EF_DOMAINID', 'Value'))) IF consts.!hostid == '' THEN DO CALL VRMessage VRWindow(), NLVGetMessage( 96 ), NLVGetMessage( 95 ), 'E' RETURN END IF consts.!domain == '' THEN DO CALL VRMessage VRWindow(), NLVGetMessage( 97 ), NLVGetMessage( 95 ), 'E' RETURN END consts.!installgui = VRGet('CHK_GUI', 'Set') consts.!installmessaging = VRGet('CHK_MESSAGING', 'Set') consts.!installdoslanapi = VRGet('CHK_DOSLANAPI', 'Set') consts.!installos2remoteipl = VRGet('CHK_RIPLOS2', 'Set') consts.!installdosremoteipl = VRGet('CHK_RIPLDOS', 'Set') consts.!installups = VRGet('CHK_UPS', 'Set') consts.!installinstallprogram = VRGet('CHK_INSTALLPROGRAM', 'Set') consts.!installgenericalerter = VRGet('CHK_GENERICALERTER', 'Set') consts.!rsponly = VRGet('CHK_RSPONLY', 'Set') IF consts.!autoinstall == 0 THEN DO _srcvol = STRIP( WORD( VRGet('CB_SOURCE', 'Value'), 1 )) consts.!source = _srcvol'\CID\SERVER\IBMLS' IF VRFileExists( consts.!source ) == 0 THEN consts.!source = _srcvol'\CID\SERVER\IBMSERV' END IF ( consts.!rsponly == 0 ) & ( STREAM( consts.!source'\LANINSTR.EXE', 'C', 'QUERY EXISTS') == '') THEN DO CALL VRMessage VRWindow(), NLVGetMessage( 81, consts.!source'\LANINSTR.EXE'), NLVGetMessage( 80 ), 'E' RETURN END /* Do some dependency verification. */ IF consts.!servertype == 3 THEN consts.!installmigration = 0 IF consts.!installups == 0 THEN consts.!upsport = 'Migrate' IF consts.!installdosremoteipl == 0 THEN DO consts.!rplcopydlr = 0 consts.!rplcopydos = 0 consts.!rpldosver = 0 consts.!rpldosnum = 0 END IF consts.!installos2remoteipl == 0 THEN DO IF consts.!installdosremoteipl == 0 THEN DO consts.!rplcopyreq = 0 consts.!rpldir = 'Migrate' consts.!rpluserdir = 'Migrate' consts.!rplcopylsp = 0 END END /* Write the response file according to the defined options. */ response = CreateResponseFile() IF response == '' THEN RETURN IF consts.!rsponly == 0 THEN DO /* Make sure Peer isn't installed. */ ibmlvl = consts.!bootdrv || '\IBMLVL.INI' lanpath = STRIP( SysIni( ibmlvl, 'IBM_LS', 'PATH'), 'T', '00'x ) IF STREAM( lanpath'\SYSLEVEL.PER', 'C', 'QUERY EXISTS') \= '' THEN DO CALL VRMessage VRWindow(), NLVGetMessage( 83),, NLVGetMessage( 82 ) lanpath'\SYSLEVEL.PER', 'E' RETURN END CALL CleanUpPeer /* Now run the install. */ CALL LaunchInstallation consts.!source, response END CALL Quit RETURN /*:VRX CB_SERVERTYPE_Click */ CB_SERVERTYPE_Click: consts.!servertype = VRGet('CB_SERVERTYPE', 'Selected') RETURN /*:VRX CHK_DOSLANAPI_Click */ CHK_DOSLANAPI_Click: consts.!installdoslanapi = VRGet('CHK_DOSLANAPI', 'Set') RETURN /*:VRX CHK_GENERICALERTER_Click */ CHK_GENERICALERTER_Click: consts.!installgenericalerter = VRGet('CHK_GENERICALERTER', 'Set') RETURN /*:VRX CHK_GUI_Click */ CHK_GUI_Click: consts.!installgui = VRGet('CHK_GUI', 'Set') RETURN /*:VRX CHK_INSTALLPROGRAM_Click */ CHK_INSTALLPROGRAM_Click: consts.!installinstallprogram = VRGet('CHK_INSTALLPROGRAM', 'Set') RETURN /*:VRX CHK_MESSAGING_Click */ CHK_MESSAGING_Click: consts.!installmessaging = VRGet('CHK_MESSAGING', 'Set') RETURN /*:VRX CHK_RIPLDOS_Click */ CHK_RIPLDOS_Click: consts.!installdosremoteipl = VRGet('CHK_RIPLDOS', 'Set') IF consts.!installdosremoteipl == 0 THEN DO consts.!rplcopydlr = 0 consts.!rplcopydos = 0 consts.!rpldosver = 0 consts.!rpldosnum = 0 IF consts.!installos2remoteipl == 0 THEN DO consts.!rplcopylsp = 0 consts.!rplcopyreq = 0 consts.!rpldir = 'Migrate' consts.!rpluserdir = 'Migrate' END END RETURN /*:VRX CHK_RIPLOS2_Click */ CHK_RIPLOS2_Click: consts.!installos2remoteipl = VRGet('CHK_RIPLOS2', 'Set') IF consts.!installos2remoteipl == 0 THEN DO consts.!rplcopyreq = 0 IF consts.!installdosremoteipl == 0 THEN DO consts.!rplcopydlr = 0 consts.!rplcopydos = 0 consts.!rplcopylsp = 0 consts.!rpldosver = 0 consts.!rpldosnum = 0 consts.!rpldir = 'Migrate' consts.!rpluserdir = 'Migrate' END END RETURN /*:VRX CHK_UPS_Click */ CHK_UPS_Click: consts.!installups = VRGet('CHK_UPS', 'Set') IF consts.!installups == 0 THEN consts.!upsport = 'Migrate' ELSE consts.!upsport = 'COM1' RETURN /*:VRX CleanUpPeer */ CleanUpPeer: PROCEDURE /* * Make sure these Peer objects don't exist (IBM's uninstaller doesn't * clean everything up, and these can cause problems if they're still * hanging around). */ CALL SysSetObjectData '', 'NODELETE=NO' CALL SysSetObjectData '', 'NODELETE=NO' CALL SysSetObjectData '', 'NODELETE=NO' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' /* * Just to be complete, we deregister all the Peer/Requester WPS classes. */ CALL SysDeregisterObjectClass 'LSPeerWorkstation' CALL SysDeregisterObjectClass 'LSPeerUser' CALL SysDeregisterObjectClass 'PRDirectory' CALL SysDeregisterObjectClass 'PRDisk' CALL SysDeregisterObjectClass 'PRPrinter' CALL SysDeregisterObjectClass 'LSDataFile' CALL SysDeregisterObjectClass 'LSDirectory' CALL SysDeregisterObjectClass 'LSDisk' CALL SysDeregisterObjectClass 'LSPrinter' RETURN /*:VRX CreateResponseFile */ CreateResponseFile: /* Set the name and location of our response file. */ osdir = STRIP( VALUE('OSDIR',,'OS2ENVIRONMENT')) IF osdir <> '' THEN rspdir = osdir'\install\rsp' ELSE rspdir = consts.!bootdrv'\OS2\INSTALL' CALL SysFileTree rspdir, 'dirs.', 'DO' IF dirs.0 < 1 THEN rspdir = SysBootDrive() rspfile = rspdir'\lansrvr.rsp' /* Delete any old response file. */ IF STREAM( rspfile, 'C', 'QUERY EXISTS') \= '' THEN CALL VRDeleteFile rspfile /* Make sure we can write to the response file. */ badwrite = LINEOUT( rspfile, '') IF badwrite == 1 THEN DO CALL VRMessage VRWindow(), NLVGetMessage( 85, TRANSLATE( rspfile) || '.'),, NLVGetMessage( 84 ), 'E' RETURN '' END /* Generate some composite strings that we need. */ addnets = '' DO i = 1 to consts.!interfaces.0 addnets = addnets 'net'i',' END addnets = STRIP( addnets ) addnets = STRIP( addnets, 'T', ',') deletenets = '' DO j = i to 4 deletenets = deletenets 'net'j',' END deletenets = STRIP( deletenets ) deletenets = STRIP( deletenets, 'T', ',') IF ( consts.!installmessaging ) & ( consts.!wrks_messenger ) THEN consts.!wrkservices = 'MESSENGER' IF ( consts.!srvs_alerter ) THEN consts.!srvservices = consts.!srvservices || 'ALERTER,' IF ( consts.!servertype == 2 ) & ( consts.!srvs_dcdbrepl ) THEN consts.!srvservices = consts.!srvservices || 'DCDBREPL,' IF ( consts.!installgenericalerter ) & ( consts.!srvs_genalerter ) THEN consts.!srvservices = consts.!srvservices || 'GENALERT,' IF ( consts.!srvs_lsserver ) THEN consts.!srvservices = consts.!srvservices || 'LSSERVER,' IF ( consts.!srvs_netlogon ) THEN consts.!srvservices = consts.!srvservices || 'NETLOGON,' IF ( consts.!srvs_netrun ) THEN consts.!srvservices = consts.!srvservices || 'NETRUN,' IF ( consts.!srvs_ripl ) THEN consts.!srvservices = consts.!srvservices || 'REMOTEBOOT,' IF ( consts.!srvs_replicator ) THEN consts.!srvservices = consts.!srvservices || 'REPLICATOR,' IF ( consts.!srvs_timesrc ) THEN consts.!srvservices = consts.!srvservices || 'TIMESOURCE,' IF ( consts.!installups ) & ( consts.!srvs_ups ) THEN consts.!srvservices = consts.!srvservices || 'UPS,' consts.!srvservices = STRIP( consts.!srvservices,,',') /* * Networks configuration section. */ CALL LINEOUT rspfile, 'DELETEIBMLAN = Networks<' IF consts.!installloopback \= 1 THEN CALL LINEOUT rspfile, ' netlb =' IF POS('net1', deletenets ) \= 0 THEN CALL LINEOUT rspfile, ' net1 =' IF POS('net2', deletenets ) \= 0 THEN CALL LINEOUT rspfile, ' net2 =' IF POS('net3', deletenets ) \= 0 THEN CALL LINEOUT rspfile, ' net3 =' IF POS('net4', deletenets ) \= 0 THEN CALL LINEOUT rspfile, ' net4 =' CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' CALL LINEOUT rspfile, 'UPDATEIBMLAN = Networks<' IF consts.!installloopback THEN CALL LINEOUT rspfile, ' netlb = LOOPDRV$,*,LM10,*,100,*' DO i = 1 to consts.!interfaces.0 j = consts.!interfaces.i CALL LINEOUT rspfile, ' net'i ' =' adapters.j.!protocol || ',*,LM10,*,100,*' END CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' /* * Requester configuration section. */ CALL LINEOUT rspfile, 'DELETEIBMLAN = Requester<' CALL LINEOUT rspfile, ' wrknets =' deletenets CALL LINEOUT rspfile, ' wrkservices =' consts.!wrkservices CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' CALL LINEOUT rspfile, 'UPDATEIBMLAN = Requester<' CALL LINEOUT rspfile, ' Computername =' consts.!hostid CALL LINEOUT rspfile, ' Domain =' consts.!domain CALL LINEOUT rspfile, ' useallmem = Migrate' CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' CALL LINEOUT rspfile, 'ADDIBMLAN = Requester<' CALL LINEOUT rspfile, ' wrknets =' addnets CALL LINEOUT rspfile, ' wrkservices = MESSENGER' CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' /* * Server configuration section. */ CALL LINEOUT rspfile, 'DELETEIBMLAN = Server<' CALL LINEOUT rspfile, ' srvnets =' deletenets CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' CALL LINEOUT rspfile, 'UPDATEIBMLAN = Server<' CALL LINEOUT rspfile, ' autopath = Migrate' CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' CALL LINEOUT rspfile, 'ADDIBMLAN = Server<' CALL LINEOUT rspfile, ' srvservices =' consts.!srvservices CALL LINEOUT rspfile, ' srvnets =' addnets CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' /* * RIPL configuration section. (Selection of interfaces is not implemented.) */ CALL LINEOUT rspfile, 'DELETEIBMLAN = Remoteboot<' CALL LINEOUT rspfile, ' rpl1 =' CALL LINEOUT rspfile, ' rpl2 =' CALL LINEOUT rspfile, ' rpl3 =' CALL LINEOUT rspfile, ' rpl4 =' CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' CALL LINEOUT rspfile, 'UPDATEIBMLAN = Remoteboot<' CALL LINEOUT rspfile, ' rpldir =' consts.!rpldir CALL LINEOUT rspfile, ' rpluserdir =' consts.!rpluserdir CALL LINEOUT rspfile, '>' CALL LINEOUT rspfile, '' /* * Basic installation options. */ SELECT WHEN consts.!servertype == 1 THEN servertype = 'DomainController' WHEN consts.!servertype == 2 THEN servertype = 'BackupDC' OTHERWISE servertype = 'AdditionalServer' END CALL LINEOUT rspfile, ' ConfigServerType =' servertype CALL LINEOUT rspfile, ' ConfigSourceDrive = None' CALL LINEOUT rspfile, ' ConfigTargetDrive =' STRIP( consts.!volume, 'T', ':') IF consts.!autostartls THEN CALL LINEOUT rspfile, ' ConfigAutoStartLS = YES' ELSE CALL LINEOUT rspfile, ' ConfigAutoStartLS = NO' /* * Major components to install */ CALL LINEOUT rspfile, ' InstallServer = INSTALL' IF consts.!installinstallprogram THEN CALL LINEOUT rspfile, ' InstallInstallProgram = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallInstallProgram = INSTALLIFREQUIRED' IF consts.!installgui THEN CALL LINEOUT rspfile, ' InstallGUI = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallGUI = REMOVE' IF consts.!installupm THEN CALL LINEOUT rspfile, ' InstallUPM = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallUPM = INSTALLIFREQUIRED' IF consts.!installmessaging THEN CALL LINEOUT rspfile, ' InstallMSGPopup = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallMSGPopup = REMOVE' IF consts.!installgenericalerter THEN CALL LINEOUT rspfile, ' InstallGenericAlerter = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallGenericAlerter = REMOVE' IF consts.!installdoslanapi THEN CALL LINEOUT rspfile, ' InstallDosLanAPI = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallDosLanAPI = REMOVE' IF consts.!installos2remoteipl THEN CALL LINEOUT rspfile, ' InstallDosRemoteIPL = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallDosRemoteIPL = REMOVE' IF consts.!installdosremoteipl THEN CALL LINEOUT rspfile, ' InstallOS2RemoteIPL = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallOS2RemoteIPL = REMOVE' IF consts.!installups THEN CALL LINEOUT rspfile, ' InstallUps = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallUps = REMOVE' IF consts.!install386hpfs THEN CALL LINEOUT rspfile, ' Install386HPFS = INSTALL' ELSE CALL LINEOUT rspfile, ' Install386HPFS = REMOVE' /* * Advanced install options. */ IF consts.!installdesktopicons THEN CALL LINEOUT rspfile, ' InstallDesktopIcons = YES' ELSE CALL LINEOUT rspfile, ' InstallDesktopIcons = NO' IF consts.!installclipboard THEN CALL LINEOUT rspfile, ' InstallClipBoard = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallClipBoard = REMOVE' IF consts.!installmigration THEN CALL LINEOUT rspfile, ' InstallMigrationImportUtil = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallMigrationImportUtil = REMOVE' IF consts.!installloopback THEN CALL LINEOUT rspfile, ' InstallLoopBackDriver = INSTALL' ELSE CALL LINEOUT rspfile, ' InstallLoopBackDriver = REMOVE' IF consts.!initializedcdb THEN CALL LINEOUT rspfile, ' ConfigInitializeDCDB = YES' ELSE CALL LINEOUT rspfile, ' ConfigInitializeDCDB = NO' /* * UPS options. */ CALL LINEOUT rspfile, ' ConfigUPSPort =' consts.!upsport /* * Remote IPL options. */ IF consts.!rplcopylsp THEN CALL LINEOUT rspfile, ' ConfigCopyLSP = Copy' ELSE CALL LINEOUT rspfile, ' ConfigCopyLSP = CopyIfRequired' IF consts.!rplcopyreq THEN CALL LINEOUT rspfile, ' ConfigCopyOS2Requester = Copy' ELSE CALL LINEOUT rspfile, ' ConfigCopyOS2Requester = CopyIfRequired' IF consts.!rplcopydlr THEN CALL LINEOUT rspfile, ' ConfigCopyDLR = Copy' ELSE CALL LINEOUT rspfile, ' ConfigCopyDLR = CopyIfRequired' IF consts.!rplcopydos THEN DO CALL LINEOUT rspfile, ' ConfigCopyDOS = Copy' IF consts.!rpldosver == 0 THEN CALL LINEOUT rspfile, ' ConfigDosVersion = Migrate' ELSE CALL LINEOUT rspfile, ' ConfigDosVersion =' consts.!rpldosver CALL LINEOUT rspfile, ' ConfigDosNumber =' consts.!rpldosnum END ELSE CALL LINEOUT rspfile, ' ConfigDosNumber = 0' /* * FFST/2 options -- just use the defaults (can be reconfigured later). */ CALL LINEOUT rspfile, ' ConfigDisplayMsg = Migrate' CALL LINEOUT rspfile, ' ConfigRouteAlertsTo = Migrate' CALL LINEOUT rspfile, ' ConfigAutoStartFFST = Migrate' CALL LINEOUT rspfile, ' ConfigApplDumpPath = Migrate' CALL LINEOUT rspfile, ' ConfigApplMaxDumps = Migrate' CALL LINEOUT rspfile, ' ConfigSystemDumpPath = Migrate' CALL LINEOUT rspfile, ' ConfigSystemMaxDumps = Migrate' CALL LINEOUT rspfile, ' ConfigMsgLogName = Migrate' CALL LINEOUT rspfile, ' ConfigWsId = Migrate' CALL LINEOUT rspfile, ' ConfigWsSerial1 = Migrate' CALL LINEOUT rspfile, ' ConfigWsSerial2 = Migrate' CALL LINEOUT rspfile, ' ConfigWsType1 = Migrate' CALL LINEOUT rspfile, ' ConfigWStype2 = Migrate' /* * All done, close the file and return. */ CALL STREAM rspfile, 'C', 'CLOSE' IF consts.!rsponly == 1 THEN DO CALL VRMessage VRWindow(), NLVGetMessage( 87, TRANSLATE( rspfile )),, NLVGetMessage( 86 ), 'I' CALL Quit END RETURN rspfile /*:VRX Fini */ Fini: window = VRWindow() call VRSet window, "Visible", 0 drop window return 0 /*:VRX GetDefaultNames */ GetDefaultNames: PROCEDURE EXPOSE consts. defnames. dflt_hostname = '' dflt_domain = '' /* Look for an existing IBMLAN.INI and see if it defines the LAN names */ ibmlvl = consts.!bootdrv'\IBMLVL.INI' IF VRFileExists( ibmlvl ) THEN DO ibmlan = STRIP( SysIni( ibmlvl, 'IBM_LS', 'PATH'), 'T', '00'x ) IF LEFT( ibmlan, 6 ) == 'ERROR:' THEN ibmlan = '' END IF ibmlan <> '' THEN DO lan_ini = ibmlan'\IBMLAN.INI' IF VRFileExists( lan_ini ) THEN DO matches.0 = 0 ok = SysFileSearch('Computername', lan_ini, 'matches.') IF matches.0 > 0 THEN DO i = 1 to matches.0 PARSE VALUE STRIP( matches.i ) WITH 1 'Computername' '=' dflt_hostname IF dflt_hostname <> '' THEN LEAVE END ok = SysFileSearch('Domain', lan_ini, 'matches.') IF matches.0 > 0 THEN DO i = 1 to matches.0 PARSE VALUE STRIP( matches.i ) WITH 1 'Domain' '=' dflt_domain IF dflt_domain <> '' THEN LEAVE END END END IF dflt_hostname == '' THEN dflt_hostname = VALUE('HOSTNAME',,'OS2ENVIRONMENT') IF dflt_hostname <> '' & LENGTH( dflt_hostname ) > 1 THEN DO dflt_hostname = TRANSLATE( STRIP( LEFT( dflt_hostname, 15 )),, "______________________________________",, " '/\{}[]<>,?|*&^%Õ$#@()-½œ¾­¨¬«ó¸©ôõæ") END ELSE dflt_hostname = '' IF dflt_domain <> '' & LENGTH( dflt_domain ) > 1 THEN DO dflt_domain = TRANSLATE( STRIP( LEFT( dflt_domain, 15 )),, "______________________________________",, " '/\{}[]<>,?|*&^%Õ$#@()-½œ¾­¨¬«ó¸©ôõæ") END ELSE dflt_domain = '' defnames.!hostid = TRANSLATE( dflt_hostname ) defnames.!domain = TRANSLATE( dflt_domain ) RETURN /*:VRX GetInterfaces */ /* * Parse PROTOCOL.INI for installed NETBIOS interfaces. */ GetInterfaces: PROCEDURE EXPOSE adapters. mpts_exe = SysSearchPath('PATH', 'MPTS.EXE') mpts_path = FILESPEC('DRIVE', mpts_exe ) || FILESPEC('PATH', mpts_exe ) IF STREAM( mpts_path'\PROTOCOL.INI', 'C', 'QUERY EXISTS') == '' THEN mpts_path = STRIP( SysIni( ibmlvl, 'IBM_LANX', 'PATH'), 'T', '00'x ) protocol_ini = mpts_path'\PROTOCOL.INI' /* * Open PROTOCOL.INI and search for the [NETBIOS] section */ CALL LINEIN protocol_ini, 1, 0 nbsection = 0 DO WHILE ( nbsection = 0 ) & ( LINES( protocol_ini ) > 0 ) line = STRIP( TRANSLATE( LINEIN( protocol_ini ))) IF line = '[NETBIOS]' THEN nbsection = 1 END /* * Now parse all lines in this section of the form 'ADAPTER... =' */ count = 0 DO WHILE ( nbsection = 1 ) & ( LINES( protocol_ini ) > 0 ) line = STRIP( TRANSLATE( LINEIN( protocol_ini ))) IF LEFT( line, 1 ) = '[' THEN nbsection = 0 PARSE VAR line leading 'ADAPTER' number '=' definition definition = STRIP( definition ) IF ( definition \= '') & ( leading = '') THEN DO count = count + 1 PARSE VAR definition protocol ',' interface adapters.count.!number = STRIP( number ) adapters.count.!protocol = STRIP( protocol ) adapters.count.!interface = STRIP( interface ) END END adapters.0 = count CALL STREAM protocol_ini, 'C', 'CLOSE' RETURN /*:VRX Halt */ Halt: signal _VREHalt return /*:VRX Init */ Init: CALL VRSet 'Console', 'WindowListTitle', '' CALL RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' CALL SysLoadFuncs /* Load the language strings */ CALL NLVSetup boot = SysBootDrive() IF boot == '' THEN boot = FILESPEC('DRIVE', VALUE('OS2_SHELL',,'OS2ENVIRONMENT')) target = boot consts.!bootdrv = boot consts.!autoinstall = 0 consts.!install386hpfs = 0 /* not configurable from GUI, only for pre-WSeB */ DO a = 1 TO InitArgs.0 arg = TRANSLATE( InitArgs.a ) IF ( arg == '-AUTO') | ( arg == '/AUTO') THEN consts.!autoinstall = 1 IF ( arg == '-HPFS386') | ( arg == '/HPFS386') THEN consts.!install386hpfs = 1 END /* Set up the various comboboxes */ default = 1 guesscd = 0 fallback = 0 map = SysDriveMap('C:', 'USED') DO x = 1 TO WORDS( map ) volume = WORD( map, x ) info = SysDriveInfo( volume ) IF ( WORD( info, 2 ) \= '') & ( WORD( info, 2 ) \= '0') THEN DO CALL VRMethod 'CB_DRIVES', 'AddString', volume ' [' || WORD( info, 4 ) || ']' IF volume == target THEN default = x END CALL VRMethod 'CB_SOURCE', 'AddString', volume IF volume == LEFT( VALUE('LANINSTEP',,'OS2ENVIRONMENT'), 1 ) THEN guesscd = x fs = SysFileSystemType( volume ) IF ( guesscd == 0 ) & ( fs == 'CDFS') THEN guesscd = x IF ( fallback == 0 ) & ( fs == '') THEN fallback = x END IF guesscd == 0 THEN DO IF fallback > 0 THEN guesscd = fallback ELSE guesscd = 1 END ok = VRSet('CB_DRIVES', 'Selected', default ) ok = VRSet('CB_SOURCE', 'Selected', guesscd ) ok = VRSet('CB_SERVERTYPE', 'Selected', 3 ) defnames.!hostid = '' defnames.!domain = '' CALL GetDefaultNames ok = VRSet('EF_HOSTID', 'Value', defnames.!hostid ) ok = VRSet('EF_DOMAINID', 'Value', defnames.!domain ) /* Initialize the configuration settings */ CALL SetDefaultConfig /* If -auto was specified, look for LANINSTR.EXE in the current directory */ consts.!source = '' IF consts.!autoinstall == 1 THEN DO workdir = VRGet('Application', 'WorkingDirectory') IF VRFileExists( workdir'\LANINSTR.EXE') THEN DO consts.!source = workdir CALL VRSet 'DT_CDDRIVE', 'Visible', 0 CALL VRSet 'CB_SOURCE', 'Visible', 0 END CALL VRSet 'CHK_RSPONLY', 'Visible', 0 END window = VRWindow() call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" drop window IF adapters.0 == 0 THEN DO CALL VRSet 'DT_INTRO', 'Visible', 0 msgtext.1 = NLVGetMessage( 92 ) msgtext.2 = '' msgtext.3 = NLVGetMessage( 93 ) msgtext.4 = '' msgtext.5 = NLVGetMessage( 94 ) msgtext.0 = 5 buttons.1 = NLVGetMessage( 99 ) buttons.2 = NLVGetMessage( 3 ) buttons.0 = 2 option = VRMessageStem( VRWindow(), 'msgtext.', NLVGetMessage( 98 ), 'W', 'buttons.', 1, 2 ) IF option == 1 THEN DO ok = SysOpenObject('', 'RUNNING', 'TRUE') IF ok == 0 THEN ok = SysOpenObject('', 'RUNNING', 'TRUE') IF ok == 0 THEN CALL VRMessage VRWindow(), NLSGetMessage( 111 ), NLSGetMessage( 110 ), 'E' END CALL Quit END RETURN /*:VRX LaunchInstallation */ LaunchInstallation: PROCEDURE EXPOSE consts. ARG source, responsefile logpath = VALUE('LOGFILES',,'OS2ENVIRONMENT') IF logpath == '' THEN logpath = consts.!bootdrv logpath = STRIP( logpath, 'T', '\') /* * Launch the install program. */ CALL VALUE 'REMOTE_INSTALL_STATE', '0', 'OS2ENVIRONMENT' ADDRESS CMD '@'source'\LANINSTR.EXE /SRV /L1:'logpath'\server.l1 /L2:'logpath'\server.l2 /R:'responsefile '>NUL' CALL VALUE 'REMOTE_INSTALL_STATE', '', 'OS2ENVIRONMENT' IF rc == 0 | (D2X( rc, 4 ) == 'FE00') THEN DO CALL UpdateDesktop CALL VRMessage VRWindow(), NLVGetMessage( 89 ), NLVGetMessage( 88 ), 'I' END ELSE CALL VRMessage VRWindow(), NLVGetMessage( 91 ) '0x' || D2X( rc, 4 ),, NLVGetMessage( 90 ), 'W' RETURN /*:VRX NLVGetMessage */ /* * Gets the message text associated with the given message number from the * current language file. */ NLVGetMessage: PROCEDURE EXPOSE consts. msgfile = consts.!messages msgnum = ARG( 1 ) IF msgnum == '' THEN RETURN '' SELECT WHEN ARG() == 2 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2) ) WHEN ARG() == 3 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(3) ) WHEN ARG() == 4 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(3), ARG(4) ) WHEN ARG() == 5 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(3), ARG(4), ARG(5) ) WHEN ARG() == 6 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(3), ARG(4), ARG(5), ARG(6) ) WHEN ARG() == 7 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(3), ARG(4), ARG(5), ARG(6), ARG(7) ) WHEN ARG() == 8 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(2), ARG(4), ARG(5), ARG(6), ARG(7), ARG(8) ) WHEN ARG() == 9 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(2), ARG(4), ARG(5), ARG(6), ARG(7), ARG(8), ARG(9) ) WHEN ARG() == 10 THEN msgtxt = SysGetMessage( msgnum, msgfile, ARG(2), ARG(2), ARG(4), ARG(5), ARG(6), ARG(7), ARG(8), ARG(9), ARG(10) ) OTHERWISE msgtxt = SysGetMessage( msgnum, msgfile ) END PARSE VAR msgtxt message '0D'x . IF SUBSTR( message, 1, 4 ) == 'SYS0' THEN message = '' RETURN message /*:VRX NLVSetText */ /* * Sets the specified property of the specified control to the specified * message text. */ NLVSetText: PROCEDURE EXPOSE consts. PARSE ARG control, property, message, substitution success = 1 IF substitution == '' THEN text = NLVGetMessage( message ) ELSE text = NLVGetMessage( message, substitution ) IF text == '' THEN success = 0 ELSE CALL VRSet control, property, text RETURN success /*:VRX NLVSetup */ NLVSetup: PROCEDURE EXPOSE consts. filestem = 'srvi_' /* * Sets most of the main window UI text from the message file. */ execPath = VRGet("Application", "Program") execDir = VRParseFileName( execPath, "DP") /* * First, figure out what language/message file to use. */ syslang = VALUE('LANG',,'OS2ENVIRONMENT') SELECT WHEN TRANSLATE( syslang ) == 'ZH_TW' THEN nlv = 'tw' WHEN TRANSLATE( syslang ) == 'ZH_CN' THEN nlv = 'cx' OTHERWISE PARSE VAR syslang nlv '_' . END IF ( STREAM( execDir'\'filestem||nlv'.msg', 'C', 'QUERY EXISTS') \= '') | ( SysSearchPath('DPATH', filestem||nlv'.msg') \= '') THEN DO consts.!messages = filestem||nlv'.msg' consts.!helpfile = filestem||nlv'.hlp' END ELSE DO consts.!messages = filestem||'en.msg' consts.!helpfile = filestem||'en.hlp' END /* Note: helpfile is not implemented yet. */ /* CALL VRSet 'WN_MAIN', 'HelpFile', consts.!helpfile */ /* * Now set the captions for the UI controls on the main window, according * to the specified language. */ CALL NLVSetText 'WN_MAIN', 'Caption', 1 CALL NLVSetText 'DT_TOP', 'Caption', 1 CALL NLVSetText 'DT_INTRO', 'Caption', 6 CALL NLVSetText 'GB_CONFIG', 'Caption', 10 CALL NLVSetText 'DT_DRIVE', 'Caption', 11 CALL NLVSetText 'DT_TYPE', 'Caption', 12 CALL NLVSetText 'DT_HOSTID', 'Caption', 13 CALL NLVSetText 'DT_DOMAINID', 'Caption', 14 CALL NLVSetText 'PB_INTERFACES', 'Caption', 15 CALL NLVSetText 'PB_AUTOSTART', 'Caption', 16 CALL NLVSetText 'PB_ADVANCED', 'Caption', 17 CALL NLVSetText 'DT_CDDRIVE', 'Caption', 18 CALL NLVSetText 'GB_OPTIONS', 'Caption', 20 CALL NLVSetText 'CHK_GUI', 'Caption', 21 CALL NLVSetText 'CHK_INSTALLPROGRAM', 'Caption', 22 CALL NLVSetText 'CHK_MESSAGING', 'Caption', 23 CALL NLVSetText 'CHK_GENERICALERTER', 'Caption', 24 CALL NLVSetText 'CHK_DOSLANAPI', 'Caption', 25 CALL NLVSetText 'CHK_RIPLOS2', 'Caption', 26 CALL NLVSetText 'CHK_RIPLDOS', 'Caption', 27 CALL NLVSetText 'CHK_UPS', 'Caption', 28 CALL NLVSetText 'CHK_RSPONLY', 'Caption', 19 CALL NLVSetText 'PB_INSTALL', 'Caption', 29 CALL NLVSetText 'PB_CANCEL', 'Caption', 3 CALL VRMethod 'CB_SERVERTYPE', 'AddString', NLVGetMessage( 7 ) CALL VRMethod 'CB_SERVERTYPE', 'AddString', NLVGetMessage( 8 ) CALL VRMethod 'CB_SERVERTYPE', 'AddString', NLVGetMessage( 9 ) RETURN /*:VRX PB_ADVANCED_Click */ PB_ADVANCED_Click: CALL VRLoadSecondary 'SW_ADVANCED', 'W' RETURN /*:VRX PB_ADVCANCEL_Click */ PB_ADVCANCEL_Click: CALL SW_ADVANCED_Close RETURN /*:VRX PB_ADVOK_Click */ PB_ADVOK_Click: PROCEDURE EXPOSE consts. /* * Get the selections from the 'options' page. */ consts.!installupm = VRGet('CHK_UPM', 'Set') consts.!installclipboard = VRGet('CHK_CLIPBOARD', 'Set') consts.!installloopback = VRGet('CHK_LOOPBACK', 'Set') consts.!installmigration = VRGet('CHK_MIGRATIONIMPORTUTIL', 'Set') consts.!initializedcdb = VRGet('CHK_INITIALIZEDCDB', 'Set') consts.!installdesktopicons = VRGet('CHK_ICONS', 'Set') /* * Get the selections from the UPS page, if applicable. */ IF consts.!installups == 1 THEN DO IF VRGet('RB_UPSCOM2', 'Set') THEN consts.!upsport = 'COM2' ELSE consts.!upsport = 'COM1' END /* * Get the selections from the RIPL page, if applicable. */ IF ( consts.!installos2remoteipl ) | ( consts.!installdosremoteipl ) THEN DO consts.!rpldir = VRGet('CB_RIPL_BOOTDRV', 'Value') || '\IBMLAN\RPL' consts.!rpluserdir = VRGet('CB_RIPL_WSSDRV', 'Value') || '\IBMLAN\RPLUSER' consts.!rplcopyreq = VRGet('CHK_RIPL_COPYREQ', 'Set') consts.!rplcopydlr = VRGet('CHK_RIPL_COPYDLR', 'Set') consts.!rplcopylsp = VRGet('CHK_RIPL_COPYLSP', 'Set') consts.!rplcopydos = VRGet('CHK_RIPL_COPYDOS', 'Set') /* IF consts.!rplcopydos == 0 THEN DO consts.!rpldosver = 0 consts.!rpldosnum = 0 END ELSE DO */ dosversion = VRGet('CB_RIPL_DOSVERSION', 'Value') SELECT WHEN dosversion == 'IBM DOS 7.0' THEN consts.!rpldosver = 'IBM_DOS70' WHEN dosversion == 'IBM DOS 6.3' THEN consts.!rpldosver = 'IBM_DOS63' WHEN dosversion == 'IBM DOS 6.1' THEN consts.!rpldosver = 'IBM_DOS61' WHEN dosversion == 'MS-DOS 6.x' THEN consts.!rpldosver = 'MS_DOS60' OTHERWISE consts.!rpldosver = 0 END consts.!rpldosnum = VRGet('SP_RIPL_DOSNUMBER', 'Value') /* END */ END /* * Close the window and return. */ CALL SW_ADVANCED_Close RETURN /*:VRX PB_AUTOSTART_Click */ PB_AUTOSTART_Click: CALL VRLoadSecondary 'SW_AUTOSTART', 'W' RETURN /*:VRX PB_AUTOSTARTCANCEL_Click */ PB_AUTOSTARTCANCEL_Click: CALL SW_AUTOSTART_Close RETURN /*:VRX PB_AUTOSTARTOK_Click */ PB_AUTOSTARTOK_Click: consts.!autostartls = VRGet('CHK_AUTOSTARTLS', 'Set') consts.!wrkservices = '' consts.!srvservices = '' /* * Requester services */ consts.!wrks_messenger = VRGet('CHK_STARTMESSENGER', 'Set') /* * Server services */ consts.!srvs_netlogon = VRGet('CHK_STARTNETLOGON', 'Set') consts.!srvs_timesrc = VRGet('CHK_STARTTIMESRC', 'Set') consts.!srvs_replicator = VRGet('CHK_STARTREPLICATOR', 'Set') consts.!srvs_netrun = VRGet('CHK_STARTNETRUN', 'Set') consts.!srvs_alerter = VRGet('CHK_STARTALERTER', 'Set') consts.!srvs_dcdbrepl = VRGet('CHK_STARTDCDBREPL', 'Set') consts.!srvs_genalerter = VRGet('CHK_STARTGENALERTER', 'Set') consts.!srvs_ripl = VRGet('CHK_STARTRIPL', 'Set') consts.!srvs_ups = VRGet('CHK_STARTUPS', 'Set') CALL SW_AUTOSTART_Close RETURN /*:VRX PB_CANCEL_Click */ PB_CANCEL_Click: CALL Quit return /*:VRX PB_INSTALL_Click */ PB_INSTALL_Click: CALL BeginInstallProcess RETURN /*:VRX PB_INTERFACES_CANCEL_Click */ PB_INTERFACES_CANCEL_Click: CALL SW_INTERFACES_Close return /*:VRX PB_INTERFACES_Click */ PB_INTERFACES_Click: CALL VRLoadSecondary 'SW_INTERFACES', 'W' RETURN /*:VRX PB_INTERFACES_OK_Click */ PB_INTERFACES_OK_Click: count = 0 IF ( VRGet('CHK_NET1', 'Set')) & ( adapters.0 > 0 ) THEN DO count = count + 1 consts.!interfaces.count = 1 END IF ( VRGet('CHK_NET2', 'Set')) & ( adapters.0 > 1 ) THEN DO count = count + 1 consts.!interfaces.count = 2 END IF ( VRGet('CHK_NET3', 'Set')) & ( adapters.0 > 2 ) THEN DO count = count + 1 consts.!interfaces.count = 3 END IF ( VRGet('CHK_NET4', 'Set')) & ( adapters.0 > 3 ) THEN DO count = count + 1 consts.!interfaces.count = 4 END consts.!interfaces.0 = count CALL SW_INTERFACES_Close RETURN /*:VRX Quit */ Quit: window = VRWindow() call VRSet window, "Shutdown", 1 drop window return /*:VRX SetDefaultConfig */ SetDefaultConfig: /* Autostarted services */ consts.!wrkservices = '' consts.!srvservices = '' consts.!wrks_messenger = 1 consts.!srvs_lsserver = 1 consts.!srvs_netlogon = 1 consts.!srvs_timesrc = 0 consts.!srvs_replicator = 0 consts.!srvs_netrun = 0 consts.!srvs_alerter = 0 consts.!srvs_dcdbrepl = 0 consts.!srvs_genalerter = 0 consts.!srvs_ripl = 0 consts.!srvs_ups = 0 consts.!autostartls = 0 /* Enabled interfaces */ CALL GetInterfaces count = 0 DO i = 1 TO adapters.0 count = count + 1 consts.!interfaces.count = i END consts.!interfaces.0 = adapters.0 /* Installed components (from main window) */ consts.!installgui = 1 consts.!installmessaging = 1 consts.!installdoslanapi = 0 consts.!installos2remoteipl = 0 consts.!installdosremoteipl = 0 consts.!installups = 0 consts.!installgenericalerter = 0 consts.!installinstallprogram = 1 /* Advanced installation options */ consts.!installupm = 1 consts.!installclipboard = 1 consts.!installloopback = 0 consts.!installmigration = 0 consts.!initializedcdb = 0 consts.!installdesktopicons = 1 /* UPS options */ consts.!upsport = 'Migrate' /* RIPL options */ consts.!rpldir = 'Migrate' consts.!rpluserdir = 'Migrate' consts.!rplcopyreq = 0 consts.!rplcopydlr = 0 consts.!rplcopydos = 0 consts.!rplcopylsp = 0 consts.!rpldosver = 0 consts.!rpldosnum = 0 RETURN /*:VRX SW_ADVANCED_Close */ SW_ADVANCED_Close: call SW_ADVANCED_Fini return /*:VRX SW_ADVANCED_Create */ SW_ADVANCED_Create: call SW_ADVANCED_Init return /*:VRX SW_ADVANCED_Fini */ SW_ADVANCED_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX SW_ADVANCED_Init */ SW_ADVANCED_Init: CALL NLVSetText 'SW_ADVANCED', 'Caption', 50 CALL NLVSetText 'PB_ADVOK', 'Caption', 2 CALL NLVSetText 'PB_ADVCANCEL', 'Caption', 3 /* 51: 'Installation options' */ /* ;SW_OPTIONS+[Installation options]; */ /* CALL VRMethod 'NB_CONFIG', 'SetTabText', 1, NLVGetMessage( 51 ) */ CALL VRLoad 'NB_CONFIG', VRWindowPath(), 'SW_OPTIONS' CALL VRMethod 'NB_CONFIG', 'InsertPage', 'SW_OPTIONS', '+' || NLVGetMessage( 51 ) IF consts.!installups == 1 THEN DO CALL VRLoad 'NB_CONFIG', VRWindowPath(), 'SW_UPS' CALL VRMethod 'NB_CONFIG', 'InsertPage', 'SW_UPS', '+' || NLVGetMessage( 52 ) /* 52: 'UPS service' */ END IF ( consts.!installos2remoteipl ) | ( consts.!installdosremoteipl ) THEN DO CALL VRLoad 'NB_CONFIG', VRWindowPath(), 'SW_RIPL' CALL VRMethod 'NB_CONFIG', 'InsertPage', 'SW_RIPL', '+' || NLVGetMessage( 53 ) /* 53: 'Remote IPL' */ END window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window RETURN /*:VRX SW_AUTOSTART_Close */ SW_AUTOSTART_Close: call SW_AUTOSTART_Fini return /*:VRX SW_AUTOSTART_Create */ SW_AUTOSTART_Create: call SW_AUTOSTART_Init return /*:VRX SW_AUTOSTART_Fini */ SW_AUTOSTART_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX SW_AUTOSTART_Init */ SW_AUTOSTART_Init: CALL NLVSetText 'PB_AUTOSTARTOK', 'Caption', 2 CALL NLVSetText 'PB_AUTOSTARTCANCEL', 'Caption', 3 CALL NLVSetText 'SW_AUTOSTART' , 'Caption', 32 CALL NLVSetText 'CHK_AUTOSTARTLS', 'Caption', 33 CALL NLVSetText 'GB_AUTOSTART', 'Caption', 34 CALL NLVSetText 'CHK_STARTNETLOGON', 'Caption', 35 CALL NLVSetText 'CHK_STARTTIMESRC', 'Caption', 36 CALL NLVSetText 'CHK_STARTREPLICATOR', 'Caption', 37 CALL NLVSetText 'CHK_STARTNETRUN', 'Caption', 38 CALL NLVSetText 'CHK_STARTALERTER', 'Caption', 39 CALL NLVSetText 'CHK_STARTGENALERTER', 'Caption', 40 CALL NLVSetText 'CHK_STARTDCDBREPL', 'Caption', 41 CALL NLVSetText 'CHK_STARTRIPL', 'Caption', 42 CALL NLVSetText 'CHK_STARTUPS', 'Caption', 43 CALL NLVSetText 'CHK_STARTMESSENGER', 'Caption', 44 CALL NLVSetText 'CHK_STARTGENALERTER', 'HintText', 45 CALL NLVSetText 'CHK_STARTDCDBREPL', 'HintText', 46 CALL NLVSetText 'CHK_STARTRIPL', 'HintText', 47 CALL NLVSetText 'CHK_STARTUPS', 'HintText', 48 CALL NLVSetText 'CHK_STARTMESSENGER', 'HintText', 49 CALL VRSet 'CHK_AUTOSTARTLS', 'Set', consts.!autostartls CALL VRSet 'CHK_STARTNETLOGON', 'Set', consts.!srvs_netlogon CALL VRSet 'CHK_STARTTIMESRC', 'Set', consts.!srvs_timesrc CALL VRSet 'CHK_STARTREPLICATOR', 'Set', consts.!srvs_replicator CALL VRSet 'CHK_STARTNETRUN', 'Set', consts.!srvs_netrun CALL VRSet 'CHK_STARTALERTER', 'Set', consts.!srvs_alerter IF consts.!servertype == 2 THEN DO CALL VRSet 'CHK_STARTDCDBREPL', 'Enabled', '1' CALL VRSet 'CHK_STARTDCDBREPL', 'Set', consts.!srvs_dcdbrepl CALL VRSet 'CHK_STARTDCDBREPL', 'HintText', '' END ELSE CALL VRSet 'CHK_STARTDCDBREPL', 'Set', '0' IF consts.!installgenericalerter == 1 THEN DO CALL VRSet 'CHK_STARTGENALERTER', 'Enabled', '1' CALL VRSet 'CHK_STARTGENALERTER', 'Set', consts.!srvs_genalerter CALL VRSet 'CHK_STARTGENALERTER', 'HintText', '' END ELSE CALL VRSet 'CHK_STARTGENALERTER', 'Set', '0' IF ( consts.!installos2remoteipl == 1 ) | ( consts.!installdosremoteipl == 1 ) THEN DO CALL VRSet 'CHK_STARTRIPL', 'Enabled', '1' CALL VRSet 'CHK_STARTRIPL', 'Set', consts.!srvs_ripl CALL VRSet 'CHK_STARTRIPL', 'HintText', '' END ELSE CALL VRSet 'CHK_STARTRIPL', 'Set', '0' IF consts.!installups == 1 THEN DO CALL VRSet 'CHK_STARTUPS', 'Enabled', '1' CALL VRSet 'CHK_STARTUPS', 'Set', consts.!srvs_ups CALL VRSet 'CHK_STARTUPS', 'HintText', '' END ELSE CALL VRSet 'CHK_STARTUPS', 'Set', '0' IF consts.!installmessaging == 1 THEN DO CALL VRSet 'CHK_STARTMESSENGER', 'Enabled', '1' CALL VRSet 'CHK_STARTMESSENGER', 'Set', consts.!wrks_messenger CALL VRSet 'CHK_STARTMESSENGER', 'HintText', '' END ELSE CALL VRSet 'CHK_STARTMESSENGER', 'Set', '0' window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window RETURN /*:VRX SW_INTERFACES_Close */ SW_INTERFACES_Close: call SW_INTERFACES_Fini return /*:VRX SW_INTERFACES_Create */ SW_INTERFACES_Create: call SW_INTERFACES_Init return /*:VRX SW_INTERFACES_Fini */ SW_INTERFACES_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX SW_INTERFACES_Init */ SW_INTERFACES_Init: CALL NLVSetText 'SW_INTERFACES', 'Caption', 30 CALL NLVSetText 'GB_INTERFACES', 'Caption', 31 CALL NLVSetText 'PB_INTERFACES_OK', 'Caption', 2 CALL NLVSetText 'PB_INTERFACES_CANCEL', 'Caption', 3 IF adapters.0 > 0 THEN DO ifcaption = NLVGetMessage( 5, adapters.1.!interface ) CALL VRSet 'CHK_NET1', 'Caption', ifcaption '-' adapters.1.!protocol CALL VRSet 'CHK_NET1', 'Enabled', '1' CALL VRSet 'CHK_NET1', 'Set', '1' CALL VRSet 'CHK_NET1', 'Visible', '1' END IF adapters.0 > 1 THEN DO ifcaption = NLVGetMessage( 5, adapters.2.!interface ) CALL VRSet 'CHK_NET2', 'Caption', ifcaption '-' adapters.2.!protocol CALL VRSet 'CHK_NET2', 'Enabled', '1' CALL VRSet 'CHK_NET2', 'Set', '1' CALL VRSet 'CHK_NET2', 'Visible', '1' END IF adapters.0 > 2 THEN DO ifcaption = NLVGetMessage( 5, adapters.3.!interface ) CALL VRSet 'CHK_NET3', 'Caption', ifcaption '-' adapters.3.!protocol CALL VRSet 'CHK_NET3', 'Enabled', '1' CALL VRSet 'CHK_NET3', 'Set', '1' CALL VRSet 'CHK_NET3', 'Visible', '1' END IF adapters.0 > 3 THEN DO ifcaption = NLVGetMessage( 5, adapters.4.!interface ) CALL VRSet 'CHK_NET4', 'Caption', ifcaption '-' adapters.4.!protocol CALL VRSet 'CHK_NET4', 'Enabled', '1' CALL VRSet 'CHK_NET4', 'Set', '1' CALL VRSet 'CHK_NET4', 'Visible', '1' END window = VRInfo( "Object" ) if( \VRIsChildOf( window, "Notebook" ) ) then do call VRMethod window, "CenterWindow" call VRSet window, "Visible", 1 call VRMethod window, "Activate" end drop window RETURN /*:VRX SW_OPTIONS_Close */ SW_OPTIONS_Close: call SW_OPTIONS_Fini return /*:VRX SW_OPTIONS_Create */ SW_OPTIONS_Create: call SW_OPTIONS_Init return /*:VRX SW_OPTIONS_Fini */ SW_OPTIONS_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX SW_OPTIONS_Init */ SW_OPTIONS_Init: CALL VRSet 'CHK_UPM', 'Set', consts.!installupm CALL VRSet 'CHK_CLIPBOARD', 'Set', consts.!installclipboard CALL VRSet 'CHK_LOOPBACK', 'Set', consts.!installloopback IF consts.!servertype == 3 THEN DO CALL VRSet 'CHK_MIGRATIONIMPORTUTIL', 'Enabled', 0 CALL VRSet 'CHK_MIGRATIONIMPORTUTIL', 'Set', 0 END ELSE CALL VRSet 'CHK_MIGRATIONIMPORTUTIL', 'Set', consts.!installmigration CALL VRSet 'CHK_INITIALIZEDCDB', 'Set', consts.!initializedcdb CALL VRSet 'CHK_ICONS', 'Set', consts.!installdesktopicons /* CALL NLVSetText 'DT_OPTIONS', 'Caption', 56 */ CALL NLVSetText 'CHK_UPM', 'Caption', 57 CALL NLVSetText 'CHK_CLIPBOARD', 'Caption', 58 CALL NLVSetText 'CHK_LOOPBACK', 'Caption', 59 CALL NLVSetText 'CHK_MIGRATIONIMPORTUTIL', 'Caption', 60 CALL NLVSetText 'CHK_INITIALIZEDCDB', 'Caption', 61 CALL NLVSetText 'CHK_ICONS', 'Caption', 62 /* * These controls were initially set non-visible so to avoid 'flickering' * when the text is updated. (Not sure why this happens to this dialog * in particular - something about being the (first) notebook page?) */ CALL VRSet 'CHK_UPM', 'Visible', 1 CALL VRSet 'CHK_CLIPBOARD', 'Visible', 1 CALL VRSet 'CHK_LOOPBACK', 'Visible', 1 CALL VRSet 'CHK_MIGRATIONIMPORTUTIL', 'Visible', 1 CALL VRSet 'CHK_INITIALIZEDCDB', 'Visible', 1 CALL VRSet 'CHK_ICONS', 'Visible', 1 RETURN /*:VRX SW_RIPL_Close */ SW_RIPL_Close: call SW_RIPL_Fini return /*:VRX SW_RIPL_Create */ SW_RIPL_Create: call SW_RIPL_Init return /*:VRX SW_RIPL_Fini */ SW_RIPL_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX SW_RIPL_Init */ SW_RIPL_Init: PROCEDURE EXPOSE consts. /* Get defaults for drive letter selections */ bootdrv = SysBootDrive() IF TRANSLATE( consts.!rpldir ) == 'MIGRATE' THEN ripldrv = bootdrv ELSE ripldrv = FILESPEC('DRIVE', consts.!rpldir ) IF TRANSLATE( consts.!rpluserdir ) == 'MIGRATE' THEN userdrv = bootdrv ELSE userdrv = FILESPEC('DRIVE', consts.!rpluserdir ) IF ripldrv == '' THEN ripldrv = bootdrv IF userdrv == '' THEN userdrv = bootdrv /* Set up the comboboxes */ defaultripl = 1 defaultuser = 1 map = SysDriveMap('C:', 'LOCAL') DO x = 1 TO WORDS( map ) volume = WORD( map, x ) info = SysDriveInfo( volume ) IF ( WORD( info, 2 ) \= '') & ( WORD( info, 2 ) \= '0') THEN DO CALL VRMethod 'CB_RIPL_BOOTDRV', 'AddString', volume CALL VRMethod 'CB_RIPL_WSSDRV', 'AddString', volume IF volume == ripldrv THEN defaultripl = x IF volume == userdrv THEN defaultuser = x END END CALL VRSet 'CB_RIPL_BOOTDRV', 'Selected', defaultripl CALL VRSet 'CB_RIPL_WSSDRV', 'Selected', defaultuser CALL VRSet 'CB_RIPL_DOSVERSION', 'Selected', 1 CALL VRSet 'CHK_RIPL_COPYREQ', 'Set', consts.!rplcopyreq CALL VRSet 'CHK_RIPL_COPYDLR', 'Set', consts.!rplcopydlr CALL VRSet 'CHK_RIPL_COPYDOS', 'Set', consts.!rplcopydos CALL VRSet 'CHK_RIPL_COPYLSP', 'Set', consts.!rplcopylsp SELECT WHEN consts.!rpldosver == 'IBM_DOS70' THEN CALL VRSet 'CB_RIPL_DOSVERSION', 'Selected', 1 WHEN consts.!rpldosver == 'IBM_DOS63' THEN CALL VRSet 'CB_RIPL_DOSVERSION', 'Selected', 2 WHEN consts.!rpldosver == 'IBM_DOS61' THEN CALL VRSet 'CB_RIPL_DOSVERSION', 'Selected', 3 WHEN consts.!rpldosver == 'MS_DOS60' THEN CALL VRSet 'CB_RIPL_DOSVERSION', 'Selected', 4 OTHERWISE CALL VRSet 'CB_RIPL_DOSVERSION', 'Selected', 1 END IF ( consts.!rpldosnum < 1 ) | ( consts.!rpldosnum > 8 ) THEN CALL VRSet 'SP_RIPL_DOSNUMBER', 'Value', 1 ELSE CALL VRSet 'SP_RIPL_DOSNUMBER', 'Value', consts.!rpldosnum /* Set/disable controls as appropriate */ IF consts.!installdosremoteipl == 0 THEN DO CALL VRSet 'CHK_RIPL_COPYDLR', 'Enabled', 0 CALL VRSet 'CHK_RIPL_COPYDOS', 'Enabled', 0 CALL VRSet 'CB_RIPL_DOSVERSION', 'Enabled', 0 CALL VRSet 'SP_RIPL_DOSNUMBER', 'Enabled', 0 END IF consts.!installos2remoteipl == 0 THEN DO CALL VRSet 'CHK_RIPL_COPYREQ', 'Enabled', 0 END /* CALL NLVSetText 'DT_RIPL', 'Caption', 65 */ CALL NLVSetText 'DT_RIPL_BOOTDRV', 'Caption', 66 CALL NLVSetText 'DT_RIPL_WSSDRV', 'Caption', 67 CALL NLVSetText 'GB_RIPLIMAGE', 'Caption', 68 CALL NLVSetText 'CHK_RIPL_COPYREQ', 'Caption', 69 CALL NLVSetText 'CHK_RIPL_COPYDLR', 'Caption', 70 CALL NLVSetText 'CHK_RIPL_COPYLSP', 'Caption', 71 CALL NLVSetText 'CHK_RIPL_COPYDOS', 'Caption', 72 CALL NLVSetText 'DT_RIPL_DOSVERSION', 'Caption', 73 CALL NLVSetText 'DT_RIPL_DOSNUMBER', 'Caption', 74 CALL NLVSetText 'GB_RIPLIF', 'Caption', 75 RETURN /*:VRX SW_UPS_Close */ SW_UPS_Close: call SW_UPS_Fini return /*:VRX SW_UPS_Create */ SW_UPS_Create: call SW_UPS_Init return /*:VRX SW_UPS_Fini */ SW_UPS_Fini: window = VRInfo( "Window" ) call VRDestroy window drop window return /*:VRX SW_UPS_Init */ SW_UPS_Init: IF consts.!upsport == 'COM2' THEN CALL VRSet 'RB_UPSCOM2', 'Set', 1 ELSE CALL VRSet 'RB_UPSCOM1', 'Set', 1 /* CALL NLVSetText 'DT_UPS', 'Caption', 77 */ CALL NLVSetText 'GB_UPSPORT', 'Caption', 78 RETURN /*:VRX UpdateDesktop */ UpdateDesktop: PROCEDURE EXPOSE consts. /* * Update the desktop layout, if possible. */ ok = SysMoveObject('', '') IF ok == 1 THEN DO auxwp = 'AUXWP' osdir = STRIP( VALUE('OSDIR',,'OS2ENVIRONMENT')) IF ( osdir <> '') & ( STREAM( osdir'\dll\ecswp.dll', 'C', 'QUERY EXISTS') <> '') THEN auxwp = 'ECSWP' CALL SysCreateObject 'WPProgram', NLVGetMessage( 104 ), '',, 'EXENAME='consts.!volume'\IBMLAN\NETPROG\NETSTCMD.CMD;PARAMETERS=STOP REQUESTER;PROGTYPE=WINDOWABLEVIO;OBJECTID=', 'REPLACE' CALL SysCreateObject 'WPProgram', NLVGetMessage( 102 ), '',, 'EXENAME='consts.!bootdrv'\MUGLIB\LOGON.EXE;PROGTYPE=PM;PARAMETERS=/V:NONE;OBJECTID=', 'REPLACE' CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 100 ) || ';ALWAYSSORT=YES;DEFAULTSORT=-1;SORTFOLDERSFIRST=YES;SHOWALLINTREEVIEW=YES;DEFAULTVIEW=ICON;ICONVIEW=FLOWED,NORMAL;ICONRESOURCE=120,'auxwp';ICONNRESOURCE=1,121,'auxwp CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 103 ) CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 100 ) CALL SysSetObjectData '', 'ALWAYSSORT=YES;DEFAULTSORT=-1;SORTFOLDERSFIRST=YES;SHOWALLINTREEVIEW=YES;DEFAULTVIEW=ICON;ICONVIEW=FLOWED,NORMAL;ICONRESOURCE=122,'auxwp';ICONNRESOURCE=1,123,'auxwp CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 101 ) || ';PARAMETERS=/V:DOMAIN /D' CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 105 ) || ';PROGTYPE=WINDOWABLEVIO' CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 106 ) || ';PROGTYPE=PM' CALL SysSetObjectData '', 'PROGTYPE=PM' CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 107 ) CALL SysMoveObject '', '' CALL SysSetObjectData '', 'TITLE=' || NLVGetMessage( 107 ) CALL SysMoveObject '', '' CALL SysMoveObject '', '' CALL SysMoveObject '', '' CALL SysMoveObject '', '' CALL SysMoveObject '', '' CALL SysCreateShadow '', '' CALL SysCreateShadow '', '' /* CALL SysCreateShadow '', '' CALL SysCreateShadow '', '' */ CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' CALL SysDestroyObject '' END CALL SysSaveObject '', 'FALSE' RETURN /*:VRX WN_MAIN_Close */ WN_MAIN_Close: call Quit return