简体   繁体   English

使用Powershell / DSC的MSI升级

[英]MSI upgrade with Powershell /DSC

I am able to successfully uninstall (Ensure = "Absent") or install a product (Ensure = "Present"). 我能够成功卸载(Ensure =“ Absent”)或安装产品(Ensure =“ Present”)。 However, if I create a new version of the same product, it always comes back with the same message - "already installed". 但是,如果我创建相同产品的新版本,则它总是返回相同的消息-“已经安装”。

Does that mean the only way to upgrade is to uninstall / install? 这是否意味着升级的唯一方法是卸载/安装?

It sounds like this is an MSI that you are creating. 听起来这是您正在创建的MSI。 Make sure you're changing the product code for each version: 确保您要更改每个版本的产品代码

What is ProductCode in MSI Package? MSI软件包中的ProductCode是什么?

The product code is the unique GUID of identifying an application or product release; 产品代码是标识应用程序或产品版本的唯一GUID。 In other words, different versions and languages of Product must have different product codes. 换句话说,产品的不同版本和语言必须具有不同的产品代码。 http://msdn.microsoft.com/en-us/library/aa370854(VS.85).aspx . http://msdn.microsoft.com/zh-CN/library/aa370854(VS.85).aspx Also, ProductCode can be used to query feature state, and product state. 另外,ProductCode可用于查询功能状态和产品状态。 For example, installer API "MsiQueryFeatureStateEx()" and "MsiQueryProductState()", etc. 例如,安装程序API“ MsiQueryFeatureStateEx()”和“ MsiQueryProductState()”等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM