Skip to content

Commit f73059c

Browse files
committed
allow build when uci dist files are absent
1 parent 0df0782 commit f73059c

2 files changed

Lines changed: 55 additions & 174 deletions

File tree

Lines changed: 2 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33
<Fragment>
4-
<DirectoryRef Id="service_folder">
5-
<Directory Id="collectors" Name="collectors" />
6-
</DirectoryRef>
7-
</Fragment>
8-
<Fragment>
9-
<ComponentGroup Id="uci_dist_files">
10-
<Component Id="unified_collector_interface.dll" Directory="service_folder" Guid="{27275D4D-B2AD-8D3D-A0FA-A0BCF1129F1E}" Win64="yes">
11-
<File Id="unified_collector_interface.dll" KeyPath="yes" Source="$(var.UciDistDir)\unified-collector-interface.dll" />
12-
</Component>
13-
<Component Id="libMPCommon.dll" Directory="socwatch" Guid="{1BC23BAA-AA01-2834-817C-1974EC6A2EC0}" Win64="yes">
14-
<File Id="libMPCommon.dll" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\libMPCommon.dll" />
15-
</Component>
16-
<Component Id="socwatch.dll" Directory="socwatch" Guid="{A211BF08-805D-2834-A9C2-95B8EA450C97}" Win64="yes">
17-
<File Id="socwatch.dll" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\socwatch.dll" />
18-
</Component>
19-
<Component Id="socwatchdrv.sys" Directory="socwatch" Guid="{F7756219-5977-2C38-B01C-5FD088A6E623}" Win64="yes">
20-
<File Id="socwatchdrv.sys" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\socwatchdrv.sys" />
21-
</Component>
22-
<Component Id="SOCWatchConfig.txt" Directory="configs" Guid="{83519B51-3264-883F-BAEE-B7C9C8DDDC52}" Win64="yes">
23-
<File Id="SOCWatchConfig.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\configs\SOCWatchConfig.txt" />
24-
</Component>
25-
<Component Id="acpi_dstate_config.txt" Directory="output_configs" Guid="{F6472AC1-E54B-BB3C-8BD4-5C124440362F}" Win64="yes">
26-
<File Id="acpi_dstate_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\acpi-dstate_config.txt" />
27-
</Component>
28-
<Component Id="aggr_telem_config.txt" Directory="output_configs" Guid="{B304C8B7-1811-5133-8F84-3BC42E2DD840}" Win64="yes">
29-
<File Id="aggr_telem_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\aggr-telem_config.txt" />
30-
</Component>
31-
<Component Id="connected_standby.txt" Directory="output_configs" Guid="{77AC8B1E-D6C4-0130-8C56-823F6B5C66B5}" Win64="yes">
32-
<File Id="connected_standby.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\connected-standby.txt" />
33-
</Component>
34-
<Component Id="continuous_monitoring_config.txt" Directory="output_configs" Guid="{7DB32161-B9F0-5134-8E9C-90D2AE2F83BE}" Win64="yes">
35-
<File Id="continuous_monitoring_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\continuous-monitoring_config.txt" />
36-
</Component>
37-
<Component Id="cpu_c_p_state_config.txt" Directory="output_configs" Guid="{65CE8933-0936-9236-8A16-580FE8D65B79}" Win64="yes">
38-
<File Id="cpu_c_p_state_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\cpu-c-p-state_config.txt" />
39-
</Component>
40-
<Component Id="cpu_gpu_concurrency_config.txt" Directory="output_configs" Guid="{C255983E-93AF-783E-895B-623F60BF3AF5}" Win64="yes">
41-
<File Id="cpu_gpu_concurrency_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\cpu-gpu-concurrency_config.txt" />
42-
</Component>
43-
<Component Id="ddr_bw_config.txt" Directory="output_configs" Guid="{2960663A-3F41-2337-BDE4-92B251A60C35}" Win64="yes">
44-
<File Id="ddr_bw_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\ddr-bw_config.txt" />
45-
</Component>
46-
<Component Id="default_config.txt" Directory="output_configs" Guid="{838C579E-13B8-1B3E-91C0-0495492CB36F}" Win64="yes">
47-
<File Id="default_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\default_config.txt" />
48-
</Component>
49-
<Component Id="dram_srr_config.txt" Directory="output_configs" Guid="{B92473AE-AAAA-553A-9105-CEF7D81B1E98}" Win64="yes">
50-
<File Id="dram_srr_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\dram-srr_config.txt" />
51-
</Component>
52-
<Component Id="feature_ordering.txt" Directory="output_configs" Guid="{8238604C-6E12-2531-9909-D5CF30723B14}" Win64="yes">
53-
<File Id="feature_ordering.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\feature_ordering.txt" />
54-
</Component>
55-
<Component Id="graphics_config.txt" Directory="output_configs" Guid="{3CB6352C-D88B-753E-B66A-FA69E935518B}" Win64="yes">
56-
<File Id="graphics_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\graphics_config.txt" />
57-
</Component>
58-
<Component Id="pch_slps0_dbg_config.txt" Directory="output_configs" Guid="{B0C01247-DED5-7C33-8696-573899209198}" Win64="yes">
59-
<File Id="pch_slps0_dbg_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\pch-slps0-dbg_config.txt" />
60-
</Component>
61-
<Component Id="pch_slps0_config.txt" Directory="output_configs" Guid="{58926B78-1C56-593A-99B7-272F2ACD9B0D}" Win64="yes">
62-
<File Id="pch_slps0_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\pch-slps0_config.txt" />
63-
</Component>
64-
<Component Id="power_config.txt" Directory="output_configs" Guid="{11E8A0A6-8C81-E331-9C9B-88DF1C002809}" Win64="yes">
65-
<File Id="power_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\power_config.txt" />
66-
</Component>
67-
<Component Id="soc_temp_config.txt" Directory="output_configs" Guid="{606F05C9-0764-4133-88FC-24B55CE74F50}" Win64="yes">
68-
<File Id="soc_temp_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\soc-temp_config.txt" />
69-
</Component>
70-
<Component Id="temp_config.txt" Directory="output_configs" Guid="{304F8430-8EF7-983A-A1C6-D3D234383CD5}" Win64="yes">
71-
<File Id="temp_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\temp_config.txt" />
72-
</Component>
73-
<Component Id="throt_reason_config.txt" Directory="output_configs" Guid="{459A6890-5E80-D132-A0EF-95654C6F7C75}" Win64="yes">
74-
<File Id="throt_reason_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\throt-reason_config.txt" />
75-
</Component>
76-
<Component Id="timer_resolution_config.txt" Directory="output_configs" Guid="{73BDB608-2D60-593B-B105-68CD17B498BE}" Win64="yes">
77-
<File Id="timer_resolution_config.txt" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\output_configs\timer-resolution_config.txt" />
78-
</Component>
79-
<Component Id="libSWCore.dll" Directory="plugins" Guid="{0949C328-0129-1235-BA85-1EC88E215AE9}" Win64="yes">
80-
<File Id="libSWCore.dll" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\plugins\libSWCore.dll" />
81-
</Component>
82-
<Component Id="libSWWriterPlugins.dll" Directory="plugins" Guid="{C396BF1E-705F-7231-8CF8-190929B7A9B0}" Win64="yes">
83-
<File Id="libSWWriterPlugins.dll" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\plugins\libSWWriterPlugins.dll" />
84-
</Component>
85-
<Component Id="telemetry_0x130670b2.xml" Directory="xml_configs" Guid="{6E40F729-4D4B-D232-AB1D-0CAD501F6801}" Win64="yes">
86-
<File Id="telemetry_0x130670b2.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x130670b2.xml" />
87-
</Component>
88-
<Component Id="telemetry_0x130671b2.xml" Directory="xml_configs" Guid="{F95DC961-2A4D-5434-ADAB-3183A51B92EA}" Win64="yes">
89-
<File Id="telemetry_0x130671b2.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x130671b2.xml" />
90-
</Component>
91-
<Component Id="telemetry_0x1a067002.xml" Directory="xml_configs" Guid="{49B66B82-2EF7-B330-B2D6-2BB0B39444DD}" Win64="yes">
92-
<File Id="telemetry_0x1a067002.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x1a067002.xml" />
93-
</Component>
94-
<Component Id="telemetry_0x1a067102.xml" Directory="xml_configs" Guid="{D52B2E41-A18A-2335-977E-7815C35A3022}" Win64="yes">
95-
<File Id="telemetry_0x1a067102.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x1a067102.xml" />
96-
</Component>
97-
<Component Id="telemetry_0x1e2f8200.xml" Directory="xml_configs" Guid="{23B13389-B556-3E35-98BB-CC41BB94C7FC}" Win64="yes">
98-
<File Id="telemetry_0x1e2f8200.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x1e2f8200.xml" />
99-
</Component>
100-
<Component Id="telemetry_0x1e2f8201.xml" Directory="xml_configs" Guid="{C026EE7B-6E98-0734-9683-FA3280070C63}" Win64="yes">
101-
<File Id="telemetry_0x1e2f8201.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x1e2f8201.xml" />
102-
</Component>
103-
<Component Id="telemetry_0x1e2f8202.xml" Directory="xml_configs" Guid="{9632E79F-9957-A23F-BB02-67CF006285EF}" Win64="yes">
104-
<File Id="telemetry_0x1e2f8202.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x1e2f8202.xml" />
105-
</Component>
106-
<Component Id="telemetry_0x3072005.xml" Directory="xml_configs" Guid="{8AB0F9B4-3E5C-2230-8BCE-909FE3F1A2A0}" Win64="yes">
107-
<File Id="telemetry_0x3072005.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x3072005.xml" />
108-
</Component>
109-
<Component Id="telemetry_0x3072105.xml" Directory="xml_configs" Guid="{6AF27384-9E03-5939-A865-455B412494A4}" Win64="yes">
110-
<File Id="telemetry_0x3072105.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x3072105.xml" />
111-
</Component>
112-
<Component Id="telemetry_0x3086000.xml" Directory="xml_configs" Guid="{B0441B3E-45E8-FF3E-8F8E-82A6E7A3F855}" Win64="yes">
113-
<File Id="telemetry_0x3086000.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x3086000.xml" />
114-
</Component>
115-
<Component Id="telemetry_0x3086100.xml" Directory="xml_configs" Guid="{41914BB1-020B-813A-A159-64EABB07DF6B}" Win64="yes">
116-
<File Id="telemetry_0x3086100.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x3086100.xml" />
117-
</Component>
118-
<Component Id="telemetry_0x308d000.xml" Directory="xml_configs" Guid="{4F647776-7E68-4334-AEC5-86DD96681563}" Win64="yes">
119-
<File Id="telemetry_0x308d000.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x308d000.xml" />
120-
</Component>
121-
<Component Id="telemetry_0x308d100.xml" Directory="xml_configs" Guid="{850D5899-3194-8934-BD58-2A0FEB6ECD19}" Win64="yes">
122-
<File Id="telemetry_0x308d100.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x308d100.xml" />
123-
</Component>
124-
<Component Id="telemetry_0x41fe79a4.xml" Directory="xml_configs" Guid="{28B1BE24-1AA2-5834-A0F3-61F0C957F008}" Win64="yes">
125-
<File Id="telemetry_0x41fe79a4.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x41fe79a4.xml" />
126-
</Component>
127-
<Component Id="telemetry_0x41fe79a5.xml" Directory="xml_configs" Guid="{CFD3708E-AA47-8937-B666-A21B9815B454}" Win64="yes">
128-
<File Id="telemetry_0x41fe79a5.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x41fe79a5.xml" />
129-
</Component>
130-
<Component Id="telemetry_0x5e2f8211.xml" Directory="xml_configs" Guid="{A631F441-2726-4831-89CE-D63E8EC80E97}" Win64="yes">
131-
<File Id="telemetry_0x5e2f8211.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0x5e2f8211.xml" />
132-
</Component>
133-
<Component Id="telemetry_0xb15a0edc.xml" Directory="xml_configs" Guid="{6421ADD5-736F-BC37-BF59-A265896F72B5}" Win64="yes">
134-
<File Id="telemetry_0xb15a0edc.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0xb15a0edc.xml" />
135-
</Component>
136-
<Component Id="telemetry_0xb15a0ede.xml" Directory="xml_configs" Guid="{6E477024-B011-813B-A2F8-4C47A6154750}" Win64="yes">
137-
<File Id="telemetry_0xb15a0ede.xml" KeyPath="yes" Source="$(var.UciDistDir)\collectors\socwatch\xml_configs\telemetry_0xb15a0ede.xml" />
138-
</Component>
139-
</ComponentGroup>
140-
</Fragment>
141-
<Fragment>
142-
<DirectoryRef Id="socwatch">
143-
<Directory Id="configs" Name="configs" />
144-
</DirectoryRef>
145-
</Fragment>
146-
<Fragment>
147-
<DirectoryRef Id="socwatch">
148-
<Directory Id="output_configs" Name="output_configs" />
149-
</DirectoryRef>
150-
</Fragment>
151-
<Fragment>
152-
<DirectoryRef Id="socwatch">
153-
<Directory Id="plugins" Name="plugins" />
154-
</DirectoryRef>
155-
</Fragment>
156-
<Fragment>
157-
<DirectoryRef Id="collectors">
158-
<Directory Id="socwatch" Name="socwatch" />
159-
</DirectoryRef>
160-
</Fragment>
161-
<Fragment>
162-
<DirectoryRef Id="socwatch">
163-
<Directory Id="xml_configs" Name="xml_configs" />
164-
</DirectoryRef>
4+
<ComponentGroup Id="uci_dist_files" />
1655
</Fragment>
1666
</Wix>

IntelPresentMon/PMInstallerLib/wix-uci-dist.ps1

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,69 @@ function Get-DeterministicGuid {
2020
return (New-Object System.Guid -ArgumentList (, $bytes)).ToString().ToUpperInvariant()
2121
}
2222

23+
function Write-EmptyUciDistFragment {
24+
param(
25+
[Parameter(Mandatory = $true)]
26+
[string]$OutPath
27+
)
28+
29+
$settings = New-Object System.Xml.XmlWriterSettings
30+
$settings.Encoding = New-Object System.Text.UTF8Encoding($false)
31+
$settings.Indent = $true
32+
$settings.IndentChars = ' '
33+
$settings.NewLineChars = "`r`n"
34+
$settings.NewLineHandling = [System.Xml.NewLineHandling]::Replace
35+
36+
$writer = [System.Xml.XmlWriter]::Create((Join-Path $PSScriptRoot $OutPath), $settings)
37+
try {
38+
$writer.WriteStartDocument()
39+
$writer.WriteStartElement('Wix', 'http://schemas.microsoft.com/wix/2006/wi')
40+
$writer.WriteStartElement('Fragment')
41+
$writer.WriteStartElement('ComponentGroup')
42+
$writer.WriteAttributeString('Id', 'uci_dist_files')
43+
$writer.WriteEndElement()
44+
$writer.WriteEndElement()
45+
$writer.WriteEndElement()
46+
$writer.WriteEndDocument()
47+
}
48+
finally {
49+
$writer.Dispose()
50+
}
51+
}
52+
53+
Push-Location $PSScriptRoot
54+
55+
$distPath = '..\ControlLib\uci\dist'
56+
$outPath = 'UciDist.wxs'
57+
58+
if (-not (Test-Path $distPath -PathType Container)) {
59+
Pop-Location
60+
Write-Warning "UCI dist directory '$distPath' was not found. Skipping UCI payload files."
61+
Write-EmptyUciDistFragment -OutPath $outPath
62+
exit 0
63+
}
64+
65+
if ($null -eq (Get-ChildItem -Path $distPath -Recurse -File -Force | Select-Object -First 1)) {
66+
Pop-Location
67+
Write-Warning "UCI dist directory '$distPath' contains no files. Skipping UCI payload files."
68+
Write-EmptyUciDistFragment -OutPath $outPath
69+
exit 0
70+
}
71+
2372
if (-not $env:WIX) {
73+
Pop-Location
2474
Write-Error 'Environment variable WIX is not set. Please install WIX or set WIX to the WiX installation directory.'
2575
exit 1
2676
}
2777

2878
$heatExe = Join-Path $env:WIX 'bin\heat.exe'
2979
if (-not (Test-Path $heatExe)) {
30-
Write-Error "heat.exe not found at '$heatExe'. Verify your WIX environment variable points to the correct location."
31-
exit 1
32-
}
33-
34-
Push-Location $PSScriptRoot
35-
36-
if (-not (Test-Path '..\ControlLib\uci\dist')) {
3780
Pop-Location
38-
Write-Error "Expected '..\\ControlLib\\uci\\dist' to exist before harvesting UCI payload files."
81+
Write-Error "heat.exe not found at '$heatExe'. Verify your WIX environment variable points to the correct location."
3982
exit 1
4083
}
4184

42-
$outPath = 'UciDist.wxs'
43-
44-
& $heatExe dir '..\ControlLib\uci\dist' `
85+
& $heatExe dir $distPath `
4586
-srd -sreg -scom `
4687
-dr service_folder `
4788
-cg uci_dist_files `
@@ -52,7 +93,7 @@ $outPath = 'UciDist.wxs'
5293
$code = $LASTEXITCODE
5394
if ($code -ne 0) {
5495
Pop-Location
55-
Write-Error "heat.exe failed for '..\\ControlLib\\uci\\dist' (exit code $code)"
96+
Write-Error "heat.exe failed for '$distPath' (exit code $code)"
5697
exit $code
5798
}
5899

0 commit comments

Comments
 (0)