Editing values in a Java property-file - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

larsh
Posts: 1
Joined: Mon Apr 02, 2007 8:21 am

Editing values in a Java property-file

Is it possible to let the end-user alter the values of properties (key-value pairs) defined in a .properties-file before an installation finishes?

An interface would be best.
If this is not possible, is it possible to open a property-file included in the installation and display it for the user?


thanks,
Lars
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Lars,

Maybe this can be done with a custom action but I don't understand what you mean with .properties-file, please give me more details. At what file you referee?

Regards,
Gigi
_____________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
chrismooney
Posts: 2
Joined: Tue Jun 05, 2007 3:08 pm
Contact: Website

What he means

A java .properties file is like a windows ini file, except it can have different delimiters than the = sign between the key-value pairs. I would like an answer to this as well, as I need the ability to modify a value in a .properties file based upon text entered by the user during the install.

Essentially, I suppose I could make a program that can read the file in and modify the value based upon a passed in installer property, but it would have to be written as a C/C++ Dll or .exe to definitely run under windows. and then use that exe or dll in a custom action, but that is a good bit of work to do for what seems to be a simple thing.

The other option I came up with is to add an INI file to the project that has the same contents as the .properties file, and change my software to look for the INI instead of the .properties file, but it seems a little hokey that I have to do this just to be able to place a reference in a text file that the installer can overwrite. The real issue being that I have to add the INI through the Advanced Installer software, rather than picking an existing file, which makes it difficult to place the INI file in source control.

Ultimately, I suppose I could learn enough visual basic script to do this in a custom action, but again this is a lot of coding to do what I need. It seems that I should be able to open any text file within the installer, and place references to installer properties in the file, and the installer replaces those references during the install, much like you can do with the INI file editor.

Thank you for your quick response.

Chris Mooney

P.S. Additionally, it seems that eventually you will also need to support the modification of XML configuration files as well. A lot of software that we write is starting to go to that sort of configuration since it provides a more self-describing configuration file.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi Chris,

Windows Installer offer directly support only for editing INI files. For all other type of files you need to use a custom action in order to insert property references into them.

Regarding the XML file editing, we have this on our TODO list and will be available in a future version of Advanced Installer. I'm afraid that I cannot give you an ETA for it.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”