老兄,我这有个ASTA提供的自动安装软件成服务的程序,说明见下,觉得有用的话,留EMAIL,<br>我给你发过来.<br><br>ASTA Services as NT Service<br>Many ASTA users have implemented their ASTA Servers as NT Services. Since ASTA now suports<br>16 3rd party Delphi Components, extending that support to NT Service version could be a bit<br>challenging.<br><br>So we at ASTA decided to create an Application (AstaServerLauncher) that could launch and<br>bounce back ASTA Servers if they go down AND to deliver an NT Service Version of<br>the same executable that would use the registry settings created by running it one time<br>as an normal EXE.<br><br>By supporting the One App as a service, we have enabled ALL AstaServers to run as an NT<br>Service.<br><br>=====================================================================================<br>AstaServerLauncher:<br> designed to launch ASTA servers and bounce them back if they go down.<br> Configure it to run one or more ASTA servers and any settings used will<br> be used by the AstaServiceLauncherNTS which it reads from the registry.<br><br>AstaServerLauncher NTS- NT Service Version of AstaServerLauncher<br><br>This does not have a user interface, it is run as a service and reads<br>the registry to tell which programs to start. Use the<br>AstaServiceLauncher to setup the Registry configuration.<br><br>To install it as a service run the program with the command line<br>parameter of /Install. (You can create a shortcut to use for this by<br>editing the shortcuts "Target" property and adding /Install to it)<br>(/Uninstall does the reverse)<br><br>Then in control panel, open up Services. Look for AstaServiceLauncherNTS<br>Double click it. Set it to manual or automatic start. Click on Allow<br>Service to Interact with desktop so that it is checked. (You can also<br>set it to run in its own session by selecting a particular account with<br>This Account radion button). Press OK.<br><br>You can start the service manually. Once started it will read the<br>registry and startup any programs that need AutoStarted. Then it will<br>keep those programs alive if they are set to AutoReStart.<br><br><br>