1

我的主应用程序是用 Java 编写的,它有 Main.jar。我正在准备最终的部署包。

但它有其他依赖项,例如第三方库需要首先在 Windows 操作系统中可用/预安装,一旦安装,我的应用程序就可以运行,否则它将显示错误并且无法工作。所以我很挣扎,最终用户必须这样做:

1) Thirdparty.library.msi (install manually) which is a GUI installer itself already
2) Then setup my Main.jar
3) Once it started it looks first for the third party libraries, if does not exist, software fails.

对于这种情况,是否有任何适当的方法可以制作一个安装程序,它可以完成第 1 步和第 2 步的工作,但两者看起来都像 1 安装?

跟进:我还希望最终用户看不到我的第三方以进行演示。所以我看到有一个工具叫做 msi

1) 安装人员准备 BATCH

Windows ® Installer. V 3.01.4000.1823 

msiexec /Option <Required Parameter> [Optional Parameter]

Install Options
    </package | /i> <Product.msi>
        Installs or configures a product
    /a <Product.msi>
        Administrative install - Installs a product on the network
    /j<u|m> <Product.msi> [/t <Transform List>] [/g <Language ID>]
        Advertises a product - m to all users, u to current user
    </uninstall | /x> <Product.msi | ProductCode>
        Uninstalls the product
Display Options
    /quiet
        Quiet mode, no user interaction
    /passive
        Unattended mode - progress bar only
    /q[n|b|r|f]
        Sets user interface level
        n - No UI
        b - Basic UI
        r - Reduced UI
        f - Full UI (default)
    /help
        Help information
Restart Options
    /norestart
        Do not restart after the installation is complete
    /promptrestart
        Prompts the user for restart if necessary
    /forcerestart
        Always restart the computer after installation
Logging Options
    /l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <LogFile>
        i - Status messages
        w - Nonfatal warnings
        e - All error messages
        a - Start up of actions
        r - Action-specific records
        u - User requests
        c - Initial UI parameters
        m - Out-of-memory or fatal exit information
        o - Out-of-disk-space messages
        p - Terminal properties
        v - Verbose output
        x - Extra debugging information
        + - Append to existing log file
        ! - Flush each line to the log
        * - Log all information, except for v and x options
    /log <LogFile>
        Equivalent of /l* <LogFile>
Update Options
    /update <Update1.msp>[;Update2.msp]
        Applies update(s)
    /uninstall <PatchCodeGuid>[;Update2.msp] /package <Product.msi | ProductCode>
        Remove update(s) for a product
Repair Options
    /f[p|e|c|m|s|o|d|a|u|v] <Product.msi | ProductCode>
        Repairs a product
        p - only if file is missing
        o - if file is missing or an older version is installed (default)
        e - if file is missing or an equal or older version is installed
        d - if file is missing or a different version is installed
        c - if file is missing or checksum does not match the calculated value
        a - forces all files to be reinstalled
        u - all required user-specific registry entries (default)
        m - all required computer-specific registry entries (default)
        s - all existing shortcuts (default)
        v - runs from source and recaches local package
Setting Public Properties
    [PROPERTY=PropertyValue]

或者 在此处输入图像描述

2) 实用/样品

# Install Silently [works]:
C:\windows\system32\msiexec.exe /I "C:\Documents and Settings\sun\My Documents\Downloads\10.70.msi" /QN
C:\windows\system32\msiexec.exe /I "C:\Documents and Settings\sun\My Documents\Downloads\10.71.msi" /QN

# For future reference [not tested]
start /wait msiexec /i O12Conv.msi /qb
start /wait msiexec /p O12Convsp1-en-us.msp /qb
start /wait msiexec /i mpsetupedp.msi

# other samples [not tested]
msiexec /package Application.msi /quiet
msiexec /uninstall Application.msi /quiet
msiexec /update msipatch.msp /quiet
msiexec /uninstall msipatch.msp /package Application.msi / quiet
4

3 回答 3

1

所有基于 UI 的安装工具都能够运行外部程序并以由命令行参数控制的批处理模式运行。

因此,如果您的thirdparty.msi 是您拥有并且必须使用的,我建议您找到以批处理模式运行它的能力。然后创建您自己的安装程序,该程序将调用此第 3 方 MSI。

有多种工具可用于创建基于 UI 的安装程序(InstallShieled、InstallAnywhere 等)。

于 2011-12-25T15:28:19.883 回答
0

如何创建一个 DOS 批处理脚本 (.bat) 并从那里按特定顺序调用 msi 安装程序和 JAR?

于 2011-12-25T15:22:59.027 回答
0

有一种方法可以检查是否安装了依赖的应用程序[就像设置了一个环境变量]。如果没有,那么打包脚本可以安装它。我在 Install Shield 中做到了这一点;不确定其他工具。

于 2011-12-25T15:27:42.707 回答