Lon
Posts: 10
Joined: Fri Jun 15, 2007 9:08 pm
Location: Virginia USA

Edit an installed file after installation

What are the steps to edit a file after it has been installed?

For example, you install an application which has a config file with certain defaults. But you also provide the end user with a dozen or so command line properties like DEBUG=on or SERVER="HostName" or PORT=555… that needs to be written to the installed config file.

I wrote a synchronous install immediate dll custom action called GetCommandLineParms() that gets all the properties and validates them - works great. Then I wrote another dll custom action ApplyUserParms() to edit the installed config file and replace old properties with new ones. Sounds simple enough.

None of the dll global variables are persisted from one call to the other which would have made things easy, but I can accept that.

It appears (?) that you cannot edit a file until it is actually installed which means the custom action has to occur deferred which also means all those properties are not accessible unless I use the CustomActionData property with a bunch of delimiters. That must be a better way.

Is it possible to edit the config file as it is being installed (like in a temp folder) instead of afterward. If so what would be the path since [AppDir] is the target.

Any guidance would be appreciated.

Thanks
Lon
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Lon,
What are the steps to edit a file after it has been installed?
Windows Installer offer support for INI files. In the "Files and Folders" page choose "New INI File" and use the ini file editor ("Edit INI File" dialog) to edit the INI file.

For any other file you need to use a custom action as you already do. Also editing XML files will be available in a future version of AI.
Is it possible to edit the config file as it is being installed (like in a temp folder) instead of afterward. If so what would be the path since [AppDir] is the target.
I'm afraid I don't fully understand this. Please give me more details.

Kind Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Alexander
Posts: 29
Joined: Thu Dec 30, 2004 12:47 pm
Location: Germany

Hi,

any news about the XML editing feature?
kind regards,
Alex
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Alex,
any news about the XML editing feature?
This feature is scheduled for the 5.3 version of Advanced Installer.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
Alexander
Posts: 29
Joined: Thu Dec 30, 2004 12:47 pm
Location: Germany

Thanks for the fast reply!

Any idea when v5.3 will be released?
kind regards,
Alex
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Alex,

The 5.3 version of Advanced Installer is scheduled for release in about one month from now.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
Rawand
Posts: 13
Joined: Tue Apr 08, 2008 2:33 pm

Re: Edit an installed file after installation

hi all, i have been looking for editing the .properties file in some step during the installation but found nothing, there are many guys requesting this but all the replies are some link to xml or ini which doesnt help for me, Lon you did that by dll custom action ApplyUserParms(); so if you or any other one give me some idea it will be really apreciated. regards
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Edit an installed file after installation

Hi,

Usually .config or .properties files are basically XML files and they can be edited by using the XML editor. In order to be able to edit this type of files, you need to import them by using the "Import Files" button ("XML Files" menu) on the toolbar in the "Files and Folders" page.

However, if you want to edit a simple text file you can use the OpenTextFile method.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”