I'm not sure this is close to what you want, but here goes anyway. I wrote
it with the same intention as you but with a command-line install.

The parameter "string version" is the runtime version, which will be
something like "v1.0.3705" or "v1.1.4322" (releases 1.0 and 1.1
respectively). It's a bit messy but it works:

private static void RunProcess(string version)

{

    Process p = new Process();

    ProcessStartInfo psi = new ProcessStartInfo();


psi.FileName="\""+Environment.GetEnvironmentVariable("windir")+"\\Microsoft.
Net\\Framework\\"+version+"\\"+"installutil.exe\"";

    psi.Arguments = "BirthdayService.exe"; //replace this by the name of
your service executable

    psi.UseShellExecute = false;

    psi.RedirectStandardOutput=true;

    p.StartInfo = psi;

    p.Start();

    p.WaitForExit();

    Console.WriteLine(p.StandardOutput.ReadToEnd());

}


Paulo Sacramento

----- Original Message -----
From: "Muthuraj Velayutham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 08, 2003 9:57 PM
Subject: [ADVANCED-DOTNET] Automating Windows Service Installation


> Hi,
>
> I have a Windows Service, which has to be installed on to our clients
> Servers. During the development i can use installutil provided in .NET SDK
> to install the Windows service and test it.
>
> Now as a part of deployment I am building a setup project to install this
> Windows service. When I tried to install to one of my test box, I figured
> out that the installation only copies the file. I need to run the
> installutil.exe to configure the Windows Serivce.
>
> I don't want my clients to do this. I am sure there is a way to program
> this in the Setup Project instead of the user doing it.
>
> Any help on this will be appreciated.
>
> Raj
>
> ===================================
> This list is hosted by DevelopMentor�  http://www.develop.com
> NEW! ASP.NET courses you may be interested in:
>
> 2 Days of ASP.NET, 29 Sept 2003, in Redmond
> http://www.develop.com/courses/2daspdotnet
>
> Guerrilla ASP.NET, 13 Oct 2003, in Boston
> http://www.develop.com/courses/gaspdotnet
>
> View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to