Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to open a IE from a cs file Pin
vamsimohan2122-Mar-06 20:53
vamsimohan2122-Mar-06 20:53 
QuestionI got a problem in using DataAccess Application Block to update database Pin
seeger12322-Mar-06 13:28
seeger12322-Mar-06 13:28 
AnswerRe: I got a problem in using DataAccess Application Block to update database Pin
DaBears23-Mar-06 11:26
DaBears23-Mar-06 11:26 
QuestionShow an .m2 format file in a form. Pin
AeQuitaZ22-Mar-06 13:09
AeQuitaZ22-Mar-06 13:09 
AnswerRe: Show an .m2 format file in a form. Pin
LongRange.Shooter23-Mar-06 4:44
LongRange.Shooter23-Mar-06 4:44 
QuestionHow to get rid of the DataGridView selection margin Pin
Marc Clifton22-Mar-06 10:46
mvaMarc Clifton22-Mar-06 10:46 
AnswerNever mind--RowHeadersVisible! Pin
Marc Clifton22-Mar-06 10:51
mvaMarc Clifton22-Mar-06 10:51 
QuestionDLL Not Found Problem! Pin
LongRange.Shooter22-Mar-06 10:30
LongRange.Shooter22-Mar-06 10:30 
I'm doing a custom install action program which is designed to implement the just-copied DLL's in the GAC. The DLL compiles without a problem. The install program compiles without a problem. No warning for either program. Yet when Setup goes to execute my DLL, it says the DLL or one of its' dependants cannot be found. (sigh) I even verified that the install project is packaging the DLL and its debug package correctly and it is. I'm at a loss. Here is the code I've deployed:

C#
using System;
using System.ComponentModel;
using System.Configuration;
using System.Configuration.Install;
using System.Diagnostics;
using System.IO;


namespace RegisterComponent
{
	/// <summary>
	/// Provides the custom actions for installing the PL Core components
	/// </summary>
	[RunInstaller(true)]
	public class RegisterComponent:Installer
	{

		string dllPath;
		
		#region ..ctor Implementation

		public new void Dispose()
		{
			this.Dispose(true);
			GC.SuppressFinalize(this);
		}
		public new void Dispose(bool disposing)
		{
			if (disposing) 
			{}
			base.Dispose(disposing);
		}

		#endregion

		#region Custom Install Actions

		/// <summary>
		/// Registers the DLL's in the GAC
		/// </summary>
		/// <param name="stateSaver"></param>
		public override void Install(System.Collections.IDictionary stateSaver)
		{
			try
			{
				this.dllPath = this.Context.Parameters["parm"];
				System.Diagnostics.Trace.WriteLine("Saving the Path of the core components", "RegistrationInstaller");
				stateSaver.Add("Path", dllPath);  // saves the users path for uninstall
				System.Diagnostics.Trace.WriteLine("Performing the base install", "RegistrationInstaller");
				base.Install (stateSaver);

				// now that files are all installed, register the components in the GAC
				System.Diagnostics.Trace.WriteLine("Creating the file for GAC registration", "RegistrationInstaller");
				using (StreamWriter gacutil = File.CreateText(dllPath+"install.cmd") )
				{
					gacutil.WriteLine("Echo off");
					gacutil.WriteLine(@"PATH C:\Winnt\Microsoft.NET\Framework\v1.1.3705");
					gacutil.WriteLine(String.Format(@"gacutil /ir FILEPATH {0}\Components\plcorecommon.dll ""Common Methods 1.1""",dllPath));
					gacutil.WriteLine(String.Format(@"gacutil /ir FILEPATH {0}\Components\plcoredbclient.dll ""DB Client Methods 1.1""",dllPath));
					gacutil.WriteLine(String.Format(@"gacutil /ir FILEPATH {0}\Components\plcoreweb.dll ""Remote Methods""",dllPath));
					gacutil.WriteLine(String.Format(@"gacutil /ir FILEPATH {0}\Components\plcorewebdb.dll ""Remote DB Methods""",dllPath));

				}

				// launch the batch process to register the dll's in the GAC
				System.Diagnostics.Trace.WriteLine("Starting the process to register the GAC", "RegistrationInstaller");
				Process install = Process.Start(String.Concat(dllPath, "install.cmd"));
				install.WaitForExit();
				install.Close();
				//File.Delete(dllPath+"install.cmd");
				System.Diagnostics.Trace.WriteLine("GAC Registration complete.", "RegistrationInstaller");
			}
			catch (Exception e)
			{
				string msg = "Error creating/running GAC utility bat file: " + e.Message+System.Environment.NewLine
					+ e.StackTrace;
				this.Context.LogMessage(msg);
			}
		}
		#endregion

		#region Uninstall Actions
		/// <summary>
		/// Uninstalls the DLL's from the GAC
		/// </summary>
		/// <param name="savedState"></param>
		public override void Uninstall(System.Collections.IDictionary savedState)
		{
			try
			{
				dllPath = savedState["Path"].ToString();
				using (StreamWriter gacutil = File.CreateText(dllPath+"install.cmd") )
				{
					gacutil.WriteLine("Echo off");
					gacutil.WriteLine(@"PATH C:\Winnt\Microsoft.NET\Framework\v1.1.3705");
					gacutil.WriteLine(String.Format(@"gacutil /ur FILEPATH {0}\Components\plcorecommon.dll ""Common Methods 1.1""",dllPath));
					gacutil.WriteLine(String.Format(@"gacutil /ur FILEPATH {0}\Components\plcoredbclient.dll ""DB Client Methods 1.1""",dllPath));
					gacutil.WriteLine(String.Format(@"gacutil /ur FILEPATH {0}\Components\plcoreweb.dll ""Remote Methods""",dllPath));
					gacutil.WriteLine(String.Format(@"gacutil /ur FILEPATH {0}\Components\plcorewebdb.dll ""Remote DB Methods""",dllPath));

				}

				// launch the batch process to unregister the files in the GAC
				Process uninstall = Process.Start( String.Concat(dllPath, "install.cmd") );
				uninstall.WaitForExit();
				uninstall.Close();

				//File.Delete(String.Concat(dllPath, "install.cmd");
			
				// with the files now removed from the GAC, the uninstall can begin.
				base.Uninstall (savedState);
			}
			catch (Exception e)
			{
				string msg = "Error creating/running deregistration bat file: " + e.Message+System.Environment.NewLine
					+ e.StackTrace;
				this.Context.LogMessage(msg);
				base.Uninstall(savedState);
			}
		}
		#endregion

	}
}


Help!!
AnswerRe: DLL Not Found Problem! Pin
leppie22-Mar-06 19:53
leppie22-Mar-06 19:53 
GeneralRe: DLL Not Found Problem! Pin
LongRange.Shooter23-Mar-06 4:10
LongRange.Shooter23-Mar-06 4:10 
QuestionLanguage Problem Pin
snouto22-Mar-06 10:21
snouto22-Mar-06 10:21 
AnswerRe: Language Problem Pin
leppie22-Mar-06 19:57
leppie22-Mar-06 19:57 
Questionclient application Pin
haseeb_saeed22-Mar-06 9:35
haseeb_saeed22-Mar-06 9:35 
AnswerRe: client application Pin
Ed.Poore22-Mar-06 10:25
Ed.Poore22-Mar-06 10:25 
AnswerRe: client application Pin
snouto22-Mar-06 10:29
snouto22-Mar-06 10:29 
QuestionTransprency image on Pocket PC Pin
bouli22-Mar-06 9:34
bouli22-Mar-06 9:34 
QuestionUsing DataRelation for DataBindings backwards? Pin
bobbyn31422-Mar-06 9:31
bobbyn31422-Mar-06 9:31 
QuestionDesigner Question Pin
Marc Clifton22-Mar-06 9:28
mvaMarc Clifton22-Mar-06 9:28 
QuestionHow Do We Create a Checker Game? Pin
jeff1922-Mar-06 9:14
jeff1922-Mar-06 9:14 
AnswerRe: How Do We Create a Checker Game? Pin
DigitalKing22-Mar-06 18:40
DigitalKing22-Mar-06 18:40 
GeneralRe: How Do We Create a Checker Game? Pin
Member 156244864-May-22 5:17
Member 156244864-May-22 5:17 
QuestionHiding a Tab Control Pin
Franz Klein22-Mar-06 9:11
Franz Klein22-Mar-06 9:11 
AnswerRe: Hiding a Tab Control Pin
jonas_berg22-Mar-06 10:05
jonas_berg22-Mar-06 10:05 
AnswerRe: Hiding a Tab Control Pin
Ed.Poore22-Mar-06 10:06
Ed.Poore22-Mar-06 10:06 
QuestionProgressive vs. Baseline JPEG Pin
SylvesterW22-Mar-06 9:10
SylvesterW22-Mar-06 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.