Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

izPack creates an uninstaller that doesn't work in Windows "Programs and Features"

I'm working on a graphic installer for a java project using izPack 4.3.4, the installation goes well but when I try to uninstall it by clicking on his reference in "Programs and Features" window it shows the message:

Error: Unable to access jarfile C:\Program Files (x86)\myproject\uninstaller\uninstaller.jar

The fact is that I choosed to put and rename the uninstaller in the root install path of my program and not in \uninstaller dir. See the XML:

<info>
...
  <uninstaller name="uninstall.jar" write="yes" path="${INSTALL_PATH}" />
...
</info>

And, in fact, uninstall.jar file is created in C:\Program Files (x86)\myproject\ and it works if I double click on it or throught the Start Menu. I think izpacks writes the wrong data in the Windows's registry to reference it in "Programs and Features"... but I don't know why...

like image 294
TheUnexpected Avatar asked Nov 14 '22 17:11

TheUnexpected


1 Answers

If you're installing using IZPack on Windows, you can (should) have a RegistrySpec.xml. That guy writes all the registry entries you need. Windows looks for a Registry Value "UninstallString" as the file to run to kick off your uninstall, and you likely need to overwrite that. For example on mine:

<pack name="UninstallStuff">
<!-- Special "pack", if not defined an uninstall key will be generated automatically -->
<value name="UninstallString"
    keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME"
    root="HKLM"
    string="$INSTALL_PATH\uninstall\uninstaller.cmd"/>    
<pack name="UninstallStuff">
like image 129
Minus Ex Avatar answered Dec 07 '22 00:12

Minus Ex