Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 248357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:20:10+00:00 2026-05-11T21:20:10+00:00

When I uninstall my service I get the error where it says I have

  • 0

When I uninstall my service I get the error where it says I have to stop such and such service before uninstalling. This is unsatisfactory – the uninstaller should automatically stop it.

I found a blog or newsgroup posting on this months ago and got it to work properly, but now it has stopped working for me. And I don’t have a link to the post… maybe someone else know where it is? 🙂 I guess I changed some subtle thing and it stopped working. I find Wix extremely difficult to troubleshoot.

I am using the following include to fetch the property X_ WIN_ SERVICE_ NAME (sorry I don’t know how to avoid _ escaping here) from the registry. It doesn’t matter on install because in that case I explicitly set it with an input file. This include is used before any components in my wxs file.

<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?ifndef SetupXWinServiceRegistryProperties ?>
<?define SetupXWinServiceRegistryProperties ?>

<?define XWinServiceRegistryKey='Software\X\Y'?>

<Property Id="X_WIN_SERVICE_NAME">
  <RegistrySearch Id="XWinServiceNameSearch"
                    Root="HKLM"
                    Key="$(var.XWinServiceRegistryKey)"
                    Name="ServiceName"
                    Type="raw"/>
</Property>

<?endif?>
</Include>

The following include component is used to save the registry value on install:

<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?ifndef WriteXWinServiceRegistryProperties ?>
<?define WriteXWinServiceRegistryProperties ?>

<Component Id="CompWriteXWinServiceRegistryProps"
  Guid="some guid">

<!-- Write properties to the registry. Then they will be 
       accessable during uninstall. -->

<RegistryValue Root="HKLM"
   Key="$(var.XWinServiceRegistryKey)"
   Name="ServiceName"
   Type="string"
   Value="[X_WIN_SERVICE_NAME]"
   Action="write" />

</Component>

<?endif?>

</Include>

I have checked my system after install and the registry value is properly written there. The part in my component where the service is setup looks like:

          <ServiceInstall Id="ServiceInstallXWinService"
                          Name="[X_WIN_SERVICE_NAME]"
                          Start="auto"
                          DisplayName="xxx"
                          Description="yyy"
                          Account="[X_WIN_SERVICE_USER]"
                          Password="[X_WIN_SERVICE_PASSWORD]"
                          Type="ownProcess"
                          ErrorControl="normal"
                          Vital="yes" />

          <ServiceControl Id="ServiceInstallXWinService" 
                          Name="[X_WIN_SERVICE_NAME]"
                          Stop="both"
                          Remove="uninstall"
                          Wait="yes" />

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:20:10+00:00Added an answer on May 11, 2026 at 9:20 pm

    Are you sure that the X_WIN_SERVICE_NAME property is set to the correct value on uninstall. Use a verbose log file to make sure that the search is setting the value correctly. Everything looks fine (although I don’t know why you put everything in Include files instead of just using Fragments).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have to uninstall the old version of my service before I install
How can i stop my service at uninstall in Win7 or Vista with UAC
I'm uninstalling a service like this: using (AssemblyInstaller installer = new AssemblyInstaller(serviceFileName, new String[]
I have several programs I want to uninstall from my computer (Windows 7 64bit).
I have a windows service that is already installed on a server, and I
Problem Description: We have a service which has applications for main mobile OS’s. We
I have an existing (C# based) windows service that is derived from the Installer
So I have an MSI that deploys a service. <ServiceInstall Id='ServiceInstall' ErrorControl='ignore' Type='ownProcess' DisplayName='MetricsReportingService'
I have installed XAMPP on my windows 7 machine but can't get Apache to
I am installing windows service and it works fine. Now I am uninstalling the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.