Home All Groups Group Topic Archive Search About

Windows Service Installer, Display Form

Author
13 Mar 2007 9:54 PM
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( );
     }
}

Author
13 Mar 2007 11:30 PM
Henning Krause [MVP - Exchange]
Hello  Laura,

use

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

best regards,
Henning Krause

<LauraColem***@gmail.com> wrote in message
Show quote
news:1173822855.839764.248340@y66g2000hsf.googlegroups.com...
>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( );
>     }
> }
>
Author
14 Mar 2007 4:07 PM
LauraColeman1
Thanks Henning.  Using ShowDialog fixes the problem.

On Mar 13, 3:30 pm, "Henning Krause [MVP - Exchange]"
<newsgroups_rem***@this.infinitec.de> wrote:
Show quote
> Hello  Laura,
>
> use
>
> GUIproject.myForm FormName = new GUIproject.myForm( );
> FormName.ShowDialog();
>
> best regards,
> Henning Krause
>
> <LauraColem***@gmail.com> wrote in message
>
> news:1173822855.839764.248340@y66g2000hsf.googlegroups.com...
>
>
>
> >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 -

AddThis Social Bookmark Button