G
Guest
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
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