windows-installerinstallshield-2010

Installshield CheckBox Control ID


I set the launch .exe at installation complete in the Project Assistant Installation Interview tab. Works fine.

I needed to launch the .exe with the condition that a certain app was open. So I created a property, used FindWindow and set the CheckBox to checked if property = true. All works fine.

Now I'm trying to disable the CheckBox is the hwnd is not open...but there is no Control ID set or created for the CheckBox. The 2nd param needs it.

This link suggests... MSIGetProperty function. That function returns the property value not the ID.

_WinSubEnableControl (hwndDlg,?????, 0);

Update: I was able to disable with a ControlCondition using the Property I created. Still like to know how to get a control ID (So the built in function _WinSubEnableControl could be used).


Solution

  • The Control IDs for controls on a Windows Installer dialog are arbitrarily assigned by Windows Installer itself. The only supported way to enable or disable a control is through the Control Conditions as you found.

    In practice, if you can find the window, and you know the text on your check box, you can easily find the control ID by enumerating child windows. But as there is no officially supported way to find the main window, this is not supported.