Uninstall is failing with error - with error "service could not be deleted"
Closed this issue · 1 comments
dorlep commented
I am under development stage , below is my code
Scenario -
- I installed the project 1st time
- Then I develop something
- then trying to uninstalled 1st time installed project
- and getting below error, not able to uninstall
Could you please help me to uninstall?
Feature pccwinFeature = new Feature("PCCWindows", "P job worker", "INSTALLDIR");
WixSharp.File service;
var project = new ManagedProject("PCCWindows",
new InstallDir(installDir,
new Dir("P job worker",
service = new WixSharp.File(pccwinFeature, sourceDir + @"\PJobWorkerService.exe"),
new Files(pccwinFeature, sourceDir + @"\*.dll"),
new Files(pccwinFeature, sourceDir + @"\*.config"),
new Files(pccwinFeature, sourceDir + @"\*.xml")
))
, new RegValue(pccwinFeature, WixSharp.RegistryHive.LocalMachine, "Software\\PSuite\\P\\PCCWindows", "InstalledDirectory", "[INSTALLDIR]")
)
{
DigitalSignature = new DigitalSignature
{
PfxFilePath = digitalSignaturePath,
Password = "of2TmunCgb2022",
Description = "MyProduct",
HashAlgorithm = HashAlgorithmType.sha256
}
};
service.ServiceInstaller = new ServiceInstaller
{
Name = "[SERVICENAME]",
StartOn =null,
StopOn = null,
RemoveOn = SvcEvent.Uninstall_Wait,
Account = "[USERNAME]",
Password = "[PASSWORD]",
};
project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889f");
project.DefaultDeferredProperties += ",SERVICENAME,DATABASE_CONNECTION,PROVIDER_NAME";
project.UI = WUI.WixUI_ProgressOnly;
project.AfterInstall += Msi_AfterInstall;
ValidateAssemblyCompatibility();
Thank you in advance.
oleg-shilo commented
Hm... the error message does not show the name of the service. Meanig that most likely when you specified Name = "[SERVICENAME]",
that SERVICENAME
property was empty.
I am not sure how WiX/MSI or the system behaves in case of service name is empty. I would expect it to nicely fail. But judging from your question it somehow succeeded.
Did you check that the service is installed?