在 Inno 安装我的应用程序后,我希望 Inno 使用 Windows 服务列表中安装文件夹的属性安装 2 个服务。
我已经安装了,wamp
我想为mysql添加一个新服务apache
new service for
apacheServiceInstallParams = -n wampapachec -k install
mysqlServiceInstallParams = --install-manual wampmysqldc
function InstallService(const FileName, ServiceName,
DisplayName: string; ServiceType, StartType: DWORD): Boolean;
var
ManagerHandle: SC_HANDLE;
ServiceHandle: SC_HANDLE;
begin
Result := False;
ManagerHandle := OpenSCManager('', '', SC_MANAGER_ALL_ACCESS);
if ManagerHandle <> 0 then
begin
try
ServiceHandle := CreateService(ManagerHandle, ServiceName,
DisplayName, SERVICE_ALL_ACCESS, ServiceType, StartType,
SERVICE_ERROR_IGNORE, FileName, '', 0, '', '', '');
if ServiceHandle <> 0 then
begin
Result := True;
CloseServiceHandle(ServiceHandle);
end
else
MsgBox(SysErrorMessage(DLLGetLastError), mbError, MB_OK);
finally
CloseServiceHandle(ManagerHandle);
end;
end
else
MsgBox(SysErrorMessage(DLLGetLastError), mbError, MB_OK);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
if InstallService(ExpandConstant('{app}\bin\aoache\apache2.2.22\bin\httpd.exe'),
'wampapachecow',
'MySQL', SERVICE_WIN32_SHARE_PROCESS, SERVICE_AUTO_START)
then
MsgBox('MySql Service installation succeeded!', mbInformation, MB_OK);
if InstallService(ExpandConstant('{app}\bin\mysql\mysql5.5.24\bin\mysqld.exe'),
'wampmysqldcow',
'MySQL', SERVICE_WIN32_SHARE_PROCESS, SERVICE_AUTO_START)
then
MsgBox('MySql Service installation succeeded!', mbInformation, MB_OK);
end;
end;
我不明白的是:
我有这样的:
InstallService(ExpandConstant('{app}\bin\aoache\apache2.2.22\bin\httpd.exe'),
'wampapachecow',
'MySQL', SERVICE_WIN32_SHARE_PROCESS, SERVICE_AUTO_START)
应该是这样的?
InstallService(ExpandConstant('{app}\MySQL 5.5\bin\mysqld.exe'),
ExpandConstant('--defaults-file="{app}\MySQL 5.5\my.ini"'),
'MySQL', SERVICE_WIN32_SHARE_PROCESS, SERVICE_AUTO_START)
请解释第二个参数:
'wampapachecow'
和ExpandConstant('--defaults-file="{app}\MySQL 5.5\my.ini"')