From: <du...@us...> - 2007-04-30 20:05:33
|
Revision: 364 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=364&view=rev Author: dukus Date: 2007-04-30 13:05:26 -0700 (Mon, 30 Apr 2007) Log Message: ----------- Final group support added Modified Paths: -------------- trunk/plugins/mpinstaler/MPInstaler/GroupForm.Designer.cs trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs Modified: trunk/plugins/mpinstaler/MPInstaler/GroupForm.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/GroupForm.Designer.cs 2007-04-30 19:53:23 UTC (rev 363) +++ trunk/plugins/mpinstaler/MPInstaler/GroupForm.Designer.cs 2007-04-30 20:05:26 UTC (rev 364) @@ -46,6 +46,8 @@ this.button3 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -78,6 +80,8 @@ // // tabPage2 // + this.tabPage2.Controls.Add(this.label2); + this.tabPage2.Controls.Add(this.label1); this.tabPage2.Controls.Add(this.button3); this.tabPage2.Controls.Add(this.button2); this.tabPage2.Controls.Add(this.listView3); @@ -154,9 +158,9 @@ // this.listView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader3}); - this.listView2.Location = new System.Drawing.Point(6, 33); + this.listView2.Location = new System.Drawing.Point(6, 49); this.listView2.Name = "listView2"; - this.listView2.Size = new System.Drawing.Size(170, 170); + this.listView2.Size = new System.Drawing.Size(170, 154); this.listView2.TabIndex = 1; this.listView2.UseCompatibleStateImageBehavior = false; this.listView2.View = System.Windows.Forms.View.Details; @@ -165,9 +169,9 @@ // this.listView3.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader4}); - this.listView3.Location = new System.Drawing.Point(270, 33); + this.listView3.Location = new System.Drawing.Point(270, 49); this.listView3.Name = "listView3"; - this.listView3.Size = new System.Drawing.Size(200, 169); + this.listView3.Size = new System.Drawing.Size(200, 153); this.listView3.TabIndex = 2; this.listView3.UseCompatibleStateImageBehavior = false; this.listView3.View = System.Windows.Forms.View.Details; @@ -221,6 +225,24 @@ this.button5.Text = "Remove"; this.button5.UseVisualStyleBackColor = true; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(267, 30); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(69, 13); + this.label1.TabIndex = 5; + this.label1.Text = "Files in group"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(6, 30); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(69, 13); + this.label2.TabIndex = 6; + this.label2.Text = "Avaiable files"; + // // GroupForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -235,6 +257,7 @@ this.tabPage1.ResumeLayout(false); this.tabPage1.PerformLayout(); this.tabPage2.ResumeLayout(false); + this.tabPage2.PerformLayout(); this.ResumeLayout(false); } @@ -259,5 +282,7 @@ private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button5; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-30 19:53:23 UTC (rev 363) +++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-04-30 20:05:26 UTC (rev 364) @@ -187,6 +187,18 @@ } } + public bool FindFileInGroupState(MPIFileList fl) + { + if (SetupGroups.Count < 1) + return true; + for(int i=0;i<SetupGroups.Count;i++) + { + if (FindFileInGroup(SetupGroups[i].Id, fl.FileNameShort) && SetupGroups[i].Checked) + return true; + } + return false; + } + public void Clear() { FileList.Clear(); @@ -891,10 +903,12 @@ { string _id; string _name; + bool _checked; public GroupString(string wid,string wname) { Id = wid; Name = wname; + Checked = false; } public string Id { @@ -907,6 +921,12 @@ set { _name = value; } } + public bool Checked + { + get { return _checked; } + set { _checked = value; } + } + } public class GroupStringMapping Modified: trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-04-30 19:53:23 UTC (rev 363) +++ trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-04-30 20:05:26 UTC (rev 364) @@ -106,22 +106,28 @@ bool test_file(MPIFileList fl, ZipEntry ze) { + if (_intalerStruct.FindFileInGroupState(fl)) + { if (fl.Type == MPinstalerStruct.SKIN_TYPE || fl.Type == MPinstalerStruct.SKIN_MEDIA_TYPE) { - if (Path.GetFileName(ze.Name) == Path.GetFileName(fl.FileName) - && ze.Name.Contains(@"\" + fl.SubType + @"\") && InstallableSkinList.Contains(fl.SubType)) - { - return true; - } - else return false; + if (Path.GetFileName(ze.Name) == Path.GetFileName(fl.FileName) + && ze.Name.Contains(@"\" + fl.SubType + @"\") && InstallableSkinList.Contains(fl.SubType)) + { + return true; + } + else return false; } else { - if (Path.GetFileName(ze.Name) == Path.GetFileName(fl.FileName)) - return true; - else return false; + if (Path.GetFileName(ze.Name) == Path.GetFileName(fl.FileName)) + return true; + else return false; } + } + else + return false; } + public void installLanguage(ListBox lb) { MPLanguageHelper mpih = new MPLanguageHelper(); Modified: trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs 2007-04-30 19:53:23 UTC (rev 363) +++ trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs 2007-04-30 20:05:26 UTC (rev 364) @@ -28,186 +28,198 @@ /// </summary> private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(wizard_1)); - this.panel1 = new System.Windows.Forms.Panel(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.listBox1 = new System.Windows.Forms.ListBox(); - this.progressBar2 = new System.Windows.Forms.ProgressBar(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.label2 = new System.Windows.Forms.Label(); - this.title_label = new System.Windows.Forms.Label(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.panel2 = new System.Windows.Forms.Panel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.button_back = new System.Windows.Forms.Button(); - this.button_next = new System.Windows.Forms.Button(); - this.button_cancel = new System.Windows.Forms.Button(); - this.skinlister = new System.Windows.Forms.CheckedListBox(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - this.panel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.Color.White; - this.panel1.Controls.Add(this.pictureBox2); - this.panel1.Controls.Add(this.listBox1); - this.panel1.Controls.Add(this.progressBar2); - this.panel1.Controls.Add(this.progressBar1); - this.panel1.Controls.Add(this.label2); - this.panel1.Controls.Add(this.title_label); - this.panel1.Controls.Add(this.richTextBox1); - this.panel1.Controls.Add(this.skinlister); - this.panel1.Location = new System.Drawing.Point(165, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(334, 298); - this.panel1.TabIndex = 0; - // - // pictureBox2 - // - this.pictureBox2.BackColor = System.Drawing.Color.Transparent; - this.pictureBox2.Location = new System.Drawing.Point(267, 4); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(64, 64); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox2.TabIndex = 6; - this.pictureBox2.TabStop = false; - this.pictureBox2.Visible = false; - // - // listBox1 - // - this.listBox1.FormattingEnabled = true; - this.listBox1.HorizontalScrollbar = true; - this.listBox1.Location = new System.Drawing.Point(14, 174); - this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(308, 108); - this.listBox1.TabIndex = 5; - // - // progressBar2 - // - this.progressBar2.Location = new System.Drawing.Point(14, 143); - this.progressBar2.Name = "progressBar2"; - this.progressBar2.Size = new System.Drawing.Size(308, 14); - this.progressBar2.TabIndex = 4; - // - // progressBar1 - // - this.progressBar1.Location = new System.Drawing.Point(14, 123); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(308, 14); - this.progressBar1.TabIndex = 3; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(9, 49); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(35, 13); - this.label2.TabIndex = 2; - this.label2.Text = "label2"; - // - // title_label - // - this.title_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.title_label.Location = new System.Drawing.Point(9, 9); - this.title_label.Name = "title_label"; - this.title_label.Size = new System.Drawing.Size(252, 30); - this.title_label.TabIndex = 1; - this.title_label.Text = "label1"; - // - // richTextBox1 - // - this.richTextBox1.BackColor = System.Drawing.SystemColors.ActiveCaptionText; - this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.richTextBox1.Location = new System.Drawing.Point(3, 74); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.ReadOnly = true; - this.richTextBox1.Size = new System.Drawing.Size(331, 224); - this.richTextBox1.TabIndex = 0; - this.richTextBox1.Text = ""; - // - // panel2 - // - this.panel2.Controls.Add(this.pictureBox1); - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(168, 298); - this.panel2.TabIndex = 1; - // - // pictureBox1 - // - this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(0, 0); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(168, 298); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox1.TabIndex = 5; - this.pictureBox1.TabStop = false; - // - // button_back - // - this.button_back.Location = new System.Drawing.Point(223, 314); - this.button_back.Name = "button_back"; - this.button_back.Size = new System.Drawing.Size(75, 23); - this.button_back.TabIndex = 2; - this.button_back.Text = "< Back"; - this.button_back.UseVisualStyleBackColor = true; - this.button_back.Click += new System.EventHandler(this.button_back_Click); - // - // button_next - // - this.button_next.Location = new System.Drawing.Point(304, 314); - this.button_next.Name = "button_next"; - this.button_next.Size = new System.Drawing.Size(75, 23); - this.button_next.TabIndex = 3; - this.button_next.Text = "Next >"; - this.button_next.UseVisualStyleBackColor = true; - this.button_next.Click += new System.EventHandler(this.button_next_Click); - // - // button_cancel - // - this.button_cancel.Location = new System.Drawing.Point(399, 314); - this.button_cancel.Name = "button_cancel"; - this.button_cancel.Size = new System.Drawing.Size(75, 23); - this.button_cancel.TabIndex = 4; - this.button_cancel.Text = "Cancel"; - this.button_cancel.UseVisualStyleBackColor = true; - this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click); - // - // skinlister - // - this.skinlister.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.skinlister.FormattingEnabled = true; - this.skinlister.Location = new System.Drawing.Point(14, 74); - this.skinlister.Name = "skinlister"; - this.skinlister.Size = new System.Drawing.Size(247, 210); - this.skinlister.TabIndex = 7; - // - // wizard_1 - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(499, 358); - this.Controls.Add(this.button_cancel); - this.Controls.Add(this.button_next); - this.Controls.Add(this.button_back); - this.Controls.Add(this.panel2); - this.Controls.Add(this.panel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "wizard_1"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "wizard_1"; - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - this.panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(wizard_1)); + this.panel1 = new System.Windows.Forms.Panel(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.listBox1 = new System.Windows.Forms.ListBox(); + this.progressBar2 = new System.Windows.Forms.ProgressBar(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.label2 = new System.Windows.Forms.Label(); + this.title_label = new System.Windows.Forms.Label(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.skinlister = new System.Windows.Forms.CheckedListBox(); + this.Customize_list = new System.Windows.Forms.CheckedListBox(); + this.panel2 = new System.Windows.Forms.Panel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.button_back = new System.Windows.Forms.Button(); + this.button_next = new System.Windows.Forms.Button(); + this.button_cancel = new System.Windows.Forms.Button(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.BackColor = System.Drawing.Color.White; + this.panel1.Controls.Add(this.pictureBox2); + this.panel1.Controls.Add(this.listBox1); + this.panel1.Controls.Add(this.progressBar2); + this.panel1.Controls.Add(this.progressBar1); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.title_label); + this.panel1.Controls.Add(this.richTextBox1); + this.panel1.Controls.Add(this.skinlister); + this.panel1.Controls.Add(this.Customize_list); + this.panel1.Location = new System.Drawing.Point(165, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(334, 298); + this.panel1.TabIndex = 0; + // + // pictureBox2 + // + this.pictureBox2.BackColor = System.Drawing.Color.Transparent; + this.pictureBox2.Location = new System.Drawing.Point(267, 4); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(64, 64); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox2.TabIndex = 6; + this.pictureBox2.TabStop = false; + this.pictureBox2.Visible = false; + // + // listBox1 + // + this.listBox1.FormattingEnabled = true; + this.listBox1.HorizontalScrollbar = true; + this.listBox1.Location = new System.Drawing.Point(14, 174); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(308, 108); + this.listBox1.TabIndex = 5; + // + // progressBar2 + // + this.progressBar2.Location = new System.Drawing.Point(14, 143); + this.progressBar2.Name = "progressBar2"; + this.progressBar2.Size = new System.Drawing.Size(308, 14); + this.progressBar2.TabIndex = 4; + // + // progressBar1 + // + this.progressBar1.Location = new System.Drawing.Point(14, 123); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(308, 14); + this.progressBar1.TabIndex = 3; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 2; + this.label2.Text = "label2"; + // + // title_label + // + this.title_label.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.title_label.Location = new System.Drawing.Point(9, 9); + this.title_label.Name = "title_label"; + this.title_label.Size = new System.Drawing.Size(252, 30); + this.title_label.TabIndex = 1; + this.title_label.Text = "label1"; + // + // richTextBox1 + // + this.richTextBox1.BackColor = System.Drawing.SystemColors.ActiveCaptionText; + this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.richTextBox1.Location = new System.Drawing.Point(3, 74); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.ReadOnly = true; + this.richTextBox1.Size = new System.Drawing.Size(331, 224); + this.richTextBox1.TabIndex = 0; + this.richTextBox1.Text = ""; + // + // skinlister + // + this.skinlister.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.skinlister.FormattingEnabled = true; + this.skinlister.Location = new System.Drawing.Point(14, 74); + this.skinlister.Name = "skinlister"; + this.skinlister.Size = new System.Drawing.Size(247, 210); + this.skinlister.TabIndex = 7; + // + // Customize_list + // + this.Customize_list.CheckOnClick = true; + this.Customize_list.FormattingEnabled = true; + this.Customize_list.Location = new System.Drawing.Point(14, 98); + this.Customize_list.Name = "Customize_list"; + this.Customize_list.Size = new System.Drawing.Size(308, 139); + this.Customize_list.TabIndex = 8; + this.Customize_list.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.Customize_list_ItemCheck); + // + // panel2 + // + this.panel2.Controls.Add(this.pictureBox1); + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(168, 298); + this.panel2.TabIndex = 1; + // + // pictureBox1 + // + this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.Location = new System.Drawing.Point(0, 0); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(168, 298); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.TabIndex = 5; + this.pictureBox1.TabStop = false; + // + // button_back + // + this.button_back.Location = new System.Drawing.Point(223, 314); + this.button_back.Name = "button_back"; + this.button_back.Size = new System.Drawing.Size(75, 23); + this.button_back.TabIndex = 2; + this.button_back.Text = "< Back"; + this.button_back.UseVisualStyleBackColor = true; + this.button_back.Click += new System.EventHandler(this.button_back_Click); + // + // button_next + // + this.button_next.Location = new System.Drawing.Point(304, 314); + this.button_next.Name = "button_next"; + this.button_next.Size = new System.Drawing.Size(75, 23); + this.button_next.TabIndex = 3; + this.button_next.Text = "Next >"; + this.button_next.UseVisualStyleBackColor = true; + this.button_next.Click += new System.EventHandler(this.button_next_Click); + // + // button_cancel + // + this.button_cancel.Location = new System.Drawing.Point(399, 314); + this.button_cancel.Name = "button_cancel"; + this.button_cancel.Size = new System.Drawing.Size(75, 23); + this.button_cancel.TabIndex = 4; + this.button_cancel.Text = "Cancel"; + this.button_cancel.UseVisualStyleBackColor = true; + this.button_cancel.Click += new System.EventHandler(this.button_cancel_Click); + // + // wizard_1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(499, 358); + this.Controls.Add(this.button_cancel); + this.Controls.Add(this.button_next); + this.Controls.Add(this.button_back); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "wizard_1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "wizard_1"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + this.panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); } @@ -227,5 +239,6 @@ private System.Windows.Forms.ListBox listBox1; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.CheckedListBox skinlister; + private System.Windows.Forms.CheckedListBox Customize_list; } } \ No newline at end of file Modified: trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs =================================================================== --- trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs 2007-04-30 19:53:23 UTC (rev 363) +++ trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs 2007-04-30 20:05:26 UTC (rev 364) @@ -9,367 +9,424 @@ namespace MPInstaler { - public partial class wizard_1 : Form + public partial class wizard_1 : Form + { + public int step = 0; + public MPpackageStruct package; + MPInstallHelper inst = new MPInstallHelper(); + List<ActionInfo> actions = new List<ActionInfo>(); + bool update = false; + bool working = false; + public wizard_1() { - public int step = 0; - public MPpackageStruct package; - MPInstallHelper inst = new MPInstallHelper(); - List<ActionInfo> actions = new List<ActionInfo>(); - bool update = false; - public wizard_1() - { - package = new MPpackageStruct(); - InitializeComponent(); - } - public void starStep() - { - inst.LoadFromFile(); - if (inst.IndexOf(package) < 0) - nextStep(1); - else - if (MessageBox.Show("Extension already installed. Do you want continue ?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) - nextStep(1); - } - public void StartUpdate() - { - update = true; - inst.LoadFromFile(); - nextStep(1); - //if (!this.Visible) this.Show(); - //this.Text = "MediaPortal extension instaler"; - //skinlister.Items.Clear(); - //foreach (string sk in package.SkinList) - //{ - // skinlister.Items.Add(sk, true); - //} - //if (package._intalerStruct.Logo != null) - //{ - // pictureBox2.Visible = true; - // pictureBox2.Image = package._intalerStruct.Logo; - //} - //else - //{ - // pictureBox2.Visible = false; - //} - //for (int i = 0; i < skinlister.Items.Count; i++) - //{ - // if (skinlister.GetItemChecked(i)) - // package.InstallableSkinList.Add(skinlister.Items[i].ToString()); - //} - //label2.Visible = true; - //progressBar1.Visible = true; - //progressBar2.Visible = true; - //listBox1.Visible = true; ; - //title_label.Text = package._intalerStruct.Name; - //label2.Text = "Instaling ..."; - //button_next.Visible = false; - //button_back.Visible = true; - //richTextBox1.Text = ""; - //richTextBox1.Visible = false; - //step = 7; - //install(); - } + package = new MPpackageStruct(); + InitializeComponent(); + } + public void starStep() + { + inst.LoadFromFile(); + if (inst.IndexOf(package) < 0) + nextStep(1); + else + if (MessageBox.Show("Extension already installed. Do you want continue ?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) + nextStep(1); + } + public void StartUpdate() + { + update = true; + inst.LoadFromFile(); + nextStep(1); + //if (!this.Visible) this.Show(); + //this.Text = "MediaPortal extension instaler"; + //skinlister.Items.Clear(); + //foreach (string sk in package.SkinList) + //{ + // skinlister.Items.Add(sk, true); + //} + //if (package._intalerStruct.Logo != null) + //{ + // pictureBox2.Visible = true; + // pictureBox2.Image = package._intalerStruct.Logo; + //} + //else + //{ + // pictureBox2.Visible = false; + //} + //for (int i = 0; i < skinlister.Items.Count; i++) + //{ + // if (skinlister.GetItemChecked(i)) + // package.InstallableSkinList.Add(skinlister.Items[i].ToString()); + //} + //label2.Visible = true; + //progressBar1.Visible = true; + //progressBar2.Visible = true; + //listBox1.Visible = true; ; + //title_label.Text = package._intalerStruct.Name; + //label2.Text = "Instaling ..."; + //button_next.Visible = false; + //button_back.Visible = true; + //richTextBox1.Text = ""; + //richTextBox1.Visible = false; + //step = 7; + //install(); + } - public void nextStep(int m) - { - step+=m; - test_next_step(m); - switch (step) + public void nextStep(int m) + { + step += m; + test_next_step(m); + switch (step) + { + case 1: + { + this.Text = "MediaPortal extension instaler"; + skinlister.Items.Clear(); + Customize_list.Visible = false; + button_back.Visible = false; + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Visible = false; + listBox1.Items.Clear(); + listBox1.Visible = false; + label2.Visible = false; + title_label.Text = package._intalerStruct.Name; + button_next.Text = "Next"; + richTextBox1.Visible = true; + if (package._intalerStruct.Logo != null) { - case 1: - { - this.Text = "MediaPortal extension instaler"; - skinlister.Items.Clear(); - button_back.Visible = false; - progressBar1.Visible = false; - progressBar2.Visible = false; - skinlister.Visible = false; - listBox1.Items.Clear(); - listBox1.Visible = false; - label2.Visible = false; - title_label.Text = package._intalerStruct.Name; - button_next.Text = "Next"; - richTextBox1.Visible = true; - if (package._intalerStruct.Logo != null) - { - pictureBox2.Visible = true; - pictureBox2.Image = package._intalerStruct.Logo; - } - else - { - pictureBox2.Visible = false; - } - richTextBox1.Text = String.Format(" Name : {0} \n\n Author : {1} \n\n Version : {2} \n\n Description :\n {3} \n", package._intalerStruct.Name, package._intalerStruct.Author, package._intalerStruct.Version, package._intalerStruct.Description); - if (!this.Visible) this.ShowDialog(); - break; - } - case 2: - { - label2.Visible = true; - progressBar1.Visible = false; - progressBar2.Visible = false; - skinlister.Visible = false; - listBox1.Visible = false; - label2.Text = "License Agreement"; - button_next.Text = "I Agree"; - button_back.Visible = true; - richTextBox1.Visible = true; - richTextBox1.Text = package.txt_EULA; - break; - } - case 3: - { - label2.Visible = true; - progressBar1.Visible = false; - progressBar2.Visible = false; - skinlister.Visible = false; - listBox1.Visible = false; - label2.Text = "Change log"; - button_next.Text = "Next"; - button_back.Visible = true; - richTextBox1.Visible = true; - richTextBox1.Text = package.txt_log; - break; - } - case 4: - { - progressBar1.Visible = false; - progressBar2.Visible = false; - skinlister.Visible = false; - listBox1.Visible = false; - label2.Visible = true; - label2.Text = "Read me"; - button_back.Visible = true; - richTextBox1.Visible = true; - richTextBox1.Text = package.txt_readme; - break; - } - case 5: - { - progressBar1.Visible = false; - progressBar2.Visible = false; - skinlister.Visible = true; - listBox1.Visible = false; - label2.Visible = true; - label2.Text = "Select skin"; - button_next.Text = "Next"; - button_back.Visible = true; - richTextBox1.Visible = false; - skinlister.Items.Clear(); - foreach (string sk in package.SkinList) - { - skinlister.Items.Add(sk, true); - } - break; - } - case 6: - { - progressBar1.Visible = false; - progressBar2.Visible = false; - skinlister.Visible = false; - listBox1.Visible = false; - label2.Visible = true; - label2.Text = "Instaling ..."; - button_next.Text = "Next"; - button_back.Visible = true; - richTextBox1.Visible = true; - richTextBox1.Text = String.Format("Intall paths : \n"); - foreach (Config.Dir option in Enum.GetValues(typeof(Config.Dir))) - { - richTextBox1.Text += String.Format("{0} - {1}\n", option, Config.GetFolder(option)); - } - break; - } - case 7: - { - if (!this.Visible) this.ShowDialog(); - for (int i = 0; i < skinlister.Items.Count; i++) - { - if (skinlister.GetItemChecked(i)) - package.InstallableSkinList.Add(skinlister.Items[i].ToString()); - } - label2.Visible = true; - progressBar1.Visible = true; - progressBar2.Visible = true; - listBox1.Visible = true; ; - label2.Text = "Instaling ..."; - button_next.Visible = false; - button_back.Visible = true; - richTextBox1.Text = ""; - richTextBox1.Visible = false; - install(); - break; - } - + pictureBox2.Visible = true; + pictureBox2.Image = package._intalerStruct.Logo; } - } - - private void install() - { - button_next.Visible = false; - button_back.Visible = false; - button_cancel.Enabled = false; - if (progressBar1 != null) + else { - progressBar1.Minimum = 0; - progressBar1.Maximum = package._intalerStruct.FileList.Count; + pictureBox2.Visible = false; } - for (int i = 0; i < package._intalerStruct.FileList.Count; i++) + richTextBox1.Text = String.Format(" Name : {0} \n\n Author : {1} \n\n Version : {2} \n\n Description :\n {3} \n", package._intalerStruct.Name, package._intalerStruct.Author, package._intalerStruct.Version, package._intalerStruct.Description); + if (!this.Visible) this.ShowDialog(); + break; + } + case 2: + { + label2.Visible = true; + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Visible = false; + listBox1.Visible = false; + Customize_list.Visible = false; + label2.Text = "License Agreement"; + button_next.Text = "I Agree"; + button_back.Visible = true; + richTextBox1.Visible = true; + richTextBox1.Text = package.txt_EULA; + break; + } + case 3: + { + label2.Visible = true; + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Visible = false; + listBox1.Visible = false; + Customize_list.Visible = false; + label2.Text = "Change log"; + button_next.Text = "Next"; + button_back.Visible = true; + richTextBox1.Visible = true; + richTextBox1.Text = package.txt_log; + break; + } + case 4: + { + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Visible = false; + listBox1.Visible = false; + Customize_list.Visible = false; + label2.Visible = true; + label2.Text = "Read me"; + button_back.Visible = true; + richTextBox1.Visible = true; + richTextBox1.Text = package.txt_readme; + break; + } + case 5: + { + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Visible = true; + listBox1.Visible = false; + label2.Visible = true; + Customize_list.Visible = false; + label2.Text = "Select skin"; + button_next.Text = "Next"; + button_back.Visible = true; + richTextBox1.Visible = false; + skinlister.Items.Clear(); + foreach (string sk in package.SkinList) { - package.instal_file(progressBar2,listBox1,(MPIFileList) package._intalerStruct.FileList[i]); - progressBar1.Value++; - this.Refresh(); - this.Update(); + skinlister.Items.Add(sk, true); } - package.installLanguage(listBox1); - button_next.Visible = false; - button_cancel.Enabled = true; - inst.Add(package); - inst.SaveToFile(); - label2.Text = "Done ..."; - ActionInfo ac = package._intalerStruct.FindAction("POSTSETUP"); - if (ac != null) + break; + } + case 6: + { + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Visible = true; + listBox1.Visible = false; + label2.Visible = true; + skinlister.Visible = false; + Customize_list.Visible = true; + label2.Text = "Customize setup"; + button_next.Text = "Next"; + button_back.Visible = true; + richTextBox1.Visible = false; + Customize_list.Visible = true; + Customize_list.Items.Clear(); + foreach (GroupString gs in package._intalerStruct.SetupGroups) { - actions.Add(ac); - listBox1.Visible = false; - skinlister.Items.Clear(); - skinlister.Visible = true; - progressBar1.Visible = false; - progressBar2.Visible = false; - skinlister.Items.Add(ac.ToString()); + Customize_list.Items.Add(gs.Name, !package._intalerStruct.ProiectProperties.SingleGroupSelect); } - button_cancel.Text = "Finish"; - } - - private void test_next_step(int m) - { - switch (step) + if (package._intalerStruct.ProiectProperties.SingleGroupSelect && package._intalerStruct.SetupGroups.Count > 0) + Customize_list.SetItemChecked(0, true); + break; + } + case 7: + { + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Visible = false; + listBox1.Visible = false; + Customize_list.Visible = false; + label2.Visible = true; + label2.Text = "Instaling ..."; + button_next.Text = "Next"; + button_back.Visible = true; + richTextBox1.Visible = true; + richTextBox1.Text = String.Format("Intall paths : \n"); + foreach (Config.Dir option in Enum.GetValues(typeof(Config.Dir))) { - case 1: - break; - case 2: - if (update) step = 6; - if (String.IsNullOrEmpty(package.txt_EULA)) - { - step+=m; - test_next_step(m); - } - break; - case 3: - if (String.IsNullOrEmpty(package.txt_log)) - { - step+=m; - test_next_step(m); - } - break; - case 4: - if (String.IsNullOrEmpty(package.txt_readme)) - { - step+=m; - test_next_step(m); - } - break; - case 5: - if (!package.containsSkin) - { - step += m; - test_next_step(m); - } - break; - default: - break; + richTextBox1.Text += String.Format("{0} - {1}\n", option, Config.GetFolder(option)); } - } - - private void button_next_Click(object sender, EventArgs e) - { - nextStep(1); - } - - private void button_cancel_Click(object sender, EventArgs e) - { - if (step == 7) + break; + } + case 8: + { + if (!this.Visible) this.ShowDialog(); + for (int i = 0; i < skinlister.Items.Count; i++) { - foreach (ActionInfo ac in actions) - { - int i=skinlister.Items.IndexOf(ac.ToString()); - if (skinlister.GetSelected(i)) - ac.ExecuteAction(package._intalerStruct); - } - - this.Close(); + if (skinlister.GetItemChecked(i)) + package.InstallableSkinList.Add(skinlister.Items[i].ToString()); } - else + for (int i = 0; i < Customize_list.Items.Count; i++) { - this.Close(); + package._intalerStruct.SetupGroups[i].Checked = Customize_list.GetItemChecked(i); } - } + label2.Visible = true; + Customize_list.Visible = false; + progressBar1.Visible = true; + progressBar2.Visible = true; + listBox1.Visible = true; ; + label2.Text = "Instaling ..."; + button_next.Visible = false; + button_back.Visible = true; + richTextBox1.Text = ""; + richTextBox1.Visible = false; + install(); + break; + } - private void button_back_Click(object sender, EventArgs e) + } + } + + private void install() + { + button_next.Visible = false; + button_back.Visible = false; + button_cancel.Enabled = false; + if (progressBar1 != null) + { + progressBar1.Minimum = 0; + progressBar1.Maximum = package._intalerStruct.FileList.Count; + } + for (int i = 0; i < package._intalerStruct.FileList.Count; i++) + { + package.instal_file(progressBar2, listBox1, (MPIFileList)package._intalerStruct.FileList[i]); + progressBar1.Value++; + this.Refresh(); + this.Update(); + } + package.installLanguage(listBox1); + button_next.Visible = false; + button_cancel.Enabled = true; + inst.Add(package); + inst.SaveToFile(); + label2.Text = "Done ..."; + ActionInfo ac = package._intalerStruct.FindAction("POSTSETUP"); + if (ac != null) + { + actions.Add(ac); + listBox1.Visible = false; + skinlister.Items.Clear(); + skinlister.Visible = true; + progressBar1.Visible = false; + progressBar2.Visible = false; + skinlister.Items.Add(ac.ToString()); + } + button_cancel.Text = "Finish"; + } + + private void test_next_step(int m) + { + switch (step) + { + case 1: + break; + case 2: + if (update) step = 7; + if (String.IsNullOrEmpty(package.txt_EULA)) + { + step += m; + test_next_step(m); + } + break; + case 3: + if (String.IsNullOrEmpty(package.txt_log)) + { + step += m; + test_next_step(m); + } + break; + case 4: + if (String.IsNullOrEmpty(package.txt_readme)) + { + step += m; + test_next_step(m); + } + break; + case 5: + if (!package.containsSkin) + { + step += m; + test_next_step(m); + } + break; + case 6: + if (package._intalerStruct.SetupGroups.Count < 1) + { + step += m; + test_next_step(m); + } + break; + default: + break; + } + } + + private void button_next_Click(object sender, EventArgs e) + { + nextStep(1); + } + + private void button_cancel_Click(object sender, EventArgs e) + { + if (step == 8) + { + foreach (ActionInfo ac in actions) { - nextStep(-1); + int i = skinlister.Items.IndexOf(ac.ToString()); + if (skinlister.GetSelected(i)) + ac.ExecuteAction(package._intalerStruct); } - internal void uninstall(string tit) + this.Close(); + } + else + { + this.Close(); + } + } + + private void button_back_Click(object sender, EventArgs e) + { + nextStep(-1); + } + + internal void uninstall(string tit) + { + inst.LoadFromFile(); + int index = -1; + int ind = -1; + foreach (MPpackageStruct p in inst.lst) + { + ind++; + if (p._intalerStruct.Name.Trim() == tit.Trim()) { - inst.LoadFromFile(); - int index = -1; - int ind=-1; - foreach (MPpackageStruct p in inst.lst) + index = ind; + break; + } + } + if (index > -1) + if (((MPpackageStruct)inst.lst[index])._intalerStruct.Uninstall.Count > 0) + { + if (MessageBox.Show("Uninstalling extension." + tit + "\nDo you want continue ?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) + { + if (!this.Visible) this.Show(); + MPpackageStruct p = (MPpackageStruct)inst.lst[index]; + label2.Visible = true; + progressBar1.Visible = true; + progressBar2.Visible = false; + listBox1.Visible = true; + this.Text = "Uninstalling " + p._intalerStruct.Name; + title_label.Text = p._intalerStruct.Name; + label2.Text = "Uninstalling ..."; + button_next.Visible = false; + button_back.Visible = false; + richTextBox1.Text = ""; + richTextBox1.Visible = false; + progressBar1.Maximum = p._intalerStruct.Uninstall.Count; + for (int i = 0; i < p._intalerStruct.Uninstall.Count; i++) { - ind++; - if (p._intalerStruct.Name.Trim() == tit.Trim()) + UninstallInfo u = (UninstallInfo)p._intalerStruct.Uninstall[i]; + progressBar1.Value++; + progressBar1.Update(); + progressBar1.Refresh(); + if (System.IO.File.Exists(u.Path)) + { + if (System.IO.File.GetCreationTime(u.Path) == u.Date) { - index = ind; - break; + System.IO.File.Delete(u.Path); + listBox1.Items.Add(u.Path); } + else + listBox1.Items.Add("File date changed :" + u.Path); + } + else listBox1.Items.Add("File not found :" + u.Path); } - if (index > -1) - if (((MPpackageStruct)inst.lst[index])._intalerStruct.Uninstall.Count>0) - { - if (MessageBox.Show("Uninstalling extension." + tit + "\nDo you want continue ?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) - { - if (!this.Visible) this.Show(); - MPpackageStruct p = (MPpackageStruct)inst.lst[index]; - label2.Visible = true; - progressBar1.Visible = true; - progressBar2.Visible = false; - listBox1.Visible = true; - this.Text = "Uninstalling "+p._intalerStruct.Name; - title_label.Text = p._intalerStruct.Name; - label2.Text = "Uninstalling ..."; - button_next.Visible = false; - button_back.Visible = false; - richTextBox1.Text = ""; - richTextBox1.Visible = false; - progressBar1.Maximum = p._intalerStruct.Uninstall.Count; - for (int i = 0; i < p._intalerStruct.Uninstall.Count; i++) - { - UninstallInfo u = (UninstallInfo)p._intalerStruct.Uninstall[i]; - progressBar1.Value++; - progressBar1.Update(); - progressBar1.Refresh(); - if (System.IO.File.Exists(u.Path)) - { - if (System.IO.File.GetCreationTime(u.Path) == u.Date) - { - System.IO.File.Delete(u.Path); - listBox1.Items.Add(u.Path); - }else - listBox1.Items.Add("File date changed :"+u.Path); - } - else listBox1.Items.Add("File not found :"+u.Path); - } - inst.lst.RemoveAt(index); - inst.SaveToFile(); - } - } - else - MessageBox.Show("Uninstall information not found !"); - else - MessageBox.Show("Uninstall information not found !"); + inst.lst.RemoveAt(index); + inst.SaveToFile(); + } + } + else + MessageBox.Show("Uninstall information not found !"); + else + MessageBox.Show("Uninstall information not found !"); - button_cancel.Text = "Finish"; - } + button_cancel.Text = "Finish"; } + + private void Customize_list_ItemCheck(object sender, ItemCheckEventArgs e) + { + if (working) return; + working = true; + if (package._intalerStruct.ProiectProperties.SingleGroupSelect) + { + for (int i = 0; i < Customize_list.Items.Count; i++) + Customize_list.SetItemChecked(i, false); + } + Customize_list.SetItemChecked(e.Index, true); + working = false; + } + + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |