gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 11:21:24 26 4
gpt4 key购买 nike

我的主要应用程序是用 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]

enter image description here

2) 实用/ sample

# 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

最佳答案

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

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

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

关于java - 当项目在 Java 中使用许多其他依赖项时,如何制作安装程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8630188/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com