[izpack-user] executing after install & making shortcut in Startup folder

346 views
Skip to first unread message

Gabriel Rossetti

unread,
Oct 20, 2009, 12:20:11 PM10/20/09
to us...@izpack.codehaus.org
Hello everyone,

I have two questions, the first is I'd like to execute my program right
after the installation, but when I use the <execute> tag it waits for it
to finish, which I don't want, and the installation never terminates.

My second question is I'd like to create a shortcut but place it in the
Startup folder and also create a regular group, but not on the desktop.
I found examples for the program group but not how to put it somewhere
else. Could someone please help?

Thank you,
Gabriel

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Andreas Vef

unread,
Oct 21, 2009, 3:45:54 AM10/21/09
to us...@izpack.codehaus.org
Hello Gabriel,

there is currently no direct way to start an application without waiting.
On Windows you may try to use an execute panel and
cmd.exe /C "start ${INSTALL_PATH}\YourApplication.exe"

Shortcut creation is controlled by attributes of the shortcut element.
Example:

<shortcut
name="MyApp"
subgroup="\MySubGroup"
applications="no"
desktop="no"
programGroup="yes"
startMenu="no"
startup="no"
target="${INSTALL_PATH}/YourApplication.exe"
workingDirectory="${INSTALL_PATH}/YourApplication.exe"
description="This is my application">
<createForPack name="MyPackage"/>
</shortcut>

This will create the shortcut in Programs\yourmaingroup\MySubGroup,
where yourmaingroup is the group that the user selects during installation.
The subgroup attribute is currently undocumented.

So, to create it in the Startup folder but not on te desktop, just use startup="yes" and desktop="no", etc.
See documentation of shortcut attributes

Kind regards,
Andreas

-----Ursprüngliche Nachricht-----
Von: Gabriel Rossetti [mailto:gabriel....@arimaz.com]
Gesendet: Dienstag, 20. Oktober 2009 18:20
An: us...@izpack.codehaus.org
Betreff: [izpack-user] executing after install & making shortcut in Startup folder

Gabriel Rossetti

unread,
Oct 21, 2009, 8:46:09 AM10/21/09
to us...@izpack.codehaus.org
Hello Andreas,

Thanks for your help. I tried the shortcut code and adapted it like you
said :

<shortcuts>
<shortcut
name="MyApp"
programGroup="no"
desktop="no"
applications="no"
startMenu="no"
startup="yes"
target="$INSTALL_PATH/MySubpath/MyApp.exe"
workingDirectory="$INSTALL_PATH/MySubpath"
iconFile="$INSTALL_PATH/MySubpath/icon/logo.ico"
iconIndex="0"
description="Open the app on Startup"/>
</shortcuts>

but it doesn't work. I read that if the shortcut always needs to be
installed I don't need <createForPack name="MyPackage"/>. Do you know
why it doesn't work?

And when you say an execution panel, do you mean the <execute> tag or is
it something else?

Thank you,
Gabriel

Andreas Vef

unread,
Oct 21, 2009, 9:35:21 AM10/21/09
to us...@izpack.codehaus.org
Hello Gabriel,

your shortcut definition seems to be ok. Unfortunately there is absolutely no error handling in shortcut creation, all exceptions are caught and ignored.
I think that the target files must exist at the time when the shortcuts are created. By default they are created when you continue from the shortcut panel, so you should place the shortcut panel after the install panel.
Or you can add the LateShortcutInstallListener, this will create the shortcuts when installation finishes.
Add this element after the <panels> element.
<listeners>
<listener installer="LateShortcutInstallListener"/>
</listeners>
This mechanism is not documented, I found it from the source code.

There are two posibilities to start your application (sorry, of course there is no "execution panel").
You may try an <executable stage="postinstall"> with a batch file, or a ProcessPanel

Andreas

-----Ursprüngliche Nachricht-----
Von: Gabriel Rossetti [mailto:gabriel....@arimaz.com]

Gesendet: Mittwoch, 21. Oktober 2009 14:46
An: us...@izpack.codehaus.org
Betreff: Re: AW: [izpack-user] executing after install & making shortcut in Startup folder

Gabriel Rossetti

unread,
Oct 23, 2009, 3:13:16 AM10/23/09
to us...@izpack.codehaus.org
Hello Andreas,

Ok, I tried the listener but it doesn't work. The shortcut panel shows
up, but it doesn't create them. I even tried copying the target file &
icon to C:\Temp and hard coding them in the spec file but it doesn't
work. I also have the same problem with writing to the registry, it
doesn't work, here's my code :


for the registery :

in setup.xml :

<native type="3rdparty" name="COIOSHelper.dll" stage="both">
<os family="windows"/>
</native>

<resources>
<res id="InfoPanel.info" src="Intro.txt"/>
<res id="LicencePanel.licence" src="Licence.txt"/>
<res id="Heading.image" src="heading-image.png"/>
<res id="installer.langsel.img" src="splash-image.png"/>
<res id="Installer.image" src="side-image.png" />
<res src="MyRegistrySpec.xml" id="registrySpec.xml"/>
<res src="MyShortcutSpec.xml" id="shortcutSpec.xml"/>
</resources>

<listeners>
<listener installer="RegistryInstallerListener"
uninstaller="RegistryUninstallerListener">
<os family="windows"/>
</listener>
</listeners>

in MyRegistrySpec.xml :

<registry>
<pack name="Core">
<value name="MyApp"
keypath="Software\Microsoft\Windows\CurrentVersion\Run"
root="HKCU"
string="C:\Temp\MyApp.exe"/>
</pack>
</registry>


I don't understand why neither the shortcuts nor the registry access
work, and I'm running Windows as an admin user too.

Andreas Vef

unread,
Oct 23, 2009, 4:12:15 AM10/23/09
to us...@izpack.codehaus.org
Hello Gabriel,

for shortcut creation you need another native library:
<native type="izpack" name="ShellLink.dll">


<os family="windows"/>
</native>

As I said it's very difficult to find the problem, since all errors are ignored.
I got it working only by running the installer jar in the debugger (Eclipse JDT)...

Andreas

-----Ursprüngliche Nachricht-----
Von: Gabriel Rossetti [mailto:gabriel....@arimaz.com]

Gesendet: Freitag, 23. Oktober 2009 09:13
An: us...@izpack.codehaus.org
Betreff: Re: AW: AW: [izpack-user] executing after install & making shortcut in Startup folder

Reply all
Reply to author
Forward
0 new messages