accept the input from the user and change the config file - 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!

anoop
Posts: 40
Joined: Tue Jan 10, 2012 12:07 pm

accept the input from the user and change the config file

Hi,
in my application i'm using a .config file where in this file consist details like ip,DB name,DB user name,DB password. The problem is i'm not able to know how to accept all these above details from the user and should automatically modify the config file.(above details should be replaced by the older ones)

here is one example

<connectionStrings>
<add name=".Domain" connectionString="data source=192.168.1.2;User ID=sa;Password=SQLAdmin1;Database=tempdb" providerName="System.Data.SqlClient"/>
</connectionStrings>

this needs to be asked at the time of installation using the User Interface of advance Installer


is there any solution?? i have checked the forum too..please help me its very critical!!!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: accept the input from the user and change the config fil

Hello,

You can follow this user guide article for guidance.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
anoop
Posts: 40
Joined: Tue Jan 10, 2012 12:07 pm

Re: accept the input from the user and change the config fil

hi,
i had read that same article but that dosen't make my question clear...the issue is i am using enterprise one but how to get the data linked from dialog box to that web.config file..
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: accept the input from the user and change the config fil

Hello,

The article is pretty self explanatory.
You can try to implement the described steps onto a test project. If you find any step unclear please contact us.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
anoop
Posts: 40
Joined: Tue Jan 10, 2012 12:07 pm

Re: accept the input from the user and change the config fil

hi,

i have done the following thing Which have highlighted...i have edited using the xml editor. i have given the property in uppercase so it should be public.


<connectionStrings>
<add name=".Domain" connectionString="data source=[USER_IPADDRESS];User ID=[USER_NAME];Password=[USER_PASS];Database=tempdb" providerName="System.Data.SqlClient"/>
</connectionStrings>


after this i have created the new dialog which is sql connection dialog box. But can you explain me how exactly this dialog box will get to know whether i have entered user name in place of user name and password in place of password.. how this is mapped to the xml file.

and is that enough for me to just put a dialog box n leave or should i have to create a new custom action???

plz guide me!!
anoop
Posts: 40
Joined: Tue Jan 10, 2012 12:07 pm

Re: accept the input from the user and change the config fil

hi,
i got the way of working it...the dialog box property value should be put in the config file that is from the property value like PASSWORD_PROP,USERNAME_PROP,SERVER_PROP.

Return to “Common Problems”