/// <summary> /// Writes the XML file for getting infos about updates. /// </summary> /// <param name="xmlFile">is the filename where to save the infos to.</param> public bool WriteUpdateXml(string xmlFile) { if (String.IsNullOrEmpty(xmlFile)) { Console.WriteLine("[MpeMaker] Error: Output file for Update.xml is not specified in package."); return(false); } if (!Path.IsPathRooted(xmlFile)) { xmlFile = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(this.ProjectSettings.ProjectFilename), xmlFile)); } ExtensionCollection list = ExtensionCollection.Load(xmlFile); PackageClass pakToAdd = Clone(); pakToAdd.GeneralInfo.OnlineLocation = ReplaceInfo(pakToAdd.GeneralInfo.OnlineLocation); pakToAdd.GeneralInfo.Params.Items.Remove(pakToAdd.GeneralInfo.Params[ParamNamesConst.ICON]); list.Add(pakToAdd); list.Sort(true); list.Save(xmlFile); return(true); }
public AddFolder2Group(PackageClass packageClass, GroupItem groupItem, string folder) { Init(); _groupItem = groupItem; txt_folder.Text = folder; Package = packageClass; }
public bool Execute(PackageClass packageClass, bool silent) { if (!silent) if ( MessageBox.Show("Do you want to uninstall " + packageClass.GeneralInfo.Name + "?", "Uninstall extension", MessageBoxButtons.YesNo) != DialogResult.Yes) return false; packageClass.UnInstallInfo = new UnInstallInfoCollection(packageClass); packageClass.UnInstallInfo = packageClass.UnInstallInfo.Load(); packageClass.Silent = silent; if (packageClass.UnInstallInfo == null) { if (!silent) if ( MessageBox.Show("No uninstall information found. Do you want to remove " + packageClass.GeneralInfo.Name + " from the list?", "Uninstall extension", MessageBoxButtons.YesNo) != DialogResult.Yes) return false; packageClass.UnInstallInfo = new UnInstallInfoCollection(packageClass); } packageClass.FileUnInstalled += packageClass_FileUnInstalled; progressBar1.Maximum = packageClass.UnInstallInfo.Items.Count + 1; Package = packageClass; ShowDialog(); return true; }
/// <summary> /// Loads the specified file name. /// </summary> /// <param name="fileName">Name of the file.</param> /// <returns>True if loding was successful else False </returns> public bool Load(string fileName) { if (File.Exists(fileName)) { try { var serializer = new XmlSerializer(typeof (PackageClass)); var fs = new FileStream(fileName, FileMode.Open); var packageClass = (PackageClass)serializer.Deserialize(fs); fs.Close(); this.Groups = packageClass.Groups; this.Sections = packageClass.Sections; this.GeneralInfo = packageClass.GeneralInfo; this.UniqueFileList = packageClass.UniqueFileList; this.Dependencies = packageClass.Dependencies; this.ProjectSettings = packageClass.ProjectSettings; this.PluginDependencies = packageClass.PluginDependencies; var pak = new PackageClass(); foreach (SectionParam item in pak.GeneralInfo.Params.Items) { if (!GeneralInfo.Params.Contain(item.Name)) GeneralInfo.Params.Add(item); } Reset(); return true; } catch { return false; } } return false; }
public void Initialize(bool isInstalled, bool meetsAllDependencies, PackageClass package, PackageClass updatePackage) { Package = package; UpdatePackage = updatePackage; lbl_name.Text = package.GeneralInfo.Name; lblAuthors.Text = string.Format("[{0}]", package.GeneralInfo.Author); lbl_version.Text = package.GeneralInfo.Version.ToString(); img_dep.Visible = meetsAllDependencies; if (meetsAllDependencies) { (Parent.Parent.Parent as ExtensionListControl).toolTip1.SetToolTip(img_dep, "Some dependencies are not met.\r\nThe extension may not work properly.\r\nClick here for more information."); } lbl_description.Text = package.GeneralInfo.ExtensionDescription; btn_screenshot.Visible = !string.IsNullOrEmpty(package.GeneralInfo.Params[ParamNamesConst.ONLINE_SCREENSHOT].Value); btn_conf.Visible = isInstalled && !string.IsNullOrEmpty(Package.GeneralInfo.Params[ParamNamesConst.CONFIG].GetValueAsPath()); btn_uninstall.Visible = isInstalled; if (string.IsNullOrEmpty(Package.GeneralInfo.HomePage)) { btn_home.Visible = false; } else { btn_home.Visible = true; (Parent.Parent.Parent as ExtensionListControl).toolTip1.SetToolTip(btn_home, "Extension web page"); } if (string.IsNullOrEmpty(Package.GeneralInfo.ForumPage)) { btn_forum.Visible = false; } else { btn_forum.Visible = true; (Parent.Parent.Parent as ExtensionListControl).toolTip1.SetToolTip(btn_forum, "Extension forum page"); } PopulateInstallBtn(); if (isInstalled && updatePackage != null) { btn_update.Visible = true; img_update.Visible = true; (Parent.Parent.Parent as ExtensionListControl).toolTip1.SetToolTip(img_update, string.Format("New update available. Version: {0}", updatePackage.GeneralInfo.Version.ToString())); } else { btn_update.Visible = false; img_update.Visible = false; } if (Package.Parent != null) { chk_ignore.Checked = Package.Parent.IgnoredUpdates.Contains(Package.GeneralInfo.Id); } GetThumbnail(); IsInitialized = true; }
/// <summary> /// Compares the specified package. /// </summary> /// <param name="pak1">The pak1.</param> /// <param name="pak2">The pak2.</param> /// <returns></returns> public static int Compare(PackageClass pak1, PackageClass pak2) { if (pak1.GeneralInfo.Name.ToUpper().CompareTo(pak2.GeneralInfo.Name.ToUpper()) == 0) { return(pak2.GeneralInfo.Version.CompareTo(pak1.GeneralInfo.Version)); } return(pak1.GeneralInfo.Name.ToUpper().CompareTo(pak2.GeneralInfo.Name.ToUpper())); }
/// <summary> /// Compares the specified package. /// </summary> /// <param name="pak1">The pak1.</param> /// <param name="pak2">The pak2.</param> /// <returns></returns> public static int CompareVersionAscending(PackageClass pak1, PackageClass pak2) { if (pak1.GeneralInfo.Name.ToUpperInvariant().CompareTo(pak2.GeneralInfo.Name.ToUpperInvariant()) == 0) { return pak1.GeneralInfo.Version.CompareTo(pak2.GeneralInfo.Version); } return pak1.GeneralInfo.Name.ToUpperInvariant().CompareTo(pak2.GeneralInfo.Name.ToUpperInvariant()); }
public bool Execute(PackageClass packageClass) { Package = packageClass; if (ShowDialog() == DialogResult.OK) { return true; } return false; }
private void listView1_DoubleClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { DialogResult = DialogResult.OK; Result = listView1.SelectedItems[0].Tag as PackageClass; Close(); } }
/// <summary> /// Copies the default group check from another package /// </summary> /// <param name="packageClass">The package class.</param> public void CopyGroupCheck(PackageClass packageClass) { foreach (GroupItem groupItem in Groups.Items) { GroupItem item = packageClass.Groups[groupItem.Name]; if (item == null) continue; groupItem.Checked = item.DefaulChecked; } }
public void Set(PackageClass pak) { _loading = true; Package = pak; txt_outfile.Text = pak.GeneralInfo.Location; lbl_file.Text = Package.ReplaceInfo(txt_outfile.Text); _loading = false; txt_outfile_TextChanged(null, null); }
public void Set(PackageClass pak) { Index = 0; Text = string.Format("{0} Screen Shots ({1})", pak.GeneralInfo.Name, Urls.Count); pictureBox.ImageLocation = ""; progressBar1.Visible = false; Urls.Clear(); string[] u = pak.GeneralInfo.Params[ParamNamesConst.ONLINE_SCREENSHOT].Value.Split(ParamNamesConst.SEPARATORS); foreach (var s in u) { Urls.Add(s); } SetButton(); LoadImage(); }
/// <summary> /// Previews the section form, but no change made. /// </summary> /// <param name="packageClass">The package class.</param> /// <param name="sectionItem">The param collection.</param> public void Preview(PackageClass packageClass, SectionItem sectionItem) { MessageBox.Show("This is a non visual Section. Nothing to show"); bool state = false; try { Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; AsmHelper script = new AsmHelper(CSScript.LoadCode(sectionItem.Params[Const_script].Value, Path.GetTempFileName(), true)); state = (bool)script.Invoke("Script.GetState", packageClass, sectionItem); MessageBox.Show("Result of script : " + state.ToString()); } catch (Exception ex) { MessageBox.Show("Eror in script : " + ex.Message); } }
public void Initialize(PackageClass package, bool isInstalled) { this.Package = package; this.isInstalled = isInstalled; this.meetsAllDependencies = !package.CheckDependency(true); if (isInstalled) UpdatePackage = MpeCore.MpeInstaller.KnownExtensions.GetUpdate(package); extensionControlCollapsed.Initialize( package.GeneralInfo.Name, package.GeneralInfo.Author, package.GeneralInfo.Version.ToString(), meetsAllDependencies, UpdatePackage != null ? UpdatePackage.GeneralInfo.Version.ToString() : null, CollapsedItemClicked); Height = extensionControlCollapsed.PreferredSize.Height + Margin.Top + Margin.Bottom; }
public ActionEdit(PackageClass packageClass, ActionItem item) { _loading = true; _packageClass = packageClass; _actionItem = item; InitializeComponent(); Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); cmb_type.Text = item.ActionType; cmb_group.Items.Add(""); foreach (var group in packageClass.Groups.Items) { cmb_group.Items.Add(group.Name); } cmb_group.SelectedItem = item.ConditionGroup; if (_actionItem.Params.Items.Count < 1) btn_params.Enabled = false; lbl_description.Text = MpeInstaller.ActionProviders[item.ActionType].Description; cmb_execute.SelectedIndex = (int)item.ExecuteLocation; _loading = false; }
public static void Main(PackageClass packageClass, ActionItem actionItem) { System.Version MpSkinVersion = MediaPortal.Common.Utils.CompatibilityManager.SkinVersion; System.Version NewVersion = new System.Version(1, 3, 0, 0); if (MpeCore.Classes.VersionProvider.MediaPortalVersion.MinimumMPVersionRequired.ToString() == "1.2.100.0") { } if (MpSkinVersion.CompareTo(NewVersion) >= 0) { if (!packageClass.Silent) { MessageBox.Show("MP 1.3.x detected ! Now updating skin files ..."); } string myFilmsDefaultWideFolder = Path.Combine(MpeCore.MpeInstaller.TransformInRealPath("%Config%"), @"MyFilms\Skin.12\DefaultWide"); string defaultWideFolder = Path.Combine(MpeCore.MpeInstaller.TransformInRealPath("%Skin%"), "DefaultWide"); if (Directory.Exists(myFilmsDefaultWideFolder) && Directory.Exists(defaultWideFolder)) { CopyFiles(myFilmsDefaultWideFolder, defaultWideFolder, true); } myFilmsDefaultWideFolder = Path.Combine(MpeCore.MpeInstaller.TransformInRealPath("%Config%"), @"MyFilms\Skin.12\Default"); defaultWideFolder = Path.Combine(MpeCore.MpeInstaller.TransformInRealPath("%Skin%"), "Default"); if (Directory.Exists(myFilmsDefaultWideFolder) && Directory.Exists(defaultWideFolder)) { CopyFiles(myFilmsDefaultWideFolder, defaultWideFolder, true); } return; } if (MpeCore.Classes.VersionProvider.MediaPortalVersion.MinimumMPVersionRequired.ToString() == "1.1.6.27644") { if (!packageClass.Silent) { MessageBox.Show("MP 1.2.x detected - using MP1.2 Skin Files!"); } } return; }
public void Set(PackageClass pak) { Package = null; txt_name.Text = pak.GeneralInfo.Name; txt_guid.Text = pak.GeneralInfo.Id; txt_version1.Text = pak.GeneralInfo.Version.Major; txt_version2.Text = pak.GeneralInfo.Version.Minor; txt_version3.Text = pak.GeneralInfo.Version.Build; txt_version4.Text = pak.GeneralInfo.Version.Revision; txt_author.Text = pak.GeneralInfo.Author; cmb_status.Text = pak.GeneralInfo.DevelopmentStatus; txt_homepage.Text = pak.GeneralInfo.HomePage; txt_forum.Text = pak.GeneralInfo.ForumPage; txt_update.Text = pak.GeneralInfo.UpdateUrl; txt_online.Text = pak.GeneralInfo.OnlineLocation; txt_description.Lines = pak.GeneralInfo.ExtensionDescription.Split('\n'); txt_versiondesc.Lines = pak.GeneralInfo.VersionDescription.Split('\n'); txt_tags.Text = pak.GeneralInfo.Tags; date_release.Value = pak.GeneralInfo.ReleaseDate; Package = pak; RefreshIcon(); }
private static PackageClass GetNewProject() { PackageClass packageClass = new PackageClass(); packageClass.Groups.Items.Add(new GroupItem("Default")); packageClass.Sections.Add("Welcome Screen"); packageClass.Sections.Items[0].WizardButtonsEnum = WizardButtonsEnum.NextCancel; packageClass.Sections.Add("Install Section"); var item = new ActionItem("InstallFiles") { Params = new SectionParamCollection( MpeInstaller.ActionProviders["InstallFiles"].GetDefaultParams()) }; packageClass.Sections.Items[1].Actions.Add(item); packageClass.Sections.Items[1].WizardButtonsEnum = WizardButtonsEnum.Next; packageClass.Sections.Add("Setup Complete"); packageClass.Sections.Items[2].WizardButtonsEnum = WizardButtonsEnum.Finish; packageClass.CreateMPDependency(); return packageClass; }
public void InstallFile(string file, bool silent, bool gui) { if (!File.Exists(file)) { if (!silent) MessageBox.Show("File not found !"); return; } if (IsOldFormat(file)) { if (!silent) MessageBox.Show("This is an old format file (mpi). The extension will NOT be installed. "); return; } MpeCore.MpeInstaller.Init(); PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(file); if (pak == null) { if (!silent) MessageBox.Show("Wrong file format !"); return; } if (pak.CheckDependency(false)) { PackageClass installedPak = MpeCore.MpeInstaller.InstalledExtensions.Get(pak.GeneralInfo.Id); if (installedPak != null) { if (pak.GeneralInfo.Params[ParamNamesConst.FORCE_TO_UNINSTALL_ON_UPDATE].GetValueAsBool()) { if (!silent) if ( MessageBox.Show( "Another version of this extension is installed\nand needs to be uninstalled first.\nDo you want to continue?\n" + "Old extension version: " + installedPak.GeneralInfo.Version + "\n" + "New extension version: " + pak.GeneralInfo.Version, "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) return; UnInstall dlg = new UnInstall(); dlg.Execute(installedPak, true); pak.CopyGroupCheck(installedPak); } else { MpeCore.MpeInstaller.InstalledExtensions.Remove(installedPak); } } if (gui) this.Hide(); pak.Silent = silent; pak.StartInstallWizard(); if (gui) { SetFilterForKnownExtensionsList(); RefreshListControls(); this.Show(); } } else { if (!silent) { if (MessageBox.Show("Dependency check error! Install aborted!\nWould you like to view more details?", pak.GeneralInfo.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } } } }
private void extensionListControl_UnInstallExtension(object sender, PackageClass packageClass) { UnInstall dlg = new UnInstall(); if (dlg.Execute(packageClass, false)) { RefreshListControls(); } }
private bool DoUpdate(PackageClass packageClass, PackageClass newpackageClass, bool silent) { string newPackageLoacation = ExtensionUpdateDownloader.GetPackageLocation(newpackageClass, Client_DownloadProgressChanged, Client_DownloadFileCompleted); if (!File.Exists(newPackageLoacation)) { if (!silent) MessageBox.Show("Can't locate the installer package. Update aborted"); return false; } PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(newPackageLoacation); if (pak == null) { if (!silent) MessageBox.Show("Invalid package format ! Update aborted !"); return false; } if (pak.GeneralInfo.Id != newpackageClass.GeneralInfo.Id || pak.GeneralInfo.Version.CompareTo(newpackageClass.GeneralInfo.Version) < 0) { if (!silent) MessageBox.Show("Invalid update information ! Update aborted!"); return false; } if (!pak.CheckDependency(false)) { if (!silent) { if (MessageBox.Show("Dependency check error! Update aborted!\nWould you like to view more details?", pak.GeneralInfo.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } } return false; } if (!silent) if ( MessageBox.Show( "This operation will update the extension " + packageClass.GeneralInfo.Name + " to the version " + pak.GeneralInfo.Version + " \n Do you want to continue ? ", "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) return false; // only uninstall previous version, if the new package has the setting to force uninstall of previous version on update if (pak.GeneralInfo.Params[ParamNamesConst.FORCE_TO_UNINSTALL_ON_UPDATE].GetValueAsBool()) { UnInstall dlg = new UnInstall(); dlg.Execute(packageClass, true); } else { MpeCore.MpeInstaller.InstalledExtensions.Remove(packageClass); } pak.CopyGroupCheck(packageClass); pak.Silent = true; pak.StartInstallWizard(); return true; }
private void extensionListControl_UpdateExtension(object sender, PackageClass packageClass, PackageClass newpackageClass) { this.Hide(); if (DoUpdate(packageClass, newpackageClass, false)) { RefreshListControls(); } this.Show(); }
public SectionResponseEnum Execute(PackageClass packageClass, SectionItem sectionItem) { Base.ActionExecute(packageClass, sectionItem, ActionExecuteLocationEnum.BeforPanelShow); Base.ActionExecute(packageClass, sectionItem, ActionExecuteLocationEnum.AfterPanelShow); Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; bool state = false; try { AsmHelper script = new AsmHelper(CSScript.LoadCode(sectionItem.Params[Const_script].Value, Path.GetTempFileName(), true)); state = (bool)script.Invoke("Script.GetState", packageClass, sectionItem); } catch (Exception ex) { if (!packageClass.Silent) MessageBox.Show("Eror in script : " + ex.Message); state = false; } foreach (string includedGroup in sectionItem.IncludedGroups) { packageClass.Groups[includedGroup].Checked = state; } Base.ActionExecute(packageClass, sectionItem, ActionExecuteLocationEnum.AfterPanelHide); return SectionResponseEnum.Ok; }
public void Set(PackageClass pak) {}
private void extensionListControl_ShowScreenShot(object sender, PackageClass packageClass) { _screenShotNavigator.Set(packageClass); if (!_screenShotNavigator.Visible) _screenShotNavigator.Show(); }
private bool LoadProject(string filename) { PackageClass pak = new PackageClass(); if (!pak.Load(filename)) { MessageBox.Show("Error loading package project"); return false; } pak.GenerateAbsolutePath(Path.GetDirectoryName(filename)); foreach (FolderGroup folderGroup in pak.ProjectSettings.FolderGroups) { ProjectSettings.UpdateFiles(pak, folderGroup); } pak.ProjectSettings.ProjectFilename = filename; Package = pak; mruMenu.AddFile(filename); return true; }
public void Set(PackageClass pak) { Package = pak; list_versions.Items.Clear(); foreach (DependencyItem item in Package.Dependencies.Items) { list_versions.Items.Add(item); } groupBox1.Enabled = false; }
private void Init() { MpeInstaller.Init(); InitializeComponent(); Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); Package = new PackageClass(); treeView1.ExpandAll(); _panels.Add("Node0", new WelcomSection()); _panels.Add("Node2", new GeneralSection()); _panels.Add("Node3", new FilesGroupsSection()); _panels.Add("Node4", new InstallSections()); _panels.Add("Node5", new RequirementsSection()); _panels.Add("Node6", new BuildSection()); _panels.Add("Node7", new ToolsUpdateXml()); openFileDialog.Filter = mpeFileDialogFilter; saveFileDialog.Filter = mpeFileDialogFilter; mruMenu = new MruStripMenu(mnu_recent, OnMruFile, mruRegKey + "\\MRU", true, 10); }
public void Set(PackageClass pak) { listBox_sections.Items.Clear(); Package = pak; PopulateList(); if (listBox_sections.Items.Count > 0) { listBox_sections.SelectedItem = listBox_sections.Items[0]; } cmb_grupvisibility.Items.Clear(); cmb_grupvisibility.Items.Add(string.Empty); mnu_groulist.Items.Clear(); foreach (GroupItem groupItem in Package.Groups.Items) { cmb_grupvisibility.Items.Add(groupItem.Name); mnu_groulist.Items.Add(groupItem.Name); } }
private void extensionListControl_InstallExtension(object sender, PackageClass packageClass) { string newPackageLoacation = ExtensionUpdateDownloader.GetPackageLocation(packageClass, Client_DownloadProgressChanged, Client_DownloadFileCompleted); if (!File.Exists(newPackageLoacation)) { MessageBox.Show("Can't locate the installer package. Install aborted"); return; } PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(newPackageLoacation); if (pak == null) { MessageBox.Show("Package loading error ! Install aborted!"); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) File.Delete(newPackageLoacation); } catch { } return; } if (!pak.CheckDependency(false)) { if (MessageBox.Show("Dependency check error! Install aborted!\nWould you like to view more details?", pak.GeneralInfo.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } pak.ZipProvider.Dispose(); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) File.Delete(newPackageLoacation); } catch { } return; } if (packageClass.GeneralInfo.Version.CompareTo(pak.GeneralInfo.Version) != 0) { if (MessageBox.Show( string.Format(@"Downloaded version of {0} is {1} and differs from your selected version: {2}! Do you want to continue ?",packageClass.GeneralInfo.Name, pak.GeneralInfo.Version,packageClass.GeneralInfo.Version), "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Error) != DialogResult.Yes) return; } if ( MessageBox.Show( "This operation will install " + packageClass.GeneralInfo.Name + " version " + pak.GeneralInfo.Version + "\n Do you want to continue ?", "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) return; this.Hide(); packageClass = MpeCore.MpeInstaller.InstalledExtensions.Get(packageClass.GeneralInfo.Id); if (packageClass != null) { if (pak.GeneralInfo.Params[ParamNamesConst.FORCE_TO_UNINSTALL_ON_UPDATE].GetValueAsBool()) { if ( MessageBox.Show( "Another version of this extension is installed\nand needs to be uninstalled first.\nDo you want to continue?\n" + "Old extension version: " + packageClass.GeneralInfo.Version + "\n" + "New extension version: " + pak.GeneralInfo.Version, "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) { this.Show(); return; } UnInstall dlg = new UnInstall(); dlg.Execute(packageClass, false); } else { MpeCore.MpeInstaller.InstalledExtensions.Remove(packageClass); } pak.CopyGroupCheck(packageClass); } pak.StartInstallWizard(); RefreshListControls(); pak.ZipProvider.Dispose(); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) File.Delete(newPackageLoacation); } catch { } this.Show(); }
private void extensionListControl_ConfigureExtension(object sender, PackageClass packageClass) { string conf_str = packageClass.GeneralInfo.Params[ParamNamesConst.CONFIG].GetValueAsPath(); if (string.IsNullOrEmpty(conf_str)) return; try { if (Path.GetExtension(conf_str).ToUpperInvariant() == ".DLL") { string assemblyFileName = conf_str; AppDomainSetup setup = new AppDomainSetup(); setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; setup.PrivateBinPath = Path.GetDirectoryName(assemblyFileName); setup.ApplicationName = Path.GetFileName(Assembly.GetExecutingAssembly().Location); setup.ShadowCopyFiles = "true"; setup.ShadowCopyDirectories = Path.GetDirectoryName(assemblyFileName); AppDomain appDomain = AppDomain.CreateDomain("pluginDomain", null, setup); PluginLoader remoteExecutor = (PluginLoader) appDomain.CreateInstanceFromAndUnwrap( Assembly.GetAssembly(typeof (MpeCore.MpeInstaller)).Location, typeof (PluginLoader).ToString()); remoteExecutor.Load(conf_str); remoteExecutor.Dispose(); AppDomain.Unload(appDomain); } else { Process.Start(conf_str); } } catch (Exception ex) { MessageBox.Show("Error : " + ex.Message); } }
public GeneralSection() { InitializeComponent(); Package = null; }