0

I am adding property information to our MSI built using WiX 3.11. I am referring to the properties you find when right-clicking on a file and selecting Properties:

enter image description here

In the Product.wxs file I am setting these values like so:

<Product Id="$(var.ProductCode)" Name="$(var.ProductName) $(var.ShortAssyVersion)" Language="1033" Version="$(var.LongAssyVersion)" Manufacturer="$(var.CompanyLegalName)" UpgradeCode="$(var.UpgradeCode)"> <Package Description="Installation Package" InstallerVersion="300" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated" Comments="$(var.LongAssyVersion)" />

I would like to use some of these values in an automated build script and am trying to retrieve the values using PowerShell get-item. When I run this command in PowerShell:

PS C:\Subversion\MyProduct\Publish> (get-item "Setup.msi").VersionInfo | fl

this is the output:

OriginalFilename  :
FileDescription   :
ProductName       :
Comments          :
CompanyName       :
FileName          : C:\Subversion\MyProduct\Publish\Setup.msi
FileVersion       :
ProductVersion    :
IsDebug           : False
IsPatched         : False
IsPreRelease      : False
IsPrivateBuild    : False
IsSpecialBuild    : False
Language          :
LegalCopyright    :
LegalTrademarks   :
PrivateBuild      :
SpecialBuild      :
FileVersionRaw    : 0.0.0.0
ProductVersionRaw : 0.0.0.0

How can I retrieve these values (i.e., Comments, Date Created, etc.) from the file properties for use in a PowerShell script?

BrianKE
  • 4,035
  • 13
  • 65
  • 115
  • the `.Version` you get access to with `Get-Item` is provided by the filesystem _directly_. many of the other props you see in the `Properties` dialog are provided by addon code installed by the various apps/utils installed on each system - and are not accessible via the `Get-*Item` cmdlets. you CAN access that info via >>> `(New-Object -ComObject Shell.Application).NameSpace($Path)` <<<, but it aint graceful at all. – Lee_Dailey Jan 20 '20 at 14:51
  • @Lee_Dailey So is there a way to set these file system properties when creating an MSI? – BrianKE Jan 20 '20 at 20:53
  • they are not actually _filesystem properties_. [*grin*] they are file metadata that the properties dialog looks up using an added bit of software that the OS uses to get that data. the only way that i know of to add such metadata is to build it into the file with a utility that knows about such ... and either installs a provider extension OR is compatible with a pre-existing provider extension. – Lee_Dailey Jan 20 '20 at 21:34

0 Answers0