Пример #1
0
		static void Main()
		{
			//check security permissions
			if (!Utils.CheckSecurity())
			{
				ShowSecurityError();
				return;
			}

			//check administrator permissions
			if (!Utils.IsAdministrator())
			{
				ShowSecurityError(); 
				return;
			}

			//check for running instance
			if ( !Utils.IsNewInstance())
			{
				Utils.ShowRunningInstance();
				return;
			}

			Log.WriteApplicationStart();
			//AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
			Application.ApplicationExit += new EventHandler(OnApplicationExit);
			Application.ThreadException += new ThreadExceptionEventHandler(OnThreadException);
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			//check OS version
			OS.WindowsVersion version = OS.GetVersion();
			Global.OSVersion = version;
			Log.WriteInfo(string.Format("{0} detected", version));

			//check IIS version
			Version iisVersion = RegistryUtils.GetIISVersion();
			if (iisVersion.Major == 0)
				Log.WriteError("IIS not found.");
			else
				Log.WriteInfo(string.Format("IIS {0} detected", iisVersion));

			Global.IISVersion = iisVersion;

			ApplicationForm mainForm = new ApplicationForm();

			if (!CheckCommandLineArgument("/nocheck"))
			{
				//Check for new versions
				if (CheckForUpdate(mainForm))
				{
					return;
				}
				////x64 support
				//try
				//{
				//    Utils.CheckWin64(mainForm);
				//}
				//catch (Exception ex)
				//{
				//    Log.WriteError("IIS x64 error", ex);
				//}
			}

			LoadSetupXmlFile();

			//start application
			mainForm.InitializeApplication();
			Application.Run(mainForm);
			Utils.SaveMutex();
		}
Пример #2
0
        static void Main()
        {
            //
            Utils.FixConfigurationSectionDefinition();

            //check security permissions
            if (!Utils.CheckSecurity())
            {
                ShowSecurityError();
                return;
            }

            //check administrator permissions
            if (!Utils.IsAdministrator())
            {
                ShowSecurityError();
                return;
            }

            //check for running instance
            if (!Utils.IsNewInstance())
            {
                UiUtils.ShowRunningInstance();
                return;
            }

            Log.WriteApplicationStart();
            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
            Application.ApplicationExit += new EventHandler(OnApplicationExit);
            Application.ThreadException += new ThreadExceptionEventHandler(OnThreadException);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //check OS version
            Log.WriteInfo("{0} detected", Global.OSVersion);

            //check IIS version
            if (Global.IISVersion.Major == 0)
            {
                Log.WriteError("IIS not found.");
            }
            else
            {
                Log.WriteInfo("IIS {0} detected", Global.IISVersion);
            }

            ApplicationForm mainForm = new ApplicationForm();

            if (!CheckCommandLineArgument("/nocheck"))
            {
                //Check for new versions
                if (CheckForUpdate(mainForm))
                {
                    return;
                }
            }
            // Load setup parameters from an XML file
            LoadSetupXmlFile();
            //start application
            mainForm.InitializeApplication();
            Application.Run(mainForm);
            //
            Utils.SaveMutex();
        }
Пример #3
0
        static void Main()
        {
            //check security permissions
            if (!Utils.CheckSecurity())
            {
                ShowSecurityError();
                return;
            }

            //check administrator permissions
            if (!Utils.IsAdministrator())
            {
                ShowSecurityError();
                return;
            }

            //check for running instance
            if (!Utils.IsNewInstance())
            {
                Utils.ShowRunningInstance();
                return;
            }

            Log.WriteApplicationStart();
            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
            Application.ApplicationExit += new EventHandler(OnApplicationExit);
            Application.ThreadException += new ThreadExceptionEventHandler(OnThreadException);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //check OS version
            OS.WindowsVersion version = OS.GetVersion();
            Global.OSVersion = version;
            Log.WriteInfo(string.Format("{0} detected", version));

            //check IIS version
            Version iisVersion = RegistryUtils.GetIISVersion();

            if (iisVersion.Major == 0)
            {
                Log.WriteError("IIS not found.");
            }
            else
            {
                Log.WriteInfo(string.Format("IIS {0} detected", iisVersion));
            }

            Global.IISVersion = iisVersion;

            ApplicationForm mainForm = new ApplicationForm();

            if (!CheckCommandLineArgument("/nocheck"))
            {
                //Check for new versions
                if (CheckForUpdate(mainForm))
                {
                    return;
                }
                ////x64 support
                //try
                //{
                //    Utils.CheckWin64(mainForm);
                //}
                //catch (Exception ex)
                //{
                //    Log.WriteError("IIS x64 error", ex);
                //}
            }

            LoadSetupXmlFile();

            //start application
            mainForm.InitializeApplication();
            Application.Run(mainForm);
            Utils.SaveMutex();
        }
Пример #4
0
		static void Main()
		{
			//
			Utils.FixConfigurationSectionDefinition();

			//check security permissions
			if (!Utils.CheckSecurity())
			{
				ShowSecurityError();
				return;
			}

			//check administrator permissions
			if (!Utils.IsAdministrator())
			{
				ShowSecurityError(); 
				return;
			}

			//check for running instance
			if ( !Utils.IsNewInstance())
			{
				UiUtils.ShowRunningInstance();
				return;
			}

			Log.WriteApplicationStart();
			//AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(OnUnhandledException);
			Application.ApplicationExit += new EventHandler(OnApplicationExit);
			Application.ThreadException += new ThreadExceptionEventHandler(OnThreadException);
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			//check OS version
			Log.WriteInfo("{0} detected", Global.OSVersion);

			//check IIS version
			if (Global.IISVersion.Major == 0)
				Log.WriteError("IIS not found.");
			else
				Log.WriteInfo("IIS {0} detected", Global.IISVersion);

			ApplicationForm mainForm = new ApplicationForm();

			if (!CheckCommandLineArgument("/nocheck"))
			{
				//Check for new versions
				if (CheckForUpdate(mainForm))
				{
					return;
				}
			}
			// Load setup parameters from an XML file
			LoadSetupXmlFile();
			//start application
			mainForm.InitializeApplication();
			Application.Run(mainForm);
			//
			Utils.SaveMutex();
		}