izPack创建一个卸载程序,该卸载程序无法在Windows的“程序和功能"(Windows)中运行. [英] izPack creates an uninstaller that doesn't work in Windows "Programs and Features"
问题描述
我正在使用izPack 4.3.4为Java项目开发图形安装程序,安装进行得很好,但是当我尝试通过在程序和功能"窗口中单击他的引用来尝试卸载它时,该消息将显示消息:/p>
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
事实是,我选择在程序的根安装路径中而不是\ uninstaller目录中放置并重命名卸载程序.参见XML:
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>
而且,实际上,在C:\ Program Files(x86)\ myproject \中创建了uninstall.jar文件,如果我双击它或在开始"菜单中双击它,它将起作用.我认为izpacks在Windows注册表中写入了错误的数据,以在程序和功能"中对其进行引用...但是我不知道为什么...
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...
推荐答案
如果要在Windows上使用IZPack进行安装,则可以(应该)拥有RegistrySpec.xml.那个人会写出您需要的所有注册表项. Windows查找注册表值"UninstallString"作为要启动卸载的文件,您可能需要覆盖该值.例如我的:
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">
这篇关于izPack创建一个卸载程序,该卸载程序无法在Windows的“程序和功能"(Windows)中运行.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!