473,503 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Registering a custom DLL after deployment - advice?

I use "Click Once" Deployment from VS2005. Works like a charm. I have to
deploy a console app and an MS Access ADP. The console app invokes the ADP.
I copy the ADP to the application files to be deployed from the console app
and then use the Process obejct to invoke the ADP on the end User's
workstaion. Below in this post is the code I use in the console application.
Anyway, I have had to add some additional functionality to the ADP in the
form of a dll I wrote in .Net which uses .Net objects (sqlDataAdapter for
reading data from Sql Server, StreamWriter for writing data to a Text File).
The DLL works fine.

My plan is this: On deployment, I will deploy a copy of the DLL (and tlb)
file(s) and a .bat file for registering the dll on the end user's workstation
on first usage of the deployment. But I don't want to keep re-registering
the dll everytime the enduser invokes the ADP (from the console app which
will be a shortcut on the endusers workstation). So I am thinking I will
delete the .bat file after first usage. Then, on the next deployment, the
..bat file wll be avaiable again for usage. Here is the code:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;
namespace SubscriberClientRnD
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//my version - as of 11/17/06
Process p = new Process();
if (File.Exists("./RegisterEntireListDLL.bat") )
{
p.StartInfo.FileName = "./RegisterEntireListDLL.bat";
p.Start();
File.Delete("./RegisterEntireListDLL.bat");
};
p.StartInfo.FileName = "./subscriberRnD.adp";
p.Start();
}
}
}

One question I have is if this is a good way to invoke the .bat file - using
Process. Then, I am guessing that by invoking .bat this way - it is
asynchronous and maybe I should use threading to make the app sleep for 500ms
before deleteing the file?

Any suggestions appreciated.

Thanks,
Rich
Jul 12 '07 #1
1 2555
Rich,

You do not have to use bat files - you can ask .Net setup & deployment
project to do this for you - just add the tlb to the output (which I believe
you already do), and set its Register property to vsdraCOM.

Anyhow, if you want to run a batch file and delete it after completion, you
will need to get the started process reference and wait for its completion,
similar to the following:
p.Start();
p.WaitForExit();
"Rich" wrote:
I use "Click Once" Deployment from VS2005. Works like a charm. I have to
deploy a console app and an MS Access ADP. The console app invokes the ADP.
I copy the ADP to the application files to be deployed from the console app
and then use the Process obejct to invoke the ADP on the end User's
workstaion. Below in this post is the code I use in the console application.
Anyway, I have had to add some additional functionality to the ADP in the
form of a dll I wrote in .Net which uses .Net objects (sqlDataAdapter for
reading data from Sql Server, StreamWriter for writing data to a Text File).
The DLL works fine.

My plan is this: On deployment, I will deploy a copy of the DLL (and tlb)
file(s) and a .bat file for registering the dll on the end user's workstation
on first usage of the deployment. But I don't want to keep re-registering
the dll everytime the enduser invokes the ADP (from the console app which
will be a shortcut on the endusers workstation). So I am thinking I will
delete the .bat file after first usage. Then, on the next deployment, the
.bat file wll be avaiable again for usage. Here is the code:

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.IO;
namespace SubscriberClientRnD
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//my version - as of 11/17/06
Process p = new Process();
if (File.Exists("./RegisterEntireListDLL.bat") )
{
p.StartInfo.FileName = "./RegisterEntireListDLL.bat";
p.Start();
File.Delete("./RegisterEntireListDLL.bat");
};
p.StartInfo.FileName = "./subscriberRnD.adp";
p.Start();
}
}
}

One question I have is if this is a good way to invoke the .bat file - using
Process. Then, I am guessing that by invoking .bat this way - it is
asynchronous and maybe I should use threading to make the app sleep for 500ms
before deleteing the file?

Any suggestions appreciated.

Thanks,
Rich
Jul 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4063
by: T | last post by:
I have a web site i want to deploy using a VS.NEt set up project. I have no problems with that, that is fine and works no problem. But the web application uses a custom event log to log...
2
1950
by: mtpollack | last post by:
Hi, I have an application that depends, for successful deployment, on a COM dll that needs to be registered on the user's machine. How do I include te registration of this dll in my setup...
5
1472
by: Nikhil Patel | last post by:
Hi all, I am creating a setup and deployment project for a signed assembly and need to register it when it is installed. How can set it to register when it is installed? Thanks.
2
1465
by: Jackson | last post by:
I have been using a Lotus Approach built application to control database for stock control, reference, pricing and reports. This has been fine until now since I was the only one using the database....
1
1340
by: Dave Moore | last post by:
Hi all - I have a problem I've been trying to solve for several days. I'm trying to get the 'hands free' deployment working on a .NET web project that involves both a front end web site (with web...
1
1864
by: Gene | last post by:
I would like to know if the following is even possible with the visual studio.net Setup and Deployment project. 1. During the deployment after creation of application directory the setup needs...
2
2207
by: linuxfedora | last post by:
I have written a C# program which has an activeX control (abc.ocx) in Visual Studio 2005, and used the setup and deployment project to create an setup.exe and setup.msi that act as an installer. ...
0
2270
by: Grumpy Aero Guy | last post by:
I have an app that utilizes a DLL provided by a 3rd party. This DLL requires registration via "regsvr32" before adding it successfully as a reference in Visual Studio during development. This...
3
5837
by: KennethLundin | last post by:
Hi, i'm developing a solution in VS9/CSharp. Now I'm constructing a deployment project for my appliation (thick, database driven, winforms, standard, good old type of application). During...
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
373
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.