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

查看:68
本文介绍了如果已经安装,则无法重新运行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天全站免登陆