以编程方式更新MSI属性 [英] Update MSI properties programmatically

查看:141
本文介绍了以编程方式更新MSI属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种应该很简单的解决方案-更新MSI属性.我们有许多在TFS 2012中受源代码控制的WiX项目,我们生成它们相关的MSI,以通过TeamCity构建配置进行部署,这些配置通常会构建所需的* .wixproj文件.

I need a solution for something that should hopefully be fairly simple - updating an MSI property. We have a number of WiX projects which are source controlled in TFS 2012 and we generate their related MSIs for deployment through TeamCity build configurations which generally build the required *.wixproj files.

根本不希望在TFS/Visual Studio中更新MSI属性,因为由于当前整个持续集成和部署过程的设置方式,我们需要将更改限制在TeamCity中.

Updating the MSI property in TFS/Visual Studio isn't an option to be pursued at all, as we need to confine our change to TeamCity, due to how our entire Continuous Integration and deployment process is currently set up.

因此,我希望实现的是一个解决方案,在该解决方案中,可以在创建所需的MSI属性后运行脚本或命令来更新所需的MSI属性.我欢迎使用Powershell,Perl,VBScript,Windows Batch脚本等中的任何脚本或命令的解决方案,因为这将被设置为最终TeamCity构建步骤,以修改创建的MSI.

What I wish to therefore implement is a solution where I can run a script or command to update the required MSI property after it's been created. I will welcome a solution using any script or command from Powershell, Perl, VBScript, Windows Batch script, etc, as this will be set up as a final TeamCity build step to modify the created MSI.

谢谢.

推荐答案

您可以使用msiinfo.exe(它是Windows SDK的一部分)来读取/添加/更新msi属性.

You can use msiinfo.exe (which is part of the Windows SDK) for reading / adding / updating msi properties.

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\MsiInfo.Exe>msiinfo.exe /?
MsiInfo V 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved

++MsiInfo.exe Command Line Syntax++
MsiInfo.exe {database} --> To Display Summary Info Properties
MsiInfo.exe {database} Options.... --> To Set Summary Info Properties
++MsiInfo.exe Options++
PID_DICTIONARY   - /I {value}
PID_CODEPAGE     - /C {value}
PID_TITLE        - /T {value}
PID_SUBJECT      - /J {value}
PID_AUTHOR       - /A {value}
PID_KEYWORDS     - /K {value}
PID_COMMENTS     - /O {value}
PID_TEMPLATE     - /P {value}
PID_LASTAUTHOR   - /L {value}
PID_REVNUMBER    - /V {value}
PID_EDITTIME     - /E {value}
PID_LASTPRINTED  - /S {value}
PID_CREATE_DTM   - /R {value}
PID_LASTSAVE_DTM - /Q {value}
PID_PAGECOUNT    - /G {value}
PID_WORDCOUNT    - /W {value}
PID_CHARCOUNT    - /H {value}
PID_THUMBNAIL    - NOT SUPPORTED
PID_APPNAME      - /N {value}
PID_SECURITY     - /U {value}
Validate String Pool - [/B] /D  (use /B to display the string pool)
/?               - Displays this help message
/nologo          - Do not display the logo message

例如,您可以如下设置作者"和主题"属性:

For example, you can set the Author and Subject properties as follows:

msiinfo.exe my.msi /A "Your name" /J "This is a demo"

请注意,您不能使用msiinfo.exe my.msi /I来读取单个属性,因为它将尝试更新属性(有效清除值).

Be aware that you cannot use msiinfo.exe my.msi /I to read single properties, as it will try to update the property instead (effectively clearing the value).

这篇关于以编程方式更新MSI属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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