CustomAction and Edit control - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Tester
Posts: 6
Joined: Sat Jan 20, 2007 2:13 pm

CustomAction and Edit control

Hallo,

I need add one special file to installation at runtime (it's license key) .
I create Edit and browse Button. After click on button I call (by DoAction)
my custom DLL where I manually invoke file open dialog. After user
selects a file I set global property (LICKEY) through MsiSetProperty
but I don't know how then to set value in Edit control in active dialog.
Currently I immediately send message WM_SETTEXT to set text to
appropriate control but it's by my opinion a little bit dirty method.
I have try use event SetProperty before but it don't work properly.

Now I need to add to my MSI possibility to copy file selected by
user to given destination directory.

How can I to do it?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The Edit control is not automatically refreshed by Windows Installer. You need to force its refresh by using a new control event under the button that calls your custom action DLL like this:

Event: SetProperty (and type in the same combo [MY_PROP])
Argument: [MY_PROP]

Note that MY_PROP is the property of the Edit control, and this control event must be scheduled after the DoAction control event. Also in your CA DLL you can directly set the property of the Edit box (MY_PROP) with the selected file.
Now I need to add to my MSI possibility to copy file selected by
user to given destination directory.
This can be done with a custom action too (copy a file to a given folder).

Hope this helps.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Tester
Posts: 6
Joined: Sat Jan 20, 2007 2:13 pm

gigi wrote:The Edit control is not automatically refreshed by Windows Installer. You need to force its refresh by using a new control event under the button that calls your custom action DLL like this:
Event: [MY_PROP]
Argument: [MY_PROP]
I did it and it work's fine, but only once.
If I then manually change edit value and through
custom action select another file, edit will not update.
It's interesting that if I browse previous or next
dialog, after return to my page, edit value is correct.

My second problem is similar. I have a dialog with
some edits and one button to set their values to default.
I use Control Event SetProperty and assign
desired values to appropriate edit properties, but
when I manually change some value and click on
default button, nothing happens. After switch to next
dialog ant return back, all edits contain default values.

I am desperate.

Tester
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

This is related to a Windows Installer behavior. Once you type something in an "Edit Box" control its content will not be refreshed.

For the file selection you can use a "Path Edit" control instead of the "Edit Box".

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”