⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 27

📁 Unix/Linux 网络时间协议版本3 Network Time Protocol Version 3 (NTP) distribution for Unix systems
💻
📖 第 1 页 / 共 5 页
字号:
- 	//      PlaceWindow(BACKGROUND,nDx/2,0,UPPER_LEFT);- 	//      SizeWindow(BACKGROUND,nDx/2,nDy/2);- 	//- 	//  However will also have to move all the dialogs/bitmaps- 	//  around to make this work correctly...- 	//----------------------------------------------------------- 	-     SetTitle( APP_NAME2 + " Setup", 24, WHITE );- - //    SetColor( BACKGROUND, BK_BLUE ); // Dark blue.- //    SetColor( STATUSBAR, BLUE );     // Bright blue.-     SetTitle( "Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.- -     Enable( BACKGROUND );-     Delay( 1 );- -    // Show the bitmap.-    // PlaceBitmap( SUPPORTDIR ^ "NTPNT.BMP",1,10,10,UPPER_RIGHT);- end;- - - /*---------------------------------------------------------------------------*\-  * Function:  CheckRequirements-  *  Purpose:  This function will make sure we are on NT, not Win95.- \*---------------------------------------------------------------------------*/- function CheckRequirements()- 	number nvVersion;- 	STRING szResult, svVersion;- begin-     // Determine the target system's operating system.-     GetSystemInfo( OS, nvVersion, svVersion );-     if (nvVersion =  IS_WINDOWSNT) then- - 	    MessageBox("This product can only run on Windows NT",SEVERE);- 		exit;-     endif;- end;- - //+---------------------------------------------------------------------------- //  Member:             ReportError()- //----------------------------------------------------------------------------- function ReportError(n_Err, sz_Message)- - begin-   switch(n_Err)- 	case k_PrivilegeErr:              sz_Message = "Privilege Error";- 	case k_CreateKeyErr:              sz_Message = "Create Key Failed";- 	case k_RestoreKeyErr:             sz_Message = "Restore Default Key Failed";- 	case k_ErrUnableToOpenWriteOwner: sz_Message = "Unable to Open and Write Owner Information";- 	case k_ErrUnableToSetOwner:       sz_Message = "Unable to Set Owner Information";- 	case k_ErrUnableToOpenDAC:        sz_Message = "Unable to Open Access Control List";- 	case k_ErrUnableToWriteDACL:      sz_Message = "Unable to Write Access Control List";- 	case k_OpenKeyError:              sz_Message = "Unable to Open Registry Key Entry";- 	case k_ModifySetAccountFail:      sz_Message = "Unable to Setup Account Parameters";- 	case k_SCMErr:                    sz_Message = "Unable to Open Service Control Manager Database";- 	case k_SCMpoErr:                  sz_Message = "Unable to Open NTP - NT service entries in the Service Control Manager";- 	case k_DeleteServiceFail:         sz_Message = "Unable to delete NTP - NT service";- 	case k_DeleteKeyFail:             sz_Message = "Unable to delete registry key information";- 	case k_DeleteValueFail:           sz_Message = "Unable to delete registry value information";- 	case k_DirSecurityErr:            sz_Message = "Unable to retreive Security information on directory";- 	case k_DirSetDACLErr:             sz_Message = "Unable to add security information on directory";- 	case k_DirSetSecurityErr:         sz_Message = "Unable to set directory security information";- 	case k_SCMpoStopErr:              sz_Message = "Unable to stop the NTP - NT service";- 	case k_SaveKeyErr:                sz_Message = "Unable to save registry key.";- 	case k_ServiceUnknownErr:         sz_Message = "The service control manager could not start the NTP - NT service - please check the event log";- 	case k_ServiceDependency:         sz_Message = "The NTP - NT service depends on several other services which are not installed.";- 	case k_ServiceDependencyFail:     sz_Message = "The NTP - NT service depends on other services which failed to start.";- 	case k_ServiceLogonFail:          sz_Message = "The service manager was unable to login the NTP - NT service - Please check the password and logon as service privilege";-     case k_BadPath:                   sz_Message = "Bad Path Specified."; - 	case k_AccessDenied:              sz_Message = "Access Denied.";- 	case k_ServiceExists:             sz_Message = "NTP - NT service already exists so cannot be re-installed";-     case k_createservicefailed:       sz_Message = "Creation of the NTP - NT service failed.";-     case k_removeservicefailed:       sz_Message = "Unable to remove the NTP - NT service.";- 	case k_ServicenoExists:           sz_Message = "NTP - NT service is not installed so cannot be removed.";- 	default:                          sz_Message = "Unknown Error";-   endswitch;- end;- - //+---------------------------------------------------------------------------- //- //  Member:             RemoveNTP()- //- //  Synopsis:   Remove the NTP service entry and registry entries- //- //----------------------------------------------------------------------------- function RemoveNTP()- 	NUMBER n_Result;- begin- 	-     dummy = APP_NAME;-     SetStatusWindow( 0, "Stopping and removing NTP service..." );- 	// Remove the NTP service entry & Registry but first stop the service-  -         nReturnValue2 = CallDLLFx(szDllNTPInst,"StopNTPService",nValue,dummy);- - 	if (nReturnValue2 != 0) then- 		ReportError(nReturnValue2,szMessage);- 		NumToStr( szTemp, nReturnValue2 );- 		szMessage = "Unable to Stop the NTP - NT Service. \n" + szTemp + "\nAre you sure it is installed?\n" + szMessage;- 		MessageBox(szMessage,SEVERE);- 		exit;- 	endif;-    	Delay( 3 ); // delay for xntpd.exe file to free up so delete works- - -   	// have to get the currently install directory from the dll by pulling it off of the imagepath param-     //if (GetImagePath(svModuleDir) != 0) then- 	//    szMessage = "Unable to retrieve the path to Remove NTP Files \n" + svModuleDir + -     //                    "\nAre you sure it is installed?\n";- 	//    MessageBox(szMessage,SEVERE);- 	//    exit;- 	//endif;- - 	n_Result = CallDLLFx(szDllNTPInst,"RemoveNTPService",nValue,dummy);- - 	if (n_Result != 0) then            - 		MessageBox("Unable to remove NTP - NT service from the registry.",SEVERE);-                 exit;- 	else- 	    if (AskYesNo("Service Removed\n Do you want to delete all the NTP Executables and config files also?\n",- 				 NO) = YES) then- - 			TARGETDIR = WINSYSDIR;                  // pick off the files we put in the - 			DeleteFile("ntpdate.exe");- 			DeleteFile("ntpq.exe");- 			DeleteFile("ntptrace.exe");- 			DeleteFile("xntpdc.exe");- 			DeleteFile("xntpd.exe");- 			DeleteFile("instsrv.exe");- - 			TARGETDIR = svModuleDir;- 			DeleteFile("ntpog.wri");- 			DeleteFile("readme.nt");- 			DeleteDir(svModuleDir, ONLYDIR);- 									- -             TARGETDIR = WINDIR;-             DeleteFile("ntp.conf");-             DeleteFile("ntp.drift");- - 			MessageBox("NTP - NT service and registry entries are removed.\n" +- 					   "All Executable/Config files have been deleted.",INFORMATION);- 		else- 			MessageBox("NTP - NT service and registry entries are removed.\n" +- 					   "All Executable/Config files are retained.",INFORMATION);- 		endif;  - 	endif;- end;- -  - //+---------------------------------------------------------------------------- //- //  Member:             UpdateModules()- //- //----------------------------------------------------------------------------- function UpdateModules()- 	STRING szFileSet;- 	STRING szMessage;- 	NUMBER nvSize, nvType;- begin-     SetStatusWindow( 0, "Updating NTP installation..." );- -         nReturnValue2 = CallDLLFx(szDllNTPInst,"StopNTPService",nValue,dummy);- - 	if (nReturnValue2 != 0) then- 		ReportError(nReturnValue2,szMessage);- 		NumToStr( szTemp, nReturnValue2 );- 		szMessage = "Unable to Stop the NTP - NT Service. \n" + szTemp + "\nAre you sure it is running?\n" + szMessage;- 		MessageBox(szMessage,SEVERE);- 		exit;- 	endif;-    	Delay( 3 ); // delay for xntpd.exe file to free up so copy works- - 	// have to get the currently install directory from the dll by pulling it off of the imagepath param-     if (GetImagePath(svModuleDir) != 0) then- 		szMessage = "Unable to retrieve the path to Update NTP Files \n" + svModuleDir + -                   "\nAre you sure it is installed?\n";- 		MessageBox(szMessage,SEVERE);- 		exit;- 	endif;- - 	InstallNTPFiles(svModuleDir,1);- 	-     nReturnValue2 = CallDLLFx(szDllNTPInst,"StartNTPService",nValue,dummy);- -     if (nReturnValue2 != 0) then- 		ReportError(nReturnValue2,szMessage);- 		szMessage = "Unable to start the NTP - NT Service.\n" + szMessage;- 		MessageBox(szMessage,SEVERE);- 		exit;-     endif;- - 	SetStatusWindow( 100, "Update completed." );- 	Delay( 2 );-    - 	MessageBox("Your Network Time Protocol Server modules have been updated and\n" +- 			   "the service restarted.  You should check the event log\n" +- 			   "to make sure everything came back up properly.",INFORMATION);- end;- - - /*---------------------------------------------------------------------------*\-  *-  * Function:  GetImagePAth-  *-  * Purpose:  Get the given value, under the given key, from the registry.-  *   l. kahn- \*---------------------------------------------------------------------------*/- function GetImagePath(svValue)- 	NUMBER nvSize;- 	NUMBER nvType;- begin- -         RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);-         if (RegDBGetKeyValueEx(SERVICE_ENTRY,-               "ImagePath",nvType,svValue,nvSize) < 0) then- 		return -1;- 	endif;- 			- 	StrSub(svValue,svValue,0,nvSize - 10);                       // trim to REAL length   -         return 0;- end;- - function CheckForService()-         STRING temp;- 	NUMBER nvSize;- 	NUMBER nvType;- begin- - - 	RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);-         if (RegDBGetKeyValueEx(SERVICE_ENTRY,- 			"ImagePath",nvType,temp,nvSize) < 0) then- 		return 0;- 	endif;-  return -1;- end;- - - /*---------------------------------------------------------------------------*\-  *-  * Function:  LaunchAppAndWait-  *-  *  Purpose:  replace predefined function in more expensive InstallShield -  *            with C function.-  *	l. kahn- \*---------------------------------------------------------------------------*/- function LaunchAppAndWait(svApp, svData, waitval)-   STRING tstring;- begin-         nValue = waitval;-         tstring = svApp+" "+svData;-         nReturnValue2 = CallDLLFx(szDllNTPInst,"LaunchApp",nValue,tstring);-         return 0;- end;- - - /*---------------------------------------------------------------------------*\-  *-  * Function:  FixDirectory-  *-  *  Purpose:  put the double slashes in the directory-  *  l. kahn- \*---------------------------------------------------------------------------*/- function FixDirectory(svOut,svIn)- - INT len;- INT ctr;- NUMBER letter;- INT i;- - begin-  len = StrLength(svIn) - 1;-  ctr = 0;- -  for i = 0 to len-     GetByte(letter,svIn,i);-     if (letter = 92)-       then-        SetByte(svOut,ctr,letter);-        ctr = ctr + 1;-     endif;- -     SetByte(svOut,ctr,letter);-     ctr = ctr + 1;-  endfor;- end;\ No newline at end of file--- 0 ----diff -N -x *.mak -c -r xntp3-5.86/scripts/wininstall/build.bat xntp/scripts/wininstall/build.bat*** xntp3-5.86/scripts/wininstall/build.bat	Wed Dec 31 23:58:26 1969--- xntp/scripts/wininstall/build.bat	Sun Oct 20 23:43:20 1996****************** 28,34 ****  echo Building INTEL version...  :skip_intel  ! set IPRG=f:\ishield\program  set INST=%INSTDIR%\data    rem --- 28,34 ----  echo Building INTEL version...  :skip_intel  ! set IPRG=c:\msdev\ishield\program  set INST=%INSTDIR%\data    rem Binary files xntp3-5.86/scripts/wininstall/distrib/ntpog.wri and xntp/scripts/wininstall/distrib/ntpog.wri differdiff -N -x *.mak -c -r xntp3-5.86/scripts/wininstall/distrib/readme.nt xntp/scripts/wininstall/distrib/readme.nt*** xntp3-5.86/scripts/wininstall/distrib/readme.nt	Wed Dec 31 23:57:18 1969--- xntp/scripts/wininstall/distrib/readme.nt	Mon Oct 21 02:00:19 1996****************** 1,23 ****! Building/compiling XNTP 3.5 for Windows NT  ! To automate the build run the file buildallnt.bat... then run the! file install.bat in the contrib\winnt-dist directory (i.e. step 10 below)...! or to build XNTP manually review the buildntall.bat file...  ! NOTE: For installing binaries only do step 1    - 1) Run         ntp\contrib\winnt-dist\install.bat (To install it all)- 2) Run         ntp\mkdist.bat (To package it via ZIP)  ! NOTE: You will now have to modify the configuration files installed by the! install.bat program and also the ntp.conf file (config file) installed in! the WinNT home directory.  Also see the NTP operations guide (ntpog.wri)! in the system32 directory.    ****YOU MUST ****** modify the directory line in the ntp.conf or ntp.ini ! (it will accept either name)... and change the single slash to double slashes! ie. c:\winnt\ntp.conf becomes c:\\winnt\\ntp.conf      --- 1,139 ----! ----------------------------------------------------------------------------! XNTP v3.5-86 Release (w/ NT patches)                      October 20th, 1996! 						  ! ----------------------------------------------------------------------------! 	This software is user supported freeware.  ! 	For support post to the UseNet newsgroup: comp.protocols.time.ntp  ! 	More detailed information can also be found at:! 		http://www.eecis.udel.edu/~ntp      !         NOTE: Don't run uninstall to remove or update the Network Time !               Protocol service to a new version, just run the setup program !               again.! --------------------------------------------------------------------------------! ! ! Brief Installation Instructions! 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -