Inno がアプリをインストールした後、Inno に Windows サービス リストのインストール フォルダーのプロパティを使用して 2 つのサービスをインストールしてもらいます。
インストール済みで、mysql`wamp
用の新しいサービスを追加したい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)
2番目のパラメータについて説明してください:
'wampapachecow'
とExpandConstant('--defaults-file="{app}\MySQL 5.5\my.ini"')