Discussion:
[WiX-users] Windows service doesn't remove from services.msc in windows 8 using WIX shortcut (C#)
Manoj Rawat
2015-06-24 08:33:29 UTC
Permalink
Hi,
I created shortcut for my windows service . When I uninstall the windows
service using shortcut then it removes service from startup menu, But I was
able to see the window service in services.msc tool (Note: it throws error
when I try to start\stop the particular win service ). If i uninstall it
from control panel's Add/Remove programes then it removes win service from
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="TestWindowService" Language="1033" Version="1.0.0.0"
Manufacturer="Test Service"
UpgradeCode="8cfc33c6-292f-4bad-a488-4781ae709c5e">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is
already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="TestWindowService" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="TestWindowServiceShortcut" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ManufacturerFolder"
Name="!(bind.property.Manufacturer)">
<Directory Id="INSTALLFOLDER" Name="!(bind.property.ProductName)" />
</Directory>
</Directory>
<!-- Step 1: Define the directory structure -->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder"
Name="TestWindowService"/>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the
ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent">
<!-- TODO: Insert files, registry keys, and other resources here. -->
<File Id="TestWindowService"
Source="$(var.TestWindowsService.TargetPath)" KeyPath="yes"/>
<ServiceInstall Id="TestWindowService"
DisplayName="TestWindowService" Name="TestWindowService" Description="Test
window service" Account="LocalSystem" ErrorControl="normal" Start="demand"
Type="ownProcess" Vital="yes" />
<ServiceControl Id="ControlWixService"
Name="TestWindowService.exe" Stop="uninstall" Remove="uninstall" />
</Component>
</ComponentGroup>
<ComponentGroup Id="TestWindowServiceShortcut"
Directory="ApplicationProgramsFolder">
<Component Id="TestWindowServiceShortcut"
Guid="01E98283-4246-46BC-A39F-0F1975C95AA6">
<Shortcut Id="UninstallProduct" Name="Uninstall TestWindowService"
Description="Uninstalls TestWindowService Application"
Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU"
Key="Software\[Manufacturer]\[ProductName]" Name="installed" Type="integer"
Value="1" KeyPath="yes"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
Nir Bar
2015-06-24 20:17:07 UTC
Permalink
Sometimes Windows marks a service for deletion after restart.
In this case you would see the service in the services UI until after
restart.



-----
Nir Bar
Freelance Developer
Mail: ***@panel-sw.com
Web: www.panel-sw.com
- C++ On Windows, Linux and Embedded Platforms
- WiX & InstallShield
--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Re-Windows-service-doesn-t-remove-from-services-msc-in-windows-8-using-WIX-shortcut-C-tp7600702p7600712.html
Sent from the wix-users mailing list archive at Nabble.com.
Phil Wilson
2015-06-24 22:26:18 UTC
Permalink
Your ServiceInstall says Name="TestWindowService" but your
ServiceControl says Name="TestWindowService.exe", so if the name is
actually TestWindowService your ServiceControl isn't going to do
anything with it. That's why you get the error and probably the other
unexpected behvior too.
---------------
Phil Wilson
Post by Nir Bar
Sometimes Windows marks a service for deletion after restart.
In this case you would see the service in the services UI until after
restart.
-----
Nir Bar
Freelance Developer
Web: www.panel-sw.com
- C++ On Windows, Linux and Embedded Platforms
- WiX & InstallShield
--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Re-Windows-service-doesn-t-remove-from-services-msc-in-windows-8-using-WIX-shortcut-C-tp7600702p7600712.html
Sent from the wix-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Manoj Rawat
2015-06-25 08:16:13 UTC
Permalink
Hi Phil,

Your solution fixed my issue..

Thank you very much..

Regards,
Manoj
Post by Phil Wilson
Your ServiceInstall says Name="TestWindowService" but your
ServiceControl says Name="TestWindowService.exe", so if the name is
actually TestWindowService your ServiceControl isn't going to do
anything with it. That's why you get the error and probably the other
unexpected behvior too.
---------------
Phil Wilson
Post by Nir Bar
Sometimes Windows marks a service for deletion after restart.
In this case you would see the service in the services UI until after
restart.
-----
Nir Bar
Freelance Developer
Web: www.panel-sw.com
- C++ On Windows, Linux and Embedded Platforms
- WiX & InstallShield
--
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Re-Windows-service-doesn-t-remove-from-services-msc-in-windows-8-using-WIX-shortcut-C-tp7600702p7600712.html
Post by Nir Bar
Sent from the wix-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Post by Nir Bar
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Loading...