|
1 | | -param([String[]] $MsiGenBranches) |
2 | | - |
3 | | -$baseDir = Get-Location |
4 | 1 |
|
5 | 2 | if ($env:APPVEYOR_REPO_BRANCH -eq "disabled") { |
6 | 3 | Set-Location ".\src\Azure.Functions.Cli" |
@@ -37,54 +34,3 @@ else { |
37 | 34 | Invoke-Expression -Command "dotnet run" |
38 | 35 | if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) } |
39 | 36 | } |
40 | | - |
41 | | -if ($MsiGenBranches.Contains($env:APPVEYOR_REPO_BRANCH)) { |
42 | | - Write-Host "Generating MSI files" |
43 | | - |
44 | | - # Add WiX to PATH |
45 | | - if (-not (@($env:Path -split ";") -contains $env:WIX)) |
46 | | - { |
47 | | - # Check if the Wix path points to the bin folder |
48 | | - if ((Split-Path $env:WIX -Leaf) -ne "bin") |
49 | | - { |
50 | | - $env:Path += ";$env:WIX\bin" |
51 | | - } |
52 | | - else |
53 | | - { |
54 | | - $env:Path += ";$env:WIX" |
55 | | - } |
56 | | - } |
57 | | - |
58 | | - # Get runtime version |
59 | | - $artifactsPath = "$baseDir\artifacts" |
60 | | - $buildDir = "$baseDir\build" |
61 | | - $cli = Get-ChildItem -Path $artifactsPath -Include func.dll -Recurse | Select-Object -First 1 |
62 | | - $cliVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($cli).FileVersion |
63 | | - |
64 | | - # Generate MSI installers for Windows |
65 | | - @('x64', 'x86') | ForEach-Object { |
66 | | - $platform = $_ |
67 | | - $targetDir = "$artifactsPath\win-$platform" |
68 | | - |
69 | | - Copy-Item "$buildDir\icon.ico" -Destination $artifactsPath\win-$platform |
70 | | - Copy-Item "$buildDir\license.rtf" -Destination $artifactsPath\win-$platform |
71 | | - Copy-Item "$buildDir\installbanner.bmp" -Destination $artifactsPath\win-$platform |
72 | | - Copy-Item "$buildDir\installdialog.bmp" -Destination $artifactsPath\win-$platform |
73 | | - Set-Location $targetDir |
74 | | - |
75 | | - $masterWxsName = "funcinstall" |
76 | | - $fragmentName = "$platform-frag" |
77 | | - $msiName = "func-cli-$cliVersion-$platform" |
78 | | - |
79 | | - $masterWxsPath = "$buildDir\$masterWxsName.wxs" |
80 | | - $fragmentPath = "$buildDir\$fragmentName.wxs" |
81 | | - $msiPath = "$artifactsPath\$msiName.msi" |
82 | | - |
83 | | - Invoke-Expression "heat dir '.' -cg FuncHost -dr INSTALLDIR -gg -ke -out $fragmentPath -srd -sreg -template fragment -var var.Source" |
84 | | - Invoke-Expression "candle -arch $platform -dPlatform='$platform' -dSource='.' -dProductVersion='$cliVersion' $masterWxsPath $fragmentPath" |
85 | | - Invoke-Expression "light -ext WixUIExtension -out $msiPath -sice:ICE61 $masterWxsName.wixobj $fragmentName.wixobj" |
86 | | - |
87 | | - Set-Location $baseDir |
88 | | - Get-ChildItem -Path $targetDir -Recurse | Remove-Item -Force -Recurse -ea SilentlyContinue |
89 | | - } |
90 | | -} |
0 commit comments