|
From: <du...@us...> - 2007-02-25 14:59:32
|
Revision: 139
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=139&view=rev
Author: dukus
Date: 2007-02-25 06:59:25 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
First working Version.
Modified Paths:
--------------
trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/Form1.cs
trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj
trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs
trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/start_form.cs
trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs
trunk/plugins/mpinstaler/MPInstaler.suo
Added Paths:
-----------
trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.Designer.cs
trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs
trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.resx
Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/Form1.Designer.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -75,16 +75,19 @@
this.label1 = new System.Windows.Forms.Label();
this.tabPage_Language = new System.Windows.Forms.TabPage();
this.tabPage_Proiect = new System.Windows.Forms.TabPage();
+ this.proiectt_textBox4 = new System.Windows.Forms.TextBox();
+ this.label5 = new System.Windows.Forms.Label();
this.proiectt_textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.proiectt_textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.proiectt_textBox1 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.proiectt_textBox4 = new System.Windows.Forms.TextBox();
+ this.skint_comboBox1 = new System.Windows.Forms.ComboBox();
+ this.label6 = new System.Windows.Forms.Label();
this.menuStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
+ this.tabPage_Skin.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage_Text.SuspendLayout();
this.tabPage_Proiect.SuspendLayout();
@@ -198,7 +201,7 @@
this.tagReadersToolStripMenuItem,
this.externalPlayersToolStripMenuItem});
this.windowPluginToolStripMenuItem.Name = "windowPluginToolStripMenuItem";
- this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.windowPluginToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.windowPluginToolStripMenuItem.Text = "Plugin";
//
// windowToolStripMenuItem
@@ -243,20 +246,20 @@
this.mediaToolStripMenuItem,
this.fullToolStripMenuItem});
this.skinToolStripMenuItem.Name = "skinToolStripMenuItem";
- this.skinToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.skinToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.skinToolStripMenuItem.Text = "Skin";
//
// componentToolStripMenuItem
//
this.componentToolStripMenuItem.Name = "componentToolStripMenuItem";
- this.componentToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.componentToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.componentToolStripMenuItem.Text = "Component";
this.componentToolStripMenuItem.Click += new System.EventHandler(this.componentToolStripMenuItem_Click);
//
// mediaToolStripMenuItem
//
this.mediaToolStripMenuItem.Name = "mediaToolStripMenuItem";
- this.mediaToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.mediaToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.mediaToolStripMenuItem.Text = "Media";
this.mediaToolStripMenuItem.Click += new System.EventHandler(this.mediaToolStripMenuItem_Click);
//
@@ -264,40 +267,40 @@
//
this.fullToolStripMenuItem.Enabled = false;
this.fullToolStripMenuItem.Name = "fullToolStripMenuItem";
- this.fullToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
+ this.fullToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.fullToolStripMenuItem.Text = "Full";
this.fullToolStripMenuItem.Visible = false;
//
// languageToolStripMenuItem
//
this.languageToolStripMenuItem.Name = "languageToolStripMenuItem";
- this.languageToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.languageToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.languageToolStripMenuItem.Text = "Language";
this.languageToolStripMenuItem.Click += new System.EventHandler(this.languageToolStripMenuItem_Click);
//
// textToolStripMenuItem
//
this.textToolStripMenuItem.Name = "textToolStripMenuItem";
- this.textToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.textToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.textToolStripMenuItem.Text = "Text";
this.textToolStripMenuItem.Click += new System.EventHandler(this.textToolStripMenuItem_Click);
//
// otherToolStripMenuItem
//
this.otherToolStripMenuItem.Name = "otherToolStripMenuItem";
- this.otherToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.otherToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.otherToolStripMenuItem.Text = "Other";
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
- this.settingsToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
+ this.settingsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.settingsToolStripMenuItem.Text = "Settings";
//
// textToolStripMenuItem1
//
this.textToolStripMenuItem1.Name = "textToolStripMenuItem1";
- this.textToolStripMenuItem1.Size = new System.Drawing.Size(132, 22);
+ this.textToolStripMenuItem1.Size = new System.Drawing.Size(152, 22);
this.textToolStripMenuItem1.Text = "Text";
this.textToolStripMenuItem1.Click += new System.EventHandler(this.textToolStripMenuItem1_Click);
//
@@ -380,6 +383,8 @@
//
// tabPage_Skin
//
+ this.tabPage_Skin.Controls.Add(this.label6);
+ this.tabPage_Skin.Controls.Add(this.skint_comboBox1);
this.tabPage_Skin.Location = new System.Drawing.Point(4, 22);
this.tabPage_Skin.Name = "tabPage_Skin";
this.tabPage_Skin.Padding = new System.Windows.Forms.Padding(3);
@@ -432,7 +437,7 @@
"LOG",
"EULA",
"READ ME"});
- this.textt_comboBox1.Location = new System.Drawing.Point(43, 18);
+ this.textt_comboBox1.Location = new System.Drawing.Point(6, 28);
this.textt_comboBox1.Name = "textt_comboBox1";
this.textt_comboBox1.Size = new System.Drawing.Size(111, 21);
this.textt_comboBox1.TabIndex = 1;
@@ -441,7 +446,7 @@
// label1
//
this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(3, 21);
+ this.label1.Location = new System.Drawing.Point(3, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(34, 13);
this.label1.TabIndex = 0;
@@ -473,6 +478,23 @@
this.tabPage_Proiect.Text = "Proiect Properties";
this.tabPage_Proiect.UseVisualStyleBackColor = true;
//
+ // proiectt_textBox4
+ //
+ this.proiectt_textBox4.Location = new System.Drawing.Point(94, 85);
+ this.proiectt_textBox4.Name = "proiectt_textBox4";
+ this.proiectt_textBox4.Size = new System.Drawing.Size(298, 20);
+ this.proiectt_textBox4.TabIndex = 7;
+ this.proiectt_textBox4.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged);
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(5, 92);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(48, 13);
+ this.label5.TabIndex = 6;
+ this.label5.Text = "Version :";
+ //
// proiectt_textBox3
//
this.proiectt_textBox3.Location = new System.Drawing.Point(94, 59);
@@ -524,22 +546,23 @@
this.label2.TabIndex = 0;
this.label2.Text = "Name :";
//
- // label5
+ // skint_comboBox1
//
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(5, 92);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(48, 13);
- this.label5.TabIndex = 6;
- this.label5.Text = "Version :";
+ this.skint_comboBox1.FormattingEnabled = true;
+ this.skint_comboBox1.Location = new System.Drawing.Point(6, 30);
+ this.skint_comboBox1.Name = "skint_comboBox1";
+ this.skint_comboBox1.Size = new System.Drawing.Size(141, 21);
+ this.skint_comboBox1.TabIndex = 0;
+ this.skint_comboBox1.TextChanged += new System.EventHandler(this.tab_skin_change);
//
- // proiectt_textBox4
+ // label6
//
- this.proiectt_textBox4.Location = new System.Drawing.Point(94, 85);
- this.proiectt_textBox4.Name = "proiectt_textBox4";
- this.proiectt_textBox4.Size = new System.Drawing.Size(298, 20);
- this.proiectt_textBox4.TabIndex = 7;
- this.proiectt_textBox4.TextChanged += new System.EventHandler(this.proiectt_textBox1_TextChanged);
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(6, 14);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(34, 13);
+ this.label6.TabIndex = 1;
+ this.label6.Text = "Skin :";
//
// Form1
//
@@ -556,6 +579,8 @@
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.contextMenuStrip1.ResumeLayout(false);
+ this.tabPage_Skin.ResumeLayout(false);
+ this.tabPage_Skin.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage_Text.ResumeLayout(false);
this.tabPage_Text.PerformLayout();
@@ -622,6 +647,8 @@
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox proiectt_textBox4;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.ComboBox skint_comboBox1;
}
}
Modified: trunk/plugins/mpinstaler/MPInstaler/Form1.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/Form1.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -8,6 +8,7 @@
using System.Xml;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
+using MediaPortal.Configuration;
namespace MPInstaler
{
@@ -103,9 +104,9 @@
foreach (string fil in openFileDialog1.FileNames)
switch (type)
{
- case 1: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_TYPE, MPinstalerStruct.SKIN_XML_SUBTYPE, Path.GetFullPath(fil), "02010","");
+ case 1: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_TYPE, "BlueTwo", Path.GetFullPath(fil), "02010", "");
break;
- case 2: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_MEDIA_TYPE, MPinstalerStruct.SKIN_XML_SUBTYPE, Path.GetFullPath(fil), "02020","");
+ case 2: addrow(Path.GetFileName(fil), MPinstalerStruct.SKIN_MEDIA_TYPE, "BlueTwo", Path.GetFullPath(fil), "02020", "");
break;
default:
break;
@@ -258,6 +259,46 @@
textt_comboBox1.Items.Add(MPinstalerStruct.TEXT_LOG_TYPE);
textt_comboBox1.Items.Add(MPinstalerStruct.TEXT_README_TYPE);
textt_comboBox1.Items.Add(MPinstalerStruct.TEXT_EULA_TYPE);
+ skint_comboBox1.Items.Clear();
+ string SkinDirectory = Config.GetFolder(Config.Dir.Skin);
+ if (Directory.Exists(SkinDirectory))
+ {
+ string[] skinFolders = Directory.GetDirectories(SkinDirectory, "*.*");
+
+ foreach (string skinFolder in skinFolders)
+ {
+ bool isInvalidDirectory = false;
+ string[] invalidDirectoryNames = new string[] { "cvs" };
+
+ string directoryName = skinFolder.Substring(SkinDirectory.Length + 1);
+
+ if (directoryName != null && directoryName.Length > 0)
+ {
+ foreach (string invalidDirectory in invalidDirectoryNames)
+ {
+ if (invalidDirectory.Equals(directoryName.ToLower()))
+ {
+ isInvalidDirectory = true;
+ break;
+ }
+ }
+
+ if (isInvalidDirectory == false)
+ {
+ //
+ // Check if we have a home.xml located in the directory, if so we consider it as a
+ // valid skin directory
+ //
+ string filename = Path.Combine(SkinDirectory, Path.Combine(directoryName, "references.xml"));
+ if (File.Exists(filename))
+ {
+ skint_comboBox1.Items.Add(directoryName);
+ }
+ }
+ }
+ }
+ }
+
}
private void bossview_SelectedIndexChanged(object sender, EventArgs e)
@@ -270,11 +311,12 @@
tabControl1.Controls.Add(tabPage_Plugin);
tabControl1.Controls.Add(tabPage_Proiect);
}
- if (bossview.SelectedItems[0].SubItems[1].Text == MPinstalerStruct.SKIN_TYPE)
+ if (bossview.SelectedItems[0].SubItems[1].Text == MPinstalerStruct.SKIN_TYPE || bossview.SelectedItems[0].SubItems[1].Text == MPinstalerStruct.SKIN_MEDIA_TYPE)
{
tabControl1.Controls.Clear();
tabControl1.Controls.Add(tabPage_Skin);
tabControl1.Controls.Add(tabPage_Proiect);
+ skint_comboBox1.Text = bossview.SelectedItems[0].SubItems[2].Text;
}
if (bossview.SelectedItems[0].SubItems[1].Text == MPinstalerStruct.TEXT_TYPE)
{
@@ -311,6 +353,14 @@
}
}
+ private void tab_skin_change(object sender, EventArgs e)
+ {
+ if (bossview.SelectedItems.Count > 0)
+ {
+ bossview.SelectedItems[0].SubItems[2].Text =skint_comboBox1.Text;
+ }
+ }
+
private void proiectt_textBox1_TextChanged(object sender, EventArgs e)
{
if (!_loading)
Modified: trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/MPInstaler.csproj 2007-02-25 14:59:25 UTC (rev 139)
@@ -36,6 +36,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -125,6 +126,10 @@
<SubType>Designer</SubType>
<DependentUpon>start_form.cs</DependentUpon>
</EmbeddedResource>
+ <EmbeddedResource Include="wizard\controlp.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>controlp.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="wizard\wizard_1.resx">
<SubType>Designer</SubType>
<DependentUpon>wizard_1.cs</DependentUpon>
@@ -133,6 +138,7 @@
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
+ <None Include="app.config" />
<None Include="MPInstaler_TemporaryKey.pfx" />
<BaseApplicationManifest Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
@@ -156,6 +162,12 @@
<Compile Include="start_form.Designer.cs">
<DependentUpon>start_form.cs</DependentUpon>
</Compile>
+ <Compile Include="wizard\controlp.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="wizard\controlp.Designer.cs">
+ <DependentUpon>controlp.cs</DependentUpon>
+ </Compile>
<Compile Include="wizard\wizard_1.cs">
<SubType>Form</SubType>
</Compile>
Modified: trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/MPinstalerStruct.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -9,7 +9,9 @@
using System.Xml;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
+using MediaPortal.Configuration;
+
namespace MPInstaler
{
public class MPinstalerStruct
@@ -183,7 +185,9 @@
s.PutNextEntry(entry);
s.Write(buffer, 0, buffer.Length);
+ ls.Items.Add("Added file :" + GetZipEntry(file));
}
+ else ls.Items.Add("Error : File not found !");
}
if (File.Exists(ProiectdFileName))
@@ -285,9 +289,53 @@
return ret;
}
+
+ public static string GetDirEntry(MPIFileList flst)
+ {
+ string ret = string.Empty;
+ if (flst.Type == PLUGIN_TYPE)
+ {
+ ret = Config.GetFolder(Config.Dir.Plugins) + @"\";
+ switch (flst.SubType)
+ {
+ case PLUGIN_WINDOW_SUBTYPE:
+ ret += "Windows";
+ break;
+ case PLUGIN_PLAYER_SUBTYPE:
+ ret += "ExternalPlayers";
+ break;
+ case PLUGIN_PROCESS_SUBTYPE:
+ ret += "Process";
+ break;
+ case PLUGIN_SUBTITLE_SUBTYPE:
+ ret += "Subtitle";
+ break;
+ case PLUGIN_TAGREADER_SUBTYPE:
+ ret += "TagReaders";
+ break;
+
+ }
+ ret += @"\" + Path.GetFileName(flst.FileName);
+ }
+
+ if (flst.Type == SKIN_TYPE)
+ {
+ ret = Config.GetFolder(Config.Dir.Skin) + @"\"+ flst.SubType + @"\" + Path.GetFileName(flst.FileName);
+ }
+
+ if (flst.Type == SKIN_MEDIA_TYPE)
+ {
+ ret = Config.GetFolder(Config.Dir.Skin) + @"\" + flst.SubType + @"\" + "Media" + @"\" + Path.GetFileName(flst.FileName);
+ }
+
+ if (flst.Type == TEXT_TYPE)
+ {
+ ret = Config.GetFolder(Config.Dir.Base) + @"\" + Path.GetFileName(flst.FileName);
+ }
+ return ret;
+ }
}
-
public class MPIFileList
{
string _FileName = string.Empty;
Modified: trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/MPpackageStruct.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -1,8 +1,12 @@
using System;
using System.Collections.Generic;
+using System.Collections;
using System.Text;
using System.IO;
+using System.Xml;
using ICSharpCode.SharpZipLib.Zip;
+using System.Windows.Forms;
+using MediaPortal.Configuration;
namespace MPInstaler
{
@@ -21,7 +25,56 @@
txt_readme = String.Empty;
}
-
+
+ public void instal_file(ProgressBar pb, MPIFileList fl)
+ {
+ string fil = FileName;
+ byte[] data = new byte[2048];
+ int nb = data.Length;
+ ZipEntry entry;
+ try
+ {
+ if (File.Exists(fil))
+ {
+ ZipInputStream s = new ZipInputStream(File.OpenRead(fil));
+ while ((entry = s.GetNextEntry()) != null)
+ {
+ //MessageBox.Show(entry.Name);
+ if (Path.GetFileName(entry.Name) ==Path.GetFileName(fl.FileName))
+ {
+ string tpf =Path.GetFullPath(MPinstalerStruct.GetDirEntry(fl)) ;
+ //MessageBox.Show(tpf);
+ FileStream fs = new FileStream(tpf, FileMode.Create);
+ if (pb != null)
+ {
+ pb.Minimum = 0;
+ pb.Maximum = (int)entry.Size;
+ pb.Value = 0;
+ }
+ while ((nb = s.Read(data, 0, data.Length)) > 0)
+ {
+ if (pb != null)
+ {
+ //MessageBox.Show(String.Format("{0} {1} {2}",pb.Minimum,pb.Value,pb.Maximum));
+ pb.Value += nb;
+ pb.Refresh();
+ pb.Update();
+ }
+ fs.Write(data, 0, nb);
+ }
+ fs.Close();
+ }
+ }
+ s.Close();
+ load();
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message);
+ }
+ }
+
public void load()
{
if (isValid)
@@ -108,4 +161,105 @@
}
}
}
+
+ public class MPInstallHelper
+ {
+ public ArrayList lst = new ArrayList();
+ string InstalDir = Config.GetFolder(Config.Dir.Base) + @"\" + "Instaler";
+ string FileName = "";
+ public MPInstallHelper()
+ {
+ FileName = InstalDir + @"\" + "config.xml";
+ if (!Directory.Exists(InstalDir))
+ {
+ Directory.CreateDirectory(InstalDir);
+ }
+ //LoadFromFile();
+ }
+
+ public void Add(MPpackageStruct pk)
+ {
+ lst.Add(pk);
+ File.Copy(pk.FileName,InstalDir+@"\"+Path.GetFileName(pk.FileName),true);
+ }
+
+ public void SaveToFile()
+ {
+ Stream myStream;
+ if ((myStream = File.Open(FileName, FileMode.Create, FileAccess.Write, FileShare.None)) != null)
+ {
+ // Code to write the stream goes here.
+ XmlDocument doc = new XmlDocument();
+ XmlWriter writer = null;
+ try
+ {
+ // Create an XmlWriterSettings object with the correct options.
+ XmlWriterSettings settings = new XmlWriterSettings();
+ string st = string.Empty;
+ settings.Indent = true;
+ settings.IndentChars = ("\t");
+ settings.OmitXmlDeclaration = true;
+ // Create the XmlWriter object and write some content.
+ writer = XmlWriter.Create(myStream, settings);
+ writer.WriteStartElement("MPinstalerS");
+ writer.WriteElementString("ver", "1.00.000");
+ writer.WriteStartElement("ExtensionList");
+ for (int i = 0; i < this.lst.Count; i++)
+ {
+ MPpackageStruct it = (MPpackageStruct)this.lst[i];
+ writer.WriteStartElement("Extension");
+ writer.WriteElementString("FileName", Path.GetFileName(it.FileName));
+ writer.WriteElementString("Name", it._intalerStruct.Name);
+ writer.WriteElementString("URL", it._intalerStruct.UpdateURL);
+ writer.WriteElementString("Version", it._intalerStruct.Version);
+ writer.WriteElementString("Author", it._intalerStruct.Author);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ writer.WriteStartElement("Option");
+ writer.WriteEndElement();
+ writer.WriteEndElement();
+ writer.Flush();
+ }
+ finally
+ {
+ if (writer != null)
+ writer.Close();
+ }
+ myStream.Close();
+ }
+ }
+
+ public void LoadFromFile()
+ {
+ XmlDocument doc = new XmlDocument();
+ if (File.Exists(FileName))
+ {
+ doc.Load(FileName);
+ lst.Clear();
+ XmlNode ver = doc.DocumentElement.SelectSingleNode("/MPinstalerS");
+ XmlNodeList fileList = ver.SelectNodes("ExtensionList/Extension");
+ foreach (XmlNode nodefile in fileList)
+ {
+ MPpackageStruct pkg = new MPpackageStruct();
+ pkg.FileName = nodefile.SelectSingleNode("FileName").InnerText;
+ pkg._intalerStruct.Name = nodefile.SelectSingleNode("Name").InnerText;
+ pkg._intalerStruct.Author = nodefile.SelectSingleNode("Author").InnerText;
+ pkg._intalerStruct.Version = nodefile.SelectSingleNode("Version").InnerText;
+ pkg._intalerStruct.UpdateURL = nodefile.SelectSingleNode("URL").InnerText;
+ this.lst.Add(pkg);
+ }
+ //XmlNode nodeoption = ver.SelectSingleNode("Option");
+ //this.BuildFileName = nodeoption.SelectSingleNode("BuildFileName").InnerText;
+ }
+ }
+
+ }
+
+ public class MPInstallHelperStruct
+ {
+ public MPInstallHelperStruct()
+ {
+ }
+ }
}
Modified: trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/start_form.Designer.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -62,10 +62,10 @@
this.button3.TabIndex = 2;
this.button3.Text = "Control panel";
this.button3.UseVisualStyleBackColor = true;
+ this.button3.Click += new System.EventHandler(this.button3_Click);
//
// openFileDialog1
//
- this.openFileDialog1.FileName = "openFileDialog1";
this.openFileDialog1.Filter = "MPI files|*.mpi|ZIP files|*.zip|All files|*.*";
//
// start_form
Modified: trunk/plugins/mpinstaler/MPInstaler/start_form.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/start_form.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/start_form.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -39,12 +39,20 @@
wiz.package.LoadFromFile(fil);
if (wiz.package.isValid)
{
- wiz.nextStep();
+ wiz.nextStep(1);
}
else
MessageBox.Show("Invalid package !");
}
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ controlp cnt = new controlp();
+ this.Hide();
+ cnt.ShowDialog();
+ this.Show();
+ }
}
}
\ No newline at end of file
Added: trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.Designer.cs (rev 0)
+++ trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.Designer.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -0,0 +1,154 @@
+namespace MPInstaler
+{
+ partial class controlp
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.listView1 = new System.Windows.Forms.ListView();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.button3 = new System.Windows.Forms.Button();
+ this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
+ this.button4 = new System.Windows.Forms.Button();
+ this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
+ this.SuspendLayout();
+ //
+ // listView1
+ //
+ this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader1,
+ this.columnHeader2,
+ this.columnHeader3,
+ this.columnHeader4});
+ this.listView1.GridLines = true;
+ this.listView1.HideSelection = false;
+ this.listView1.Location = new System.Drawing.Point(-1, -3);
+ this.listView1.Name = "listView1";
+ this.listView1.Size = new System.Drawing.Size(632, 304);
+ this.listView1.TabIndex = 0;
+ this.listView1.UseCompatibleStateImageBehavior = false;
+ this.listView1.View = System.Windows.Forms.View.Details;
+ //
+ // button1
+ //
+ this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.button1.Enabled = false;
+ this.button1.Location = new System.Drawing.Point(12, 321);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 1;
+ this.button1.Text = "Uninstall";
+ this.button1.UseVisualStyleBackColor = true;
+ //
+ // button2
+ //
+ this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.button2.Location = new System.Drawing.Point(542, 321);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(75, 23);
+ this.button2.TabIndex = 2;
+ this.button2.Text = "Close";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // button3
+ //
+ this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.button3.Enabled = false;
+ this.button3.Location = new System.Drawing.Point(104, 321);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(75, 23);
+ this.button3.TabIndex = 3;
+ this.button3.Text = "Update";
+ this.button3.UseVisualStyleBackColor = true;
+ //
+ // columnHeader1
+ //
+ this.columnHeader1.Text = "Name";
+ this.columnHeader1.Width = 179;
+ //
+ // columnHeader2
+ //
+ this.columnHeader2.Text = "Author";
+ this.columnHeader2.Width = 194;
+ //
+ // columnHeader3
+ //
+ this.columnHeader3.Text = "Version";
+ this.columnHeader3.Width = 202;
+ //
+ // button4
+ //
+ this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.button4.Location = new System.Drawing.Point(196, 321);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(75, 23);
+ this.button4.TabIndex = 4;
+ this.button4.Text = "Reinstal";
+ this.button4.UseVisualStyleBackColor = true;
+ //
+ // columnHeader4
+ //
+ this.columnHeader4.Text = "File";
+ //
+ // controlp
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(629, 366);
+ this.Controls.Add(this.button4);
+ this.Controls.Add(this.button3);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.listView1);
+ this.Name = "controlp";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+ this.Text = "Control panel";
+ this.Shown += new System.EventHandler(this.controlp_Shown);
+ this.Load += new System.EventHandler(this.controlp_Load);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ListView listView1;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.ColumnHeader columnHeader1;
+ private System.Windows.Forms.ColumnHeader columnHeader2;
+ private System.Windows.Forms.ColumnHeader columnHeader3;
+ private System.Windows.Forms.ColumnHeader columnHeader4;
+ private System.Windows.Forms.Button button4;
+ }
+}
\ No newline at end of file
Added: trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs (rev 0)
+++ trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace MPInstaler
+{
+ public partial class controlp : Form
+ {
+ public MPInstallHelper lst = new MPInstallHelper();
+ public controlp()
+ {
+ InitializeComponent();
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void controlp_Load(object sender, EventArgs e)
+ {
+ listView1.Items.Clear();
+ lst.LoadFromFile();
+ LoadToListview();
+ }
+ private void controlp_Shown(object sender, EventArgs e)
+ {
+
+ }
+ public void LoadToListview()
+ {
+ listView1.Items.Clear();
+ for (int i = 0; i < lst.lst.Count; i++)
+ {
+ MPpackageStruct pk = (MPpackageStruct)lst.lst[i];
+ ListViewItem item1 = new ListViewItem(pk._intalerStruct.Name, 0);
+ item1.SubItems.Add(pk._intalerStruct.Author);
+ item1.SubItems.Add(pk._intalerStruct.Version);
+ item1.SubItems.Add(Path.GetFileName(pk.FileName));
+ listView1.Items.AddRange(new ListViewItem[] { item1 });
+ MessageBox.Show(pk.FileName);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.resx
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.resx (rev 0)
+++ trunk/plugins/mpinstaler/MPInstaler/wizard/controlp.resx 2007-02-25 14:59:25 UTC (rev 139)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
Modified: trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.Designer.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -30,14 +30,16 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(wizard_1));
this.panel1 = new System.Windows.Forms.Panel();
+ 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.richTextBox1 = new System.Windows.Forms.RichTextBox();
- this.title_label = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@@ -46,6 +48,8 @@
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
+ 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);
@@ -54,6 +58,49 @@
this.panel1.Size = new System.Drawing.Size(334, 298);
this.panel1.TabIndex = 0;
//
+ // 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(313, 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);
@@ -81,6 +128,7 @@
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
//
@@ -100,36 +148,8 @@
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);
//
- // 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 = "";
- //
- // 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(313, 30);
- this.title_label.TabIndex = 1;
- this.title_label.Text = "label1";
- //
- // 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";
- //
// wizard_1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -165,5 +185,7 @@
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label title_label;
private System.Windows.Forms.RichTextBox richTextBox1;
+ private System.Windows.Forms.ProgressBar progressBar2;
+ private System.Windows.Forms.ProgressBar progressBar1;
}
}
\ No newline at end of file
Modified: trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs
===================================================================
--- trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs 2007-02-25 14:14:27 UTC (rev 138)
+++ trunk/plugins/mpinstaler/MPInstaler/wizard/wizard_1.cs 2007-02-25 14:59:25 UTC (rev 139)
@@ -5,6 +5,7 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
+using MediaPortal.Configuration;
namespace MPInstaler
{
@@ -18,25 +19,30 @@
InitializeComponent();
}
- public void nextStep()
+ public void nextStep(int m)
{
- step++;
- test_next_step();
+ step+=m;
+ test_next_step(m);
switch (step)
{
case 1:
{
this.Text = "MediaPortal extension instaler";
button_back.Visible = false;
+ progressBar1.Visible = false;
+ progressBar2.Visible = false;
title_label.Text = package._intalerStruct.Name;
label2.Visible = false;
+ button_next.Text = "Next";
richTextBox1.Text = String.Format(" Name : {0} \n\n Author : {1} \n\n Version : {2}", package._intalerStruct.Name,package._intalerStruct.Author,package._intalerStruct.Version);
- this.ShowDialog();
+ if (!this.Visible) this.ShowDialog();
break;
}
case 2:
{
label2.Visible = true;
+ progressBar1.Visible = false;
+ progressBar2.Visible = false;
label2.Text = "License Agreement";
button_next.Text = "I Agree";
button_back.Visible = true;
@@ -46,6 +52,8 @@
case 3:
{
label2.Visible = true;
+ progressBar1.Visible = false;
+ progressBar2.Visible = false;
label2.Text = "Change log";
button_next.Text = "Next";
button_back.Visible = true;
@@ -54,6 +62,8 @@
}
case 4:
{
+ progressBar1.Visible = false;
+ progressBar2.Visible = false;
label2.Visible = true;
label2.Text = "Read me";
button_back.Visible = true;
@@ -62,29 +72,59 @@
}
case 5:
{
+ progressBar1.Visible = false;
+ progressBar2.Visible = false;
label2.Visible = true;
label2.Text = "Instaling ...";
button_next.Text = "Next";
button_back.Visible = true;
- richTextBox1.Text = "";
+ richTextBox1.Text = String.Format("Intall paths : \nPlugins : {0}\nSkin : {1}", Config.GetFolder(Config.Dir.Plugins), Config.GetFolder(Config.Dir.Skin));
break;
}
case 6:
{
label2.Visible = true;
+ progressBar1.Visible = true;
+ progressBar2.Visible = true;
label2.Text = "Instaling ...";
button_next.Visible = false;
button_back.Visible = true;
richTextBox1.Text = "";
richTextBox1.Visible = false;
+ install();
break;
}
}
}
- private void test_next_step()
+ private void install()
{
+ MPInstallHelper inst = new MPInstallHelper();
+ 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,(MPIFileList) package._intalerStruct.FileList[i]);
+ progressBar1.Value++;
+ this.Refresh();
+ this.Update();
+ }
+ button_next.Visible = false;
+ button_cancel.Enabled = true;
+ inst.Add(package);
+ inst.SaveToFile();
+ button_cancel.Text = "Finish";
+ }
+
+ private void test_next_step(int m)
+ {
switch (step)
{
case 1:
@@ -92,22 +132,22 @@
case 2:
if (String.IsNullOrEmpty(package.txt_EULA))
{
- step++;
- test_step();
+ step+=m;
+ test_next_step(m);
}
break;
case 3:
if (String.IsNullOrEmpty(package.txt_log))
{
- step++;
- test_step();
+ step+=m;
+ test_next_step(m);
}
break;
case 4:
if (String.IsNullOrEmpty(package.txt_readme))
{
- step++;
- test_step();
+ step+=m;
+ test_next_step(m);
}
break;
default:
@@ -117,7 +157,17 @@
private void button_next_Click(object sender, EventArgs e)
{
- nextStep();
+ nextStep(1);
}
+
+ private void button_cancel_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void button_back_Click(object sender, EventArgs e)
+ {
+ nextStep(-1);
+ }
}
}
\ No newline at end of file
Modified: trunk/plugins/mpinstaler/MPInstaler.suo
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|