web.config replacement

Need help authoring your installer? Ask the community for tips and advice.

web.config replacement

Postby frjames » Wed Apr 18, 2012 9:02 pm

Tried following this guide: http://www.advancedinstaller.com/user-g ... -file.html

but my file isn't getting changed. I want to use the properties that are input in my SQLConnectionDlg. Tried with and without brackets:

<add name="LocalSqlServer" connectionString="server=SERVER_PROP;Initial Catalog=DATABASE_PROP;uid=USERNAME_PROP;pwd=PASSWORD_PROP" providerName="System.Data.SqlClient"/>

<add name="LocalSqlServer" connectionString="server=[SERVER_PROP];Initial Catalog=[DATABASE_PROP];uid=[USERNAME_PROP];pwd=[PASSWORD_PROP]" providerName="System.Data.SqlClient"/>

Is there something I need to do to tell the installer to parse the web.config? It's imported under files and folders but haven't changed any properties. I'm able to do script replacements on my sql scripts but not this.

Thanks.
frjames
 
Posts: 27
Joined: Wed Apr 18, 2012 8:40 pm

Re: web.config replacement

Postby frjames » Wed Apr 18, 2012 9:34 pm

Do I have to add the file as a regular file and also import as an xml file? - your help mentions that. After importing as an xml file - what do I edit exactly? I had added the property tokens into the file before importing, and when I hover the node, it tooltips the content, but nothing is in the text area. Confused.
frjames
 
Posts: 27
Joined: Wed Apr 18, 2012 8:40 pm

Re: web.config replacement

Postby frjames » Wed Apr 18, 2012 10:47 pm

I got it to work by going to the attributes tab under connectionStrings and editing the brackets for each connectionString - which were messed up. Didn't need to add the file twice either.
frjames
 
Posts: 27
Joined: Wed Apr 18, 2012 8:40 pm

Re: web.config replacement

Postby frjames » Wed May 02, 2012 3:34 am

What's the process on web.config files during upgrades? I believe uninstall wipes out the file, but then we'll have to regenerate it again, and the client may have made changes. We also could push out occasional web.config changes. Is there a way to persist this file and just update the differences? Or is it best to wipe it out and hope for the best?
frjames
 
Posts: 27
Joined: Wed Apr 18, 2012 8:40 pm

Re: web.config replacement

Postby Bogdan » Wed May 02, 2012 3:54 pm

By default the XML files are removed too, as any normal file from the package. If you want them to persist you should use the attribute "Remove file on uninstall" from "Install" tab, in our predefined XML editor from Files and Folders page.

Regards,
Bogdan
Bogdan Mitrache
Advanced Installer Team
http://www.advancedinstaller.com/
Bogdan
 
Posts: 2403
Joined: Tue Jul 07, 2009 7:34 am

Re: web.config replacement

Postby frjames » Wed May 02, 2012 5:02 pm

Bogdan wrote:If you want them to persist you should use the attribute "Remove file on uninstall" from "Install" tab, in our predefined XML editor from Files and Folders page.


So to persist remove it on uninstall? Do you mean don't remove on uninstall???
frjames
 
Posts: 27
Joined: Wed Apr 18, 2012 8:40 pm

Re: web.config replacement

Postby Bogdan » Thu May 03, 2012 10:51 am

When I said use the attribute "Remove file on uninstall" I meant to untick it, so that during the uninstall the uninstall the file will not be removed by the MSI.

Regards,
Bogdan
Bogdan Mitrache
Advanced Installer Team
http://www.advancedinstaller.com/
Bogdan
 
Posts: 2403
Joined: Tue Jul 07, 2009 7:34 am

Re: web.config replacement

Postby frjames » Mon Jul 02, 2012 4:31 pm

If I keep the web.config on uninstall, can I condition the new web.config on install to not overwrite? If so, how? Thanks.
frjames
 
Posts: 27
Joined: Wed Apr 18, 2012 8:40 pm

Re: web.config replacement

Postby Bogdan » Tue Jul 03, 2012 2:49 pm

Each element from the XML has update settings visible in our XML editor, all you need to do is to check all of them, so the package will simply ignore the element.

Regards,
Bogdan
Bogdan Mitrache
Advanced Installer Team
http://www.advancedinstaller.com/
Bogdan
 
Posts: 2403
Joined: Tue Jul 07, 2009 7:34 am


Return to Building Installers

Who is online

Users browsing this forum: Daniel and 1 guest