Ejemplo n.º 1
0
        public override bool Next()
        {
            try
            {
                switch (ActivationType)
                {
                case ActivationTypes.Email:
                    ParentForm.Cursor       = Cursors.Default;
                    frmLicenseWizard.Result = ScreenStart.Actions.None;
                    frmLicenseWizard.CloseWizard();
                    break;

                case ActivationTypes.ExtendTrial:
                    string message;
                    if (SlyceAuthorizer.ActivateManually("", out message))
                    {
                        MessageBox.Show("ArchAngel trial has been successfully extended.", "Trial Extended", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        ParentForm.Cursor       = Cursors.Default;
                        frmLicenseWizard.Result = ScreenStart.Actions.Activate;
                        frmLicenseWizard.CloseWizard();
                    }
                    else
                    {
                        MessageBox.Show(message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    break;

                case ActivationTypes.Website:
                    if (File.Exists(txtLicenseFile2.Text))
                    {
                        // User has downloaded a license file
                        if (SlyceAuthorizer.ActivateManually(txtLicenseFile2.Text, out message))
                        {
                            MessageBox.Show("License successfully installed!", "Activation Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            ParentForm.Cursor       = Cursors.Default;
                            frmLicenseWizard.Result = ScreenStart.Actions.Activate;
                            frmLicenseWizard.CloseWizard();
                            return(true);
                        }
                        MessageBox.Show("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    ParentForm.Cursor = Cursors.Default;
                    frmLicenseWizard.CloseWizard();
                    break;

                default:
                    MessageBox.Show("Not handled yet: " + ActivationType.ToString());
                    break;
                }
                return(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
                return(false);
            }
        }
Ejemplo n.º 2
0
        private void buttonInstallLicenseFile_Click(object sender, System.EventArgs e)
        {
            if (!File.Exists(textBoxLicenseFile.Text))
            {
                MessageBox.Show("License file not found.", "Invalid License File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string message;

            if (SlyceAuthorizer.ActivateManually(textBoxLicenseFile.Text, out message))
            {
                SlyceAuthorizer.Reset();
                int  daysRemaining;
                bool errorOccurred;
                bool demo;
                SlyceAuthorizer.LockTypes     lockType;
                SlyceAuthorizer.LicenseStates status;

                bool licensed  = Licensing.SlyceAuthorizer.IsLicensed("Visual NHibernate License.SlyceLicense", out message, out daysRemaining, out errorOccurred, out demo, out lockType, out status);
                bool mustClose = false;

                if (licensed)
                {
                    ShowMessageBox("License installed.", "License Installed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    mustClose = true;
                }
                else if (demo && daysRemaining >= 0)
                {
                    ShowMessageBox(string.Format("{0} days remaining.", daysRemaining), "Trial Installed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    mustClose = true;
                }
                else
                {
                    ShowMessageBox("Your trial has expired.", "Trial Expired", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    mustClose = false;
                }
                //MessageBox.Show("ArchAngel has been successfully activated!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ParentForm.Cursor = Cursors.Default;
                HasNext           = false;
                HasFinish         = true;

                if (mustClose)
                {
                    frmLicenseWizard.Result = ScreenStart.Actions.Activate;
                    frmLicenseWizard.CloseWizard();
                }
                return;
            }
            MessageBox.Show("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }
Ejemplo n.º 3
0
        public frmLicenseWizard(int daysRemaining, SlyceAuthorizer.LockTypes lockType, SlyceAuthorizer.LicenseStates licenseStatus)
        {
            InitializeComponent();
            Instance = this;
            DaysRemaining = daysRemaining;
            LockType = lockType;
            LicenseStatus = licenseStatus;
            ucHeading1.Text = "";
            _ScreenStart = new ScreenStart();
            _ScreenStart.BackColor = Color.FromArgb(220, 220, 220);
            LoadScreen(_ScreenStart);

            string message;
            List<string> machineIds = SlyceAuthorizer.GetMachineIds(out message);

            if (machineIds.Count > 0)
                InstallationId = machineIds[0];
            else
                MessageBox.Show(this, message, "Error Determining InstallationID", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
Ejemplo n.º 4
0
        private SlyceAuthorizer.LicenseStates InstallFullLicenseAuto()
        {
            if (ScreenStart.Action == ScreenStart.Actions.Activate)
            {
                if (!SlyceAuthorizer.IsValidLicenseNumber(textBoxSerial.Text))
                {
                    ShowMessageBox("Please enter a valid serial number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(SlyceAuthorizer.LicenseStates.NotChecked);
                }
                string message;

                if (SlyceAuthorizer.ActivateViaInternet(textBoxSerial.Text, "", "", true, out message))
                {
                    ShowMessageBox("Your license was installed successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(SlyceAuthorizer.LicenseStates.Licensed);
                }
                ShowMessageBox("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(SlyceAuthorizer.LicenseStates.ServerValidationFailed);
            }
            return(SlyceAuthorizer.LicenseStates.ServerValidationFailed);
        }
Ejemplo n.º 5
0
        public frmLicenseWizard(int daysRemaining, SlyceAuthorizer.LockTypes lockType, SlyceAuthorizer.LicenseStates licenseStatus)
        {
            InitializeComponent();
            Instance               = this;
            DaysRemaining          = daysRemaining;
            LockType               = lockType;
            LicenseStatus          = licenseStatus;
            ucHeading1.Text        = "";
            _ScreenStart           = new ScreenStart();
            _ScreenStart.BackColor = Color.FromArgb(220, 220, 220);
            LoadScreen(_ScreenStart);

            string        message;
            List <string> machineIds = SlyceAuthorizer.GetMachineIds(out message);

            if (machineIds.Count > 0)
            {
                InstallationId = machineIds[0];
            }
            else
            {
                MessageBox.Show(this, message, "Error Determining InstallationID", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 6
0
        private string GetWebsiteUrl()
        {
            if (SelectedPanel == panelContinueTrial)             // Trial
            {
                string        errorMessage;
                List <string> machineIds = SlyceAuthorizer.GetMachineIds(out errorMessage);

                if (machineIds.Count == 0)
                {
                    MessageBox.Show(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return("");
                }
                return(string.Format(@"http://www.slyce.com/Support/?action=getTrial&trialNumber={0}&email={1}", machineIds[0], textBoxEmail.Text));
            }
            else             // Full
            {
                if (!SlyceAuthorizer.IsValidLicenseNumber(textBoxSerial.Text))
                {
                    MessageBox.Show("Please enter a valid serial number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return("");
                }
                return(string.Format(@"http://www.slyce.com/Support/?action=getLicense&serial={0}", textBoxSerial.Text));
            }
        }
Ejemplo n.º 7
0
        private void buttonManual_Click(object sender, EventArgs e)
        {
            if (ScreenStart.Action == ScreenStart.Actions.Activate)
            {
                if (!SlyceAuthorizer.IsValidLicenseNumber(LicenseNumber))
                {
                    MessageBox.Show("Please enter a valid serial number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                System.Diagnostics.Process.Start(string.Format(@"http://www.slyce.com/Support/?action=getLicense&serial={0}", LicenseNumber));
            }
            else             // Trial
            {
                string        errorMessage;
                List <string> machineIds = SlyceAuthorizer.GetMachineIds(out errorMessage);

                if (machineIds.Count == 0)
                {
                    MessageBox.Show(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                System.Diagnostics.Process.Start(string.Format(@"http://www.slyce.com/Support/?action=getTrial&trialNumber={0}", machineIds[0]));
            }
        }
Ejemplo n.º 8
0
        private SlyceAuthorizer.LicenseStates GetNewTrialLicenseAuto()
        {
            if (SelectedPanel == panelContinueTrial)             // Trial
            {
                string        errorMessage;
                List <string> machineIds = SlyceAuthorizer.GetMachineIds(out errorMessage);

                if (machineIds.Count == 0)
                {
                    ShowMessageBox(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(SlyceAuthorizer.LicenseStates.HardwareNotMatched);
                }
                ShowMessage("Fetching trial license...");
                string message;

                if (SlyceAuthorizer.ActivateViaInternet("", machineIds[0], textBoxEmail.Text, false, out message))
                {
                    int  daysRemaining;
                    bool errorOccurred;
                    bool demo;
                    SlyceAuthorizer.LockTypes     lockType;
                    SlyceAuthorizer.LicenseStates status;
                    Licensing.SlyceAuthorizer.Reset();
                    bool licensed = Licensing.SlyceAuthorizer.IsLicensed("Visual NHibernate License.SlyceLicense", out message, out daysRemaining, out errorOccurred, out demo, out lockType, out status);

                    if (licensed)
                    {
                        ShowMessage("Trial started");
                        ShowMessageBox("License installed.", "License Installed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else if (demo && daysRemaining >= 0)
                    {
                        ShowMessage("Trial running");
                        ShowMessageBox(string.Format("{0} days remaining.", daysRemaining), "Trial Installed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        SetRenewButtonsVisibility(true);
                        ShowMessage("Trial expired");
                        ShowMessageBox("Your trial has expired. Re-downloading won't help.\n\nGet a new serial when you purchase.", "Trial Expired", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    return(status);
                }
                ShowMessage("Activation failed");
                ShowMessageBox("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(SlyceAuthorizer.LicenseStates.ServerValidationFailed);
            }
            else             // Full
            {
                if (!SlyceAuthorizer.IsValidLicenseNumber(textBoxSerial.Text))
                {
                    ShowMessageBox("Please enter a valid serial number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(SlyceAuthorizer.LicenseStates.LicenseFileNotFound);
                }
                ShowMessage("Fetching license...");
                string message;

                if (SlyceAuthorizer.ActivateViaInternet(textBoxSerial.Text, "", "", true, out message))
                {
                    LicenseMonitor.Reset();

                    if (LicenseMonitor.CurrentLicense.LicenseStatus == LicenseMonitor.LicenseStates.EvaluationExpired)
                    {
                        SetRenewButtonsVisibility(true);
                        ShowMessage("License expired");
                        ShowMessageBox("Your license has expired. Re-downloading won't help.\n\nGet a new serial when you purchase.", "Expired", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return(SlyceAuthorizer.LicenseStates.EvaluationExpired);
                    }
                    else
                    {
                        ShowMessageBox("Your license was installed successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(SlyceAuthorizer.LicenseStates.Licensed);
                    }
                }
                ShowMessageBox("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(SlyceAuthorizer.LicenseStates.ServerValidationFailed);
            }
        }
Ejemplo n.º 9
0
        private bool InstallAuto()
        {
            #region Activate Full License
            if (ScreenStart.Action == ScreenStart.Actions.Activate)
            {
                if (!SlyceAuthorizer.IsValidLicenseNumber(LicenseNumber))
                {
                    ShowMessageBox("Please enter a valid serial number.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
                string message;

                if (SlyceAuthorizer.ActivateViaInternet(LicenseNumber, "", "", true, out message))
                {
                    LicenseMonitor.Reset();
                    ShowMessageBox("Your license was installed successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(true);
                }
                ShowMessageBox("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            #endregion

            #region Activate Trial License
            if (ScreenStart.Action == ScreenStart.Actions.Trial)
            {
                string        errorMessage;
                List <string> machineIds = SlyceAuthorizer.GetMachineIds(out errorMessage);

                if (machineIds.Count == 0)
                {
                    ShowMessageBox(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return(false);
                }
                string message;
                //throw new NotImplementedException("WTF!");

                if (SlyceAuthorizer.ActivateViaInternet("", machineIds[0], "oops", false, out message))
                {
                    int  daysRemaining;
                    bool errorOccurred;
                    bool demo;
                    SlyceAuthorizer.LockTypes     lockType;
                    SlyceAuthorizer.LicenseStates status;
                    Licensing.SlyceAuthorizer.Reset();
                    bool licensed = Licensing.SlyceAuthorizer.IsLicensed("Visual NHibernate License.SlyceLicense", out message, out daysRemaining, out errorOccurred, out demo, out lockType, out status);

                    if (licensed)
                    {
                        ShowMessageBox("License installed.", "License Installed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else if (demo && daysRemaining >= 0)
                    {
                        ShowMessageBox(string.Format("{0} days remaining.", daysRemaining), "Trial Installed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        ShowMessageBox("Your trial has expired.", "Trial Expired", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    return(true);
                }
                ShowMessageBox("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }
            #endregion

            return(false);
        }