From fd0700366f0e6332e999dbc3ffee2cf239959cc6 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 18 Nov 2017 12:15:27 +0000 Subject: [PATCH 1/7] Make it easier to build an installer locally and document it. --- build.psm1 | 25 +++++++++++++++++++++---- docs/building/windows-core.md | 9 +++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/build.psm1 b/build.psm1 index 60142869d8e..fa24613fd9b 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1918,6 +1918,17 @@ function Get-PackageVersionAsMajorMinorBuildRevision $packageVersion } +<# +.Synopsis + Creates a Windows installer MSI file and assumes that the binaries are already built using 'Start-PSBuild'. + This only works on a Windows machine due to the usage of WiX. +.EXAMPLE + # This example shows how to produce a Debug-x64 installer for development purposes only. + cd $RootPathOfPowerShellCheckout + Import-Module .\build.psm1 + Start-PSBuild + New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' +#> function New-MSIPackage { [CmdletBinding()] @@ -1946,17 +1957,18 @@ function New-MSIPackage # File describing the MSI Package creation semantics [ValidateNotNullOrEmpty()] + [ValidateScript({Test-Path $_})] [string] $ProductWxsPath = "$PSScriptRoot\assets\Product.wxs", # Path to Assets folder containing artifacts such as icons, images - [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] - [string] $AssetsPath, + [ValidateScript({Test-Path $_})] + [string] $AssetsPath = "$PSScriptRoot\assets", # Path to license.rtf file - for the EULA - [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] - [string] $LicenseFilePath, + [ValidateScript({Test-Path $_})] + [string] $LicenseFilePath = "$PSScriptRoot\assets\license.rtf", # Architecture to use when creating the MSI [Parameter(Mandatory = $true)] @@ -1986,6 +1998,11 @@ function New-MSIPackage $wixCandleExePath = Join-Path $wixToolsetBinPath "Candle.exe" $wixLightExePath = Join-Path $wixToolsetBinPath "Light.exe" + if ($null -eq (Get-Module packaging)) + { + # Import Get-PackageSemanticVersion function from packaging module + Import-Module "$PSScriptRoot\tools\packaging\packaging.psd1" + } $ProductSemanticVersion = Get-PackageSemanticVersion -Version $ProductVersion $ProductVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $ProductVersion diff --git a/docs/building/windows-core.md b/docs/building/windows-core.md index 54d0a099b17..87015bcc81a 100644 --- a/docs/building/windows-core.md +++ b/docs/building/windows-core.md @@ -77,3 +77,12 @@ You can run our cross-platform Pester tests with `Start-PSPester`. ## Building in Visual Studio We currently have the issue [#3400](https://github.com/PowerShell/PowerShell/issues/3400) tracking this task. + +## Building an installer + +The installer is `WiX` based. You can create a Debug-x64 MSI as follows: +````powershell +Import-Module .\build.psm1 +Start-PSBuild +New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' +```` From 7357aa9eda6f3012307b27fa310827f8ceac0ca6 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 18 Nov 2017 12:31:40 +0000 Subject: [PATCH 2/7] Fix markdown lint warning MD031 Fenced code blocks should be surrounded by blank lines --- docs/building/windows-core.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/building/windows-core.md b/docs/building/windows-core.md index 87015bcc81a..9d4b832c594 100644 --- a/docs/building/windows-core.md +++ b/docs/building/windows-core.md @@ -81,6 +81,7 @@ We currently have the issue [#3400](https://github.com/PowerShell/PowerShell/iss ## Building an installer The installer is `WiX` based. You can create a Debug-x64 MSI as follows: + ````powershell Import-Module .\build.psm1 Start-PSBuild From 8dce4c3809168c4487f30c202b42fe63837012a0 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 18 Nov 2017 19:51:07 +0000 Subject: [PATCH 3/7] change wording of help to build installable package as suggested in PR. --- build.psm1 | 2 +- docs/building/windows-core.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index fa24613fd9b..282156731a5 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1920,7 +1920,7 @@ function Get-PackageVersionAsMajorMinorBuildRevision <# .Synopsis - Creates a Windows installer MSI file and assumes that the binaries are already built using 'Start-PSBuild'. + Creates a Windows installer MSI package and assumes that the binaries are already built using 'Start-PSBuild'. This only works on a Windows machine due to the usage of WiX. .EXAMPLE # This example shows how to produce a Debug-x64 installer for development purposes only. diff --git a/docs/building/windows-core.md b/docs/building/windows-core.md index 9d4b832c594..6dddefd9464 100644 --- a/docs/building/windows-core.md +++ b/docs/building/windows-core.md @@ -78,7 +78,7 @@ You can run our cross-platform Pester tests with `Start-PSPester`. We currently have the issue [#3400](https://github.com/PowerShell/PowerShell/issues/3400) tracking this task. -## Building an installer +## Building an installable Package The installer is `WiX` based. You can create a Debug-x64 MSI as follows: From d5e453cf0711f365614282031c0e675e41e15ef6 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 18 Nov 2017 20:44:16 +0000 Subject: [PATCH 4/7] Move New-MSIPackage to packaging module as suggested in PR but do not expose instructions in building/windows-core.md --- build.psm1 | 137 ------------------------------- docs/building/windows-core.md | 10 --- tools/packaging/packaging.psd1 | 2 +- tools/packaging/packaging.psm1 | 145 +++++++++++++++++++++++++++++++++ 4 files changed, 146 insertions(+), 148 deletions(-) diff --git a/build.psm1 b/build.psm1 index 282156731a5..24f98047792 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1929,143 +1929,6 @@ function Get-PackageVersionAsMajorMinorBuildRevision Start-PSBuild New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> -function New-MSIPackage -{ - [CmdletBinding()] - param ( - - # Name of the Product - [ValidateNotNullOrEmpty()] - [string] $ProductName = 'PowerShell', - - # Suffix of the Name - [string] $ProductNameSuffix, - - # Version of the Product - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $ProductVersion, - - # Product Guid needs to change for every version to support SxS install - [ValidateNotNullOrEmpty()] - [string] $ProductGuid = 'a5249933-73a1-4b10-8a4c-13c98bdc16fe', - - # Source Path to the Product Files - required to package the contents into an MSI - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [string] $ProductSourcePath, - - # File describing the MSI Package creation semantics - [ValidateNotNullOrEmpty()] - [ValidateScript({Test-Path $_})] - [string] $ProductWxsPath = "$PSScriptRoot\assets\Product.wxs", - - # Path to Assets folder containing artifacts such as icons, images - [ValidateNotNullOrEmpty()] - [ValidateScript({Test-Path $_})] - [string] $AssetsPath = "$PSScriptRoot\assets", - - # Path to license.rtf file - for the EULA - [ValidateNotNullOrEmpty()] - [ValidateScript({Test-Path $_})] - [string] $LicenseFilePath = "$PSScriptRoot\assets\license.rtf", - - # Architecture to use when creating the MSI - [Parameter(Mandatory = $true)] - [ValidateSet("x86", "x64")] - [ValidateNotNullOrEmpty()] - [string] $ProductTargetArchitecture, - - # Force overwrite of package - [Switch] $Force - ) - - ## AppVeyor base image might update the version for Wix. Hence, we should - ## not hard code version numbers. - $wixToolsetBinPath = "${env:ProgramFiles(x86)}\WiX Toolset *\bin" - - Write-Verbose "Ensure Wix Toolset is present on the machine @ $wixToolsetBinPath" - if (-not (Test-Path $wixToolsetBinPath)) - { - throw "Wix Toolset is required to create MSI package. Please install it from https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311.exe" - } - - ## Get the latest if multiple versions exist. - $wixToolsetBinPath = (Get-ChildItem $wixToolsetBinPath).FullName | Sort-Object -Descending | Select-Object -First 1 - - Write-Verbose "Initialize Wix executables - Heat.exe, Candle.exe, Light.exe" - $wixHeatExePath = Join-Path $wixToolsetBinPath "Heat.exe" - $wixCandleExePath = Join-Path $wixToolsetBinPath "Candle.exe" - $wixLightExePath = Join-Path $wixToolsetBinPath "Light.exe" - - if ($null -eq (Get-Module packaging)) - { - # Import Get-PackageSemanticVersion function from packaging module - Import-Module "$PSScriptRoot\tools\packaging\packaging.psd1" - } - $ProductSemanticVersion = Get-PackageSemanticVersion -Version $ProductVersion - $ProductVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $ProductVersion - - $assetsInSourcePath = Join-Path $ProductSourcePath 'assets' - New-Item $assetsInSourcePath -type directory -Force | Write-Verbose - - Write-Verbose "Place dependencies such as icons to $assetsInSourcePath" - Copy-Item "$AssetsPath\*.ico" $assetsInSourcePath -Force - - $productVersionWithName = $ProductName + '_' + $ProductVersion - $productSemanticVersionWithName = $ProductName + '-' + $ProductSemanticVersion - - Write-Verbose "Create MSI for Product $productSemanticVersionWithName" - - [Environment]::SetEnvironmentVariable("ProductSourcePath", $ProductSourcePath, "Process") - # These variables are used by Product.wxs in assets directory - [Environment]::SetEnvironmentVariable("ProductName", $ProductName, "Process") - [Environment]::SetEnvironmentVariable("ProductGuid", $ProductGuid, "Process") - [Environment]::SetEnvironmentVariable("ProductVersion", $ProductVersion, "Process") - [Environment]::SetEnvironmentVariable("ProductSemanticVersion", $ProductSemanticVersion, "Process") - [Environment]::SetEnvironmentVariable("ProductVersionWithName", $productVersionWithName, "Process") - [Environment]::SetEnvironmentVariable("ProductTargetArchitecture", $ProductTargetArchitecture, "Process") - $ProductProgFilesDir = "ProgramFiles64Folder" - if ($ProductTargetArchitecture -eq "x86") - { - $ProductProgFilesDir = "ProgramFilesFolder" - } - [Environment]::SetEnvironmentVariable("ProductProgFilesDir", $ProductProgFilesDir, "Process") - - $wixFragmentPath = (Join-path $env:Temp "Fragment.wxs") - $wixObjProductPath = (Join-path $env:Temp "Product.wixobj") - $wixObjFragmentPath = (Join-path $env:Temp "Fragment.wixobj") - - $packageName = $productSemanticVersionWithName - if ($ProductNameSuffix) { - $packageName += "-$ProductNameSuffix" - } - $msiLocationPath = Join-Path $pwd "$packageName.msi" - - if(!$Force.IsPresent -and (Test-Path -Path $msiLocationPath)) - { - Write-Error -Message "Package already exists, use -Force to overwrite, path: $msiLocationPath" -ErrorAction Stop - } - - $WiXHeatLog = & $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v - $WiXCandleLog = & $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch x64 -v - $WiXLightLog = & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v - - Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force - - if (Test-Path $msiLocationPath) - { - Write-Verbose "You can find the MSI @ $msiLocationPath" -Verbose - $msiLocationPath - } - else - { - $WiXHeatLog | Out-String | Write-Verbose -Verbose - $WiXCandleLog | Out-String | Write-Verbose -Verbose - $WiXLightLog | Out-String | Write-Verbose -Verbose - throw "Failed to create $msiLocationPath" - } -} function Start-CrossGen { [CmdletBinding()] diff --git a/docs/building/windows-core.md b/docs/building/windows-core.md index 6dddefd9464..54d0a099b17 100644 --- a/docs/building/windows-core.md +++ b/docs/building/windows-core.md @@ -77,13 +77,3 @@ You can run our cross-platform Pester tests with `Start-PSPester`. ## Building in Visual Studio We currently have the issue [#3400](https://github.com/PowerShell/PowerShell/issues/3400) tracking this task. - -## Building an installable Package - -The installer is `WiX` based. You can create a Debug-x64 MSI as follows: - -````powershell -Import-Module .\build.psm1 -Start-PSBuild -New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' -```` diff --git a/tools/packaging/packaging.psd1 b/tools/packaging/packaging.psd1 index 49c929f7ec3..51f199bb2cf 100644 --- a/tools/packaging/packaging.psd1 +++ b/tools/packaging/packaging.psd1 @@ -5,7 +5,7 @@ CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0" PowerShellVersion="5.0" -CmdletsToExport=@("Start-PSPackage",'New-PSSignedBuildZip') +CmdletsToExport=@("Start-PSPackage",'New-PSSignedBuildZip','New-MSIPackage') RootModule="packaging.psm1" RequiredModules = @("build") } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 4ac1211527c..7a0b682f0cc 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1163,3 +1163,148 @@ function Get-NugetSemanticVersion $packageSemanticVersion } + +<# +.Synopsis + Creates a Windows installer MSI package and assumes that the binaries are already built using 'Start-PSBuild'. + This only works on a Windows machine due to the usage of WiX. +.EXAMPLE + # This example shows how to produce a Debug-x64 installer for WiX development purposes only. + cd $RootPathOfPowerShellCheckout + Import-Module .\build.psm1 + Start-PSBuild + Import-Module .\tools\packaging\packaging.psd1 + New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' +#> +function New-MSIPackage +{ + [CmdletBinding()] + param ( + + # Name of the Product + [ValidateNotNullOrEmpty()] + [string] $ProductName = 'PowerShell', + + # Suffix of the Name + [string] $ProductNameSuffix, + + # Version of the Product + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string] $ProductVersion, + + # Product Guid needs to change for every version to support SxS install + [ValidateNotNullOrEmpty()] + [string] $ProductGuid = 'a5249933-73a1-4b10-8a4c-13c98bdc16fe', + + # Source Path to the Product Files - required to package the contents into an MSI + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [string] $ProductSourcePath, + + # File describing the MSI Package creation semantics + [ValidateNotNullOrEmpty()] + [ValidateScript({Test-Path $_})] + [string] $ProductWxsPath = "$PSScriptRoot\..\..\assets\Product.wxs", + + # Path to Assets folder containing artifacts such as icons, images + [ValidateNotNullOrEmpty()] + [ValidateScript({Test-Path $_})] + [string] $AssetsPath = "$PSScriptRoot\..\..\assets", + + # Path to license.rtf file - for the EULA + [ValidateNotNullOrEmpty()] + [ValidateScript({Test-Path $_})] + [string] $LicenseFilePath = "$PSScriptRoot\..\..\assets\license.rtf", + + # Architecture to use when creating the MSI + [Parameter(Mandatory = $true)] + [ValidateSet("x86", "x64")] + [ValidateNotNullOrEmpty()] + [string] $ProductTargetArchitecture, + + # Force overwrite of package + [Switch] $Force + ) + + ## AppVeyor base image might update the version for Wix. Hence, we should + ## not hard code version numbers. + $wixToolsetBinPath = "${env:ProgramFiles(x86)}\WiX Toolset *\bin" + + Write-Verbose "Ensure Wix Toolset is present on the machine @ $wixToolsetBinPath" + if (-not (Test-Path $wixToolsetBinPath)) + { + throw "Wix Toolset is required to create MSI package. Please install it from https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311.exe" + } + + ## Get the latest if multiple versions exist. + $wixToolsetBinPath = (Get-ChildItem $wixToolsetBinPath).FullName | Sort-Object -Descending | Select-Object -First 1 + + Write-Verbose "Initialize Wix executables - Heat.exe, Candle.exe, Light.exe" + $wixHeatExePath = Join-Path $wixToolsetBinPath "Heat.exe" + $wixCandleExePath = Join-Path $wixToolsetBinPath "Candle.exe" + $wixLightExePath = Join-Path $wixToolsetBinPath "Light.exe" + + $ProductSemanticVersion = Get-PackageSemanticVersion -Version $ProductVersion + $ProductVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $ProductVersion + + $assetsInSourcePath = Join-Path $ProductSourcePath 'assets' + New-Item $assetsInSourcePath -type directory -Force | Write-Verbose + + Write-Verbose "Place dependencies such as icons to $assetsInSourcePath" + Copy-Item "$AssetsPath\*.ico" $assetsInSourcePath -Force + + $productVersionWithName = $ProductName + '_' + $ProductVersion + $productSemanticVersionWithName = $ProductName + '-' + $ProductSemanticVersion + + Write-Verbose "Create MSI for Product $productSemanticVersionWithName" + + [Environment]::SetEnvironmentVariable("ProductSourcePath", $ProductSourcePath, "Process") + # These variables are used by Product.wxs in assets directory + [Environment]::SetEnvironmentVariable("ProductName", $ProductName, "Process") + [Environment]::SetEnvironmentVariable("ProductGuid", $ProductGuid, "Process") + [Environment]::SetEnvironmentVariable("ProductVersion", $ProductVersion, "Process") + [Environment]::SetEnvironmentVariable("ProductSemanticVersion", $ProductSemanticVersion, "Process") + [Environment]::SetEnvironmentVariable("ProductVersionWithName", $productVersionWithName, "Process") + [Environment]::SetEnvironmentVariable("ProductTargetArchitecture", $ProductTargetArchitecture, "Process") + $ProductProgFilesDir = "ProgramFiles64Folder" + if ($ProductTargetArchitecture -eq "x86") + { + $ProductProgFilesDir = "ProgramFilesFolder" + } + [Environment]::SetEnvironmentVariable("ProductProgFilesDir", $ProductProgFilesDir, "Process") + + $wixFragmentPath = (Join-path $env:Temp "Fragment.wxs") + $wixObjProductPath = (Join-path $env:Temp "Product.wixobj") + $wixObjFragmentPath = (Join-path $env:Temp "Fragment.wixobj") + + $packageName = $productSemanticVersionWithName + if ($ProductNameSuffix) { + $packageName += "-$ProductNameSuffix" + } + $msiLocationPath = Join-Path $pwd "$packageName.msi" + + if(!$Force.IsPresent -and (Test-Path -Path $msiLocationPath)) + { + Write-Error -Message "Package already exists, use -Force to overwrite, path: $msiLocationPath" -ErrorAction Stop + } + + $WiXHeatLog = & $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v + $WiXCandleLog = & $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -ext WixUIExtension -ext WixUtilExtension -arch x64 -v + $WiXLightLog = & $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -ext WixUtilExtension -dWixUILicenseRtf="$LicenseFilePath" -v + + Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force + + if (Test-Path $msiLocationPath) + { + Write-Verbose "You can find the MSI @ $msiLocationPath" -Verbose + $msiLocationPath + } + else + { + $WiXHeatLog | Out-String | Write-Verbose -Verbose + $WiXCandleLog | Out-String | Write-Verbose -Verbose + $WiXLightLog | Out-String | Write-Verbose -Verbose + throw "Failed to create $msiLocationPath" + } +} From 6025d084fddcb2c4376ddb737ee572e1435d2f2a Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 18 Nov 2017 21:16:26 +0000 Subject: [PATCH 5/7] Remove New-MSiPackage cmdlet help, which was already moved in the last commit --- build.psm1 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/build.psm1 b/build.psm1 index 24f98047792..cc120c2f841 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1918,18 +1918,6 @@ function Get-PackageVersionAsMajorMinorBuildRevision $packageVersion } -<# -.Synopsis - Creates a Windows installer MSI package and assumes that the binaries are already built using 'Start-PSBuild'. - This only works on a Windows machine due to the usage of WiX. -.EXAMPLE - # This example shows how to produce a Debug-x64 installer for development purposes only. - cd $RootPathOfPowerShellCheckout - Import-Module .\build.psm1 - Start-PSBuild - New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' -#> - function Start-CrossGen { [CmdletBinding()] param( From d330560607fff6d389b61b7f7d90cd239e21295a Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 20 Nov 2017 22:29:28 +0000 Subject: [PATCH 6/7] Do not expose New-MSIPackage in packaging manifest as agreed in PR. Tested it still work in a clean checkout --- tools/packaging/packaging.psd1 | 2 +- tools/packaging/packaging.psm1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/packaging/packaging.psd1 b/tools/packaging/packaging.psd1 index 51f199bb2cf..49c929f7ec3 100644 --- a/tools/packaging/packaging.psd1 +++ b/tools/packaging/packaging.psd1 @@ -5,7 +5,7 @@ CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0" PowerShellVersion="5.0" -CmdletsToExport=@("Start-PSPackage",'New-PSSignedBuildZip','New-MSIPackage') +CmdletsToExport=@("Start-PSPackage",'New-PSSignedBuildZip') RootModule="packaging.psm1" RequiredModules = @("build") } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 7a0b682f0cc..2027fb39c38 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1173,7 +1173,7 @@ function Get-NugetSemanticVersion cd $RootPathOfPowerShellCheckout Import-Module .\build.psm1 Start-PSBuild - Import-Module .\tools\packaging\packaging.psd1 + Import-Module .\tools\packaging\packaging.psm1 New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' #> function New-MSIPackage From 8036a608a68ffedfb5596af80dc1f60ec8fff3ce Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 21 Nov 2017 06:52:36 +0000 Subject: [PATCH 7/7] tweak new-msipackage help --- tools/packaging/packaging.psm1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 2027fb39c38..3262dcd7e2d 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1171,10 +1171,8 @@ function Get-NugetSemanticVersion .EXAMPLE # This example shows how to produce a Debug-x64 installer for WiX development purposes only. cd $RootPathOfPowerShellCheckout - Import-Module .\build.psm1 - Start-PSBuild - Import-Module .\tools\packaging\packaging.psm1 - New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' + Import-Module .\build.psm1; Start-PSBuild # only needs to be exected once to initialize + New-MSIPackage -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' -Force #> function New-MSIPackage {