From 3913d8bea2bfc0076215f542a89cc31ddafa5e7f Mon Sep 17 00:00:00 2001 From: "Raghu Shantha [MSFT]" Date: Thu, 18 Aug 2016 15:42:42 -0700 Subject: [PATCH] Update Sign-Package.ps1 to reflect prerequisites, remove the phrase 'Open' (#1816) * Update Sign-Package.ps1 * Updated based on CR comments --- tools/Sign-Package.ps1 | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/Sign-Package.ps1 b/tools/Sign-Package.ps1 index 60a7968807..73640b3b67 100644 --- a/tools/Sign-Package.ps1 +++ b/tools/Sign-Package.ps1 @@ -1,8 +1,8 @@ -# Utility to generate a self-signed certificate and sign a given package such as OpenPowerShell.zip/appx/msi +# Utility to generate a self-signed certificate and sign a given package such as PowerShell.zip/appx/msi [CmdletBinding()] param ( - #Path to package - Ex: OpenPowerShell.msi, OpenPowerShell.appx + #Path to package - Ex: PowerShell.msi, PowerShell.appx [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $PackageFilePath @@ -18,17 +18,17 @@ function New-SelfSignedCertificate #Path to save generated Certificate [ValidateNotNullOrEmpty()] - [string] $CertificateFilePath = "$pwd\OpenPowerShell.cer", + [string] $CertificateFilePath = "$pwd\PowerShell.cer", #Path to save generated pvk file [ValidateNotNullOrEmpty()] - [string] $PvkFilePath = "$env:Temp\OpenPowerShell.pvk" + [string] $PvkFilePath = "$env:Temp\PowerShell.pvk" ) $makecertBinPath = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x64\MakeCert.exe" - Write-Verbose "Ensure MakeCert.exe is present @ $makecertBinPath" + Write-Verbose "Windows 10 SDK needed - https://go.microsoft.com/fwlink/p/?LinkID=822845 - Ensure MakeCert.exe is present @ $makecertBinPath" if (-not (Test-Path $makecertBinPath)) { throw "$makecertBinPath is required to generate a self-signed certificate" @@ -52,23 +52,23 @@ function ConvertTo-Pfx #Path to Certificate file [ValidateNotNullOrEmpty()] - [string] $CertificateFilePath = "$pwd\OpenPowerShell.cer", + [string] $CertificateFilePath = "$pwd\PowerShell.cer", #Path to pvk file [ValidateNotNullOrEmpty()] - [string] $PvkFilePath = "$env:Temp\OpenPowerShell.pvk", + [string] $PvkFilePath = "$env:Temp\PowerShell.pvk", #Path to generated pfx file [ValidateNotNullOrEmpty()] - [string] $PfxFilePath = "$env:Temp\OpenPowerShell.pfx" + [string] $PfxFilePath = "$env:Temp\PowerShell.pfx" ) $pvk2pfxBinPath = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x64\pvk2pfx.exe" - Write-Verbose "Ensure pvk2pfx.exe is present @ $pvk2pfxBinPath" + Write-Verbose "Windows 10 SDK needed - https://go.microsoft.com/fwlink/p/?LinkID=822845 - Ensure pvk2pfx.exe is present @ $pvk2pfxBinPath" if (-not (Test-Path $pvk2pfxBinPath)) { - throw "$pvk2pfxBinPath is required to convert pvk file to pfx file - one of the prerequisities to signing a package!" + throw "$pvk2pfxBinPath is required to convert pvk file to pfx file - one of the prerequisites to sign a package!" } Remove-Item $PfxFilePath -Force -ErrorAction Ignore @@ -87,20 +87,20 @@ function Sign-Package [CmdletBinding()] param ( - #Path to package - Ex: OpenPowerShell.msi, OpenPowerShell.appx + #Path to package - Ex: PowerShell.msi, PowerShell.appx [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $PackageFilePath, - #Path to generated pfx file for signing the package + #Path to generated pfx file to sign the package [ValidateNotNullOrEmpty()] - [string] $PfxFilePath = "$env:Temp\OpenPowerShell.pfx" + [string] $PfxFilePath = "$env:Temp\PowerShell.pfx" ) $signtoolBinPath = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\x64\SignTool.exe" - Write-Verbose "Ensure SignTool.exe is present @ $signtoolBinPath" + Write-Verbose "Windows 10 SDK needed - https://go.microsoft.com/fwlink/p/?LinkID=822845 - Ensure SignTool.exe is present @ $signtoolBinPath" if (-not (Test-Path $signtoolBinPath)) { throw "$signtoolBinPath is required to sign the package!" @@ -122,4 +122,4 @@ Write-Output "Signed Package is available @ `'$signedPackage`'" Write-Output "On Windows Full SKU - Import the self-signed certificate `'$certificate`' to TrustedStore (Import-Certificate) prior to installing the package" -Write-Output "On Windows Nano - Use `'$env:Windir\System32\Certoc.exe -AddStore TrustedPeople `' to import the self-signed certificate `'$certificate`' to TrustedStore" \ No newline at end of file +Write-Output "On Windows Nano - Use `'$env:Windir\System32\Certoc.exe -AddStore TrustedPeople `' to import the self-signed certificate `'$certificate`' to TrustedStore"