2
Vote

Add self installation and uninstallation

description

Would be nice to have it autodetect based on command line args or something for self installation or uninstallation

static bool IsSelfInstallingOrUninstalling(string[] programArgs)
    {

        if (programArgs.Length > 0)
        {
            if (programArgs[0] == "/i")
            {
                System.Configuration.Install.ManagedInstallerClass.InstallHelper(new string[] { Assembly.GetExecutingAssembly().Location });
                return true;
            }
            else if (programArgs[0] == "/u")
            {
                System.Configuration.Install.ManagedInstallerClass.InstallHelper(new string[] { "/u", Assembly.GetExecutingAssembly().Location });
                return true;
            }
        }
        return false;
    }

comments