intraweb部署windows服务http.sys方法
一、创建服务程序“Project1.exe”
1、我的编译环境是 win7+Delphi xe+iw15.0.10,如果是win10,Delphi需要选择管理员权限运行才能生成exe。
2、打开xe>file>new>other,选择intraweb application wizard。
3、向导界面上application type,选择standalone application(http.sys),路径自己选择如“D:”,工程名字如“Project1”,OK。
4、工程文件如下
program Project1;
uses
IWRtlFix,
IWJclStackTrace,
IWJclDebug,
Forms,
IWStartHSys,
Unit1 in 'Unit1.pas' {IWForm1: TIWAppForm},
ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase},
UserSessionUnit in 'UserSessionUnit.pas' {IWUserSession: TIWUserSessionBase};
{$R *.res}
begin
TIWStartHSys.Execute(false);//这是关键 必须是false,其他都是自己创建的。
end.
5、打开unit ServerController,IWServerController,属性,appname修改如“test”或者自己喜欢的名字,但必须是英文。
description修改如“这是intraweb应用程序”。
6、打开Unit1,IWForm1,随便放上一个按钮控件,好验证是否能够打开网址。
7、编译完成,生成“Project1.exe”。就这么简单。
二、部署windows服务
1、打开记事本,复制以下:
::如果是win10,则鼠标右键选择管理员权限运行。win7不用。
d:\Project1.exe /install
net start Project1.exe