I have windows service which will get installed as part of wix installation . Problem is that, currently service is in production and it is not responding to stop due to some poorly written code in service OnStop method .
So next time when the user tries to install upgraded version installation will fail because service will never stop when wix tries to stop the service .
Is there any way in which i come to know if wix is taking too much time to uninstall and i can kill the process if i get that notification ?
Also, is there any way i can kill process based on product version ?
Thanks
I shouldn't answer this since it has been ages since I have dealt with stuff like this, but what the heck, let's try.
I want to emphasize that I haven't actually tested these tools for killing services, and I don't have time to do so right now. There could be issues with the sequencing whereby StopServices
could be scheduled before the CloseApplication
custom action from WiX is scheduled to run. Please check the InstallExecuteSequence
using Orca (towards bottom) after compilation to see whether this is the case.
I have found a solution for this after digging for sometime .
I am creating new C# custom action project and i am sequencing my action before InstallInitialize.
In my C# custom action method, i am reading the existing installed file version by using FileVersionInfo.GetVersionInfo(filePath);
Then i am checking with desired version which i want to check and if condition matches i am killing my service process using
foreach (Process proc in Process.GetProcessesByName("ProcessName"))
{
proc.Kill();
session.Log("Service Killed");
}
in order to achieve this, Wix toolset v3.11.1 has to installed beforehand
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.