Ejemplo n.º 1
0
        public void PopulateWithModelSettings(IConfigurationView configurationWizard)
        {
            configurationWizard.ClearAll();
            if (_model.Flavors != null)
            {
                foreach (var flavor in _model.Flavors)
                {
                    configurationWizard.AddFlavor(flavor.FlavorName, flavor.DownloadURL);
                }
            }
            var flavorProducts = new Dictionary <string, IEnumerable <string> >();

            if (_model.Products != null)
            {
                foreach (var product in _model.Products)
                {
                    flavorProducts[product.Title] =
                        _model.Flavors.Where(flavor => flavor.IncludedProductTitles.Contains(product.Title)).Select(f => f.FlavorName);
                }
                configurationWizard.AddProductConfigurationRows(flavorProducts, new List <string>(_model.Flavors.Select(f => f.FlavorName)));
            }
            if (_model.Tasks != null)
            {
                configurationWizard.OutputFolder = _model.Tasks.OutputFolder;
                configurationWizard.Compile      = _model.Tasks.Compile;
                configurationWizard.BuildSelfExtractingDownloadPackage = _model.Tasks.BuildSelfExtractingDownloadPackage;
                configurationWizard.GatherFiles         = _model.Tasks.GatherFiles;
                configurationWizard.RememberSettings    = _model.Tasks.RememberSettings;
                configurationWizard.SelfExtractingStyle = _model.Tasks.SelfExtractingStyle;
                configurationWizard.WriteInstallerXml   = _model.Tasks.WriteInstallerXml;
                configurationWizard.WriteDownloadsXml   = _model.Tasks.WriteDownloadsXml;
            }
        }
Ejemplo n.º 2
0
 public void ExecuteTasks(IConfigurationView configurationWizard)
 {
     if (configurationWizard.Compile)
     {
         MasterInstallerCompiler.Compile(_model, "", "C:/Repositories/masterinstaller/", configurationWizard);
     }
     if (configurationWizard.RememberSettings)
     {
         _model.Flavors.Clear();
         foreach (var flavor in configurationWizard.GetFlavors())
         {
             _model.Flavors.Add(new ConfigurationModel.FlavorOptions {
                 FlavorName            = flavor.Item1, DownloadURL = flavor.Item2,
                 IncludedProductTitles = configurationWizard.GetIncludedProducts(flavor.Item1)
             });
         }
         _model.Tasks.OutputFolder = configurationWizard.OutputFolder;
         _model.Tasks.Compile      = configurationWizard.Compile;
         _model.Tasks.BuildSelfExtractingDownloadPackage = configurationWizard.BuildSelfExtractingDownloadPackage;
         _model.Tasks.GatherFiles         = configurationWizard.GatherFiles;
         _model.Tasks.RememberSettings    = configurationWizard.RememberSettings;
         _model.Tasks.SelfExtractingStyle = configurationWizard.SelfExtractingStyle;
         _model.Tasks.WriteInstallerXml   = configurationWizard.WriteInstallerXml;
         _model.Tasks.WriteDownloadsXml   = configurationWizard.WriteDownloadsXml;
     }
     _model.Save();
 }
 public void ExecuteTasks(IConfigurationView configurationWizard)
 {
     if (configurationWizard.Compile)
     {
         MasterInstallerCompiler.Compile(_model, "", "C:/Repositories/masterinstaller/", configurationWizard);
     }
     if (configurationWizard.RememberSettings)
     {
         _model.Flavors.Clear();
         foreach (var flavor in configurationWizard.GetFlavors())
         {
             _model.Flavors.Add(new ConfigurationModel.FlavorOptions { FlavorName = flavor.Item1, DownloadURL = flavor.Item2,
                 IncludedProductTitles = configurationWizard.GetIncludedProducts(flavor.Item1)});
         }
         _model.Tasks.OutputFolder = configurationWizard.OutputFolder;
         _model.Tasks.Compile = configurationWizard.Compile;
         _model.Tasks.BuildSelfExtractingDownloadPackage = configurationWizard.BuildSelfExtractingDownloadPackage;
         _model.Tasks.GatherFiles = configurationWizard.GatherFiles;
         _model.Tasks.RememberSettings = configurationWizard.RememberSettings;
         _model.Tasks.SelfExtractingStyle = configurationWizard.SelfExtractingStyle;
         _model.Tasks.WriteInstallerXml = configurationWizard.WriteInstallerXml;
         _model.Tasks.WriteDownloadsXml = configurationWizard.WriteDownloadsXml;
     }
     _model.Save();
 }
 public void PopulateWithModelSettings(IConfigurationView configurationWizard)
 {
     configurationWizard.ClearAll();
     if (_model.Flavors != null)
     {
         foreach (var flavor in _model.Flavors)
         {
             configurationWizard.AddFlavor(flavor.FlavorName, flavor.DownloadURL);
         }
     }
     var flavorProducts = new Dictionary<string, IEnumerable<string>>();
     if (_model.Products != null)
     {
         foreach (var product in _model.Products)
         {
             flavorProducts[product.Title] =
                 _model.Flavors.Where(flavor => flavor.IncludedProductTitles.Contains(product.Title)).Select(f => f.FlavorName);
         }
         configurationWizard.AddProductConfigurationRows(flavorProducts, new List<string>(_model.Flavors.Select(f => f.FlavorName)));
     }
     if (_model.Tasks != null)
     {
         configurationWizard.OutputFolder = _model.Tasks.OutputFolder;
         configurationWizard.Compile = _model.Tasks.Compile;
         configurationWizard.BuildSelfExtractingDownloadPackage = _model.Tasks.BuildSelfExtractingDownloadPackage;
         configurationWizard.GatherFiles = _model.Tasks.GatherFiles;
         configurationWizard.RememberSettings = _model.Tasks.RememberSettings;
         configurationWizard.SelfExtractingStyle = _model.Tasks.SelfExtractingStyle;
         configurationWizard.WriteInstallerXml = _model.Tasks.WriteInstallerXml;
         configurationWizard.WriteDownloadsXml = _model.Tasks.WriteDownloadsXml;
     }
 }
Ejemplo n.º 5
0
 public void AddFlavor(IConfigurationView wizard, string flavorName, string flavorUrl)
 {
     _model.Flavors.Add(new ConfigurationModel.FlavorOptions {
         FlavorName = flavorName, DownloadURL = flavorUrl, IncludedProductTitles = new List <string>()
     });
     PopulateWithModelSettings(wizard);
 }
 public void DeleteLastFlavor(IConfigurationView wizard)
 {
     if (_model.Flavors.Count > 1)
     {
         _model.Flavors.RemoveAt(_model.Flavors.Count - 1);
         PopulateWithModelSettings(wizard);
     }
 }
Ejemplo n.º 7
0
 public ConfigurationModel(IConfigurationView view, IWizard wizard)
 {
     this.view = view;
     ITabNavigation navView = castNavigationView(view);
     navView.RegisterNext(NextHandler,TabNumber);
     navView.RegisterPrevious(PreviousHandler,TabNumber);
     this.wizard = wizard;
 }
        public void RegisterView (IConfigurationView configurationView) {
            if (configurationView == null) {
                throw new InvalidOperationException("View must be initialized");
            }

            view = configurationView;
            configurationView.Controller = this;
        }
Ejemplo n.º 9
0
 public void DeleteLastFlavor(IConfigurationView wizard)
 {
     if (_model.Flavors.Count > 1)
     {
         _model.Flavors.RemoveAt(_model.Flavors.Count - 1);
         PopulateWithModelSettings(wizard);
     }
 }
        public void RegisterView(IConfigurationView configurationView)
        {
            if (configurationView == null)
            {
                throw new InvalidOperationException("View must be initialized");
            }

            view = configurationView;
            configurationView.Controller = this;
        }
 private static bool CheckLegacyBitmapSetting(ConfigurationModel model, string bitmapFilePath, IConfigurationView view)
 {
     if (model.General.ListBackground.ImagePath.Contains(Path.DirectorySeparatorChar.ToString()))
     {
         if (!File.Exists(model.General.ListBackground.ImagePath))
         {
             view.LogErrorLine(string.Format("Bitmap path '{0}' specified in XML node /MasterInstaller/General/ListBackground does not exist. This may be legacy data. Bitmaps should be stored in the '{1}' folder and referenced by file name only.",
                 model.General.ListBackground.ImagePath, bitmapFilePath));
             return false;
         }
     }
     return true;
 }
Ejemplo n.º 12
0
 public ConfigurationPresenter(IConfigurationView view)
 {
     this.view = view;
     this.view.SelectConfigurationFile += delegate
     {
         // The ISelectFilePresenter and ISelectFileView behaviors
         // are implicit here, but in a WinForms case, a call to
         // OpenFileDialog wouldn't be too far fetched...
         var selectFilePresenter = Gimme.The <ISelectFilePresenter>();
         selectFilePresenter.ShowView();
         this.configuration.FullPath = selectFilePresenter.FullPath;
         this.view.SetConfigurationFile(this.configuration.FullPath);
     };
 }
Ejemplo n.º 13
0
        public ConfigurationController(IConfigurationView _view)
        {
            string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
            string productName = Application.ProductName;
            string myDocumentsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) ?? @"C:\";
            string ApplicationDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ?? myDocumentsFolder;
            programFolder = Path.Combine(ApplicationDataFolder, productName);
            defaultConfigFile = String.Format("{0}.exe.config", assemblyName);
            configFile = Path.Combine(programFolder, defaultConfigFile);

            view = _view;

            view.OnReadConfiguration += new EventHandler(view_OnReadConfiguration);
            view.OnWriteConfiguration += new EventHandler(view_OnWriteConfiguration);
        }
Ejemplo n.º 14
0
        public ConfigurationController(IConfigurationView _view)
        {
            string assemblyName          = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
            string productName           = Application.ProductName;
            string myDocumentsFolder     = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) ?? @"C:\";
            string ApplicationDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) ?? myDocumentsFolder;

            programFolder     = Path.Combine(ApplicationDataFolder, productName);
            defaultConfigFile = String.Format("{0}.exe.config", assemblyName);
            configFile        = Path.Combine(programFolder, defaultConfigFile);

            view = _view;

            view.OnReadConfiguration  += new EventHandler(view_OnReadConfiguration);
            view.OnWriteConfiguration += new EventHandler(view_OnWriteConfiguration);
        }
 public static void Compile(ConfigurationModel model, string certificatePassword, string masterInstallerPath, IConfigurationView view)
 {
     var _utilsPath = Path.Combine(masterInstallerPath, "Utils");
     var cppFilePath = Path.Combine(masterInstallerPath, "Code and Projects");
     var bitmapFilePath = Path.Combine(cppFilePath, "Bitmaps");
     if (CheckLegacyBitmapSetting(model, bitmapFilePath, view))
     {
         var tempFolder = CreateTempCompilationFolder(model);
         GenerateConfigGeneralCpp(cppFilePath, model);
         GenerateConfigDisksCpp(cppFilePath, model);
         GenerateProductsCpp(cppFilePath, model);
         /*
     ProcessConfigFile(xmlDoc, CppFilePath + "\\ConfigFunctions.xsl", CppFilePath + "\\ConfigFunctions.cpp");
     ProcessConfigFile(xmlDoc, CppFilePath + "\\ConfigGlobals.xsl", CppFilePath + "\\AutoGlobals.h");
     ProcessConfigFile(xmlDoc, CppFilePath + "\\ConfigResources.xsl", CppFilePath + "\\AutoResources.rc");
          */
     }
 }
        public ConfigurationPresenter(IConfigurationView view, IUrlValidator urlValidator,
                                      IMobileConfigurationReader configurationReader, IMobileConfigurationWriter configurationWriter,
                                      INavigationManager navigationManager, IAlertDisplayer alertDisplayer, ISynchronizationServiceManager synchronizationServiceManager)
        {
            this.View                          = view;
            this.UrlValidator                  = urlValidator;
            this.ConfigurationReader           = configurationReader;
            this.ConfigurationWriter           = configurationWriter;
            this.NavigationManager             = navigationManager;
            this.AlertDisplayer                = alertDisplayer;
            this.SynchronizationServiceManager = synchronizationServiceManager;


            this.View.ApplicationModes = Enum.GetValues(typeof(ApplicationMode)).Cast <ApplicationMode>();
            var configuration = ConfigurationReader.GetConfiguration();

            this.View.SelectedApplicationMode = configuration.ApplicationMode;
            this.View.ServerUrlInputEnabled   = configuration.ApplicationMode == ApplicationMode.Client;
            this.View.ServerUrlInputText      = configuration.ServerUrl ?? "https://";
            this.View.Save += OnSave;
            this.View.ApplicationModeChange += OnSelectedApplicationModeChange;
        }
Ejemplo n.º 17
0
 protected virtual ITabNavigation castNavigationView(IConfigurationView view)
 {
     return (ITabNavigation)view;
 }
 public ConfigurationController(IConfigurationView view)
 {
     View = view;
     View.SaveSettings  += SaveSettings;
     View.CancelChanges += CloseView;
 }
 private void ExpectRegisterAndPrepareView(IConfigurationView viewMock)
 {
     Expect.Call(FacadeMock.CreateConfiguration()).Return(new ServiceHostConfiguration());
     Expect.Call(viewMock.Controller).PropertyBehavior();
     Expect.Call(viewMock.GenerateSnapshotMenuItemEnabled).PropertyBehavior();
     Expect.Call(viewMock.NewFileMenuItemEnabled).PropertyBehavior();
     Expect.Call(viewMock.OpenFileMenuItemEnabled).PropertyBehavior();
     Expect.Call(viewMock.OptionsMenuItemEnabled).PropertyBehavior();
     Expect.Call(viewMock.SaveFileAsMenuItemEnabled).PropertyBehavior();
     Expect.Call(viewMock.SaveFileMenuItemEnabled).PropertyBehavior();
     Expect.Call(FacadeMock.AnyFileExists(ConfigurationFileNames)).Return(false);
     Expect.Call(() => viewMock.SetServiceNodesAndRedraw(null, null));
     Expect.Call(() => viewMock.SetCoreServiceNodesEnabled(false));
 }
Ejemplo n.º 20
0
 protected override ITabNavigation castNavigationView(IConfigurationView view)
 {
     return MockRepository.GenerateStub<ITabNavigation>();
 }
Ejemplo n.º 21
0
 public OverRiddenConfigModel_1(IWizard wizard, IConfigurationView view)
     : base(view,wizard)
 {
 }
Ejemplo n.º 22
0
 private static bool CheckLegacyBitmapSetting(ConfigurationModel model, string bitmapFilePath, IConfigurationView view)
 {
     if (model.General.ListBackground.ImagePath.Contains(Path.DirectorySeparatorChar.ToString()))
     {
         if (!File.Exists(model.General.ListBackground.ImagePath))
         {
             view.LogErrorLine(string.Format("Bitmap path '{0}' specified in XML node /MasterInstaller/General/ListBackground does not exist. This may be legacy data. Bitmaps should be stored in the '{1}' folder and referenced by file name only.",
                                             model.General.ListBackground.ImagePath, bitmapFilePath));
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 23
0
        public static void Compile(ConfigurationModel model, string certificatePassword, string masterInstallerPath, IConfigurationView view)
        {
            var _utilsPath     = Path.Combine(masterInstallerPath, "Utils");
            var cppFilePath    = Path.Combine(masterInstallerPath, "Code and Projects");
            var bitmapFilePath = Path.Combine(cppFilePath, "Bitmaps");

            if (CheckLegacyBitmapSetting(model, bitmapFilePath, view))
            {
                var tempFolder = CreateTempCompilationFolder(model);
                GenerateConfigGeneralCpp(cppFilePath, model);
                GenerateConfigDisksCpp(cppFilePath, model);
                GenerateProductsCpp(cppFilePath, model);

                /*
                 * ProcessConfigFile(xmlDoc, CppFilePath + "\\ConfigFunctions.xsl", CppFilePath + "\\ConfigFunctions.cpp");
                 * ProcessConfigFile(xmlDoc, CppFilePath + "\\ConfigGlobals.xsl", CppFilePath + "\\AutoGlobals.h");
                 * ProcessConfigFile(xmlDoc, CppFilePath + "\\ConfigResources.xsl", CppFilePath + "\\AutoResources.rc");
                 */
            }
        }
 public void AddFlavor(IConfigurationView wizard, string flavorName, string flavorUrl)
 {
     _model.Flavors.Add(new ConfigurationModel.FlavorOptions { FlavorName = flavorName, DownloadURL = flavorUrl, IncludedProductTitles = new List<string>()});
     PopulateWithModelSettings(wizard);
 }