cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LambConsulting
Level 3

Edit control not refreshed if user type something in the edit control before browse

Hello,

i created an Edit control and a button in a Dialog who will open a browse dialog box with Custom Actions. The Edit control will recieve the path of the selected file from the browse dialog box.

Here is the code of my function who call the browse dialog box to select the file path :


#define LICENSEPROPERTIES "LC_LICENSEFILEPATH"

STRING szFile[512], svDir, svFileList, svTemp;
NUMBER nResult, nReturn;
BOOL bMultiSel, bDerefLinks;
LIST listFiles;
STRING svValue;
NUMBER nvSize;
HWND hDlg;

STRING svPath;

begin

nvSize = 256;
MsiGetProperty(hInstall, LICENSEPROPERTIES, svPath, nvSize);

bMultiSel = FALSE;
bDerefLinks = FALSE;

listFiles = ListCreate(STRINGLIST);

// Open the file browse dialog.
nResult = FileBrowseDlg( szFile, 512, "LIC files (*.lic)\0*.lic\0\0", "Select File", svPath, bMultiSel, listFiles, bDerefLinks );

if nResult = 0 then
MsiSetProperty( hInstall , LICENSEPROPERTIES , szFile );
endif;
ListDestroy(listFiles);
end;

As you can see, I call a function named FileBrowseDlg. This function display the browse dialogbox and returns in "szFile" the path selected by the user. After that, I do a MsiSetProperty to change the text value of the edit control "LICENSEPROPERTIES"

When I debug this code everything is OK. I can see the new path in "szFile" and I can deduce that the MsiSetProperty set the edit control text value.

But ! My problem is that the edit control text value isn't directly refresh with the new file path value if the user typed something into the edit control before clicking Browse.

I read many things on the internet before asking you like changing the ordering values in the direct editor or else... But nothing resolve my problem.

We search to have the best pratice to do that.

Your Help will be very very appreciated !
Labels (1)
0 Kudos
(3) Replies
LambConsulting
Level 3

Any idea ? 😞 😞 😞
0 Kudos
LambConsulting
Level 3

My problem is not resolved yet... 😞

And I don't understand why noboby answers... Can I get some help ?
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

If you are using a Basic MSI project, the internal Windows Installer user interface support will generally not refresh controls backed by a property until the dialog is closed and reopened. Edit controls will also not refresh if any value was entered by a user into the control. Unfortunately, these are limitations of the MSI user interface functionality.

You can either implement a custom user interface for MSI installations using Windows Installer's external UI support or you can use a different project type such as InstallScript, which provides a script/resource driven UI. It would also be possible to use an InstallScript project to obtain user input, then launch your existing MSI package silently and pass any properties on the command line to the MSI package.
0 Kudos