Windows Service Installer, Display Form

  • Thread starter Thread starter LauraColeman1
  • Start date Start date
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( );
}
}
 
Hello Laura,

use

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

best regards,
Henning Krause
 
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 -
 
Back
Top