Example #1
0
        public void InitializeInterface(InstallationForm form)
        {
            ILicence l = InstallationManager.Instance.Licence;

            form.cmdCancel.Enabled  = true;
            form.cmdInstall.Enabled = false;
            form.cmdTrial.Enabled   = false;
            form.cmdAll.Enabled     = true;

            form.txtCode.Enabled = false;
            //form.txtCode.Text = l.ActivationCode;

            form.txtLicenceType.Enabled = false;
            form.txtLicenceType.Text    = l.TypeToString();
            form.lblScadenza.Text       = "ATTENZIONE! La licenza di prova scadrà tra " + l.RemainingDays.ToString() + " giorni.";
            form.lblScadenza.Visible    = true;
            form.txtTrial.Enabled       = false;
            form.txtTrial.Text          = l.TrialDays.ToString();

            form.txtRagSoc.Enabled = true;
            form.txtRagSoc.Text    = InstallationManager.Instance.Buyer.CustomerName;

            form.txtMail.Enabled = true;
            form.txtMail.Text    = InstallationManager.Instance.Buyer.Mail;

            form.txtLicenceType.Text = "PROVA";

            form.txtHardwareId.Text = InstallationManager.Instance.Licence.HardwareId;
        }
Example #2
0
        public void RequestTrial(InstallationForm form)
        {
            ILicence l = InstallationManager.Instance.Licence;

            form.TypeOfRequestedLicence = LicenceTypes.Trial;
            form.cmdCancel.Enabled      = true;
            form.cmdInstall.Enabled     = false;
            form.cmdTrial.Enabled       = false;
            form.cmdAll.Enabled         = true;

            form.txtCode.Enabled = false;
            //form.txtCode.Text = l.ActivationCode;

            form.txtLicenceType.Enabled = false;
            form.txtLicenceType.Text    = l.TypeToString();
            form.lblScadenza.Text       = "ATTENZIONE! La licenza di prova scadrà tra " + l.TrialDays.ToString() + " giorni.";
            form.lblScadenza.Visible    = true;
            form.txtTrial.Enabled       = false;
            form.txtTrial.Text          = l.TrialDays.ToString();

            form.txtRagSoc.Enabled = true;
            form.txtRagSoc.Text    = InstallationManager.Instance.Buyer.CustomerName;

            form.txtMail.Enabled = true;
            form.txtMail.Text    = InstallationManager.Instance.Buyer.Mail;

            form.txtLicenceType.Text = "PROVA";
        }
Example #3
0
        public void InitializeInterface(InstallationForm form)
        {
            ILicence l = InstallationManager.Instance.Licence;

            form.cmdCancel.Enabled  = true;
            form.cmdInstall.Enabled = true;
            form.cmdTrial.Enabled   = false;
            form.cmdAll.Enabled     = false;

            form.txtCode.Enabled = true;
            //form.txtCode.Text = l.ActivationCode;

            form.txtLicenceType.Enabled = false;
            form.txtLicenceType.Text    = l.TypeToString();
            form.lblScadenza.Text       = "ATTENZIONE! Licenza scaduta. Inserire un codice di attivazione.";
            form.lblScadenza.Visible    = true;
            form.txtTrial.Enabled       = false;
            form.txtTrial.Text          = "0";

            form.txtRagSoc.Enabled = true;
            form.txtRagSoc.Text    = InstallationManager.Instance.Buyer.CustomerName;

            form.txtMail.Enabled = true;
            form.txtMail.Text    = InstallationManager.Instance.Buyer.Mail;

            form.TypeOfRequestedLicence = LicenceTypes.All;
            form.txtLicenceType.Text    = "PROVA";
        }
Example #4
0
        public void SaveLicence(InstallationForm form)
        {
            if (form.TypeOfRequestedLicence != LicenceTypes.All)
            {
                MessageBox.Show("Impostare correttamente i dati di attivazione!", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            //if (!InstallationManager.Instance.Licence.IsValid())
            //{
            //    MessageBox.Show("Impostare correttamente i dati di attivazione!", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    return;
            //}


            try
            {
                InstallationManager.Instance.ActivateProduct(new BaseActivatorHandler(), form.txtHardwareId.Text, form.txtCode.Text);

                UpdateLicence(form);
            }
            catch (NotValidActivationCodeException)
            {
                SendWarningMessage(form);
            }
        }
Example #5
0
        public void Install(InstallationForm install)
        {
            var createStatus = membershipService.CreateUser(install.Username, install.Password, install.Email);

            if (createStatus != MembershipCreateStatus.Success)
            {
                throw new InstallationException("Member creation failed", 2, createStatus);
            }

            if (createStatus == MembershipCreateStatus.Success)
            {
                membershipService.CreateRole("Admin");
                membershipService.AddUserToRole("Admin", install.Username);
                formsService.SignIn(install.Username, false);

                // create site
                session.Store(new Site {
                    Email = install.Email
                });

                // rename root to sitename
                folderService.RootFolder.Name = install.SiteName;
                session.SaveChanges();

                CreateDefaultPage(install.SiteName);
                EyePatchApplication.HasPages = true;
            }
        }
Example #6
0
 private void UpdateLicence(InstallationForm form)
 {
     InstallationManager.Instance.Licence = LicenceFactory.CreateFullLicence(DateTime.Now, form.txtCode.Text, form.txtHardwareId.Text);
     InstallationManager.Instance.Buyer   = SoftwareBuyerFactory.CreateSoftwareBuyer(form.txtRagSoc.Text, form.txtMail.Text);
     InstallationManager.Instance.UpdateInstallInfo();
     SendConfirmMessage();
     form.DialogResult = DialogResult.OK;
     form.Close();
 }
Example #7
0
 private void Save(InstallationForm form)
 {
     InstallationManager.Instance.Licence = LicenceFactory.CreateLicence(form.TypeOfRequestedLicence, DateTime.Now, form.txtCode.Text, null, 30, form.txtHardwareId.Text);
     InstallationManager.Instance.Buyer   = SoftwareBuyerFactory.CreateSoftwareBuyer(form.txtRagSoc.Text, form.txtMail.Text);
     InstallationManager.Instance.InsertInstallInfo();
     SendConfirmMessage(form.TypeOfRequestedLicence);
     form.DialogResult = DialogResult.OK;
     form.Close();
 }
        private void AddInstallButton_Click(object sender, EventArgs e)
        {
            InstallationForm newInstallation = new InstallationForm(""); //<------------------

            if (newInstallation.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                BlueVex2.Properties.Settings.Default.Installations.Add(newInstallation.KeyName + "," + newInstallation.Account + "," + newInstallation.Path);
                PopulateInstallationsListView();
            }
        }
Example #9
0
        public JsonResult Install(InstallationForm install)
        {
            // TODO Need to secure post install

            if (ModelState.IsValid)
            {
                contentManager.Application.Install(install);
                return(JsonNet(new { success = true }));
            }
            return(JsonNet(new { success = false, message = "Validation Error" }));
        }
Example #10
0
        private void SendWarningMessage(InstallationForm form)
        {
            string codeAlert = "";

            if (form.TypeOfRequestedLicence == LicenceTypes.All)
            {
                codeAlert = " Verificare l'esattezza del codice inserito.";
            }

            MessageBox.Show("Inserire i dati corretti. Verificare l'inserimento corretto del nome azienda e della mail. " + codeAlert, "Attenzione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
 private void EditInstallButton_Click(object sender, EventArgs e)
 {
     if (this.InstallationsListView.SelectedItems.Count > 0)
     {
         string           itemString      = this.InstallationsListView.SelectedItems[0].Text + "," + this.InstallationsListView.SelectedItems[0].SubItems[1].Text + "," + this.InstallationsListView.SelectedItems[0].SubItems[2].Text;
         InstallationForm newInstallation = new InstallationForm(itemString);
         if (newInstallation.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             BlueVex2.Properties.Settings.Default.Installations.Remove(itemString);
             BlueVex2.Properties.Settings.Default.Installations.Add(newInstallation.KeyName + "," + newInstallation.Account + "," + newInstallation.Path);
             PopulateInstallationsListView();
         }
     }
 }
Example #12
0
 private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         InstallationForm frm = InstallationFormFactory.GetFormOnViewLicenceOrUpdateIfIsTrial(InstallationManager.Instance.Licence.HardwareId);
         frm.ShowDialog();
         frm.Dispose();
         MemoryHelper.ReduceMemory();
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
Example #13
0
        public void configure()
        {
            if (project.IsDefinedNamespace)
            {
                config.defnamespaces.Insert(0, project.getPropertyValue("RootNamespace"));

                var form = new InstallationForm(config, project);
                form.ShowDialog();

                project.defineNamespace(config.unamespace);
            }

            cfgNamespace();
            cfgPlatform();
            cfgCompiler();
        }
Example #14
0
        public void InsertActivationCode(InstallationForm form)
        {
            //form.TypeOfRequestedLicence = LicenceTypes.All;
            //form.cmdCancel.Enabled = true;
            //form.cmdInstall.Enabled = true;
            //form.cmdTrial.Enabled = true;
            //form.cmdAll.Enabled = false;

            //form.txtCode.Enabled = true;
            //form.txtCode.Text = "";

            //form.txtLicenceType.Enabled = false;
            //form.txtLicenceType.Text = "Permanente";

            //form.txtTrial.Enabled = false;
            //form.txtTrial.Text = "";

            //form.txtRagSoc.Enabled = true;
            //form.txtMail.Enabled = true;
        }
Example #15
0
        public void SaveLicence(InstallationForm form)
        {
            if (form.TypeOfRequestedLicence == LicenceTypes.Unknown)
            {
                MessageBox.Show("Selezionare una modalità di attivazione!", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                if (form.TypeOfRequestedLicence != LicenceTypes.Trial)
                {
                    InstallationManager.Instance.ActivateProduct(new BaseActivatorHandler(), form.txtHardwareId.Text, form.txtCode.Text);
                }
                Save(form);
            }
            catch (NotValidActivationCodeException)
            {
                SendWarningMessage(form);
            }
        }
Example #16
0
        public void RequestTrial(InstallationForm form)
        {
            form.TypeOfRequestedLicence = LicenceTypes.Trial;
            form.cmdCancel.Enabled      = true;
            form.cmdInstall.Enabled     = true;
            form.cmdTrial.Enabled       = false;
            form.cmdAll.Enabled         = true;

            form.txtCode.Enabled = false;
            form.txtCode.Text    = "LICENZA DI PROVA";

            form.txtLicenceType.Enabled = false;
            form.txtLicenceType.Text    = "PROVA";

            form.txtTrial.Enabled = false;
            form.txtTrial.Text    = "30";

            form.txtRagSoc.Enabled = true;


            form.txtMail.Enabled = true;
        }
Example #17
0
        public void InitializeInterface(InstallationForm form)
        {
            form.cmdCancel.Enabled  = true;
            form.cmdInstall.Enabled = false;
            form.cmdTrial.Enabled   = true;
            form.cmdAll.Enabled     = true;

            form.txtCode.Enabled = false;
            form.txtCode.Text    = "";

            form.txtLicenceType.Enabled = false;
            form.txtLicenceType.Text    = "";

            form.txtTrial.Enabled = false;
            form.txtTrial.Text    = "";

            form.txtRagSoc.Enabled = true;
            form.txtRagSoc.Text    = "";

            form.txtMail.Enabled = true;
            form.txtMail.Text    = "";
        }
Example #18
0
        public void InsertActivationCode(InstallationForm form)
        {
            ILicence l = InstallationManager.Instance.Licence;

            form.TypeOfRequestedLicence = LicenceTypes.All;
            form.cmdCancel.Enabled      = true;
            form.cmdInstall.Enabled     = true;
            form.cmdTrial.Enabled       = true;
            form.cmdAll.Enabled         = false;

            form.txtCode.Enabled = true;
            form.txtCode.Text    = "";

            form.txtLicenceType.Enabled = false;
            form.txtLicenceType.Text    = "FULL";

            form.txtTrial.Enabled = false;
            form.txtTrial.Text    = "";

            form.txtRagSoc.Enabled = true;
            form.txtMail.Enabled   = true;
        }
    protected override bool InstallPrerequisites(
        TargetAssembly targetAssembly,
        IPrerequisite[] missingPrerequisites)
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        // Prompt the user
        using (var promptForm = new InstallationPromptForm(targetAssembly, missingPrerequisites))
        {
            Application.Run(promptForm);
            if (!promptForm.Result)
            {
                return(false);
            }
        }

        // Perform the installation
        using (var installationForm = new InstallationForm(targetAssembly, missingPrerequisites))
        {
            Application.Run(installationForm);
            return(installationForm.Result);
        }
    }
Example #20
0
        //private bool CheckActivation(string publicKey, string code)
        //{
        //    BaseActivatorHandler h = new BaseActivatorHandler();
        //    h.SetCodeToValidate(code);
        //    h.SetPublicKey(publicKey);
        //    return h.IsActivationCodeValid();
        //}

        private void SendWarningMessage(InstallationForm form)
        {
            MessageBox.Show("Inserire i dati corretti. Verificare l'inserimento corretto del nome azienda e della mail. Verificare l'esattezza del codice inserito.", "Attenzione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
Example #21
0
 public void SaveLicence(InstallationForm form)
 {
     //
 }
Example #22
0
 public void InsertActivationCode(InstallationForm form)
 {
     //
 }
Example #23
0
 public void CloseDialog(InstallationForm form)
 {
     form.Close();
 }
Example #24
0
 public void RequestTrial(InstallationForm form)
 {
 }