This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Config file text logic when upgrading/reinstalling
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2019
08:43 AM
Config file text logic when upgrading/reinstalling
New with InstallShield (inherited from the prior developer), we are running InstallShield 2016 Professional Edition, v23 SP2 to build our software MSI installation file.
Our software installs a web application and a web service where certain sections in the web.config file are unique to each user (customer).
We have a template web.config file with such sections blank and we add additional library references on every release in the other corresponding sections in the web.config file template.
Is it possible to have InstallShield use this template web.config file with the updated library references and merge the user-specific sections from the existing web.config file when reinstalling/upgrading?
If merging is not possible, is it possible to check if a web.config file exists and grab such user-specific sections from the existing web.config file and inject them to the template web.config file?
Please advise and thank you for reading.
Our software installs a web application and a web service where certain sections in the web.config file are unique to each user (customer).
We have a template web.config file with such sections blank and we add additional library references on every release in the other corresponding sections in the web.config file template.
Is it possible to have InstallShield use this template web.config file with the updated library references and merge the user-specific sections from the existing web.config file when reinstalling/upgrading?
If merging is not possible, is it possible to check if a web.config file exists and grab such user-specific sections from the existing web.config file and inject them to the template web.config file?
Please advise and thank you for reading.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2019
09:04 AM
Look under SYSTEM CONFIGURATION. You can probably use 'XML File Changes' or 'Text File Changes' to do what you need to do.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2019
03:30 PM
rguggisberg wrote:
Look under SYSTEM CONFIGURATION. You can probably use 'XML File Changes' or 'Text File Changes' to do what you need to do.
Reviewing Help topics, I found a way to search content inside an XML file (Behavior an Logic/System Search) for the existing ConnectionString entry inside web.config file and save such entry on a property.
Now, on XML File Changes, is it possible to have a condition to set the value for the element?
For instance...
If property is blank, set ConnectingString to default value.
If property is not blank, set ConnectionString to prperty
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2019
03:53 PM
Yes. You can put a condition on this.
Make 2 items under XML Files and name them something like:
1. DefaultConnectionString
2. PropertyConnectionString
A component will be created for each one. You can then go to the Components view under ORGANIZATION and apply the proper condition on the components.
Make 2 items under XML Files and name them something like:
1. DefaultConnectionString
2. PropertyConnectionString
A component will be created for each one. You can then go to the Components view under ORGANIZATION and apply the proper condition on the components.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 06, 2019
06:21 PM
web.config schema allows for a second file ( AppSettings file= ) to be specified that contains override values. This allows for the web.config to have stock files and always be safely overwritten by the installer and the override file values ( if exists ) will automatically be merged together when your application goes to read it's settings. More information can be found here:
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/appsettings/appsettings-element-for-configuration
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/appsettings/appsettings-element-for-configuration
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 07, 2019
10:49 AM
rguggisberg wrote:
Yes. You can put a condition on this.
Make 2 items under XML Files and name them something like:
1. DefaultConnectionString
2. PropertyConnectionString
A component will be created for each one. You can then go to the Components view under ORGANIZATION and apply the proper condition on the components.
Thanks for the prompt response.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 08, 2019
08:21 AM
Christopher Painter wrote:
web.config schema allows for a second file ( AppSettings file= ) to be specified that contains override values. This allows for the web.config to have stock files and always be safely overwritten by the installer and the override file values ( if exists ) will automatically be merged together when your application goes to read it's settings. More information can be found here:
https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/appsettings/appsettings-element-for-configuration
Great! I tested this approach and we plan to move forward with it. Thank you!