public SplashScreen() { try { SingleInstanceMutex = Mutex.OpenExisting("MiSMDRMutex0"); MessageBox.Show("There is already an instance of MiSMDR running.", "MiSMDR already running", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); Process.GetCurrentProcess().Kill(); } catch (Exception ex) { SingleInstanceMutex = new Mutex(false, "MiSMDRMutex0"); _firstTime = true; //Never change this _statusCount = 0; CheckVersion(); _forcedDemo = false; // TURN ON AND OFF DEMO HERE - to force into demo mode every startup _popup = false; _trialStatus = false; Microsoft.Win32.RegistryKey key; key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\\MiSMDR"); string existing_key = (string)key.GetValue("MiSMDRKey"); key.Close(); LicenseBreaker breaker = new LicenseBreaker(existing_key); RegisteredDetails details = breaker.BreakKey(); if ((details.licence_type == "expired-trial") || (details.licence_type == "unregistered") || (details.licence_type == "invalid")) //only show popup for expired trial, invalid or unregistered { _popup = true; //make the registration page popup } if ((details.licence_type == "trial") || (details.licence_type == "expired-trial")) { _trialStatus = true; //make the trial status appear } if (_forcedDemo) { MiConfig.SetDemoMode(_forcedDemo); //always overwrite the config file if this is forced Demo Only _demo = true; } else { _demo = MiConfig.GetDemoMode(); //get the stored demo mode if it is not forced (returns true if there is no config) } //get the location of the user settings Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal); _configPath = config.FilePath.Remove(config.FilePath.Length - 11); // user.config is 11 characters InitializeComponent(); } }