[izpack-user] problem with <executable>

860 views
Skip to first unread message

Chad Berkley

unread,
Apr 8, 2008, 1:43:57 PM4/8/08
to us...@izpack.codehaus.org
Hello,

I'm trying to get a small shell script to execute using the <executable>
tag. It seems to work fine on one computer, but not on others and I'm
baffled as to why it won't run. I can't seem to get any error stream
from the computers where it does not work, though I know an error is
occurring because a small dialog that says "continue?" yes/no pops up at
the end of the installation (when the script is supposed to execute).
I think for some reason, the error message is not being generated or
not being included into the dialog.

So my question is, is there a way to get at the error stream during an
izpack installation? I'd like to see why the script is not executing on
some of my test machines.

Here's the executable statements that I'm using and the script that it's
executing:

<pack name="R (2.6.2) osx" required="no" os="mac" id="r-2.6.2-mac">
<description>R (2.6.2) for Mac OSX - If you choose to install
this option, the R installer will be launched at the completion of
the Kepler installation.
</description>
<file targetdir="$INSTALL_PATH/" src="R-2.6.2-osx.dmg" os="mac"
unpack="false"/>
<executable type="bin" stage="never"
targetfile="$INSTALL_PATH/loaddmg.sh" os="mac" />
<executable type="bin" stage="postinstall"
targetfile="$INSTALL_PATH/loaddmg.sh" os="mac" />
</pack>


loaddmg.sh:
#!/bin/sh
hdiutil mount R-2.6.2-osx.dmg
open /Volumes/R-2.6.2/R.mpkg/


Once the installer finishes, I can execute the script from the command
line normally so I know it's not a permission or path issue (within the
script).

Thanks for any help.

chad

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

http://xircles.codehaus.org/manage_email


Daniel Strecker

unread,
Apr 9, 2008, 3:52:36 AM4/9/08
to us...@izpack.codehaus.org
Try out starting the installer from a console window / the command line
as follows:

java -DTRACE=TRUE -jar yourInstaller.jar

This gives you lots of information, all printed to console.


Cheers,
Daniel


> So my question is, is there a way to get at the error stream
> during an izpack installation? I'd like to see why the script
> is not executing on some of my test machines.
>

> [...]

Chad Berkley

unread,
Apr 9, 2008, 2:16:34 PM4/9/08
to us...@izpack.codehaus.org
Thanks, that's exactly what I was looking for.

chad

Daniel Strecker

unread,
Apr 15, 2008, 11:24:08 AM4/15/08
to us...@izpack.codehaus.org
Hi List!

At uninstall, I want to run a script which removes a service under windows. I include the following in my install.xml:
<executable targetfile="cmd /c start $INSTALL_PATH/bin/scriptname.cmd" stage="uninstall" failure="warn" os="windows" keep="true"/>

The "cmd /c start" is there to open a new console window. But this doesn't work. If I use

<executable targetfile="$INSTALL_PATH/bin/scriptname.cmd" stage="uninstall" failure="warn" os="windows" keep="true"/>

directly, then the uninstaller hangs in case the script waits for a keystroke. To avoid this, I tried to put in the "cmd /c start" to run the script in a console window, which can be closed by the user.

Unfortunately, this technique doesn't work. The uninstaller gives a warning that the program cannot be found.

If I put the line
<executable targetfile="notepad.exe" stage="uninstall" failure="warn" os="windows" keep="true"/>
Next to the other executable-line, notepad is executed as you would expect it.

I cannot adjust the script, because I get it from another group and it might be modified later.


Best Regards,
Daniel Strecker

360 Treasury Systems AG
Grüneburgweg 16-18 / Westend Carrée
60322 Frankfurt/Main
T. +49 (0)69 900 289 23
F. +49 (0)69 900 289 29
E. stre...@360t.com
W. www.360T.com

Commercial Register Frankfurt, No. HRB 49874; Executive Board: Carlo Kölzer, Alfred Schorno; Supervisory Board: Dr. Rainer Zimmermann

This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission.

Jordi Giménez

unread,
Apr 15, 2008, 12:27:22 PM4/15/08
to us...@izpack.codehaus.org
Hi Daniel,

Unfortunately, start is a shell command, so in fact there is not a "start.exe" anywhere that executes when you type this command in. That's why Java can not find it and you get the warning.
My approach is to use Windows Scripting Host like this:

<executable targetfile="${ENV[windir]}\System32\CScript.exe" keep="true" stage="uninstall" failure="warn" os="windows">
    <args>
        <arg value="$INSTALL_PATH\myscript.vbs"/>
    </args>
</executable>

Then, write a myscript.vbs like this:
CreateObject("Wscript.Shell").Run "cmd /C ""$INSTALL_PATH\therealscript.bat""",0,false

I must confess this is not an elegant solution, but works.

Maybe we could add a new parameter to the <executable> tag as a feature request in order to allow some program to run without waiting for it to end.

Best regards,

--
Jordi Giménez
Área desarrollo

netquest
Tel: (+34) 93 2050063
e-mail: jgim...@netquest.es
Web: www.solucionesnetquest.com

Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es usted el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.
Daniel Strecker escribió:

Shailesh Mangal

unread,
Apr 15, 2008, 3:28:46 PM4/15/08
to us...@izpack.codehaus.org
We have a similar requirement, and we have wrapped our scripts into a batch file and following works for us.

<executable targetfile="$INSTALL_PATH/pathToBatchFile/bin/install.bat" stage="postinstall" keep="true">
</executable>

Shailesh
Now, TestManagement is a breeze.

Florian GIMBERT

unread,
Apr 15, 2008, 4:56:16 PM4/15/08
to us...@izpack.codehaus.org

Great !

 


De : Shailesh Mangal [mailto:sx...@yahoo.com]
Envoyé : mardi 15 avril 2008 21:29
À : us...@izpack.codehaus.org
Objet : Re: [izpack-user] Executinga process in separate console window at uninstall time

Nicholas Albion

unread,
Jun 4, 2013, 2:02:39 AM6/4/13
to izpac...@googlegroups.com, us...@izpack.codehaus.org, florian...@tagsysrfid.com
This doesn't seem to be working on izpack 5.0.0-rc1-SNAPSHOT

    <packs>
        <pack name="Core" required="yes">
            <description>The core files</description>
            <executable stage="postinstall" targetfile="notepad.exe" keep="true"/>
            <executable stage="uninstall" targetfile="$INSTALL_PATH/bin/myapp.bat" keep="true">
            <args><arg value="remove"/></args>
            </executable>
        </pack>
    </packs>

Nicholas Albion

unread,
Jun 4, 2013, 2:47:52 AM6/4/13
to izpac...@googlegroups.com, us...@izpack.codehaus.org, florian...@tagsysrfid.com
Sorry, that is working for me now
Reply all
Reply to author
Forward
0 new messages