public ActionItem(ActionItem obj) { Name = obj.Name; Params = Params; ConditionGroup = obj.ConditionGroup; ExecuteLocation = obj.ExecuteLocation; }
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; }
private void testToolStripMenuItem_Click(object sender, EventArgs e) { if (SelectedSection == null) return; ToolStripMenuItem menu = sender as ToolStripMenuItem; IActionType type = menu.Tag as IActionType; if (type != null) { ActionItem item = new ActionItem(type.DisplayName); item.Params = new SectionParamCollection(MpeInstaller.ActionProviders[type.DisplayName].GetDefaultParams()); ActionEdit dlg = new ActionEdit(Package, item); if (dlg.ShowDialog() == DialogResult.OK) { if (SelectedSection != null) { SelectedSection.Actions.Items.Add(item); list_actions.Items.Add(item); } } } }
private void btn_done_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_skinpath.Text)) { MessageBox.Show("No skin folder specified !"); return; } Package.GeneralInfo.Name = txt_name.Text; Package.GeneralInfo.Author = txt_author.Text; Package.GeneralInfo.Version = new VersionInfo() { Major = txt_version1.Text, Minor = txt_version2.Text, Build = txt_version3.Text, Revision = txt_version4.Text }; string fontName = Path.GetFileName(txt_skinpath.Text); #region Skin GroupItem skinGroup = new GroupItem("Skin files"); FolderGroup skinfoldergroup = new FolderGroup() { DestinationFilename = "%Skin%\\" + fontName, Folder = txt_skinpath.Text, InstallType = "CopyFile", UpdateOption = UpdateOptionEnum.OverwriteIfOlder, Param1 = "", Recursive = true, Group = skinGroup.Name }; Package.Groups.Add(skinGroup); Package.ProjectSettings.Add(skinfoldergroup); ProjectSettings.UpdateFiles(Package, skinfoldergroup); #endregion #region fonts if (!string.IsNullOrEmpty(txt_font1.Text + txt_font2.Text + txt_font3.Text)) { GroupItem fontGroup = new GroupItem("Font files"); if (!string.IsNullOrEmpty(txt_font1.Text) && File.Exists(txt_font1.Text)) { FileItem fileitem = new FileItem { DestinationFilename = "%Skin%\\" + fontName + "\\Fonts\\" + Path.GetFileName(txt_font1.Text), InstallType = "CopyFont", LocalFileName = Path.GetFullPath(txt_font1.Text) }; fontGroup.Files.Add(fileitem); } if (!string.IsNullOrEmpty(txt_font2.Text) && File.Exists(txt_font2.Text)) { FileItem fileitem = new FileItem { DestinationFilename = "%Skin%\\" + fontName + "\\Fonts\\" + Path.GetFileName(txt_font2.Text), InstallType = "CopyFont", LocalFileName = Path.GetFullPath(txt_font2.Text) }; fontGroup.Files.Add(fileitem); } if (!string.IsNullOrEmpty(txt_font3.Text) && File.Exists(txt_font3.Text)) { FileItem fileitem = new FileItem { DestinationFilename = "%Skin%\\" + fontName + "\\Fonts\\" + Path.GetFileName(txt_font3.Text), InstallType = "CopyFont", LocalFileName = Path.GetFullPath(txt_font3.Text) }; fontGroup.Files.Add(fileitem); } Package.Groups.Add(fontGroup); } #endregion #region dlls %Plugins% if (!string.IsNullOrEmpty(txt_plugin_procces.Text + txt_plugin_window.Text + txt_plugin_exe.Text)) { GroupItem dllGroup = new GroupItem("Plugin files"); if (!string.IsNullOrEmpty(txt_plugin_procces.Text) && File.Exists(txt_plugin_procces.Text)) { FileItem fileitem = new FileItem { DestinationFilename = "%Plugins%\\process\\" + Path.GetFileName(txt_plugin_procces.Text), InstallType = "CopyFile", LocalFileName = Path.GetFullPath(txt_plugin_procces.Text) }; dllGroup.Files.Add(fileitem); } if (!string.IsNullOrEmpty(txt_plugin_window.Text) && File.Exists(txt_plugin_window.Text)) { FileItem fileitem = new FileItem { DestinationFilename = "%Plugins%\\Windows\\" + Path.GetFileName(txt_plugin_window.Text), InstallType = "CopyFile", LocalFileName = Path.GetFullPath(txt_plugin_window.Text) }; dllGroup.Files.Add(fileitem); } if (!string.IsNullOrEmpty(txt_plugin_exe.Text) && File.Exists(txt_plugin_exe.Text)) { FileItem fileitem = new FileItem { DestinationFilename = "%Base%\\" + Path.GetFileName(txt_plugin_exe.Text), InstallType = "CopyFile", LocalFileName = Path.GetFullPath(txt_plugin_exe.Text) }; dllGroup.Files.Add(fileitem); } Package.Groups.Add(dllGroup); } #endregion #region install sections Package.Sections.Add("Welcome Screen").WizardButtonsEnum = WizardButtonsEnum.NextCancel; Package.Sections.Add("Install Section").WizardButtonsEnum = WizardButtonsEnum.Next; var item = new ActionItem("InstallFiles") { Params = new SectionParamCollection( MpeInstaller.ActionProviders["InstallFiles"].GetDefaultParams()) }; Package.Sections.Items[1].Actions.Add(item); Package.Sections.Add("Setup Complete").WizardButtonsEnum = WizardButtonsEnum.Finish; #endregion #region config if (radioButton1.Checked && File.Exists(txt_plugin_procces.Text)) Package.GeneralInfo.Params[ParamNamesConst.CONFIG].Value = "%Plugins%\\process\\" + Path.GetFileName(txt_plugin_procces.Text); if (radioButton1.Checked && File.Exists(txt_plugin_window.Text)) Package.GeneralInfo.Params[ParamNamesConst.CONFIG].Value = "%Plugins%\\Windows\\" + Path.GetFileName(txt_plugin_window.Text); if (radioButton1.Checked && File.Exists(txt_plugin_exe.Text)) Package.GeneralInfo.Params[ParamNamesConst.CONFIG].Value = "%Base%\\" + Path.GetFileName(txt_plugin_exe.Text); if (File.Exists(txt_ico.Text)) { string icofile = Path.GetFullPath(txt_ico.Text); Package.GeneralInfo.Params[ParamNamesConst.ICON].Value = icofile; Package.Sections.Items[0].Params[ParamNamesConst.SECTION_ICON].Value = icofile; Package.Sections.Items[1].Params[ParamNamesConst.SECTION_ICON].Value = icofile; Package.Sections.Items[2].Params[ParamNamesConst.SECTION_ICON].Value = icofile; } Package.GeneralInfo.Location = txt_mpe_folder.Text + "\\" + Package.GeneralInfo.Name + ".mpe1"; #endregion Close(); }
public void Add(ActionItem sectionItem) { Items.Add(sectionItem); }
public void Add(ActionItem sectionItem) { Items.Add(sectionItem); }
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; }