1

我注意到,当安装程序启动时,它会检测到以前的安装并提示我是否要更新它。无论如何要禁用此行为?

我有一个始终需要安装到一个干净的空目录中的应用程序。install4j 中是否有任何控件可以执行此操作?谢谢!

4

1 回答 1

2

要删除更新警报,请在 Installer->Screens & Actions 步骤中找到“Welcome”屏幕,然后取消选择“Alert for update installation”属性。

要防止安装程序提示以前的安装目录,请在 Installer->Update Options 步骤中取消选择“Detect previous installation directory”。

为防止安装在现有安装之上(即无法进行更新),请将“安装位置”屏幕的“验证表达式”属性设置为

File dir = context.getInstallationDirectory();
if (ApplicationRegistry.getApplicationInfoByDir(dir) != null) {
    Util.showWarningMessage(
        "The selected directory already contains an installation, "+
        "please choose another directory."
    );
    return false;
} else {
    return true;
}
于 2013-06-20T08:01:18.173 回答