cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
johnsocs
Level 2

Replace variables in configuration files.

All -

I'm new to installsheild and am a little confused. How can the installer replace variables in my applications configuration files with values entered in some input field at install time?

I thought installsheild would do this for me without having to write custom code?

Can anyone help with this?

Thanks
Labels (1)
0 Kudos
(2) Replies
enanrum
Level 9

You can use the Ascii File Update action to accomplish this!

So if you have a file you want to update with some values in a component, add the Ascii File Update Action, (AFUA), after it and for the ASCII File - you can use something like:
$P(ConfigFileBeanID.absoluteInstallLocation)/configfile
(You can use the shortcut action to get this value easily by adding a shortcut action and for the target, click the ellipses to the far right of the box and search for the config file in your component, select it and then cut and paste this target to your AFUA file name and delete the shortcut action!) You would then need to add the actions you wish to take for the AFUA!

You would basically need to add a Search Line/Text and then add a Replace Line/Text. You can use $V(VAR) for your searches and replacements!

Hope this helps!

Regards,
Tom
0 Kudos
johnsocs
Level 2

Great, Thanks!

enanrum wrote:
You can use the Ascii File Update action to accomplish this!

So if you have a file you want to update with some values in a component, add the Ascii File Update Action, (AFUA), after it and for the ASCII File - you can use something like:
$P(ConfigFileBeanID.absoluteInstallLocation)/configfile
(You can use the shortcut action to get this value easily by adding a shortcut action and for the target, click the ellipses to the far right of the box and search for the config file in your component, select it and then cut and paste this target to your AFUA file name and delete the shortcut action!) You would then need to add the actions you wish to take for the AFUA!

You would basically need to add a Search Line/Text and then add a Replace Line/Text. You can use $V(VAR) for your searches and replacements!

Hope this helps!

Regards,
Tom
0 Kudos