【问题标题】:How do I get IzPack installed applications to uninstall on Windows?如何让 IzPack 安装的应用程序在 Windows 上卸载?
【发布时间】:2014-07-03 04:07:17
【问题描述】:

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

安装在 Windows 上也可以正常工作,但卸载不起作用。 IzPack 放置在系统上的卸载程序会进行工作,但实际上不会删除任何文件。我认为这是由于 UAC 阻止了它,因为如果我打开管理员 CLI 并执行“java -jar uninstaller.jar”它可以工作。是否有配置选项告诉它在卸载时需要提权?我的 install.xml 中已经有 <run-privileged condition="izpack.windowsinstall"/>(安装成功需要它,并且 Linux 安装需要 Windows 限制才能正常运行)。

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

安装.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> 

【问题讨论】:

标签: java windows izpack


【解决方案1】:

要在添加/删除程序部分列出,在 Windows 中,您需要一个 RegistryInstaller/UninstallerListener,它负责添加/删除注册表项以及添加/删除软件部分。见HERE

对于卸载时权限,有一个已解决的错误 HERE 具有以下分辨率:Fixed: the uninstaller is told to make an elevation only if the installer did a successful one. 因此,卸载程序应该自动升级(如果安装程序这样做)。
我怀疑izpack.windowsinstall 的条件实际上是否正常工作。
HERE-in-the-doc 它指出Valid operating system names are izpack.windowsinstall.7, izpack.windowsinstall.vista, izpack.macinstall .. 我知道对于XP 不使用&lt;run-privileged/&gt; 是正确的。所以请检查这个condition 属性。也许您需要将其更改为实际上installer 提供管理员权限,因此自动为Uninstaller 提供管理员权限。

至于Is there a configuration option to tell it to require privilege escalation on uninstall?:,有一个属性(讽刺的是,uninstaller="yes")你可以像这样指定&lt;run-privileged uninstaller="yes" condition.../&gt;
这里uninstaller="yes" 实际上禁用卸载程序的权限提升,根据文档。所以不使用这个属性是卸载程序接收权限提升所必需的。

【讨论】:

  • 特权安装程序将其设置为精确版本并尝试匹配操作系统时运气不佳。安装时升级正常,但卸载时失败。我用来生成 install.xml 的信息位于:izpack.org/documentation/installation-files.html“内置条件”那里也将 izpack.windowsinstall 列为合法条件代码。我的文件中根本没有卸载程序行,所以它应该默认为“no”,这允许升级。还没有尝试过注册表的东西,但看起来很有希望!
  • 这里:svn.codehaus.org/izpack-svn/izpack-src/trunk/src/native/… 我仍然建议使用 izpack.windowsinstall.XYZ
  • 虽然这个建议不是很好的时机,但请参考这个-izpack.org/documentation/… .. 我已经读过人们使用launch4j将uninstaller.jar打包到*_setup.exe文件中的案例专门为此权限问题
  • "" 从上面。这是正确的语法吗?
  • 幸运/不幸的是,IzPack 涉及大量的 hit-n-trial。我建议您将您的文件/代码与 izpack 自己的安装程序 izpack-x.x.x.jar 进行比较以继续。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-06-23
  • 1970-01-01
  • 2011-08-30
  • 1970-01-01
  • 1970-01-01
  • 2023-03-03
  • 1970-01-01
相关资源
最近更新 更多