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

How to Disable buttons in InstallScript MSI projects?

Project Type: InstallScript MSI
Requirement: When user selects a radio button gray out (disable) other buttons of form until user reselect that radio button.

Since in this project type there isn’t “conditions”, so I’ve been trying to use Disable() and Enable() but I realized that it takes affect on the next opened dialog and can’t be used to on the current dialog. So, any suggestions what to try next?
Labels (1)
0 Kudos
(3) Replies
RobertDickau
Flexera Alumni

I believe there's an EnableWindow API function that can be of use; you might look at the source for the SdLicense2 dialog box, which does something similar to what you describe.
0 Kudos
Alex_W
Level 6

Hi

The Windows API call EnableWindow() didnt work for me, but I did find an API call that did; _WinSubEnableControl();

Just in case some1 else needs to use this you have to pass it a handle to the form, the ID of the control and 0 (enable) or 1 (disable)
eg: _WinSubEnableControl(hwndDlg, RES_PBUT_NEXT, 1);

to get the dialog handle use: CmdGetHwndDlg(DialogName). You have to call it after WaitOnDialog(). I call it in the DLG_INIT section of the dialog loop/switch.

Its too bad that with every project type you're forced to use differenet methods enable and disable functionality (API calls, conditions, etc.). I wonder where can I put in an enhancement request to have all funcationality available in all projects types?
0 Kudos
RobertDickau
Flexera Alumni

I believe the official channel for feature requests and other product feedback is here: www.installshield.com/feedback.

The issue in this case is that the two underlying technologies are so different: InstallScript using a code-driven, Windows-resource-and-API foundation (with a long history), and MSI using a database-table-driven architecture (approaching its tenth birthday, come to think of it). So while it's conceivable to create (and would nice to have) an environment that abstracts the two types and generates one or the other type of installer based on that, those days are probably a while off.
0 Kudos