[wix-users] My custom action fails to run sc.exe commands

Nir Bar nir.bar at panel-sw.com
Thu Nov 3 11:48:39 PDT 2022


1062 = ERROR_SERVICE_NOT_ACTIVEThe service has not been started.--Nir BarWiX Expert ---- On Thu, 03 Nov 2022 18:28:29 +0200  wix-users at lists.wixtoolset.org  wrote ----Hello Community,

I have a custom action that is being run during the uninstall just before
the removal of files:

*<Custom Action="CA_DeleteWindowsServices" Before="RemoveFiles">REMOVE ~=
"ALL"</Custom>*

And here is the declaration of my custom action in my main wxs file which
defines it as a deferred with impersonation set to NO:

*<CustomAction Id="CA_DeleteWindowsServices" Return="check"
BinaryKey="ESInstallerCustomActions" DllEntry="CAM_DeleteWindowsServices"
Execute="deferred" Impersonate="no" />*

The custom action implementation (C#) is quite simple, it just deletes some
windows services using the command "sc.exe delete my_service_name"
(Process.Start).

The thing is, that on some computers it runs well and on some computers it
fails to delete the services, and when I check the installer log, where I
trace the exception if deletion fails then I see this logged error:

*Network shell process exited with code1062*

Any ideas what I need to do or what I am missing? If needed I can share the
code for the custom action as well, although as I mentioned it's a simple
code using sc.exe delete option.

Thanks in advance,
Tigran

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list