Summary
This article discusses what to do if the CtrlGetMultCurSel InstallScript function is not selecting all items.
Project Type
InstallScript
InstallScript MSI
Symptoms
As CUSTOMERCARE1 is already part of CUSTOMERCARE1SBOX the CtrlSetMultCurSel always highlights first one, not select all.
Diagnosis
case SELECT_ALL_BAD_BUTTON:
nResult = ListGetFirstString(lBad, szSelectAllBad);
// Loop while not at end of list.
while (nResult != END_OF_LIST)
CtrlSetMultCurSel(szDlg, LIST_BAD, szSelectAllBad, TRUE);
// Get the next string in the list.
nResult = ListGetNextString(lBad, szSelectAllBad);
endwhile;
ListDestroy(lBad_Selected);
lBad_Selected = ListCreate(STRINGLIST);
CtrlGetMultCurSel(szDlg, LIST_BAD, lBad_Selected);
nCountBadSelected = ListCount(lBad_Selected);
if (nCountBad != nCountBadSelected) then
MessageBox("Select All did not properly select all systems in the list. Please manually select the missing.", WARNING);
endif;
LB_FINDSTRING finds the first string in a list box that begins with the specified string and it finds first substring
szBadList = "CUSTOMERCARE1SBOX,CUSTOMERCARE1,CUSTOMERCARE2SBOX,CUSTOMERCARE2";
As CUSTOMERCARE1 is already part of CUSTOMERCARE1SBOX the CtrlSetMultCurSel always highlights the first one instead of selecting all.
Solution
// Included header files ----------------------------------------------------
#include "ifx.h"
#define EXIT_BUTTON 1305
#define SELECT_ALL_GOOD_BUTTON 1303
#define SELECT_ALL_BAD_BUTTON 1304
prototype dlg_GetCPSystemNames();
function NUMBER dlg_GetCPSystemNames()
STRING szDlg, szMsg;
STRING szFirstSystem, szSelectAllGood, szSelectAllBad;
BOOL bDone, bAbort;
NUMBER nReturn, nResult, nCmdValue, nCountCPSystemNames, nCountCPSelectedSystemNames, nId;
NUMBER nCountGood, nCountBad, nCountGoodSelected, nCountBadSelected;
HWND hInstance, hwndParent, hwndDlg;
LIST lGood, lBad, lGood_Selected, lBad_Selected;
STRING szGoodList, szBadList;
begin
szDlg = "_dlg_SelectAll";
nResult = EzDefineDialog(szDlg, "", "", DLG_ID_SELECTALL);
nResult = ListGetFirstString(lBad, szSelectAllBad);
hwndDlg = CmdGetHwndDlg(szDlg);
hwndCntrl = CtrlGetDlgItem("", hwndDlg, LIST_BAD);
SendMessage(hwndCntrl, LB_SETSEL, TRUE, -1);
ListDestroy(lBad_Selected);
lBad_Selected = ListCreate(STRINGLIST);
CtrlGetMultCurSel(szDlg, LIST_BAD, lBad_Selected);
nCountBadSelected = ListCount(lBad_Selected);
if (nCountBad != nCountBadSelected) then
MessageBox("Select All did not properly select all systems in the list. Please manually select the missing system(s) by holding the CTRL key on your keyboard and clicking with your mouse.", WARNING);
endif;
CtrlSetMultCurSel function uses LB_FINDSTRING message finds the first string in a list box that begins with the specified string and it finds first substring
szBadList = "CUSTOMERCARE1SBOX,CUSTOMERCARE1,CUSTOMERCARE2SBOX,CUSTOMERCARE2";
CUSTOMERCARE1 is already part of CUSTOMERCARE1SBOX the CtrlSetMultCurSel always highlights first one
hwndDlg = CmdGetHwndDlg(szDlg);
hwndCntrl = CtrlGetDlgItem("", hwndDlg, LIST_BAD);
SendMessage(hwndCntrl, LB_SETSEL, TRUE, -1);
Adding the code, referenced above, should fix the problem.
Also, hwndCntrl needs to be defined at the top:
HWND hInstance, hwndParent, hwndDlg, hwndCntrl;
Related Articles
Logging An InstallScript MSI Project 363Number of Views What Are the Differences Between Basic MSI and InstallScript MSI Project? 8Number of Views The Installscript function MsiDoAction() does not correctly execute the custom action in the UI sequence of a Installscrip… 3Number of Views Convert a Basic MSI Project to an InstallScript Project 3Number of Views InstallScript MSI Project Limitations 4Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago