cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Brandon_Lowe
Level 6

MSI Custom dialog question

I normall use the installscript installs but we are looking at doing some MSI installs so I'm prototyping some of the custom stuff we do and I have hit the first small speedbump.

I'm creating a custom dialog for our registration info and on that dialog our product key has 5 field of 5 charactors each. How do I make the cursor move the the nect field when the user has entered the 5 charators in the first field and then the next. I do not want the user to have to press the tab key I just want the cursor to move. I have a dialog in installscript that does this but cannot figure it out in MSI.

Thanks
Brandon
Labels (1)
0 Kudos
(7) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

There's no real way to do this in MSI dialogs. You might be able to hack it by finding the window and playing some tricks with messages, but it would be a rather fragile solution even if it can work. If you're strongly set on having this behavior, and want to do it right, you'll need to examine using an InstallScript or C++ (etc.) dialog, either one out of the sequence (risking size and position mismatches), or as part of a full external UI.
0 Kudos
RobertDickau
Flexera Alumni

One option might be to use a MaskedEdit control, about which please see the MSI help library...
0 Kudos
DLee65
Level 13

What about using the masked edit control? We use this with success in the basic MSI setup.

When you add a masked edit in design mode it looks like a single field - you have to sort of look beyond that. How you control the number 'boxes' displayed is by the Masked Edit format itself.

For instance the Masked Edit <^^^^-^^^^-^^^^-^^^^> will display four fields with hyphens between each field. The windows installer will move the cursor from one field to the next once the correct number of characters are in place.

Note that the implementation of the masked edit field is weak lacking any level of flexibility and limited control over the character set and such. For instance I do not have an effective way to prevent users from typing in the hyphen character. However, if all you need is a way to switch between fields automagically then the masked edit is your control of choice.
0 Kudos
DLee65
Level 13

Curses! Robert beat me to the post!
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Oh, the masked edit moves you from field to field automatically? I stand corrected. Much better solution than that which I alluded to above.
0 Kudos
Brandon_Lowe
Level 6

Sorry I'm feeling very new here again. How will a masked edit field move me from field to field automagicly?

Brandon
0 Kudos
DLee65
Level 13

I am not sure I know enough about the masked edit control to explain how it works. I **think** it works because it is technically only ONE field. However, when you use a character that is considered a constant in the masked edit field, the masked edit control uses the constant as a separator for each visible field to the end user.

Look up in the InstallShield help MaskedEdit Control[Windows Installer]. It will give you the technical specs on the format characters and such.
0 Kudos