- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Conditionally displaying text control in a dialog in InstallScript MSI project
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Conditionally displaying text control in a dialog in InstallScript MSI project
Hi all,
I am following instructions at https://community.flexera.com/t5/InstallShield-Knowledge/Provide-Notification-of-a-Major-Upgrade/ta-p/4413.
In one of the steps in the above link it says:
*************************************
On the Behavior section of the dialog, select the control you have just added and add the following conditions (replace ISACTIONPROP1 with the property found in step 2):
- Action: Hide; Condition: Not ISACTIONPROP1
- Action: Show; Condition: ISACTIONPROP1
************************************
Above is for Basic MSI project dialogs where you can edit behavior from the dialog view.
I have an InstallScript MSI project and in the dialog view it says "To edit behavior for this dialog, modify the parameters for the SdWelcome function in your script."
Can someone tell me how from the installscript, I can get this text control on the dialog and then conditionally display it.
thanks in advance.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @agshah ,
Can you try with sample rul file given in InstallShield's INSTALLDIR for an eg:C:\Program Files (x86)\InstallShield\2019\Script\Isrt\src\ISRTScriptDialogs.rul which has SdWelcome function defined?
There you can add check for property like IS_MAJOR_UPGRADE present or not using MsiGetProperty.If that doesn't help you can add productversion based check just to check this is major upgrade of previous setup. Pseudo code would be:
#define TXTBOX 1301 //CONTROL identifier
.......
function SdWelcome(szTitle, szMsg)
string svName;
number nSize;
HWND hwndDlg,hwndTxtBox;
.....
...
hwndTxtBox = GetDlgItem(hwndDlg,TXTBOX);
nSize=256;
MsiGetProperty(ISMSI_HANDLE,"ProductVersion",svName,nSize);
if(svName=="2.00.0000") then
_WinSubShowWindow(hwndTxtBox,1);
_WinSubEnableControl(hwndDlg,TXTBOX,1);
else
_WinSubShowWindow(hwndTxtBox,0);
_WinSubEnableControl(hwndDlg,TXTBOX,0);
endif;
end
You can find the same in attached sample .rul file as well.
Thanks,
Jenifer