Click here to Skip to main content
15,879,474 members
Articles / Programming Languages / C#
Article

Set a password textbox for Visual Studio .NET setup project

Rate me:
Please Sign up or sign in to vote.
4.84/5 (31 votes)
15 Feb 20042 min read 224.1K   69   37
Set a password textbox for Visual Studio .NET setup project.

Introduction

Do you need to set a password mask at Visual Studio .NET setup project? With a few steps, you would get it.

Tools

The only tool you need is ORCA. ORCA is a Microsoft utility for modifying and validating Windows Installer packages. It is a database tool created for setup authors and administrators who work with the Windows Installer Service. This utility is a part of the Windows Installer SDK download along with other MSI related tools.

You can use ORCA to open and modify MSI packages.

To download and install ORCA, follow these steps:

  1. Visit the SDK Platform Site page to download the Windows Installer SDK. The link to Windows Installer SDK should be on the left hand side frame on the above site.
  2. Click on that link to go to the next page to download Windows Installer SDK, which includes ORCA.
  3. After downloading and installing Windows Installer SDK, go to \Program Files\Microsoft SDK\Bin folder on the machine to look for Orca.msi.
  4. Run Orca.msi by double clicking on it, which is the setup to install ORCA on your machine.
  5. After installing ORCA on your machine, you will be able to right click on any MSI package and open it in ORCA.

Using the code

The first thing to do, is generate our VS.NET setup project and identify our future password textbox. You can see Edit2Property in our example that is EDITA2.

Image 1

Now, we start to modify the MSI to enable our password text changing attributes for our textbox EDITA2.

First of all, we've to start ORCA and open the MSI file generated by VS.NET, and go to 'Control' table.

Image 2

Normally, all textboxes are called CustomTextA, and we've to identify our textbox by Property column. In our case, we can see our row, has '7' as attributes. Let's go to see what means this '7'.

The attributes are set in binary format, so '7' is 111. 100 + 10 + 1 and this is 4 + 2 + 1 in decimal format. Now, we can go to control attributes table here and check what attributes are 4,2,1.

Image 3

We can see that our textbox has the following properties: Enabled, Sunken and Visible. Now, check that there's an advance properties table for textboxes, and there's a Password property with value 2097152.

Image 4

Now we have to add this property to the initial property value (7). 2097152 + 7 = 2097159, that's our new property value. Set in attributes cell and save the MSI File.

Now, check your MSI, and you could see that our textbox is a password textbox!!!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Spain Spain
Currently working at Avanade.com

Comments and Discussions

 
GeneralMy vote of 5 Pin
Daniel Arcondo6-Mar-23 8:21
Daniel Arcondo6-Mar-23 8:21 
QuestionMy vote of 5 Pin
algem mojedo24-Jul-13 16:11
algem mojedo24-Jul-13 16:11 
SuggestionWorked flowless! Pin
Member 297644227-Nov-12 1:11
Member 297644227-Nov-12 1:11 
GeneralMy vote of 5 Pin
bigdreams3-Oct-11 7:39
bigdreams3-Oct-11 7:39 
Questionhow can i set image to cancel, next, back buttons? Pin
Narendra Reddy Vajrala3-Jun-09 5:10
Narendra Reddy Vajrala3-Jun-09 5:10 
GeneralVery easily implementable solution Pin
charan.aspnet22-Apr-09 19:02
charan.aspnet22-Apr-09 19:02 
GeneralSet Validation for Setup Poject Textbox Dialog in c# Pin
Ctal1-Jan-09 19:05
Ctal1-Jan-09 19:05 
QuestionHow do I do this all from the command line? Pin
Jason W. Thompson18-Aug-08 8:58
Jason W. Thompson18-Aug-08 8:58 
AnswerRe: How do I do this all from the command line? Pin
Yakko W.17-Sep-08 11:47
Yakko W.17-Sep-08 11:47 
QuestionRe: How do I do this all from the command line? Pin
dvkates19-May-09 23:17
dvkates19-May-09 23:17 
AnswerRe: How do I do this all from the command line? Pin
haker0427-Jun-11 0:51
haker0427-Jun-11 0:51 
GeneralControl Attribute link revised Pin
bimal parekh21-May-08 19:00
bimal parekh21-May-08 19:00 
GeneralEncrypting the input values Pin
jagooch13-May-08 8:30
jagooch13-May-08 8:30 
GeneralRe: Encrypting the input values Pin
Shaun Wilde16-May-08 10:52
Shaun Wilde16-May-08 10:52 
QuestionChange 'Banner Text' of 'Welcome' User Interface Dialog ? Pin
Andy Rama11-Jan-07 22:43
Andy Rama11-Jan-07 22:43 
AnswerRe: Change 'Banner Text' of 'Welcome' User Interface Dialog ? Pin
Shaun Wilde8-May-07 23:34
Shaun Wilde8-May-07 23:34 
GeneralRe: Change 'Banner Text' of 'Welcome' User Interface Dialog ? Pin
jagooch15-May-08 6:58
jagooch15-May-08 6:58 
GeneralRe: Change 'Banner Text' of 'Welcome' User Interface Dialog ? Pin
Shaun Wilde16-May-08 10:50
Shaun Wilde16-May-08 10:50 
GeneralLink to get ORCA Pin
Javed Akhter Siddiqui8-Feb-06 0:58
Javed Akhter Siddiqui8-Feb-06 0:58 
GeneralRe: Link to get ORCA Pin
Ayub_Yousuf14-Apr-07 1:29
Ayub_Yousuf14-Apr-07 1:29 
GeneralRe: Link to get ORCA Pin
Khaniya4-Mar-10 20:54
professionalKhaniya4-Mar-10 20:54 
GeneralRe: Link to get ORCA Pin
Gertsen20008-Jun-20 21:57
Gertsen20008-Jun-20 21:57 
GeneralAwsome! Pin
Javed Akhter Siddiqui8-Feb-06 0:54
Javed Akhter Siddiqui8-Feb-06 0:54 
GeneralUnique Licence number for each installation Pin
Mukund Pujari22-Nov-05 23:01
Mukund Pujari22-Nov-05 23:01 
Hi Javier,

Thanks for very useful article. Is there any way that we can have unique licence number for each installation of .NET Application? In .NET Set Up projects there is facility for mentioning Licence Number in "Customer Information User Interface", but it has got very limited use. It has got one fixed logic that the addition of specified licence numbers should be divisible by 7. So anyone who knows this can easily crack this. And also I don't want to use custom action since Custom Action run after the installation. And I want that installation should onl progress if licence number is valid .

Thank You

Mukund
GeneralRe: Unique Licence number for each installation Pin
Shaun Wilde8-May-07 23:37
Shaun Wilde8-May-07 23:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.