Click here to Skip to main content
12,400,183 members (48,260 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Visual-Studio setup

I have a Visual Studio Setup Project, with a Custom Dialog with one Textbox. The default-content of this textbox should be the hostname of the PC, where the Setup was startet. How can I do this? Is this possible, if I override the Install-Method or do I need another way?

Posted 1-Jan-11 4:25am
Updated 1-Jan-11 4:26am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Put this code intot he form's constructor AFTER the call to InitializeComponent():

string hostName = Dns.GetHostName();
textBox.Text = "PC HostName";

From OP: I don't think that this is possible on a setup-project? I can't access Textboxes in a Setup-Project this way.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

A google search for ".Net custom forms in setup project" revealed this link. It may or may not help. You should get about 308,000 hits if you google search the same phrase.[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 1 Jan 2011
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100