[izpack-users] stage: uninstall - running bat-file with arguments

J-Pro joker.pro at gmail.com
Sat Oct 28 07:47:46 CEST 2006


Good afternoon, IzPack gurus.

I'm trying to uninstall some services from my bat-file, but I run it from 
uninstaller.
I've just added these strings in install.xml:

  <executable targetfile="uninstall.bat" stage="uninstall" os="windows">
    <arg>$catalinaServiceName</arg>
    <arg>$catalinaServiceName</arg>
    <arg>$postgreInstallFolder</arg>
    <arg>$TOMSScelDelFilename</arg>
    <arg>$postgreUser</arg>
    <arg>$postgreServiceName</arg>
    <arg>$postgreServiceName</arg>
    <arg>>></arg>
    <arg>C:\T_INSTALL.log</arg>
  </executable>

">> C:\T_INSTALL.log"  is specified because I want to see bat output 
somewhere.

With these strings when uninstall starts and I press "Uninstall" button, the 
dialog appears asking me "Continue?". I assume that this dialog appears 
because my bat-files fails to execute and waits for some input. So I just 
want to see the error in it. So when I press "Yes" - it uninstalls 
everything I need except things in the bat-file. And of course there is no 
file C:\T_INSTALL.log created . :(  I don't know why....


Here is my bat-file(strings like echo 1 $catalinaServiceName are for me, 
just to know arguments order):

@echo off

echo ============================= START
echo ---------------- stopping and disabling Tomcat service
echo 1 $catalinaServiceName
echo 2 $catalinaServiceName
sc stop %1
sc config %2 start=disabled
echo ---------------- deleting TOMS DB
echo Run data script to delete all TOMS data (DB, tables, functions, etc.)
echo psql.exe -f TOMSskel.sql -U tomsUser
echo ..
echo 3 $postgreInstallFolder
echo 4 $TOMSScelDelFilename
echo 5 $postgreUser
echo
echo
echo
%3/bin/psql -f %4 -U %5
echo ---------------- stopping and disabling PostgreSQL service
echo 6 $postgreServiceName
echo 7 $postgreServiceName
echo
echo
sc stop %6
sc config %7 start=disabled
echo ============================= END

Here are my variables:

        <variable name="catalinaServiceName" value="Tomcat5"/>
        <variable name="postgreInstallFolder" value="C:\Program 
Files\PostgreSQL\8.1"/>
        <variable name="TOMSScelDelFilename" value="TOMSskelDel.sql"/>
        <variable name="postgreUser" value="postgres"/>
        <variable name="postgreServiceName" value="pgsql-8.1"/>


I see that I've passed one variable for two times. But I think there will be 
no error because of this reason.


And one more thing: maybe you wonder why didn't I call "sc" with arguments 
from install.xml via <executable/> - I'll explain. I did it. But when 
uninstall starts and I press "Uninstall", it just hangs up because of sc.exe 
waiting for some data. I saw it in processes.

Here is the code I used for calling sc and other stuff from xml:

     <!-- stopping and disabling Tomcat service -->
     <executable targetfile="sc" stage="uninstall" os="windows">
  <arg>stop</arg>
  <arg>$catalinaServiceName</arg>
     </executable>

     <executable targetfile="sc" stage="uninstall" os="windows">
  <arg>config</arg>
  <arg>$catalinaServiceName</arg>
  <arg>start=</arg>
  <arg>disabled</arg>
     </executable>

     <!-- deleting TOMS DB -->
     <executable targetfile="$postgreInstallFolder/bin/psql" 
stage="uninstall" os="windows">
            <!-- Run data script to delete all TOMS data (DB, tables, 
functions, etc.) -->
            <!-- psql.exe -f TOMSskel.sql -U tomsUser -->
  <arg>-f</arg>
  <arg>$TOMSScelDelFilename</arg>
  <arg>-U</arg>
  <arg>$postgreUser</arg>
        </executable>

     <!-- stopping and disabling PostgreSQL service -->
     <executable targetfile="sc" stage="uninstall" os="windows">
  <arg>stop</arg>
  <arg>$postgreServiceName</arg>
     </executable>

     <executable targetfile="sc" stage="uninstall" os="windows">
  <arg>config</arg>
  <arg>$postgreServiceName</arg>
  <arg>start=</arg>
  <arg>disabled</arg>
 </executable>


Please, help me to solve this problem...  Thank you very much in advance.


P.S.: "The data in this mail is absolutely the same with mine."


________________________________
With respect,

Yurii Kartsev,
Soft IT 




More information about the izpack-users mailing list