3

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.

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.

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.

Thank you.

halfer
  • 19,824
  • 17
  • 99
  • 186
hitman126
  • 699
  • 1
  • 12
  • 43

4 Answers4

2

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"

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).

oɔɯǝɹ
  • 7,219
  • 7
  • 58
  • 69
1

Assuming you mean you want to modify MSI properties in a previously-built MSI file, then basically find the WinRunSQL.vbs file in the Windows Kit/SDK and then learn the SQL commands to update the properties in the Property table. There are examples here: http://msdn.microsoft.com/en-us/library/aa372021(v=vs.85).aspx

I'm assuming you know enough about MSI to know that the properties you're referring to are likely the ones in the Property table.

PhilDW
  • 20,260
  • 1
  • 18
  • 28
0

Perhaps you can try using DTF (Deployment Tools Foundation). I have written about it in this answer on serverfault. Please follow the link for more information.

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
0

Thanks for all the great feedback.

I actually found a VBScript solution that does the job brilliantly by updating the required property of my previously-built MSI. I have set it up as a build step which runs after my MSI is created in a preceding Team City build step.

Unfortunately, I have the script saved on my office PC and don't therefore have access to it to share at this minute. I will however do so when I'm in the office after this weekend.

hitman126
  • 699
  • 1
  • 12
  • 43
  • VBScript works great for light-weight changes. Please do read the information in the linked serverfault answer, as your requirements grow using DTF and C# will allow you much easier debugging. – Stein Åsmul Jan 17 '15 at 10:26
  • Hey, can you please share the Script ? – MoonLight Apr 18 '22 at 10:35
  • @MoonLight, unfortunately I don't think I can locate that vbscript today, as it's been well over 7 years since I used it at one of my numerous, previous contract engagements. Should I stumble upon it though, I'll promptly share it with you on this thread. By the way, I do also reckon that InstEd and Orca could provide you with the required features to implement the required changes to an MSI, although to be honest I haven't worked with either for a few years now. I believe InstEd and Orca have a CLI which could be incorporated into a build and release pipeline to achieve the desired result. – hitman126 Apr 19 '22 at 06:08
  • oh that's unfortunate, no worries, if it has a CLI I'll look into it, thank you for your response . – MoonLight Apr 19 '22 at 16:26