Click here to Skip to main content
14,216,574 members
Rate this:
Please Sign up or sign in to vote.
See more:
Dear Sir
i have faced two problem which i can not solve.I want to stop uninstalling my application from control panel when the app is running.
i add the following code but it seems no work

namespace installer
{
    [RunInstaller(true)]
    public partial class installer: System.Configuration.Install.Installer
    {
        public installer()
        {
            InitializeComponent();
        }



        public override void Rollback(IDictionary savedState)
        {
            base.Rollback(savedState);

        }

        public override void Commit(IDictionary savedState)
        {
            base.Commit(savedState);

        }


        public override void Uninstall(IDictionary savedState)
        {
            Process application = null;
            foreach (var process in Process.GetProcesses())
            {
                if (!process.ProcessName.ToLower().Contains(myapp)) continue;
                application = process;
                break;
            }

            if (application != null && application.Responding)
            {
              
                throw new InstallException("The process is running");
            }
                

        }
    }



Can you tell me how to catch ip of my router using c#
Posted
Updated 24-Sep-13 3:13am
v2
Comments
Sandip Paul 491984 24-Sep-13 9:29am
   
can anyone post a code that stop uninstall when the application is running.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100