I have the following [Files]
entry:
Source: "CutToolsBcad.dll.config";
DestDir: "{app}";
Flags: ignoreversion;
Check: IsAvailable('BRX', '21', 'x64');
AfterInstall: SetupDemandload('BRX', '21', 'x64')
This file is a standard XML file and my installer does not use admin elevation.
In the config file it has (rest of data snipped):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<userSettings>
<CutTools.Properties.Settings>
<setting name="SaveToDXF_OutputFolder" serializeAs="String">
<value />
</setting>
</CutTools.Properties.Settings>
</userSettings>
</configuration>
I would like the installer to update this file (for new installs) with the {app}
folder value.
At the moment I am creating a [Registry]
entry:
Root: "HKCU";
Subkey: "Software\{#MyAppPublisherKey}\{#MyAppBaseName}";
ValueType: string;
ValueName: "InstallPath";
ValueData: "{app}";
Flags: uninsdeletekeyifempty uninsdeletevalue;
Check: not IsAdmin()
And then in my application I do the following:
textBoxSavePath.Text = Properties.Settings.Default.SaveToDXF_OutputFolder;
if(textBoxSavePath.Text == String.Empty)
{
textBoxSavePath.Text = (string)Registry.CurrentUser.GetValue("Software\\TruckleSoft\\CutToolsBcad.dll\\InstallPath");
}
But if there is a fairly simple way to directly update the config file directly using Inno Setup I would liek to know.