loading properties file using custom panel in izpack 4.3.5

209 views
Skip to first unread message

Challa

unread,
Jul 30, 2015, 3:43:03 PM7/30/15
to izpack-user
   Hi,

I am trying to load the properties file with my custom panel using IZpack 4.3.5.
i have placed all the properties and images related to my isntaller in bin folder and created jar.when i tried to run it it is working fine .

But when  i placed the same jar in the some other folder/mechine i am getting file not found exception of .properties file in my custompanel.java class.
Could you tell me how to give the relativepath/path to load the properties file using my custompanel?

i added following in install.xml

<resources>
<res id='template.properties" src="template.properties>
<resources>

<panel classname="custompanel"/>

<packs>
<pack name="Base" required="yes">
<file src="template.properties" targetDir="$INSTALL_PATH"/>
<parseble targetfile="template.properties" type="prop" parse="yes"/>
<pack>
</packs>


in my custom class

inputstream in=new FileinputStream("template.properties"); -------------------------------exception coming here


Can you please let me know how to solve this in IZpack 4.3.5 or how to provide/get the relative path of the template.properties file?

Thank you,
Challa.

René Krell

unread,
Sep 23, 2015, 3:47:03 AM9/23/15
to izpack-user
Hi Challa,

from you panel implementation you should get an instance of AutomatedInstallData, read value of the built-in variable "INSTALL_PATH" set by TargetPanel and use its value to assemble an absolute (or canonical) path instead of the relative one.
The term new FileinputStream("template.properties") will look at the current directory wherever it is situated, but you cannot rely on it to be the same like ${INSTALL_PATH}.

René


Dne čtvrtek 30. července 2015 21:43:03 UTC+2 Challa napsal(a):

René Krell

unread,
Sep 24, 2015, 3:39:11 AM9/24/15
to izpack-user
One more hint - please keep in mind that usually files are still not installed when panels are shown.
If you use template.properties to show values on a panel this is rather for purposes of updates from older, preinstalled versions of your application. This would be fine.
If your template.properties comes with the installation and you need it to exist also for installations from scratch I'd recommend to use an InstallerListener for doing tasks with it, but you can't read it for default values in panels. You must use built-in default values for this case. Dividing into default values and values from preinstalled files can be done easily by dynamic variables and conditions.

René


Dne středa 23. září 2015 9:47:03 UTC+2 René Krell napsal(a):

sandeep srivastava

unread,
Jan 14, 2016, 8:18:16 AM1/14/16
to izpack-user
Hi Rene,


I am trying to load PacksLang.xml_eng in my installer, but the file is not overriding the default eng.xml values.
Its very urgent, could you please help.

René Krell

unread,
Jan 14, 2016, 8:56:55 AM1/14/16
to izpack-user
The resource packsLang.xml_<iso3> is not meant to override built-in translations, but packs labels shown primarily in the PacksPanel.
See my previous comment, you need to usethe resource CustomLangPack.xml_<iso3> here.

Dne čtvrtek 14. ledna 2016 14:18:16 UTC+1 sandeep srivastava napsal(a):
Reply all
Reply to author
Forward
0 new messages