msi: Use special error control flag in CreateService.
Signed-off-by: Andreas Maier <andy1.m@gmx.de> Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
be5b270690
commit
ddc1baa432
|
@ -5811,6 +5811,7 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
|
||||||
LPWSTR name = NULL, disp = NULL, load_order = NULL, serv_name = NULL;
|
LPWSTR name = NULL, disp = NULL, load_order = NULL, serv_name = NULL;
|
||||||
LPWSTR depends = NULL, pass = NULL, args = NULL, image_path = NULL;
|
LPWSTR depends = NULL, pass = NULL, args = NULL, image_path = NULL;
|
||||||
DWORD serv_type, start_type, err_control;
|
DWORD serv_type, start_type, err_control;
|
||||||
|
BOOL is_vital;
|
||||||
SERVICE_DESCRIPTIONW sd = {NULL};
|
SERVICE_DESCRIPTIONW sd = {NULL};
|
||||||
UINT ret = ERROR_SUCCESS;
|
UINT ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
@ -5849,6 +5850,13 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
|
||||||
deformat_string(package, MSI_RecordGetString(rec, 11), &args);
|
deformat_string(package, MSI_RecordGetString(rec, 11), &args);
|
||||||
deformat_string(package, MSI_RecordGetString(rec, 13), &sd.lpDescription);
|
deformat_string(package, MSI_RecordGetString(rec, 13), &sd.lpDescription);
|
||||||
|
|
||||||
|
/* Should the complete install fail if CreateService fails? */
|
||||||
|
is_vital = (err_control & msidbServiceInstallErrorControlVital);
|
||||||
|
|
||||||
|
/* Remove the msidbServiceInstallErrorControlVital-flag from err_control.
|
||||||
|
CreateService (under Windows) would fail if not. */
|
||||||
|
err_control &= ~msidbServiceInstallErrorControlVital;
|
||||||
|
|
||||||
/* fetch the service path */
|
/* fetch the service path */
|
||||||
row = MSI_QueryGetRecord(package->db, query, comp);
|
row = MSI_QueryGetRecord(package->db, query, comp);
|
||||||
if (!row)
|
if (!row)
|
||||||
|
@ -5890,7 +5898,12 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
|
||||||
if (!service)
|
if (!service)
|
||||||
{
|
{
|
||||||
if (GetLastError() != ERROR_SERVICE_EXISTS)
|
if (GetLastError() != ERROR_SERVICE_EXISTS)
|
||||||
ERR("Failed to create service %s: %d\n", debugstr_w(name), GetLastError());
|
{
|
||||||
|
WARN("Failed to create service %s: %d\n", debugstr_w(name), GetLastError());
|
||||||
|
if (is_vital)
|
||||||
|
ret = ERROR_INSTALL_FAILURE;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (sd.lpDescription)
|
else if (sd.lpDescription)
|
||||||
{
|
{
|
||||||
|
|
|
@ -200,6 +200,11 @@ enum msidbServiceControlEvent
|
||||||
msidbServiceControlEventUninstallDelete = 0x00000080,
|
msidbServiceControlEventUninstallDelete = 0x00000080,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum msidbServiceInstallErrorControl
|
||||||
|
{
|
||||||
|
msidbServiceInstallErrorControlVital = 0x00008000
|
||||||
|
};
|
||||||
|
|
||||||
enum msidbMoveFileOptions
|
enum msidbMoveFileOptions
|
||||||
{
|
{
|
||||||
msidbMoveFileOptionsMove = 0x00000001,
|
msidbMoveFileOptionsMove = 0x00000001,
|
||||||
|
|
Loading…
Reference in New Issue