Remove unnecessary executable permission from .ps1 scripts
[kiteware-cmake.git] / Tests / RunCMake / CPack_WIX / print-msi.ps1
blob01fdbc8233ac2e91d0d8d4115792eb8bdb53a223
1 # https://learn.microsoft.com/en-us/windows/win32/msi/database-tables
3 param (
4 $file
7 function printTable {
8 param (
9 $msi,
10 [string]$name,
11 [int[]]$columns = (1)
14 try {
15 $view = $msi.OpenView("select * from " + $name)
16 $view.Execute()
17 while ($record = $view.Fetch()) {
18 Write-Host ($name + ": " + ($columns | ForEach-Object {"'" + $record.StringData($_) + "'"}))
20 } catch {}
23 $installer = New-Object -ComObject WindowsInstaller.Installer
24 $msi = $installer.OpenDatabase($file, 0)
26 printTable -msi $msi -name "Component" -columns 1,3
27 printTable -msi $msi -name "Directory" -columns 1,2,3
28 printTable -msi $msi -name "File" -columns 1,2,3
29 printTable -msi $msi -name "Shortcut" -columns 1,2,3,4