|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Windows Service Installer, Display Formservice 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 <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( ); > } > } > 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 - |
|||||||||||||||||||||||