When installing software with WPKG, you can create a shortcut under Start/All Programs that will allow a user to start the program by using the
%WPKG_ROOT%\tools\CreateShortCut.js
script.
For instance on a particular Windows 7 system, there is an
Audio & Video item within All Programs. I want
to add a shortcut for the GSpot
Codec Information Appliance, which has an executable program named
gspot.exe
, which I am installing in C:\Program Files\Audio
and Video\GSpot
. To add the shortcut when I install the program,
I can put the following in the
gspot.xml package file I use
for its installation. The value for name
is the name I want
to use for the menu item. The target
value is the location
where the executable file, in this case, gspot.exe, is located.
<!-- Create the shortcut pointing to gspot.exe. By default, this will get
created in %PUBLIC%\Desktop, which is usually C:\Users\Public\Desktop, so it
will need to be moved under the start menu. -->
<install cmd='cmd /c %WPKG_ROOT%\tools\CreateShortcut.js /target:"%ProgramFiles%\Audio and Video\GSpot\gspot.exe" /name:"GSpot"' />
<install cmd='cmd /c move "%Public%\Desktop\GSpot.lnk" "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Audio & Video\."' />
Note: I have to use &
in place of the &
in
"Audio & Video", because otherwise WPKG will complain about white space
not being allowed whenever I try to install the package, since the ampersand
has a special meaning in HTML/XML code.
I also have to use the move command
to move the shortcut to
the appropriate location for a Start Menu item, since it will be placed
at %PUBLIC%\Desktop
by default. You can determine the value
of %PUBLIC%
on a particular system by getting a command prompt
and issuing the command echo %PUBLIC%
. It usually equates to
C:\Users\Public
.
The complete gspot.xml file.
References:
-
Create Desktop Icon
WPKG | Open Source Software Deployment and Distribution -
Using GSpot to Identify
Missing Codecs
Date: August 23, 2008
MoonPoint Support