Java 如何让IzPack安装的应用程序在Windows上卸载?

Java 如何让IzPack安装的应用程序在Windows上卸载?,java,windows,izpack,Java,Windows,Izpack,我的IzPack安装配置在Linux上运行良好。安装和卸载都可以按预期工作 安装在Windows上也可以正常工作,但卸载不起作用。IzPack放置在系统上的卸载程序经历了工作过程,但实际上并不删除任何文件。我认为这是由于UAC阻止了它,因为如果我打开一个administrator CLI并执行“java-jar uninstaller.jar”,它就可以工作了。是否有配置选项告诉它在卸载时需要提升权限?我的install.xml中已经有(安装成功需要它,Linux安装正常运行需要windows限

我的IzPack安装配置在Linux上运行良好。安装和卸载都可以按预期工作

安装在Windows上也可以正常工作,但卸载不起作用。IzPack放置在系统上的卸载程序经历了工作过程,但实际上并不删除任何文件。我认为这是由于UAC阻止了它,因为如果我打开一个administrator CLI并执行“java-jar uninstaller.jar”,它就可以工作了。是否有配置选项告诉它在卸载时需要提升权限?我的install.xml中已经有
(安装成功需要它,Linux安装正常运行需要windows限制)

我还注意到,它不会出现在Windows的“添加/删除程序”部分。是否有一个简单的配置更改来设置它(如果它是大量自定义代码,那么它就不值得了,但是如果它不是太麻烦的话,我希望支持它)

install.xml:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<installation version="1.0">
    <info>
        <appname>Program</appname>
        <appversion>5.0</appversion>  
        <appsubpath>The Corporation</appsubpath>      
        <javaversion>1.7</javaversion>        
        <uninstaller name="uninstaller.jar" path="${INSTALL_PATH}/uninstaller" write="yes"/>
        <url>http://www.example.com</url>
        <run-privileged condition="izpack.windowsinstall"/>
        <pack200/>
    </info>
    <guiprefs width="640" height="480" resizable="no"/>
    <locale>
        <langpack iso3="eng"/>
    </locale>
    <resources>
        <res id="LicencePanel.licence" src="License.txt"/>
        <res id="InfoPanel.info" src="Readme.txt"/>
        <res src="shortcutSpec.xml" id="shortcutSpec.xml"/>
        <res src="unix_shortcutSpec.xml" id="unix_shortcutSpec.xml"/>
    </resources>    
    <native type="izpack" name="ShellLink.dll"/>
    <native type="izpack" name="ShellLink_x64.dll"/>
    <native type="3rdparty" name="COIOSHelper.dll" stage="both">
        <os family="windows"/>
    </native>
    <native type="3rdparty" name="COIOSHelper_x64.dll" stage="both">
        <os family="windows"/>
    </native>    
    <listeners>
        <listener installer="RegistryInstallerListener" uninstaller="RegistryUninstallerListener" >
            <os family="windows"/>
        </listener>
    </listeners>
    <panels>
        <panel classname="HelloPanel"/>
        <panel classname="InfoPanel"/>
        <panel classname="LicencePanel"/>
        <panel classname="TargetPanel"/>
        <panel classname="ShortcutPanel"/>
        <panel classname="PacksPanel"/>
        <panel classname="InstallPanel"/>
        <panel classname="FinishPanel"/>
    </panels>
    <packs>
        <pack name="Base" required="yes">
            <description>The base files</description>
            <file src="Readme.txt" targetdir="$INSTALL_PATH"/>
            <file src="License.txt" targetdir="$INSTALL_PATH"/>
            <file src="Program.jar" targetdir="$INSTALL_PATH"/>
            <file src="lib" targetdir="$INSTALL_PATH"/>
        </pack>
        <pack name="Manual" preselected="yes" required="no">
            <description>The documentation</description>
            <file src="Manual.pdf" targetdir="$INSTALL_PATH"/>
        </pack>         
    </packs>             
</installation> 

节目
5
公司
1.7
http://www.example.com
基本文件
文件

要在windows中的“添加/删除程序”部分中列出,您需要一个负责添加/删除注册表项以及“添加/删除软件”部分的
注册表安装程序/卸载列表。看

对于“卸载时间”权限,有一个已解决的错误,其解决方法如下:
已修复:只有在安装程序成功升级时,才会通知卸载程序进行升级。
因此,卸载程序应自动升级(如果安装程序成功升级)。
我怀疑izpack.windowsinstall是否能正常工作。
它声明有效的操作系统名称为izpack.windowsinstall.7、izpack.windowsinstall.vista、izpack.macinstall
。。我知道,对于XP,不使用
是正确的。所以一定要检查这个
条件
属性。也许您需要更改该设置,以便实际向
安装程序
提供管理员权限,从而自动向
卸载程序
提供管理员权限

至于
是否有一个配置选项来告诉它在卸载时需要权限提升?:
嗯,有一个属性(讽刺的是,
uninstaller=“yes”
)可以这样指定


此处
uninstaller=“yes”
实际上根据文档禁用卸载程序的权限提升。因此,卸载程序需要不使用此属性才能接收权限提升

注意:特权安装程序将其设置为精确版本并在匹配的操作系统上进行尝试,运气不佳。安装时升级为罚款,但卸载时升级失败。我用来生成install.xml的信息位于:“内置条件”中,其中列出了izpack.windowsinstall作为合法条件代码。我的文件中根本没有卸载程序行,因此它应该默认为“否”,这允许升级。还没有尝试过注册表的东西,但看起来很有希望!这里:我仍然建议使用izpack.windowsinstall.xyzal,虽然这不是一个很好的建议时机,但请参考此-。。我读过一些案例,其中人们使用launch4j将
uninstaller.jar
打包到
*\u setup.exe
文件中,专门用于上面的“特权问题”。这是正确的语法吗?幸运的是/不幸的是,IzPack涉及大量的hit-n-trial。我建议您将文件/代码与izpack自己的安装程序进行比较,然后继续。