I'm actually having the same issue, but pointing the uninstall key to the JRE in the installation directory won't help since the JRE will try to uninstall itself and fail so you'll get the uninstall error dialog (at least in 5.0)
I did not found a complete solution to this problem yet.
See "Registry access (InstallerListener and UninstallerListener)" in http://izpack.org/documentation/custom-actions.html
In install.xml <resources> I added:
<res id="RegistrySpec.xml" src="RegistrySpec.xml"/>
Then implemented the following RegistrySpec.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<registry version="5.0">
<pack name="UninstallStuff">
<!-- Special "pack", if not defined an uninstall key will be generated automatically -->
<!-- The variable $UNINSTALL_NAME can be only used if CheckedHelloPanel will be used
because there the variable will be declared. With that variabel it is possible
to install more as one instances of the product on one machine each with an
unique uninstall key. -->
<value name="DisplayName"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$UNINSTALL_NAME"
root="HKLM"
string="$UNINSTALL_NAME"/>
<value name="UninstallString"
keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$UNINSTALL_NAME"
root="HKLM"
string=""$INSTALL_PATH\jre\bin\javaw.exe" -jar "$INSTALL_PATH\uninstaller\uninstaller.jar""/>
<value name="UninstallString"
keypath="SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$UNINSTALL_NAME"
root="HKLM"
string=""$INSTALL_PATH\jre\bin\javaw.exe" -jar "$INSTALL_PATH\uninstaller\uninstaller.jar""/>
</pack>
</registry>
But if there is no Java version installed on the client workstation ?
IzPack uninstall procedure needs Java to invoke uninstaller.jar and in some cases the only Java available is one used to start the installer,
in many cases it is on a removal media or in %TEMP% folder, what can you do in case it is no longer available ?
Mario suggested to install Java as part of the installation and point the uninstaller to use this version, but this won't help since the uninstaller would try to uninstall the Java version running the uninstaller and fail.
Dude, the installer copies the java exe there but then writes to the windows registry the wrong driver letter.
Hi Paul,
I'll try to clarify the remaining uninstall problem we have when installing on a machine which has no JRE:
1. The uninstaller needs JRE to run.
2. If it relies on the JRE used for running the installer – this JRE may not be available when the user tries to uninstall since it is not "installed".
3. If it relies on another JRE installed by installer – the uninstaller tries to uninstall this JRE since it was installed by the installer, and show error messages during uninstall.
In my view the solution should as follows:
1. A property setting letting the developer to set the JRE path to invoke in the uninstall command in the Windows registry thus removing the need for implementing the registry spec xml.
2. IzPack should know not to attempt to uninstall the JRE which invokes the uninstaller.jar and it should not write any warning messages.
3. There should be additional procedure to remove this JRE later – I'm not sure how this can be done. We need to experiment with ways for a JRE to delete itself. For a start this should be documented as limitation.
Lior
From: Paul Bors [mailto:pa...@bors.ws]
Sent: Monday, February 23, 2015 6:11 PM
To: us...@izpack.codehaus.org
Subject: Re: [izpack-user] Problem with RegistryUnistallListener
Ie: During installation copy the JRE to the installation folder then for the uninstaller use the new JRE you just copied.
Sorry, I misread your response.
How do I customize the uninstaller to copy the JRE to a temp folder ?
Should I create a batch file which copies the JRE to a temp folder and then invokes the uninstaller Jar ?
But then I need to implement registry spec xml to invoke the batch file …
Also I'm not sure if the uninstaller can uninstall a running batch file.