From 8179958342b9771dca6f882baa6535f5e0a20aa4 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Mon, 22 Feb 2016 11:47:41 -0800 Subject: [PATCH 1/2] Upgrade Wix to stable version 3.10.1. Get rid of dummy project and instead download Wix tools directly. --- packaging/windows/WiXTools/Program.cs | 14 -------------- packaging/windows/WiXTools/README.md | 3 --- packaging/windows/WiXTools/project.json | 13 ------------- packaging/windows/generatemsi.ps1 | 18 +++++++++++------- 4 files changed, 11 insertions(+), 37 deletions(-) delete mode 100644 packaging/windows/WiXTools/Program.cs delete mode 100644 packaging/windows/WiXTools/README.md delete mode 100644 packaging/windows/WiXTools/project.json diff --git a/packaging/windows/WiXTools/Program.cs b/packaging/windows/WiXTools/Program.cs deleted file mode 100644 index 3825adfd4..000000000 --- a/packaging/windows/WiXTools/Program.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -namespace WiX.Toolset.2015 -{ - public class Program - { - public static int Main(string[] args) - { - // Temporary and bogus. Just needed so we can publish this - return 1; - } - } -} diff --git a/packaging/windows/WiXTools/README.md b/packaging/windows/WiXTools/README.md deleted file mode 100644 index 3bcef45b8..000000000 --- a/packaging/windows/WiXTools/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# WiX.Toolset.2015 - -This is a utility project that brings the Wix Tools down and lets us publish it as though it were an app. Do NOT add any C# code to it! It is not designed to actually be compiled as an assembly, it's just used for its dependencies. diff --git a/packaging/windows/WiXTools/project.json b/packaging/windows/WiXTools/project.json deleted file mode 100644 index 67be908ea..000000000 --- a/packaging/windows/WiXTools/project.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilationOptions": { - "emitEntryPoint": true - }, - - "dependencies": { - "WiX": "3.10.0.2103-pre1" - }, - - "frameworks": { - "dnxcore50": { } - } -} diff --git a/packaging/windows/generatemsi.ps1 b/packaging/windows/generatemsi.ps1 index 716df1691..ac22edae3 100644 --- a/packaging/windows/generatemsi.ps1 +++ b/packaging/windows/generatemsi.ps1 @@ -15,25 +15,29 @@ $InstallFilesWixobj = "install-files.wixobj" function AcquireWixTools { - pushd "$Stage2Dir\bin" + Write-Host Downloading Wixtools.. - Write-Host Restoring Wixtools.. + $result = Join-Path $OutputDir WiXTools - $result = $env:TEMP + if(Test-Path "$result\tools\candle.exe") + { + return Join-Path $result tools + } - .\dotnet restore $RepoRoot\packaging\windows\WiXTools --packages $result | Out-Null + New-Item $result -type directory -force | Out-Null + Invoke-WebRequest -Uri https://api.nuget.org/packages/wix.3.10.1.nupkg -Method Get -OutFile $result\WixTools.zip + Expand-Archive $result\WixTools.zip -dest $result\ if($LastExitCode -ne 0) { $result = "" - Write-Host "dotnet restore failed with exit code $LastExitCode." + Write-Host "Unable to download and extract the WixTools." } else { - $result = Join-Path $result WiX\3.10.0.2103-pre1\tools + $result = Join-Path $result tools } - popd return $result } From e9d2a374278e819ee36fa45767e4647e1661264e Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Mon, 22 Feb 2016 15:24:34 -0800 Subject: [PATCH 2/2] Download Wix tools v3.10.2 Security vulnerability with earlier Wix versions - https://www.firegiant.com/blog/2016/1/20/wix-v3.10.2-released/ --- packaging/windows/generatemsi.ps1 | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/packaging/windows/generatemsi.ps1 b/packaging/windows/generatemsi.ps1 index ac22edae3..59d009679 100644 --- a/packaging/windows/generatemsi.ps1 +++ b/packaging/windows/generatemsi.ps1 @@ -15,27 +15,24 @@ $InstallFilesWixobj = "install-files.wixobj" function AcquireWixTools { - Write-Host Downloading Wixtools.. - $result = Join-Path $OutputDir WiXTools - if(Test-Path "$result\tools\candle.exe") + if(Test-Path "$result\candle.exe") { - return Join-Path $result tools + return $result } + Write-Host Downloading Wixtools.. New-Item $result -type directory -force | Out-Null - Invoke-WebRequest -Uri https://api.nuget.org/packages/wix.3.10.1.nupkg -Method Get -OutFile $result\WixTools.zip - Expand-Archive $result\WixTools.zip -dest $result\ + # Download Wix version 3.10.2 - https://wix.codeplex.com/releases/view/619491 + Invoke-WebRequest -Uri https://wix.codeplex.com/downloads/get/1540241 -Method Get -OutFile $result\WixTools.zip + + Write-Host Extracting Wixtools.. + [System.IO.Compression.ZipFile]::ExtractToDirectory("$result\WixTools.zip", $result) if($LastExitCode -ne 0) { - $result = "" - Write-Host "Unable to download and extract the WixTools." - } - else - { - $result = Join-Path $result tools + throw "Unable to download and extract the WixTools." } return $result