Netbeans Platform and Default User Directory Settings
August 16th, 2007 | by Tonny Kohar |If you build application on top of Netbeans Platform, the default user directory setting will be in .app-name/dev. Well, this will quickly turn become problem when you deploy your next version of application, because the next version will read that directory settings for any persistence object and try to load it. If the new version is compatible then everything will works ok, if not then it is become big problem.
Note: This should not become a problem if you are using the version info (major, minor, spec) correctly.
So far, I have not find any methods to automatically delete the existing directory. So I must come up with a workaround. This workaround is basicly try to change the value in etc/app-name.conf file default_userdir=”${HOME}/.${APPNAME}/dev” to something like “${HOME}/.${APPNAME}/${APP-VER}”, in order to avoid persistence setting clashing.
The simplest way is to change the default one in [Netbeans-IDE-install-dir]/harness/etc/app.conf, but every application build with that Netbeans IDE will use the that settings. Since, we have more than 1 application build with Netbeans IDE, this approach is no go.
The alternative approach is slightly more complex
First edit the suite project.properties
In the suite project.properties, add the following
app.version=2.0
Second edit the suite ant build.xml file
This is basically just override the build-zip ant target to change the value of app-name.conf by:
1. unzip the build-zip result
2. change the value
3. zip again
<target name="build-zip" depends="suite.build-zip"> <property name="nbdist.dir" value="dist"/> <property name="release.dir" value="${nbdist.dir}/${app.name}"/> <unzip src="${nbdist.dir}/${app.name}.zip" dest="${nbdist.dir}"/> <replace file="${release.dir}/etc/${app.name}.conf" token="/dev" value="/${app.version}"/> <zip destfile="${nbdist.dir}/${app.name}-updated.zip"> <zipfileset dir="${release.dir}" prefix="${app.name}"/> </zip> <echo message=" "/> <echo message="cleaning and finalizing release" /> <delete dir="${release.dir}"/> </target>
Finally
Your are done, make sure you test it ![]()










You must be logged in to post a comment.