Mani Pazhana
asked on
Windows Service - Project Installer
Hello Experts,
I am developing a Windows Service application in .Net.
While installing the service should take some config values from users and update the user settings in app.config file.
I have a Windows FORM in my project and i could call the windows FORM in my installer class.
public override void Install(System.Collections .IDictiona ry stateSaver)
{
base.Install(stateSaver);
frmUserSettings f = new frmUserSettings()
f.ShowDialog();
}
-------------------------- -----
the above code works and the FORM shows up during installation.
now i need to get the values from the FORM and update the user settings information in the app.config file.
any help?
Thanks
I am developing a Windows Service application in .Net.
While installing the service should take some config values from users and update the user settings in app.config file.
I have a Windows FORM in my project and i could call the windows FORM in my installer class.
public override void Install(System.Collections
{
base.Install(stateSaver);
frmUserSettings f = new frmUserSettings()
f.ShowDialog();
}
--------------------------
the above code works and the FORM shows up during installation.
now i need to get the values from the FORM and update the user settings information in the app.config file.
any help?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for your reply.
I removed Windows Forms. i am using Deployment project - User Interface Text box
Now when i run my intall process, it is asking for user parameter and i am using this code in my installer class:
-------------------------- ---------- ----
public override void Install(System.Collections .IDictiona ry stateSaver)
{
base.Install(stateSaver);
string str = Context.Parameters["SENDER EMAILADDRE SS"].ToStr ing();
Settings1 UserSettings = new Settings1();
UserSettings.EmailSender = str;
UserSettings.Save();
}
-------------------------- ----
i am getting error, object reference set to an instance of the object
any idea?
I removed Windows Forms. i am using Deployment project - User Interface Text box
Now when i run my intall process, it is asking for user parameter and i am using this code in my installer class:
--------------------------
public override void Install(System.Collections
{
base.Install(stateSaver);
string str = Context.Parameters["SENDER
Settings1 UserSettings = new Settings1();
UserSettings.EmailSender = str;
UserSettings.Save();
}
--------------------------
i am getting error, object reference set to an instance of the object
any idea?
ASKER
thanks
ASKER
This is the code i am using right now in my installer code:
--------------------------
public override void Install(System.Collections
{
base.Install(stateSaver);
string str = Context.Parameters["SENDER
Settings1 UserSettings = new Settings1();
UserSettings.EmailSender = str;
UserSettings.Save();
}
--------------------------
when i run, i am getting object reference not set to an instance
any idea what i am missing?