Windows Service Installer, Display Form

L

LauraColeman1

I need to obtain some information from the user when my windows
service is installed. I've created a Windows Form, which I display as
part of the windows service installation. The problem I'm having is
that the form opens and then closes automatically without accepting
any input from the user. I think this is because the windows service
installer is calling Dispose at the end of the install. Any idea how
I can make the form stay open until the user inputs some info?

Here's the installer code, which was mostly generated automatically
by .net:

[RunInstaller(true)]
public partial class ProjectInstaller : Installer
{
public ProjectInstaller( )
{
InitializeComponent( );
}

private void serviceProcessInstaller1_AfterInstall(object sender,
InstallEventArgs e)
{
GUIproject.myForm FormName = new GUIproject.myForm( );
FormName.Show( );
}
}
 
H

Henning Krause [MVP - Exchange]

Hello Laura,

use

GUIproject.myForm FormName = new GUIproject.myForm( );
FormName.ShowDialog();

best regards,
Henning Krause
 
L

LauraColeman1

Thanks Henning. Using ShowDialog fixes the problem.

Hello Laura,

use

GUIproject.myForm FormName = new GUIproject.myForm( );
FormName.ShowDialog();

best regards,
Henning Krause




I need to obtain some information from the user when my windows
service is installed. I've created a Windows Form, which I display as
part of the windows service installation. The problem I'm having is
that the form opens and then closes automatically without accepting
any input from the user. I think this is because the windows service
installer is calling Dispose at the end of the install. Any idea how
I can make the form stay open until the user inputs some info?
Here's the installer code, which was mostly generated automatically
by .net:
[RunInstaller(true)]
public partial class ProjectInstaller : Installer
{
public ProjectInstaller( )
{
InitializeComponent( );
}
private void serviceProcessInstaller1_AfterInstall(object sender,
InstallEventArgs e)
{
GUIproject.myForm FormName = new GUIproject.myForm( );
FormName.Show( );
}
}- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top