Ramakrishna Neela

I have created one ATL project which has one COM object. To deply this I have created Setup project using VS 2005. I have added the Primary output of the ATL project to setup project also set the "registry" property to "vsdrpCOM". But when I run the setup on a different machine, my application is not working as expected.

If I run regsvr32 mydll.dll after the installation then my application is running as expected. Could anyone please help me whats wrong here

Also I'm looking for the steps to invoke bat file during installation.




Re: ClickOnce and Setup & Deployment Projects How to register a COM object during installation

SL-USA

Since you have a COM object it has to be registered on the machine you're using UNLESS you use the Reg Free COM option provided in VS2005. This way you don't have to register the dll on any machine that runs your app (the dll, obviously, needs to be part of your install):

http://msdn.microsoft.com/msdnmag/issues/05/04/RegFreeCOM/

The one thing I found is that you must mark the actual dll as OPTIONAL in the manifest (I use the MAGEUI.exe to update the manifest) or you will get an install error that the dll already exists in the application install cache folder.

Good luck!






Re: ClickOnce and Setup & Deployment Projects How to register a COM object during installation

Yu Guo – MSFT

Hi, Ramakrishna,

I am not sure how did you write your register method.

But I think you can write your custom action to register it in your commit method.

For example

Code Snippet

public override void Commit(System.Collections.IDictionary savedState)

{

base.Commit(savedState);

if (File.Exists(Context.Parameters["TargetPath"] + "mydll.dll"))

{

Process process = new Process();

process.StartInfo.FileName = "regsvr32";

process.StartInfo.Arguments = Context.Parameters["TargetPath"] + "mydll.dll";

process.Start();

}

}

Hopes this helps,

Regards






Re: ClickOnce and Setup & Deployment Projects How to register a COM object during installation

Yu Guo – MSFT

Hi, Ramakrishna,

Besides the above solution,
please read the following article,
How To Register COM Objects in Visual Studio .NET
And as described in this article,
please try “ComSelfReg”.
It works just like “regsvr32 yourdll” but much simpler.

Hopes this helps,
Regards