[dialog] - property as a default value - 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!

Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

[dialog] - property as a default value

Hello,

I have the following problem:

- I am using search to find a value in the Registry
- I am using a SQLConnectionDlg to connect to a DB
- I want to use my search result as the default value for e.g. "Username:" field

Is it possible to do this action? It appears to be impossible to use a property [SEARCH_USERNAME] or SEARCH_USERNAME as a Property Default Value.

I really need this action to be performed...

Regards,
-- Nicolas D.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [dialog] - property as a default value

Hi Nicolas,

What you need can be done by using the property of the edit box as the name of the search. For example, the "Username" edit box on "SQLConnectionDlg" dialog has the property USERNAME_PROP, therefore the property (name) of the search can be set to "USERNAME_PROP".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

Re: [dialog] - property as a default value

Hi Cosmin,

Thank you for your answer.
For example, the "Username" edit box on "SQLConnectionDlg" dialog has the property USERNAME_PROP, therefore the property (name) of the search can be set to "USERNAME_PROP".
I had already done it and it worked, but, the problem using this is the following:

INSTALL
- search in the registry does not find anything, so I set a default value in this case ("old_user") - OK
- default Username field is "old_user" and can be overridden by "new_user" - OK
- Username value is saved in the registry - OK

UNINSTALL
- there is a search in the registry which find "new_user" - OK
- the SQLConnectionDlg appears, but the default value overrides the search: I get "old_user" - NOK

Writing all of this make me think it should not be possible to make this work without using a custom action... Do you think there is another possibility?

Regards,
-- Nicolas D.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [dialog] - property as a default value

Hi Nicolas,

In order to avoid this problem you can use a "Property set with formatted" custom action scheduled under "InstallUISequence" -> "Begin". This custom action can set the "USERNAME_PROP" property to a default value only during a first time installation ("NOT Installed"). Please note that the property should not have a default value set in the Dialogs page.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Nico-D
Posts: 63
Joined: Mon Aug 18, 2008 2:34 pm

Re: [dialog] - property as a default value

After finding some bugs of my own, it is now working perfectly, and as I intended! :)

Thank you for your help, Cosmin,
-- Nicolas D.

Return to “Common Problems”