Author: miguel
Date: 2007-11-21 23:31:55 -0500 (Wed, 21 Nov 2007)
New Revision: 90122
Modified:
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/AssemblyInstaller.cs
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/ComponentInstaller.cs
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/InstallContext.cs
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/Installer.cs
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/TransactedInstaller.cs
Log:
Implement basic installer functionality
Modified:
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/AssemblyInstaller.cs
===================================================================
---
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/AssemblyInstaller.cs
2007-11-22 04:31:38 UTC (rev 90121)
+++
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/AssemblyInstaller.cs
2007-11-22 04:31:55 UTC (rev 90122)
@@ -59,28 +59,24 @@
throw new NotImplementedException ();
}
- [MonoTODO]
public override void Commit (IDictionary savedState)
{
- throw new NotImplementedException ();
+ base.Commit (savedState);
}
- [MonoTODO]
public override void Install (IDictionary savedState)
{
- throw new NotImplementedException ();
+ base.Install (savedState);
}
- [MonoTODO]
public override void Rollback (IDictionary savedState)
{
- throw new NotImplementedException ();
+ base.Rollback (savedState);
}
- [MonoTODO]
public override void Uninstall (IDictionary savedState)
{
- throw new NotImplementedException ();
+ base.Uninstall (savedState);
}
public Assembly Assembly {
@@ -103,7 +99,7 @@
public override string HelpText {
get {
- throw new NotImplementedException ();
+ return base.HelpText;
}
}
public string Path {
Modified:
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/ComponentInstaller.cs
===================================================================
---
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/ComponentInstaller.cs
2007-11-22 04:31:38 UTC (rev 90121)
+++
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/ComponentInstaller.cs
2007-11-22 04:31:55 UTC (rev 90122)
@@ -33,17 +33,15 @@
{
public abstract class ComponentInstaller : Installer
{
- [MonoTODO]
protected ComponentInstaller () {
- throw new NotImplementedException ();
}
public abstract void CopyFromComponent (IComponent component);
-
- [MonoTODO]
+
+ [MonoTODO ("Mono always returns false")]
public virtual bool IsEquivalentInstaller (ComponentInstaller
otherInstaller)
{
- throw new NotImplementedException ();
+ return false;
}
}
}
Modified:
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/InstallContext.cs
===================================================================
---
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/InstallContext.cs
2007-11-22 04:31:38 UTC (rev 90121)
+++
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/InstallContext.cs
2007-11-22 04:31:55 UTC (rev 90122)
@@ -34,15 +34,21 @@
public class InstallContext
{
private StringDictionary parameters;
+ string log_file;
+ bool log = false;
- [MonoTODO]
- public InstallContext () {
- throw new NotImplementedException ();
+ public InstallContext ()
+ {
+ log_file = null;
+ log = false;
+ parameters = ParseCommandLine (new string [0]);
}
- [MonoTODO]
- public InstallContext (string logFilePath, string[]
commandLine) {
- throw new NotImplementedException ();
+ public InstallContext (string logFilePath, string[] commandLine)
+ {
+ log_file = logFilePath;
+ parameters = ParseCommandLine (commandLine);
+ log = IsParameterTrue ("LogtoConsole");
}
public StringDictionary Parameters {
@@ -51,22 +57,35 @@
}
}
- [MonoTODO]
public bool IsParameterTrue (string paramName)
{
- throw new NotImplementedException ();
+ return parameters [paramName] == "true";
}
- [MonoTODO]
public void LogMessage (string message)
{
- throw new NotImplementedException ();
+ if (log)
+ Console.WriteLine (message);
}
- [MonoTODO]
protected static StringDictionary ParseCommandLine (string[]
args)
{
- throw new NotImplementedException ();
+ StringDictionary d = new StringDictionary ();
+
+ foreach (string s in args){
+ int p = s.IndexOf ("=");
+ if (p == -1)
+ d [s] = "true";
+ else {
+ string key = s.Substring (0, p);
+ string value = s.Substring
(p+1).ToLower ();
+ if (value == "yes" || value == "true"
|| value == "1")
+ value = "true";
+
+ d [key] = value;
+ }
+ }
+ return d;
}
}
}
Modified:
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/Installer.cs
===================================================================
---
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/Installer.cs
2007-11-22 04:31:38 UTC (rev 90121)
+++
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/Installer.cs
2007-11-22 04:31:55 UTC (rev 90122)
@@ -34,10 +34,6 @@
namespace System.Configuration.Install
{
[DefaultEvent("AfterInstall")]
-#if (!NET_2_0)
- // .NET 2.0 (Community Preview) no longer has this attribute
- [Designer("Microsoft.VisualStudio.Configuration.InstallerDesigner, " +
Consts.AssemblyMicrosoft_VisualStudio, typeof(IRootDesigner))]
-#endif
public class Installer : Component
{
private InstallContext context;
@@ -45,9 +41,7 @@
private InstallerCollection installers;
internal Installer parent;
- [MonoTODO]
public Installer () {
- throw new NotImplementedException ();
}
[DesignerSerializationVisibility
(DesignerSerializationVisibility.Hidden)]
@@ -68,17 +62,12 @@
}
}
- [DesignerSerializationVisibility
(DesignerSerializationVisibility.Content)]
- [BrowsableAttribute(false)]
public InstallerCollection Installers {
get {
return installers;
}
}
- [TypeConverter
("System.Configuration.Design.InstallerParentConverter")]
- [DesignerSerializationVisibility
(DesignerSerializationVisibility.Hidden)]
- [BrowsableAttribute (true)]
public Installer Parent {
get {
return parent;
@@ -89,76 +78,68 @@
}
}
- [MonoTODO]
public virtual void Commit (IDictionary savedState)
{
- throw new NotImplementedException ();
}
- [MonoTODO]
public virtual void Install (IDictionary stateSaver)
{
- throw new NotImplementedException ();
}
- [MonoTODO]
protected virtual void OnAfterInstall (IDictionary savedState)
{
- throw new NotImplementedException ();
+ if (AfterInstall != null)
+ AfterInstall (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
protected virtual void OnAfterRollback (IDictionary savedState)
{
- throw new NotImplementedException ();
+ if (AfterRollback != null)
+ AfterRollback (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
protected virtual void OnAfterUninstall (IDictionary savedState)
{
- throw new NotImplementedException ();
+ if (AfterUninstall != null)
+ AfterUninstall (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
protected virtual void OnBeforeInstall (IDictionary savedState)
{
- throw new NotImplementedException ();
+ if (BeforeInstall != null)
+ BeforeInstall (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
protected virtual void OnBeforeRollback (IDictionary savedState)
{
- throw new NotImplementedException ();
+ if (BeforeRollback != null)
+ BeforeRollback (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
protected virtual void OnBeforeUninstall (IDictionary
savedState)
{
- throw new NotImplementedException ();
+ if (BeforeUninstall != null)
+ BeforeUninstall (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
protected virtual void OnCommitted (IDictionary savedState)
{
- throw new NotImplementedException ();
+ if (Committed != null)
+ Committed (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
protected virtual void OnCommitting (IDictionary savedState)
{
- throw new NotImplementedException ();
+ if (Committing != null)
+ Committing (this, new InstallEventArgs
(savedState));
}
- [MonoTODO]
public virtual void Rollback (IDictionary savedState)
{
- throw new NotImplementedException ();
}
- [MonoTODO]
public virtual void Uninstall (IDictionary savedState)
{
- throw new NotImplementedException ();
}
public event InstallEventHandler AfterInstall;
Modified:
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/TransactedInstaller.cs
===================================================================
---
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/TransactedInstaller.cs
2007-11-22 04:31:38 UTC (rev 90121)
+++
trunk/mcs/class/System.Configuration.Install/System.Configuration.Install/TransactedInstaller.cs
2007-11-22 04:31:55 UTC (rev 90122)
@@ -37,14 +37,14 @@
{
}
- [MonoTODO]
public override void Install (IDictionary savedState)
{
+ base.Install (savedState);
}
- [MonoTODO]
public override void Uninstall (IDictionary savedState)
{
+ base.Uninstall (savedState);
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches