Archive for GUI

creating desktop shortcut (windows) with izPack

create a .vbs file containing the following text, you can name it myshortcut.vbs

Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set link = Shell.CreateShortcut(DesktopPath & "\MyApp.lnk")
link.Arguments = "Arg1 Arg2 Arg3"
link.Description = "A Tooltip"
link.HotKey = "CTRL+ALT+SHIFT+F"
link.IconLocation = "$INSTALL_PATH\images\MyApp.ico"
link.TargetPath = "$INSTALL_PATH\MyApp.jar"
link.WindowStyle = 1
link.WorkingDirectory = "$INSTALL_PATH"
link.Save

add the following pack information in the install.xml file


<pack name="MyApp - Core" required="yes">
  <description></description>
  <fileset dir="dist" targetdir="$INSTALL_PATH">
    <include name="mkshortcut.vbs"/>
    <include name="MyApp.jar"/>
    <include name="MyApp.ico"/>
  </fileset>
  <parsable targetfile="$INSTALL_PATH/mkshortcut.vbs"/>
  <executable os="windows" keep="true" failure="warn" stage="postinstall"
    targetfile="wscript.exe">
    <args>
      <arg value="$INSTALL_PATH/mkshortcut.vbs"/>
    </args>
  </executable>
</pack>


This would create a shortcut on the desktop which would be a shortcut to a jar file, most probably
you shall create a shortcut to a .bat file to run the application.

Leave a Comment

Follow

Get every new post delivered to your Inbox.