Click here to Skip to main content
Email Password   helpLost your password?

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.

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.

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.

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.

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!!!

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
Questionhow can i set image to cancel, next, back buttons?
Narendra Reddy Vajrala
6:10 3 Jun '09  
Hi ,
how can i set image to cancel, next, back buttons in welcome, readme, lisense,etc windows.
GeneralVery easily implementable solution
charan.aspnet
20:02 22 Apr '09  
nice

Regards,
Jaya Banbah

GeneralSet Validation for Setup Poject Textbox Dialog in c#
Ctal
20:05 1 Jan '09  
Hi,
I Have developed Setup for Shared Add-in. I Want to Register User to my database when installs setup.I have put Two Textbox Username and Password.
I already set Password character in it.
I want to validate these 2 textbox that it can not be null.
And Also want to Add one Pushbutton for database registartion .
if login fails or textbox is null then user is not allowed to go Next. (means I want to set Next button Disable).
When User user registerd Next button is Enable.
I tried it Using Orca but not getting what I want.
So please help me for the same

Thanks

Regards
Sheetal
QuestionHow do I do this all from the command line?
Jason W. Thompson
9:58 18 Aug '08  
I want to have my installer automatically edited after each build, but how do I do this?
AnswerRe: How do I do this all from the command line?
Member 2655509
12:47 17 Sep '08  
If you have the developer SDK that includes the WiRunSQL.vbs function, you can add a post-build event to your installer project that looks something like this:

Cscript WiRunSQL.vbs "$(BuiltOuputPath)" "UPDATE `Control` SET `Control`.`Attributes`=2097159 WHERE `Control`.`Dialog_`='CustomTextA' AND `Control`.`Control`='Edit2'"

(note this should all be on one line)
QuestionRe: How do I do this all from the command line?
VenhKates
0:17 20 May '09  
I got a error when i added the above line in postbuildevent property in setup...
The error says
'PostBuildEvent' failed with error code '1' 'Unspecified error'


any help?

Ven Kates

GeneralControl Attribute link revised
bimal parekh
20:00 21 May '08  
http://msdn.microsoft.com/en-us/library/aa368042.aspx[^]
GeneralEncrypting the input values
jagooch
9:30 13 May '08  
This works great! I am 50% towards protecting password data input during the installation. Now, if I am writing the input data into the registry, is there a way to tell the installer to encrypt the password before putting it there? Thanks!
GeneralRe: Encrypting the input values
Shaun Wilde
11:52 16 May '08  
You would probably want to use a custom action to do the encryption.

I'll be more enthusiastic about encouraging thinking outside the box when there's evidence of any thinking going on inside it. - pTerry
www.many-monkeys.com


GeneralChange 'Banner Text' of 'Welcome' User Interface Dialog ?
Aniket Salunkhe
23:43 11 Jan '07  
How to change the 'Banner Text' of 'Welcome' User Interface Dialog while creating Set & Deployment in .Net ?

I want a Dialog same as 'Welcome' User Interface Dialog but different 'Banner Text'.

Best Regards,
Aniket

GeneralRe: Change 'Banner Text' of 'Welcome' User Interface Dialog ?
Shaun Wilde
0:34 9 May '07  
Hi Aniket

Again you can use the Orca tool - When using the Orca tool (part of the Installer SDK) - If you do the work as a transform then you can progarammatically apply the transform after everytime you build the installer.

Shaun

I'll be more enthusiastic about encouraging thinking outside the box when there's evidence of any thinking going on inside it. - pTerry
www.many-monkeys.com


GeneralRe: Change 'Banner Text' of 'Welcome' User Interface Dialog ?
jagooch
7:58 15 May '08  
Ok, I made the changes to my .msi as a new transform, and called the transform "transform.msi" . Now what do I do to have this msi applied after each build?
GeneralRe: Change 'Banner Text' of 'Welcome' User Interface Dialog ?
Shaun Wilde
11:50 16 May '08  
you need to use the msitran tool - part of the installer SDK

I'll be more enthusiastic about encouraging thinking outside the box when there's evidence of any thinking going on inside it. - pTerry
www.many-monkeys.com


GeneralLink to get ORCA
Javed Akhter Siddiqui
1:58 8 Feb '06  
No need to download and install Platform SDK web-based installer tool for ORCA. Just follow the link below:

http://blogs.msdn.com/astebner/archive/2004/07/12/180792.aspx

[Never believe on just your eyes, there is a lot more than what you can see.]
GeneralRe: Link to get ORCA
ayubmcsku
2:29 14 Apr '07  
Thnks a lot!!!!!

Currently I am doing my MCS from Karachi University, Pakistan.

GeneralAwsome!
Javed Akhter Siddiqui
1:54 8 Feb '06  
Just what I needed. Full marks to you. Smile

[Never believe on just your eyes, there is a lot more than what you can see.]
GeneralUnique Licence number for each installation
Mukund Pujari
0:01 23 Nov '05  


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
Shaun Wilde
0:37 9 May '07  
A bit late but again you can use a custom action but this time tied to the control in the dialog - however to do this you will need to know orca and You can therefore understand how easy it is for a hacker to hack that licence number out or prevent the check.

I'll be more enthusiastic about encouraging thinking outside the box when there's evidence of any thinking going on inside it. - pTerry
www.many-monkeys.com


GeneralNice!!!!
Coder98
12:21 21 Nov '05  
Sweet! I was pulling my hair out on this one. Anyway to do this without the ORCA solution? Works well though. THANKS!

Pdog
Generalorca
mary flower
8:45 18 Oct '05  
i coud not install orca.
Confused
Generalvalidate any textbox in a setup project
comp_buster
2:59 9 Aug '05  
plzzz help me to find articles to validate any textbox input in a setup project.so that when i can alert user for wrong input when he press next button to move from on screen to another.

thanx in advance
GeneralRe: validate any textbox in a setup project
Ctal
21:05 1 Jan '09  
Hi,
Did you get any solution to your problem ?
I am facing same problem. If you get it then please help me for the same.

Thanks
Regards
Sheetal
GeneralRe: validate any textbox in a setup project
Nitin Nikam
4:05 23 Dec '09  
Hey, I have the same problem.. need to validate MSI input fields
any solution..?

Regards,
Nitin Nikam

General'Back' button disabled on FolderForm
svetlanact
6:48 12 May '05  
Hi Javier,

Great article! Exactly what I was looking for.

I have a problem that is not really related to the password textbox, but more to New Dialogs in general. During installation process the 'Back' button appears to be disabled on the 'Installation Folder' if a dialog (or more than one dialog) added via VS IDE and placed before 'Installation Folder' form. I assume that it can be fixed by fixing .msi tables, but I'm not able to figure it out. I've tried to fix 'Property' table and had some success with 'Back' and 'Next' navigation, but whatever I did results in the installation error when 'Next' button of the 'Installation 'Folder' window pressed. My guess here is that some foreign key dependency is missing.

Another question I have: is there any way to programmatically fix .msi database using .NET? Is there a provider that would open .msi database to allow write queries against it?


Thanks a lot,

Svetlana

GeneralRe: 'Back' button disabled on FolderForm
NeilWhitlow
8:14 28 Jun '05  
Instead of dealing with the API to edit msi directly, it's easier to dump it to xml, use a quickie custom .net program to modify the xml as desired, then convert the xml back to msi.

http://msi2xml.sourceforge.net

msi2xml

run program to modify xml as desired.

xml2msi


IMHO, easier to learn the xml schema to modify rather than the installer database APIs.


Last Updated 16 Feb 2004 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010