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

Miraodb miraodb at hotmail.com
Fri Feb 10 14:14:03 CET 2006


hi klaus,

> 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...

I'm very glad to hear that you're ok! One hand is better than nothing ;-) I
have some troubles with two sometimes... so i can imagine how hard it would
be with only one... and especially the left one for a right-handed !

> 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...
>


OK i just tried that too on my computers XP and 2000 and it works fine as
well.
I'll update the docu asap. I'm going to toronto for a week this saturday,
i'll be back next monday.

FWI, i found this info on the web:

 Here are the values Sun uses for the os.name property to identify various
platforms: os.name
      AIX
      Digital Unix
      FreeBSD
      HP UX
      Irix
      Linux
      Mac OS
      MPE/iX
      Netware 4.11
      OS/2
      Solaris
      Windows 2000
      Windows 95
      Windows 98
      Windows NT
      Windows XP


http://mindprod.com/jgloss/properties.html

I believe it's a good start to gather the current platforms' name.

Cheers,
fabrice





More information about the izpack-users mailing list