[izpack-user] distinguish 32 vs 64 bit architecture

783 views
Skip to first unread message

Alida

unread,
Apr 20, 2012, 5:59:19 PM4/20/12
to us...@izpack.codehaus.org
Hello,

I'm new to IzPack and I don't even know if it is here that I'm supposed to write to have some support... but it's worth trying :)

I don't understand how the conditions on the OS architecture works (I need to install two different dlls according to the user architecture 32 vs 64 bit).
Can somebody provide me an example of installer.xml that does that??

Thanks
Alida

Doug Palmer

unread,
Apr 20, 2012, 10:12:40 PM4/20/12
to us...@izpack.codehaus.org
There's a useful little system property set called sun.arch.data.model
that izpack can access via SYSTEM_sun_arch_data_model. The following bit
of configuration sets two conditions: arch64 and arch32 which you can use.

Doug


<conditions>
<condition type="variable" id="arch64">
<name>SYSTEM_sun_arch_data_model</name>
<value>64</value>
</condition>
<condition type="not" id="arch32">
<condition type="ref" refid="arch64" />
</condition>
</conditions>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Earl Hood

unread,
Apr 21, 2012, 12:19:36 AM4/21/12
to us...@izpack.codehaus.org
On Fri, Apr 20, 2012 at 9:12 PM, Doug Palmer wrote:
> There's a useful little system property set called sun.arch.data.model that
> izpack can access via SYSTEM_sun_arch_data_model. The following bit of
> configuration sets two conditions: arch64 and arch32 which you can use.

I believe this only tells you if the JVM is 32 or 64 bit, not the
underlying OS. I.e. You could have a 32bit JVM running under a 64bit
OS.

For Windows, you can check for the existence of the ProgramW6432
environment variable. This environment variable is only set for 64bit
versions of the OS.

For Linux, you can capture the output of "uname -m" command to determine
if 32bit or 64bit. The 'arch' command can also be used.

For a 32bit OS, you will get one of the following strings for the
architecture:

i386
i486
i586
i686

For 64bit Linux, you will get:

x86_64

--ewh

Alida

unread,
Apr 21, 2012, 10:04:39 AM4/21/12
to us...@izpack.codehaus.org
Thanks all for the reply but that's exactly what I tried (all the combinations) and it doesn't seem to work...
probably the problem is where I'm using the conditions... I'm writing something like that

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
<installation version="1.0">
<info>
...
</info>
<guiprefs height="480" resizable="no" width="640">
...   
</guiprefs>
    <locale>
   ...
 </locale>
    <panels>
     ...
</panels>
    <variables>
      ...
</variables>

<conditions>

<condition type="java" id="is64">
<java>
<class>com.izforge.izpack.util.OsVersion</class>
<field>IS_X64</field>
</java>
<returnvalue type="boolean">true</returnvalue>
</condition>

<condition type="java" id="is32">
<java>
<class>com.izforge.izpack.util.OsVersion</class>
<field>IS_X86</field>
</java>
<returnvalue type="boolean">true</returnvalue>
</condition>
</conditions>

    <packs>
         <pack name="PACK 32" preselected="yes" required="yes" condition="is32">
            <description/>
         <file src="FILE.DLL" targetdir="$INSTALL_PATH/"/>
    </pack>
    <pack name="PACK 64" preselected="yes" required="yes" condition="is64">
            <description/>
         <file
src="FILE.DLL" targetdir="$INSTALL_PATH/"/>
    </pack>
    </packs>
</installation>

In both the architectures it sees to pick the 64 FILE.DLL...

I'm sorry if this questions seems to be trivial but I just started with izPack and probably there is something basic that I'm missing and that for any other user of IzPack is natural! This is why a complete working example would be very very useful to me.

Thanks
Alida
Reply all
Reply to author
Forward
0 new messages