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

  • SEARCH
  • Home
  • 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 4102498
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:50:06+00:00 2026-05-20T20:50:06+00:00

Right, So I have a Windows service written in C#. I’ve already found the

  • 0

Right,

So I have a Windows service written in C#. I’ve already found the ‘ProjectInstaller.cs’ where I do some stuff, like set dependencies and service name during install.

What I’m not finding is how to hook into the uninstall process of the server.

While I know there’s little workarounds here and there, such as just trashing the key from the registry, I’d like to account for a user (with local admin rights) uninstalling the service with sc or installutil.exe – essentially, I simply want the service to write a statement to a database saying “Hey, I’m being uninstalled by bobsmith”

Possible? Doable?

Update – This is what I have in my ProjectInstaller.cs – not working…

namespace blahblah
{
[RunInstaller(true)]
public partial class ProjectInstaller : Installer
{
    public ProjectInstaller()
    {
        InitializeComponent();
        BeforeUninstall += new InstallEventHandler(ProjectInstaller_BeforeUninstall);
    }

    private void ProjectInstaller_BeforeUninstall(object sender, InstallEventArgs e)
    {
    /// do stuff...
    }
  • 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-20T20:50:07+00:00Added an answer on May 20, 2026 at 8:50 pm

    Add a ServiceInstaller object in your designer (if one is not already there) and subscribe to the BeforeUninstall event

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

Sidebar

Related Questions

I have a windows service written in C# .NET framework 3.5 and would like
Right now I have: a multithreaded windows service written in C++ which use common
I have created an windows service. I want to open some windows based application
I have written a Windows Service, that opens up a WCF service on port
I have a windows Service that start some tasks based on a configuration. Each
I have created a C# .Net windows service. There are some configuration files which
I have a windows service which runs continuously and creates some threads to do
I have a Windows Service written in C#. It includes a standalone console mode
I have built a Windows Service and for some reason, when I start the
We have a script right now which our Windows users run on a Linux

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.