TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pax Obi
NA
76
1.2k
InstallerSetup.cs pass installation parameters in from1.cs
Jan 19 2018 12:50 AM
I have properly overwrite commit in InstallerSetup.cs I do not wish to write the user entered value to app.config but rather I want to pass the string Context.Parameters["TESTPARAMETER"]; to another class in form1.cs on load function. I tried string test = InstallerSetup.Context.Parameters["TESTPARAMETER"]; but getting InstallerSetup.Context is null . Please Help.
InstallerSetup.cs
public
override
void
Commit(IDictionary savedState)
{
base
.Commit(savedState);
try
{
SQLSERVERNAME = Context.Parameters[
"SQLSERVERNAME"
];
HMSTENANTDB = Context.Parameters[
"HMSTENANTDB"
];
SQLLOGIN = Context.Parameters[
"SQLLOGIN"
];
SQLPASSWORD = Context.Parameters[
"SQLPASSWORD"
];
}
catch
(Exception e)
{
MessageBox.Show(
"Failed to update the application configuration file : "
+ e.Message);
base
.Rollback(savedState);
}
}
from1.cs
InstallerSetup InsSetup =
new
InstallerSetup();
string
Vsqlserver = InsSetup.Installers.Count.ToString();
string
Vtenant =
""
;
if
(InsSetup.Context !=
null
)
{
Vtenant = InsSetup.Context.Parameters[
"HMSTENANTDB"
];
}
else
{
Vtenant =
"context is null"
;
}
Attachment:
InstallerSetup.rar
Reply
Answers (
2
)
How to start your own business
getting error on setup??