2

这是我用于安装程序的 xml 文件。

    <izpack:registry version="5.0"
                     xmlns:izpack="http://izpack.org/schema/registry"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://izpack.org/schema/registry http://izpack.org/schema/5.0/izpack-registry-5.0.xsd">

        <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\$APP_NAME $APP_VER"
                root="HKLM"
                string="$APP_NAME" />
            <value name="DisplayVersion"
                keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
                root="HKLM"
                string="$APP_VER" />
            <value name="UninstallString"
                keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
                root="HKLM"
                string="&quot;$JAVA_HOME\bin\javaw.exe&quot; -jar &quot;$INSTALL_PATH\uninstaller\uninstaller.jar&quot;" />
            <value name="DisplayIcon"
                keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
                root="HKLM"
                string="$INSTALL_PATH\icon\uninstallericon.ico" />
            <value name="Publisher"
                keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
                root="HKLM"
                string="opname" />
        </pack>
    </izpack:registry>

我正在获取发布者名称,但无法获取大小字段值。如何在添加删除程序中添加大小字段。

4

1 回答 1

0

我想你现在可能已经找到了解决方案(或放弃了),因为这个问题已经存在三年多了,但我已经找到了解决方案。IzPack 站点上似乎没有记录它,但是通过挖掘其他已安装程序的架构和注册表设置可以找到答案。

应用程序大小作为 32 位 DWORD 值存储在注册表中,该值是应用程序的大小(以 KB 为单位),位于“EstimatedSize”项下。例如,对于 100MB (==102400KB) 的应用程序,您的配置如下所示:

<value name="EstimatedSize"
       keypath="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$APP_NAME $APP_VER"
       root="HKLM"
       dword="102400" />
于 2017-02-21T12:51:46.997 回答