Changeset 7288


Ignore:
Timestamp:
Feb 12, 2018, 6:21:34 PM (4 years ago)
Author:
kopal
Message:

CT2 automatically checks now, if essential components are available
closes #936

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypWin/MainWindow.xaml.cs

    r7272 r7288  
    267267
    268268        public MainWindow()
    269         {
     269        {           
    270270            SetLanguage();
     271
     272            CheckEssentialComponents();
     273
    271274            LoadResources();
    272275
     
    588591            InitCould();
    589592        }
    590 
    591      
     593       
     594        /// <summary>
     595        /// This method checks, if essential components are available
     596        /// If not, it shows a message box containing an error and exits CT2 with return code -1
     597        ///
     598        /// We added this to avoid spamming of tickets of users, that directly start CT2
     599        /// in the zip file of the zip installation
     600        /// </summary>
     601        private void CheckEssentialComponents()
     602        {
     603            //List of components that have to be available
     604            //add new essential compoents if needed
     605            //Warning: If a component is not available; CT2 WONT START!
     606            var essentialComponents = new List<string>();
     607            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\CrypCore.dll");
     608            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\CrypPluginBase.dll");
     609            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\CrypProprietary.dll");
     610            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\DevComponents.WpfDock.dll");
     611            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\DevComponents.WpfEditors.dll");
     612            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\DevComponents.WpfRibbon.dll");
     613            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\OnlineDocumentationGenerator.dll");
     614            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\WorkspaceManager.dll");
     615            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\WorkspaceManagerModel.dll");
     616            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\CrypPlugins\WorkspaceManager.dll");
     617            essentialComponents.Add(System.AppDomain.CurrentDomain.BaseDirectory + @"\CrypPlugins\Wizard.dll");
     618
     619            foreach(var file in essentialComponents)
     620            {
     621                if (!File.Exists(file))
     622                {
     623                    MessageBox.Show(String.Format("Missing essential component of CrypTool 2:\r\n{0}\r\nEither completely unzip the zip installation of CrypTool 2 or reinstall CrypTool 2 if not running zip installation",file),
     624                        "CrypTool 2 Essential Component not Found!", MessageBoxButton.OK,MessageBoxImage.Error);
     625                    System.Environment.Exit(-1);
     626                }
     627            }
     628        }
    592629
    593630        private void LoadIndividualComponentConnectionStatistics()
Note: See TracChangeset for help on using the changeset viewer.