[wpkg-users] how to detect PC architecture

Rainer Meier r.meier at wpkg.org
Thu Dec 3 19:21:12 CET 2015


Hi Yanni,

On 03.12.2015 17:24, Yanni wrote:
> Probably a silly question but here it goes.

There are no silly questions. Usually ;)


> Do I have to have a different xml file to install a 64bit software?
> For example the Filezilla silent installer available online is for the 32 bit
> version.

You're looking for extended host attribute matching. Check out
<http://wpkg.org/Extended_host_attribute_matching>

You can simply define multiple commands for 32-bit or 64-bit systems and use 
extended host attribute matching to let wpkg execute only the ons which apply to 
the current host.

Though in future versions the attributes might disappear in favor of more formal 
conditional statements. Have a look at the XSD and documentation included in 
site/ folder of the distribution package. For example you can define commands as 
follows:

<commands>
   <command type="install" cmd='"%PACKAGE_FOLDER%\install-64.cmd"'>
     <condition>
       <check type="host" condition="architecture" value="x64" />
     </condition>
   </command>

   <command type="install" cmd='"%PACKAGE_FOLDER%\install-32.cmd"'>
     <condition>
       <check type="host" condition="architecture" value="x86" />
     </condition>
   </command>
</commands>


Note: this is only an example for conditional commands. I just wrote this down 
and its not a real example and not tested.

Shorthand writing for this is to add conditionals directly to commands:

<commands>
   <command type="install" cmd='"%PACKAGE_FOLDER%\install-64.cmd" 
architecture="x64" />

  <command type="install" cmd='"%PACKAGE_FOLDER%\install-32.cmd" 
architecture="x86" />
</commands>


As written this shorthand notation might disappear in future versions as it's 
causing attribute name collisions with some other XML attributes while the 
conditional statements can be extended more easily and provide simpler validation.

br,
Rainer


More information about the wpkg-users mailing list