简体   繁体   中英

How do I get izpack installer to correctly restrict a fileset based on OS architecture

I have a simple installer using no custom panels and one pack to install.

The pack has two fileset elements and each file set element is restricted by the <os> element.

<packs>
    <pack name="My Application Pack" preselected="yes" required="yes">
        <description/>
        <fileset dir="@{basedir}/x86_64" targetdir="$INSTALL_PATH/">
            <os arch="x86_64"/>
        </fileset>
        <fileset dir="@{basedir}/x86" targetdir="$INSTALL_PATH/" >
            <os arch="x86"/>
        </fileset>
    </pack>
</packs>

My installer builds and runs successfully, but when it's done, it has ignored my <os> restriction, and placed all the files from the x86_64 folder as well as the x86 folder into my $INSTALL_PATH.

I'm running on a 64 bit Windows 7 machine.

Can anyone tell me if I'm doing something wrong, or could this possibly be a bug in izpack?

OBTW... as a test, I changed the restriction to this...

<os arch="sparc"/>

... and it successfully did not install the files when I ran my installer on my Windows 7, 64 bit machine. I'm not sure if that proves that this is some sort of izpack bug or not, but I thought it would be useful information.

The IzPack doc. page here gives an overview of using OS Restrictions. Also, within that page you'll find a link to A List of known OS names and architectures.. or click here.

After a brief reading of the page @ 2nd-link-above, it seems that os arch=x86_64 works for Linux family and, as such, it isn't listed for windows 64-bit.

At the end of that page you'll find a sample code to find out the values of os.name, os.version and os.arch specific to your system. you may use these values directly in

<os arch="XXX"/>

the page also mentions that

Values that only match the beginning of os.name or os.arch are also valid (eg if you specify Windows and the os.name is Windows 98, for example, everything works out fine)

so there IS some flexibility in naming conventions.

also, once you get this working for your system, pls email your combination of os.name, version and arch to the email address mentioned in the above page so that they too can be listed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM