[izpack-user] how to get the directory where the executable is?

425 views
Skip to first unread message

Gabriel Rossetti

unread,
Oct 30, 2009, 6:53:02 AM10/30/09
to us...@izpack.codehaus.org
Hello,

I am trying to get the directory where the intaller executable is. I
have this :

in my install.xml:

<file src="copy.bat" targetdir="." unpack="false" override="true"/>
<parsable type="plain" targetfile=".\copy.bat"/>
<executable type="bin" stage="postinstall" keep="false"
targetfile=".\copy.bat"/>

and copy.bat :

@echo off
move /y .\config.txt "$INSTALL_PATH"

config.txt is right next to install.exe, but it can't find it, this
works on linux though, does anyone know why it doesn't work on windows?

Thanks,
Gabriel


--
Arimaz SA
Ingénieur en Informatique
Av. du 24 Janvier 11
Ateliers de la Ville de Renens, Atelier 5
1020 Renens, Switzerland
www.arimaz.com
www.mydeskfriend.com
Mob: +41-(0)79-539-0069
Tel: +41-(0)21-566-7343


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

http://xircles.codehaus.org/manage_email


Andreas Vef

unread,
Oct 30, 2009, 7:16:35 AM10/30/09
to us...@izpack.codehaus.org
Hello Gabriel,

the current directory during installation is not the location of the install.exe (which is only a self-extracting 7zip archive), it's a temporary folder in %TEMP% to which it writes the installer.jar and then it starts Java with this jar.
Do you use a real installer binary on linux too, or do you use "java -jar installer.jar" ?

Andreas

-----Ursprüngliche Nachricht-----
Von: Gabriel Rossetti [mailto:gabriel....@arimaz.com]
Gesendet: Freitag, 30. Oktober 2009 11:53
An: us...@izpack.codehaus.org
Betreff: [izpack-user] how to get the directory where the executable is?

Gabriel Rossetti

unread,
Oct 30, 2009, 7:29:59 AM10/30/09
to us...@izpack.codehaus.org
Hello Andreas,

Thanks for the clarification. On linux I use the .jar, on windows the
.exe, and on mac the .app. So if I understand correctly, on linux it
works because it's just the jar and thus not extracted anywhere (on mac
it also works like this), but on windows it is extracted somewhere in
%TEMP%. Is there a way to get the same behavior on windows as with mac &
linux?

Thanks,
Gabriel

Andreas Vef

unread,
Oct 30, 2009, 7:42:13 AM10/30/09
to us...@izpack.codehaus.org
Hello Gabriel,

it's probably possible, but I think you have to modify the self-extractor configuration.
The location is available there, so you should be able to pass it to Java, for example as a sytem property.
You can find more information about the self-extractor at http://www.7zsfx.info/en/

Andreas


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

Gesendet: Freitag, 30. Oktober 2009 12:30
An: us...@izpack.codehaus.org
Betreff: Re: AW: [izpack-user] how to get the directory where the executable is?

Reply all
Reply to author
Forward
0 new messages