我可以在运行时(安装过程中)更新ProductName属性吗? [英] Can I update ProductName Property in runtime (during install)?

查看:96
本文介绍了我可以在运行时(安装过程中)更新ProductName属性吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Basic MSI项目(我使用InstallShield 2013 Professional).假设它具有ProductName DefaultProductName .

I have Basic MSI project (I use InstallShield 2013 Professional). Suppose it has ProductName DefaultProductName.

我可以构建它并获取setup.exe.如果安装它,它将以 DefaultProductName 名称显示在控制面板"中的已安装程序"列表中.

I can build it and get setup.exe. It will appear in a list of Installed Programs in Control Panel with DefaultProductName name if I install it.

现在,假设我想在安装过程中在运行时将我的ProductName从 DefaultProductName 更改为 NewProductName (更清楚地说:我不是在谈论升级,但是有关在干净"盒子上安装产品时的情况).

Now, suppose that I want to change my ProductName from DefaultProductName to NewProductName during install, in runtime (to be more clear: I'm talking not about Upgrades, but about situation when I'm installing my product on "clean" box).

为此,我创建了New Custom Action-> New Set Property并将ProductName属性设置为新值 NewProductName .它可以正常工作(例如,我看到新的ProductName值出现在安装对话框的标题中,而我的产品出现在控制面板中,名称为 NewProductName ).

For this purpose I created New Custom Action->New Set Property and set ProductName Property to a new value NewProductName. It works (for example, I can see that new ProductName value appears in titles of installation dialogs, and my product appeared in Control Panel with name NewProductName ).

但是,当我尝试卸载产品并在卸载对话框中移动时,我看到(在对话框的标题中)ProductName具有其默认值 DefaultProductName ,而不是其值 NewProductName ,即我在安装过程中设置为自定义操作.这是否意味着我在安装过程中可以应用的属性"值更改将在卸载"过程中不可用.为什么?

But when I'm trying to uninstall my product and moving through uninstallation dialogs, I see (in titles of dialogs) that ProductName has its default value DefaultProductName, not the value NewProductName that I set in custom action during install. Does it mean that changes in Property value that I can apply during install will not be available during Uninstall. Why?

推荐答案

Windows Installer SDK以一种神秘的方式暗示着这是不可能的.以我的经验,这是不可能的. ProductName是私有属性,在安装开始后便不可变.编辑MSI或创建并应用转换是唯一的方法.

The Windows Installer SDK in it's cryptic way implies that this is not possible. In my experience it is not possible. ProductName is a private property and immutable once the installation starts. Editing the MSI or creating and applying a transform is the only way.

这篇关于我可以在运行时(安装过程中)更新ProductName属性吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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