Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Mono.Addins.Setup/SetupService.cs: Added method for getting a

  registry from a package name.

* Mono.Addins.Setup/SetupTool.cs: Added some more help for the info
  command.

svn path=/trunk/mono-addins/; revision=136359
  • Loading branch information...
commit 7d1ebc5c10b1504164ddf32ee8791058fc160882 1 parent 55949c7
@slluis slluis authored
View
8 Mono.Addins.Setup/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-17 Lluis Sanchez Gual <lluis@novell.com>
+
+ * Mono.Addins.Setup/SetupService.cs: Added method for getting
+ a registry from a package name.
+
+ * Mono.Addins.Setup/SetupTool.cs: Added some more help for the
+ info command.
+
2009-06-04 Lluis Sanchez Gual <lluis@novell.com>
* Makefile.am:
View
44 Mono.Addins.Setup/Mono.Addins.Setup/SetupService.cs
@@ -34,6 +34,8 @@
using ICSharpCode.SharpZipLib.Zip;
using Mono.Addins.Description;
using Mono.Addins.Setup.ProgressMonitoring;
+using Microsoft.Win32;
+using System.Diagnostics;
namespace Mono.Addins.Setup
{
@@ -366,5 +368,47 @@ internal void ResetAddinInfo ()
if (Directory.Exists (RepositoryCachePath))
Directory.Delete (RepositoryCachePath, true);
}
+
+ public static AddinRegistry GetRegistryForPackage (string name)
+ {
+ string startupDir;
+ string regDir;
+ try {
+ if (System.IO.Path.DirectorySeparatorChar == '\\') {
+ // On windows, look for packages in the registry
+ RegistryKey fxFolderKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey (@"SOFTWARE\Mono\Mono.Addins\AddinRoots\" + name, false);
+ if (fxFolderKey != null) {
+ startupDir = fxFolderKey.GetValue ("RootPath") as string;
+ regDir = fxFolderKey.GetValue ("RegistryPath") as string;
+ fxFolderKey.Close ();
+ } else
+ return null;
+ }
+ else {
+ // On Unix, look for registry info using pkg-config
+ ProcessStartInfo pinfo = new ProcessStartInfo ("pkg-config","--variable=MonoAddinsRoot " + name);
+ pinfo.UseShellExecute = false;
+ pinfo.RedirectStandardOutput = true;
+ pinfo.RedirectStandardError = true;
+ Process proc = Process.Start (pinfo);
+ startupDir = proc.StandardOutput.ReadLine ();
+ proc.WaitForExit ();
+ if (proc.ExitCode != 0)
+ return null;
+
+ pinfo = new ProcessStartInfo ("pkg-config","--variable=MonoAddinsRegistry " + name);
+ pinfo.UseShellExecute = false;
+ pinfo.RedirectStandardOutput = true;
+ proc = Process.Start (pinfo);
+ regDir = proc.StandardOutput.ReadLine ();
+ proc.WaitForExit ();
+ if (proc.ExitCode != 0)
+ return null;
+ }
+ } catch {
+ return null;
+ }
+ return new AddinRegistry (regDir, startupDir);
+ }
}
}
View
9 Mono.Addins.Setup/Mono.Addins.Setup/SetupTool.cs
@@ -907,8 +907,13 @@ void CreateCommands ()
commands.Add (cmd);
cmd = new SetupCommand (cat, "info", null, new SetupCommandHandler (PrintAddinInfo));
- cmd.Description = "Prints information about an add-in.";
- cmd.AppendDesc ("Prints information about an add-in.");
+ cmd.Usage = "[addin-id|addin-file] [--xml] [--all] [--full] [--namespace <namespace>]";
+ cmd.Description = "Prints information about add-ins.";
+ cmd.AppendDesc ("Prints information about add-ins. Options:");
+ cmd.AppendDesc (" --xml: Dump the information using an XML format.");
+ cmd.AppendDesc (" --all: Dump information from all add-ins.");
+ cmd.AppendDesc (" --full: Include add-ins which don't define extension points.");
+ cmd.AppendDesc (" --namespace ns: Include only add-ins from the specified 'ns' namespace.");
commands.Add (cmd);
cat = "Packaging Commands";

0 comments on commit 7d1ebc5

Please sign in to comment.
Something went wrong with that request. Please try again.