Click here to Skip to main content
15,921,156 members
Please Sign up or sign in to vote.
5.00/5 (1 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

C#
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900