7 messages in com.googlegroups.google-desktop-developerRe: Help needed installing C# sample ...
FromSent OnAttachments
Jocker06 Feb 2006 09:03 
poz06 Feb 2006 09:56 
Jocker06 Feb 2006 13:45 
Sameer07 Feb 2006 21:04 
Jocker08 Feb 2006 01:18 
bren...@yahoo.com26 Feb 2006 08:28 
Jocker27 Feb 2006 03:07 
Subject:Re: Help needed installing C# sample plugin
From:Jocker (jock@gmail.com)
Date:02/27/2006 03:07:00 AM
List:com.googlegroups.google-desktop-developer

here is an extract from my InnoSetup installer: [Files] Source: ..\bin\Release\FileGenerico.dll; DestDir: {app}; Flags: ignoreversion Source: ..\bin\Release\gdJeniuSPlugin.dll; DestDir: {app}; Flags: ignoreversion Source: ..\bin\Release\Interop.GoogleDesktopAPI2.dll; DestDir: {app}; Flags: ignoreversion Source: ..\bin\Release\Interop.GoogleDesktopDisplay.dll; DestDir: {app}; Flags: ignoreversion Source: ..\bin\Release\PluginRegistration.exe; DestDir: {app}; Flags: ignoreversion Source: ..\bin\Release\stdole.dll; DestDir: {app}; Flags: ignoreversion [Icons] Name: {group}\{cm:UninstallProgram,JeniuS GD plugin }; Filename: {uninstallexe} [Run] Filename: {app}\PluginRegistration.exe; Parameters: -unregister; WorkingDir: {app}; StatusMsg: Unregistering previous plugins (if any); Flags: runhidden Filename: {app}\PluginRegistration.exe; Parameters: -register; WorkingDir: {app}; StatusMsg: Registering plugin.. Click on Yes on the confirmation dialog; Flags: runhidden [UninstallRun] Filename: {app}\PluginRegistration.exe; Parameters: -unregister; WorkingDir: {app}; Flags: runhidden

as you can see, at install/uninstall time PluginRegistration.exe is called. PluginRegistration.exe is a console application that executes the regasm tool found in the right folder of the .net framework.

using System; using System.Diagnostics;

namespace PluginRegistration { class PluginRegistration { static string gdAssemby = "gdJeniuSPlugin.dll";

[STAThread] static void Main(string[] args) { string arg = null; if (args != null && args.Length > 0) arg = args[0];

switch(arg) { case "-register": register(); break; case "-unregister": unregister(); break; default: printInstructions(); break; } }

static void printInstructions() { Console.WriteLine("JockerSoft JeniuS plugin for google desktop registration utility"); Console.WriteLine("USAGE: PluginRegistration.exe Params"); Console.WriteLine("Valid Params:"); Console.WriteLine(" -register"); Console.WriteLine(" -unregister"); }

static void register() { ProcessStartInfo psi = new ProcessStartInfo(getNetDir() + "regasm.exe", gdAssemby + " /codebase"); psi.WindowStyle = ProcessWindowStyle.Hidden;

Process.Start(psi); }

static void unregister() { ProcessStartInfo psi = new ProcessStartInfo(getNetDir() + "regasm.exe", "/unregister " + gdAssemby); psi.WindowStyle = ProcessWindowStyle.Hidden;

System.Diagnostics.Process.Start(psi); }

static string getNetDir() { string windir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.System); windir = System.IO.Path.GetDirectoryName(windir);

Version vers = Environment.Version; return windir + @"\Microsoft.NET\Framework\" + string.Format("v{0}.{1}.{2}", vers.Major, vers.Minor, vers.Build) + "\\"; } } }

Hope this helps