ysliew
Posts: 14
Joined: Thu Dec 17, 2009 5:09 am

Web.config Configuration

Hi,

I have added a few controls in the dialog for web.config configuration during the installation.

web.config

Code: Select all

<appSettings>
    <add key="Setting_A" value="A"/>
    <add key="Setting_B" value="B"/>
    <add key="Setting_C" value="C"/>
</appSettings>
There are a few settings in the web.config, and only Setting_C can be configured by user.
xml.png
xml.png (46.07 KiB) Viewed 4728 times
However, I found that after the installation, it will overwrite the Setting_A and it's value with Setting_C's one.

Code: Select all

<appSettings>
    <add key="Setting_C" value="ABC"/>
    <add key="Setting_B" value="B"/>
    <add key="Setting_C" value="C"/>
</appSettings>
Do I need to add every elements in web.config to resolve this, or there is a beter way?

Besides, there is a setting in my web.config to define the folder which will be used to retrive data. I was refering to How to browse for a folder at install time? and found that if user key in a non-exist folder, it will create a new folder after installaion. Is it possible to disable the new folder icon as the user is only allowed to select existing folder but not creating new folder.

Kindly advise, thanks.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Web.config Configuration

Hello,

Switch to the "Element Settings" tab and make sure the "If element is found -> add as new sibling" option is checked.
Is it possible to disable the new folder icon as the user is only allowed to select existing folder but not creating new folder.
This can be achieved from the Dialogs page. Select the BrowseDlg dialog from the "Special Dialogs" section, select the "New folder" button and simply delete it. This should prevent the user from creating a new folder.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
ysliew
Posts: 14
Joined: Thu Dec 17, 2009 5:09 am

Re: Web.config Configuration

Hi Gabriel,
Switch to the "Element Settings" tab and make sure the "If element is found -> add as new sibling" option is checked.
If I checked this, it will duplicate the setting as the web.config already consists the default value.
This can be achieved from the Dialogs page. Select the BrowseDlg dialog from the "Special Dialogs" section, select the "New folder" button and simply delete it. This should prevent the user from creating a new folder.
Thanks, it's working.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Web.config Configuration

Hello,

Please make the following settings if you want to update Setting_C.
Untitled.jpg
Untitled.jpg (43.45 KiB) Viewed 4721 times
Please note the "Is identifier attribute" checkbox that is ticked only on the "add" attribute, and not the "value" attribute.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”