如果已安装,则无法重新运行 Java JPackage 安装程序,第二次将在没有警告的情况下退出 [英] Cannot rerun Java JPackage installer if already installed, second time just exits without warning

查看:14
本文介绍了如果已安装,则无法重新运行 Java JPackage 安装程序,第二次将在没有警告的情况下退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果已经安装,则无法重新运行 JPackage 安装程序,第二次似乎退出没有警告,这是 Windows 上的正确行为吗?

Cannot rerun JPackage installer if already installed, second time just seems to exit without warning, is this correct behaviour on Windows ?

你可能会问我为什么要这样做?

You may ask why I want to do this anyway?

好吧,就我而言,我正在尝试为我的 Java 应用程序构建一个 JPackage 安装程序,所以我正在构建它并安装它,然后调整设置,重建它并尝试重新安装.我花了一些时间才发现,除非我卸载第一个安装(使用控制面板、程序和功能),否则我无法重新安装它

Well in my case I am trying to build a JPackage installer for my Java application, so I am building it installing it, then tweaking the settings, rebuilding it and try to reinstall. It took me some time to work out that I couldn't not reinstall it unless i uninstall the first installation (using Control Panel, Program and Features)

我的情况可能不是通常的用例,但它没有给出任何理由就退出感觉不正确.

My case may not be the usual usecase, but it doesn't feel correct that it just exits without giving any reason.

这也意味着,如果我向客户部署新版本,然后我需要修改安装程序,而不是修改版本号以让用户重新安装,这通常可能是最佳实践,但我会这样做如果应用程序本身没有改变,我不想做.

It also means that if I deploy a new version to customers, and I later need to amend the installer than I would have to modify the version number to let the user reinstall, this may generally be best practise but is something I would not particulary want to do if the application itself had not changed.

更新:自从通过查看 TaskManager 发现它仍在运行但似乎没有做任何事情并且没有向用户提供任何指示!

推荐答案

不知道这对 Mac 或 Linux 是否有帮助,但 Windows 安装程序在您运行时会自动删除旧版本的应用程序,因此您只需要设置一个方案这会在每次构建时更改版本号,以避免每次都必须卸载旧版本.

No idea if this helps on Mac or Linux but the Windows installer automatically removes older versions of the application when you run it so you just need to set up a scheme which changes the version number on each build to avoid having to ununstall old version each time.

要做到这一点,您可以将版本号设置为YY.MM.DDHH";因此版本号每小时都会变化并减少卸载.

To do this simply you could set the version number as "YY.MM.DDHH" so version number changes each hour and cuts down on uninstalls.

蚂蚁步骤:

<tstamp>
    <format property="appver"     pattern="yy.MM.ddHH" />
</tstamp>

<exec executable="jpackage">
    <arg line="--app-version ${appver}"/>
    ...
</exec>

CMD 版本:

set appver=%date:~6,2%.%date:~3,2%.%date:~0,2%%time:~0,2%
jpackage --app-version %appver% ...

这篇关于如果已安装,则无法重新运行 Java JPackage 安装程序,第二次将在没有警告的情况下退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆