Esempio n. 1
0
        private async void checkForUpdate()
        {
            Updater updater = new Updater();

            while (true)
            {
                Thread.Sleep(600000);

                //int status = LexActivator.IsProductActivated();
                IsGenuineResult licenseStatus = Manager.TA.IsGenuine();

                Console.WriteLine("Product Status: " + licenseStatus);
                if (licenseStatus != IsGenuineResult.Genuine || Manager.dateCheck() == true)
                {
                    Environment.Exit(0);
                    return;
                }

                bool status = await updater.checkForUpdates();

                if (status == true)
                {
                    App.Current.Dispatcher.Invoke((Action) delegate
                    {
                        buttonUpdate.IsEnabled = true;
                        textBlock10.Text       = "New version available!";
                        textBlock10.Foreground = Brushes.Red;
                    });
                    break;
                }
            }
        }
Esempio n. 2
0
        private void RegisterTurboActivate()
        {
            //TODO: goto the version page at LimeLM and paste this GUID here
            TurboActivate.VersionGUID = "ea47f8154f93260b389f5.40653018";

            try
            {
                // Check if we're activated, and every 90 days verify it with the activation servers
                // In this example we won't show an error if the activation was done offline
                // (see the 3rd parameter of the IsGenuine() function) -- http://wyday.com/limelm/help/offline-activation/
                IsGenuineResult gr = TurboActivate.IsGenuine(90, 14, true);

                isActivated = gr == IsGenuineResult.Genuine ||
                              gr == IsGenuineResult.GenuineFeaturesChanged ||

                              // an internet error means the user is activated but
                              // TurboActivate failed to contact the LimeLM servers
                              gr == IsGenuineResult.InternetError;

                if (gr == IsGenuineResult.InternetError)
                {
                    //TODO: give the user the option to retry the genuine checking immediately
                    //      For example a dialog box. In the dialog call IsGenuine() to retry immediately
                    MessageBox.Show(@"Internet error", Constants.ApplicationTitle);
                    isActivated = false;
                }
            }
            catch (TurboActivateException ex)
            {
                MessageBox.Show(@"Failed to check if activated: " + ex.Message);
                isActivated = false;
            }
        }
Esempio n. 3
0
        private void checkLicense()
        {
            IsGenuineResult genuine = Manager.TA.IsGenuine(7, 7, true);

            if (genuine == IsGenuineResult.Genuine && Manager.dateCheck() == false)
            {
                MainWindow mw = new MainWindow();
                mw.Show();
            }
            else
            {
                ActivateWindow aw = new ActivateWindow();
                aw.Show();
            }

            this.Close();
        }
Esempio n. 4
0
        public Form1()
        {
            InitializeComponent();

            try
            {
                //TODO: goto the version page at LimeLM and paste this GUID here
                ta = new TurboActivate("18324776654b3946fc44a5f3.49025204");

                // set the trial changed event handler
                ta.TrialChange += trialChange;

                // Check if we're activated, and every 90 days verify it with the activation servers
                // In this example we won't show an error if the activation was done offline
                // (see the 3rd parameter of the IsGenuine() function)
                // https://wyday.com/limelm/help/offline-activation/
                IsGenuineResult gr = ta.IsGenuine(DaysBetweenChecks, GracePeriodLength, true);

                isGenuine = gr == IsGenuineResult.Genuine ||
                            gr == IsGenuineResult.GenuineFeaturesChanged ||

                            // an internet error means the user is activated but
                            // TurboActivate failed to contact the LimeLM servers
                            gr == IsGenuineResult.InternetError;


                // If IsGenuineEx() is telling us we're not activated
                // but the IsActivated() function is telling us that the activation
                // data on the computer is valid (i.e. the crypto-signed-fingerprint matches the computer)
                // then that means that the customer has passed the grace period and they must re-verify
                // with the servers to continue to use your app.

                //Note: DO NOT allow the customer to just continue to use your app indefinitely with absolutely
                //      no reverification with the servers. If you want to do that then don't use IsGenuine() or
                //      IsGenuineEx() at all -- just use IsActivated().
                if (!isGenuine && ta.IsActivated())
                {
                    // We're treating the customer as is if they aren't activated, so they can't use your app.

                    // However, we show them a dialog where they can reverify with the servers immediately.

                    ReVerifyNow frmReverify = new ReVerifyNow(ta, DaysBetweenChecks, GracePeriodLength);

                    if (frmReverify.ShowDialog(this) == DialogResult.OK)
                    {
                        isGenuine = true;
                    }
                    else if (!frmReverify.noLongerActivated) // the user clicked cancel and the user is still activated
                    {
                        // Just bail out of your app
                        Environment.Exit(1);
                        return;
                    }
                }
            }
            catch (TurboActivateException ex)
            {
                // failed to check if activated, meaning the customer screwed
                // something up so kill the app immediately
                MessageBox.Show("Failed to check if activated: " + ex.Message);
                Environment.Exit(1);
                return;
            }

            ShowTrial(!isGenuine);

            // If this app is activated then you can get custom license fields.
            // See: https://wyday.com/limelm/help/license-features/

            /*
             * if (isGenuine)
             * {
             *  string featureValue = ta.GetFeatureValue("your feature name");
             *
             *  //TODO: do something with the featureValue
             * }
             */
        }