I'd like to have AdvancedInstaller update an app.Config file as an XML file.
to modify this:
<add key="eyeroute.db.sqlconnection" value="server='ORIG_PC\SqlExpress'; trusted_connection=true; Database='tst01'"/>
into:
<add key="eyeroute.db.sqlconnection" value="server='testpc\SqlExpress'; trusted_connection=true; Database='zzz_01'"/>
I found in the tutorial this is accomplished by adding the app.Config file as a regular file,
and then adding a new XML file, and then editing the properties to get to the key
(and it helped to Import the XML file to see exactly how the "Element" and "Attribute Settings"
need to be set to find the particular XML key that I want changed).
And I'd like to change this one setting via a GUI control so the end User can change it.
Again this is tricky but is just an "Installer Parameter" that needs to appear as [MY_PARAMETER].
No problem... Through trial and error I get all this up and text will update into the config file and even make a backup
(after I hand edited my AIP file to turn the entries for xmlCfg.dll:
- Config 11265 -> 1025
Remove 11265 -> 1025
Rollback 11521 -> 1025
And it sort of works.
The field I am trying to update has single quotes embedded into it because it is a SqlConnection string...
And the single quotes are being converted into the literal text "'"
Actual Resulting line in app.Config:
<add key="eyeroute.db.sqlconnection" value="server='testpc\SqlExpress'; trusted_connection=true; Database='zzz_01'"/>
I have taken the GUI element object out of the equation by just trying to add the hardcoded text with single quotes in for the Value of "value",
but that too comes out with the single quotes transforming into "'" text too.
Is there a way to get the "'" out of the string and single quotes in?
FOLLOW US
Get the latest news in Application Packaging