Re: [PATCH] msi: Use special errorctrl-flag for CreateService
On Sun, 2016-05-29 at 23:07 +0200, Andreas Maier wrote:
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 370007c..5675900 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5811,6 +5811,7 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) LPWSTR name = NULL, disp = NULL, load_order = NULL, serv_name = NULL; LPWSTR depends = NULL, pass = NULL, args = NULL, image_path = NULL; DWORD serv_type, start_type, err_control; + BOOL can_fail;
'is_vital' would be better.
SERVICE_DESCRIPTIONW sd = {NULL}; UINT ret = ERROR_SUCCESS;
@@ -5848,6 +5849,13 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) deformat_string(package, MSI_RecordGetString(rec, 10), &pass); deformat_string(package, MSI_RecordGetString(rec, 11), &args); deformat_string(package, MSI_RecordGetString(rec, 13), &sd.lpDescription); + + /* Should the complete install fail if CreateService fails? */ + can_fail = (err_control && msidbServiceInstallErrorControlVital >= 0);
This can't work. You want: 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 */ row = MSI_QueryGetRecord(package->db, query, comp); @@ -5890,7 +5898,12 @@ static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param) if (!service) { if (GetLastError() != ERROR_SERVICE_EXISTS) + { ERR("Failed to create service %s: %d\n", debugstr_w(name), GetLastError()); + if (can_fail) + return ERROR_INSTALL_FAILURE;
While you're at it, this ERR should be a WARN.
participants (1)
-
Hans Leidekker