Bug #5416
closed
downloaded modules by Kepler module manager should know the path of main Kepler installation.
Added by jianwu jianwu over 13 years ago.
Updated over 12 years ago.
Description
In Kepler 2.2, new modules downloaded by Kepler module manager are located at ~/KeplerData/kepler.modules/, which includes both zip file and unzipped module fold. Some modules have their own executable files which need the classes in main Kepler installation, such as the *.sh files in master-slave module. To correctly start these executables, they need to know the path of main Kepler installation, namely the path where kepler.sh is located when users install Kepler 2.2. Since the installation paths for Kepler 2.2 could be different, there is no conventional path for it.
I found the build-area folder in ~/KeplerData/kepler.modules/, it could be a good place to put a info file, e.g. keplerPath.txt, in this folder telling the Kepler installation path. By this way, downloaded modules from Kepler module manager will be able to find the classes in main Kepler installation.
Files
Why couldn't this just be a standard configuration property that is set by the core or loader on startup and that is accessible to any other module via the ConfigurationManager? I think this would be better than having yet another configuration file.
The challenge is that new downloaded modules are not aware the path of the main Kepler installation. So these modules can not use any class in the main Kepler, including Configuration Manager, before they know where they are located.
I suggest setting a Java property. For Ptolemy, we use ptolemy.ptII.dir.
On the Mac,
/Applications/Ptolemy/ptII8.0.1/bin/Vergil.app/Contents/Info.plist
<dict>
<key>ptolemy.ptII.dir</key>
<string>$APP_PACKAGE/../..</string>
<dict>
The izPack Windows executable does not have something similar.
ptolemy.util.StringUtilities.getProperty() has hacky code that checks
for the ptolemy.ptII.dir property. If it is not set, then it looks
for the StringUtilities class using getResource(). There is quite a
bit of magic there to handle Jar URLs etc.
In an Expression actor, if you call
property("ptolemy.ptII.dir")
then you will get something like:
/Users/cxh/src/kepler/ptolemy/target/classes
I've attached a model that does that.
It should be checked in a release to see if it works with the installers.
I updated class in build-area to write install-path.txt to ~/KeplerDatat/kepler.modules/build-area dir at version 30323. closing the bug.
Christopher, as I explained in comment 2, this bug happens before Kepler start, not after Kepler start. So the new added install-path.txt can help modules in ~/KeplerData/kepler.modules/ to find where kepler is installed.
One problem with your change at r30323 is that it only writes this install-path.txt on a new install. A user could subsequently move/rename their install directory.
(In reply to comment #5)
One problem with your change at r30323 is that it only writes this
install-path.txt on a new install. A user could subsequently move/rename their
install directory.
you are right. I re-open it and will work on it, so that install-path.txt can be reset if the installation path is changed. It will also work better in case there are two kepler installations (same or different versions).
it is fixed based on comment 5 and 6 at version 30378.
Original Bugzilla ID was 5416
Also available in: Atom
PDF