当项目使用Java中的许多其他依赖项时,如何制作安装程序?

发布于 2024-12-22 14:44:18 字数 4055 浏览 4 评论 0原文

我的主要应用程序是用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)安装程序准备批量

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

My main application is written in Java, which has Main.jar. I am preparing final package for deploy.

But it has other dependencies such as third party libraries need to be first available /pre-installed in Windows operating system, once that is installed my application can run, else it will show error and will not work. So i am struggling, end user has to do:

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.

For such case, Is there any proper way to make one installer which can do the job as step 1 and then step 2, but both look like 1 installation?

Follow up: i also want my third party is not visible to the end user for presentation purpose. So i saw there is a tool exists called msi

1) Installer prepare for 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]

OR
enter image description here

2) Practical/samples

# 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

So尛奶瓶 2024-12-29 14:44:18

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

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

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

All UI based installation tools have ability to run external programs and to run in batch mode that is controlled by command line arguments.

So, if your thirdparty.msi is what you have and have to use I's suggest you to find the ability to run it in a batch mode. Then create your own installation procedure that will invoke this 3rd party MSI.

There are various tools that for creating UI based installations programs (InstallShieled, InstallAnywhere etc).

云柯 2024-12-29 14:44:18

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

How about creating a DOS batch script(.bat) and call the msi installer and JAR in that particular order from there?.

拔了角的鹿 2024-12-29 14:44:18

有一种方法可以检查依赖的应用程序是否已安装[如设置的环境变量]。如果没有,那么打包脚本可以安装它。我已经在 Install Shield 中完成了此操作;不确定其他工具。

there is a way to check if the dependent app is installed [like an env variable being set]. If not then the packaging script can install it. I have done this in Install Shield; not sure about other tools.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文