[izpack-users] Creating shortcuts based on version of windows

Klaus Bartz bartzkau at gmx.net
Fri Feb 10 13:51:32 CET 2006


Hi Fabrice,
thanks, I am OK. Writing only with left hand is a little bit
unbeautiful but more easy as I thought before.
In two weeks I will lost the cast around my rght wrist :-)
Rest see context related...

Cheers

Klaus

Am 10.02.2006, 12:04 Uhr, schrieb Miraodb <miraodb at hotmail.com>:

> Hi klaus,
>
> Jeez, Good to see you again !
> I hope you're ok now and everything is cool !!!
>

>> H Scott,
>> if I look into the code, it seems so, that OS on the name or version
>> will be supported also it is not written in the docu. May be I am  
>> wrong...
>> Do you have tested it analog to the usage in install.xml?
>
> I didn't see anything like that in the code... in which class did you see
> the check for specific version of operation system ?
>

It is a little bit hidden; the benefit of object orientated programming...

At ShortcutPanel.jave line 810
             if (!OsConstraint.oneMatchesCurrentSystem(shortcutSpec))  
continue;
makes all. All spec readers which uses this method will be support extended
OS "depending".

The real work will be done in
OsConstraint.getOsList(XMLElement element) which is called from
OsConstraint.oneMatchesCurrentSystem(XMLElement el)

I have tested it just with a test installation.
------------------------- shortcutSpec.xml start -------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<shortcuts>

   <skipIfNotSupported />

   <programGroup defaultName="IzForge\test1" location="applications"/>

    <shortcut
      name="test1"
      programGroup="yes"
      desktop="no"
      applications="no"
      startMenu="no"
      startup="no"
      target="$INSTALL_PATH\Licence.txt"
      commandLine=""
      description="test shortcut for Windows XP exclusive">

      <os family="windows" name="Windows XP" />
      <createForPack name="Base" />
    </shortcut>

    <shortcut
      name="test2"
      programGroup="yes"
      desktop="no"
      applications="no"
      startMenu="no"
      startup="no"
      target="$INSTALL_PATH\Licence.txt"
      commandLine=""
      description="test shortcut for Windows 2000 and  Windows XP">

      <os family="windows" name="Windows 2000" />
      <os family="windows" name="Windows XP" />
      <createForPack name="Base" />
    </shortcut>

    <shortcut
      name="test3"
      programGroup="yes"
      desktop="no"
      applications="no"
      startMenu="no"
      startup="no"
      target="$INSTALL_PATH\Licence.txt"
      commandLine=""
      description="test shortcut for Windows 2000 exclusive">

      <os family="windows" name="Windows 2000" />
      <createForPack name="Base" />
    </shortcut>
</shortcuts>
------------------------- shortcutSpec.xml end -------------------

On my box (Windows XP) "test1" and "test2" will be installed, "test3" not.
Seems, it works.
Only question is, what OS names are valid. But this question we should
not answer explicitly because it will change or expand in future. It
is specified by the VM property os.name. Not more, not less...



> Cheers,
> fabrice
>
>
> _______________________________________________
> izpack-users mailing list
> izpack-users at lists.berlios.de
> http://lists.berlios.de/mailman/listinfo/izpack-users
>



More information about the izpack-users mailing list