smt52
Posts: 8
Joined: Sun Jul 10, 2005 11:16 pm

Altering a file on install

*** Overview

On install, we have to alter our .classpath file to contain a reference to a .jar file in the current directory.

*** Details

The current .classpath file is:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/workspace/Loader/RXTXcomm.jar"/>
<classpathentry kind="output" path=""/>
</classpath>

When we install, we need to change this file to:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="??????/RXTXcomm.jar"/>
<classpathentry kind="output" path=""/>
</classpath>

... where the text ?????? is replaced with the path to the directory containing our installed files.

How would we accomplish this? Or, alternatively, how would tell Java where to find our .jar files?
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

This could be done through a custom action. For example you could have an Attached Custom Action with an executable. This EXE receives the Application Folder (or the folder containing the files) as a parameter and changes the file according to your needs.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”