Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            eula edlg = new eula();

            edlg.setAboutMode();
            edlg.ShowDialog();
        }
Esempio n. 2
0
 public bool eulaCheck()
 {
     try
     {
         string eulaCheckName = installDir + "\\eulaChecked.txt";
         if (File.Exists(eulaCheckName))
         {
             return(true);
         }
         eula dlg = new eula();
         dlg.ShowDialog();
         if (dlg.agreed)
         {
             StreamWriter tmp = new StreamWriter(eulaCheckName);
             tmp.WriteLine("User agreed to Eula");
             return(true);
         }
         else
         {
             ShowMessage(" StressRefine cannot be run without agreeing to the" + System.Environment.NewLine +
                         "terms of the license agreement");
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 3
0
        public bool licCheck(bool checkEula)
        {
            bool ret     = false;
            bool skiplic = false;

            if (skiplic)
            {
                return(true);
            }
            string cuskey        = null;
            int    todayjul      = GetJulianDate();
            bool   licFileExists = false;

            try
            {
                string AcLicName = mainForm.installDir + "\\license.txt";
                if (!File.Exists(AcLicName))
                {
                    if (checkEula)
                    {
                        eula edlg = new eula();
                        edlg.ShowDialog();
                        if (!edlg.agreed)
                        {
                            mainForm.ShowMessage(" StressRefine cannot be run without agreeing to the" + System.Environment.NewLine +
                                                 "terms of the license agreement");
                            return(false);
                        }
                    }
                    licForm dlg = new licForm();
                    dlg.ShowDialog();
                    cuskey = dlg.key;
                    StreamWriter tmp = new StreamWriter(AcLicName);
                    tmp.WriteLine(cuskey);
                    tmp.Close();
                }
                else
                {
                    StreamReader tmp = new StreamReader(AcLicName);
                    cuskey = tmp.ReadLine();
                    tmp.Close();
                    licFileExists = true;
                }
                if (cuskey.Length >= 24)
                {
                    bool academicLicense = false;
                    int  numdays         = 30;
                    int  keyjuldate      = keyParse(cuskey, out academicLicense);
                    if (academicLicense)
                    {
                        numdays = 180;
                        //int daysRem = numdays - (todayjul - keyjuldate);
                        //mainForm.ShowMessage(" academic license. days remaining " + daysRem);
                    }
                    if (todayjul - keyjuldate > numdays)
                    {
                        mainForm.ShowMessage("license expired");
                        if (licFileExists)
                        {
                            File.Delete(AcLicName);
                        }
                        return(false);
                    }
                    else
                    {
                        if (checkEula && !academicLicense)
                        {
                            int daysleft = 30 - todayjul + keyjuldate;
                            mainForm.ShowMessage("days left in evaluation: " + daysleft);
                        }
                        return(true);
                    }
                }
            }
            catch
            {
                ret = false;
            }

            if (!ret)
            {
                mainForm.ShowMessage("no license");
            }

            return(ret);
        }