Exemplo n.º 1
0
        private static void RunInstall()
        {
            if (!PermissionCheck.IsRunAsAdmin)
            {
                MessageBox.Show("This option requires administrator privileges.", "Install", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (TaskScheduler.IsInstalled())
            {
                return;
            }

            if (!TaskScheduler.Create())
            {
                MessageBox.Show("Registration failed, task not created.", "Install", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }