1+ param  (
2+     [Parameter (Mandatory = $false )]
3+     [string ]$BuildVersion  =  " 1.0.0.0" , 
4+     [Parameter (Mandatory = $false )]
5+     [string ]$Platform  =  " x64" , 
6+     [Parameter (Mandatory = $false )]
7+     [string ]$WixBinPath  =  " c:\Program Files (x86)\WiX Toolset v3.11\bin" 
8+ )
9+ 
10+ Set-Location  $PSScriptRoot 
11+ 
12+ #  Remove previous builds
13+ If (Test-Path  $PSScriptRoot \bin\$Platform \Release\*  - PathType Any) {
14+     Remove-Item  $PSScriptRoot \bin\$Platform \Release\* 
15+ }
16+ 
17+ 
18+ 
19+ $heatArgs  =  @ (
20+     " dir" , 
21+     " $PSScriptRoot \..\SqlWorkload\bin\$Platform \release" , 
22+     " -gg" , 
23+     " -sfrag" , 
24+     " -sreg" , 
25+     " -srd" , 
26+     " -nologo" , 
27+     " -cg" , 
28+     " ProductComponents" , 
29+     " -dr" 
30+     " INSTALLFOLDER" , 
31+     " -out" , 
32+     " $PSScriptRoot \harvest.wxs" , 
33+     " -var" , 
34+     " var.SqlWorkload.TargetDir" , 
35+     " -t" , 
36+     " $PSScriptRoot \transform.xsl" 
37+ )
38+ 
39+ #  Write-Host $heatArgs
40+ 
41+ &  " $WixBinPath \heat.exe" @heatArgs 
42+ 
43+ 
44+ 
45+ 
46+ $heatArgs  =  @ (
47+     " dir" , 
48+     " $PSScriptRoot \..\WorkloadViewer\bin\$Platform \release" , 
49+     " -gg" , 
50+     " -sfrag" , 
51+     " -sreg" , 
52+     " -srd" , 
53+     " -nologo" , 
54+     " -cg" , 
55+     " WorkloadViewerComponents" , 
56+     " -dr" 
57+     " INSTALLFOLDER" , 
58+     " -out" , 
59+     " $PSScriptRoot \harvest2.wxs" , 
60+     " -var" , 
61+     " var.WorkloadViewer.TargetDir" , 
62+     " -t" , 
63+     " $PSScriptRoot \transform.xsl" , 
64+     " -t" , 
65+     " $PSScriptRoot \transform2.xsl" 
66+ )
67+ 
68+ 
69+ #   Write-Host "$WixBinPath\heat.exe"
70+ #   Write-Host $heatArgs
71+ 
72+ &  " $WixBinPath \heat.exe" @heatArgs 
73+ 
74+ 
75+ 
76+ 
77+ 
78+ 
79+ 
80+ $heatArgs  =  @ (
81+     " dir" , 
82+     " $PSScriptRoot \..\ConvertWorkload\bin\release" , 
83+     " -gg" , 
84+     " -sfrag" , 
85+     " -sreg" , 
86+     " -srd" , 
87+     " -nologo" , 
88+     " -cg" , 
89+     " ConvertWorkloadComponents" , 
90+     " -dr" 
91+     " INSTALLFOLDER" , 
92+     " -out" , 
93+     " $PSScriptRoot \harvest3.wxs" , 
94+     " -var" , 
95+     " var.ConvertWorkload.TargetDir" , 
96+     " -t" , 
97+     " $PSScriptRoot \transform.xsl" , 
98+     " -t" , 
99+     " $PSScriptRoot \transform2.xsl" 
100+     " -t" , 
101+     " $PSScriptRoot \transform3.xsl" 
102+ )
103+ 
104+ #   Write-Host "$WixBinPath\heat.exe"
105+ #   Write-Host $heatArgs
106+ 
107+ &  " $WixBinPath \heat.exe" @heatArgs 
108+ 
109+ 
110+ # ----------------------------------------------------------------
111+ 
112+ 
113+ $candleArgs  =  @ (
114+     " -nologo" , 
115+     " -out" , 
116+     " $PSScriptRoot \candleout\" , 
117+     " -dSqlWorkload.TargetDir=`" $PSScriptRoot \..\SqlWorkload\bin\$Platform \release`" " 
118+     " -dWorkloadViewer.TargetDir=`" $PSScriptRoot \..\WorkloadViewer\bin\$Platform \release`" " 
119+     " -dConvertWorkload.TargetDir=`" $PSScriptRoot \..\ConvertWorkload\bin\release`" " 
120+     " -dBuildVersion=$BuildVersion " , 
121+     " -dPlatform=$Platform " , 
122+     " $PSScriptRoot \Product.wxs" , 
123+     " $PSScriptRoot \harvest.wxs" , 
124+     " $PSScriptRoot \harvest2.wxs" , 
125+     " $PSScriptRoot \harvest3.wxs" , 
126+     " -arch" 
127+     " $Platform " 
128+ )
129+ 
130+ #  Write-Host $candleArgs
131+ 
132+ &  " $WixBinPath \candle.exe" @candleArgs 
133+ 
134+ # ----------------------------------------------------------------
135+ 
136+ $lightArgs  =  @ (
137+     " -out" , 
138+     " .\bin\$Platform \Release\WorkloadTools.msi" 
139+     " $PSScriptRoot \candleout\*.wixobj" , 
140+     " -ext" , 
141+     " WixUIExtension" 
142+ )
143+ 
144+ #  Write-Host $lightArgs
145+ 
146+ 
147+ &  " $WixBinPath \light.exe" @lightArgs 
148+ 
149+ 
150+ .  $PSScriptRoot \SignMsi.ps1 - InputFile " .\bin\$Platform \Release\WorkloadTools.msi" - OutputFile " .\bin\$Platform \Release\WorkloadTools_$Platform .msi" 
0 commit comments