在次要更新中轻松添加/删除文件 [英] Easily adding/removing files within a Minor update

查看:83
本文介绍了在次要更新中轻松添加/删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在想如何为使用基础MSI项目使用Installshield创建的应用程序安装设置升级.

我不支持任何其他功能/组件,大多数升级只是从默认组件中添加/删除文件/文件夹.

在创建升级时,我似乎在删除文件/文件夹时遇到困难.我通过复制/粘贴原始setup.ism(即我的安装的版本1)来创建升级,以便拥有原始安装的所有文件/文件夹,然后添加/删除所有更改.这样对吗?还是upgrade.ism应该仅包含新添加/删除的文件文件夹?

我首先尝试了次要升级.我想出了如何删除文件(右键单击-删除,然后将一个条目添加到RemoveFiles编辑器中),但是我还没有弄清楚如何删除文件夹.我不想手动将每个文件添加到RemoveFiles表中,因为可能有数百个文件.如何升级才能删除文件夹及其所有子文件夹?

我也尝试了专业升级,这很容易,因为我不必担心由于先卸载而删除文件/文件夹.但是,然后我没有得到通知用户它实际上是升级的对话框.

解决方案

您可以使用UpgradeTable中定义的Action属性来检测是否发生了重大升级,从而给用户带来了不同的UI元素.

大多数人将永远不需要较小的升级和/或补丁.对于大多数应用程序而言,主要升级是最简单的维护方法,并且运输整个软件包的不利影响很小.仅对于运送给成千上万的客户的大型安装程序而言,这是一个问题.

要在次要升级期间删除文件,您需要刺破"该组件.您将其编写为可传递的(InstallShield条件reevaluate = true),并为其提供始终返回false的表达式.结帐:

在次要升级过程中卸载组件

您删除组件并在RemoveFile表中编写规则的方法不正确.这会破坏组件规则和引用计数.

了解次要升级的工作原理以及可以做什么和不可以做什么是一个好主意,但是如果您发现自己更偏向于主要升级,也不要感到惊讶.

I've been playing around with how I want to setup my upgrades for an application install I'm creating using Installshield, using basic MSI projects.

I don't support any additional features/components and most of the upgrades will just be files/folders being added/removed from the default component.

I seem to be having difficulty in removing files/folders when creating an upgrade. I create my upgrade by copy/pasting the original setup.ism (i.e Version 1 of my install), so that I have all the files/folders of the original install, and then I just add/remove any changes. Is this correct? or should the upgrade.ism only contain newly added/removed files folders?

I first tried a Minor upgrade. I figured out how to remove files (right click - delete, and then add an entry to the RemoveFiles editor), but I haven't figured out how to remove folders. I don't want to have to manually add each file to the RemoveFiles table as there is likely to be hundreds of them. How can I have an upgrade remove a folder and all its children?

I've also tried the Major upgrade, which is very easy as I don't have to worry about removing files/folders due to it uninstalling first. But then I don't get the dialog that informs the user that it is actually an upgrade.

解决方案

You can use your Action property defined in the UpgradeTable to detect if a major upgrade is occurring a present different UI elements to your user.

Most people will never need minor upgrades and/or patches. For most applications the major upgrade is the simplest approach to maintain and the downside of shipping the entire package is minimal. It's only for really large installers shipped to thousands or millions of customers this becomes an issue.

To remove a file during a minor upgrade you need to 'puncture' the component. You author it as transitive (InstallShield condition reevaluate=true) and give it an expression that always returns false. Checkout:

Uninstall a component during minor upgrade

Your approach of removing the component and authoring a rule in the RemoveFile table is incorrect. This breaks the component rules and reference counting.

It's a good idea to learn how minor upgrades work and what you can and can't do but don't be surprised if you find yourself leaning on major upgrades more.

这篇关于在次要更新中轻松添加/删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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