Skip to content

Conversation

@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Sep 22, 2018

PR Summary

Make Start-PSPackage give a better message about how to fix files.wxs
Some minor changes:

  1. Avoid relative paths as much as possible.
  2. Add a message about how to fix files.wxs when current files don't match the existing files.wxs.
  3. Fix a few script analyzer warnings since I'm on it.

The messages before this PR: (relative paths)

PS:137> Start-PSPackage -Type msi
Packaging RID: 'win7-x64'; Packaging Configuration: 'Release'
Packaging Source: 'E:\PowerShell\src\powershell-win-core\bin\Release\netcoreapp2.1\win7-x64\publish'
Packaging Type: msi
verifying no new files have been added or removed...
WARNING: {$(env.ProductSourcePath)\sos_amd64_amd64_4.6.26814.04.dll} is no longer in product and should be removed from {E:\PowerShell\tools\packaging\..\..\assets\Files.wxs}
WARNING: new file in {$(env.ProductSourcePath)} with name {sos_amd64_amd64_4.6.26814.03.dll} in a {DirectoryRef} need to be added to {E:\PowerShell\tools\packaging\..\..\assets\Files.wxs}
Update xml saved to C:\Users\dongbow\AppData\Local\Temp\chov3oyp.3oi.xml
Current files to not match  {E:\PowerShell\tools\packaging\..\..\assets\Files.wxs}
At E:\PowerShell\tools\packaging\packaging.psm1:2721 char:9
+         throw "Current files to not match  {$FilesWxsPath}"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Current files t...sets\Files.wxs}:String) [], RuntimeException
+ FullyQualifiedErrorId : Current files to not match  {E:\PowerShell\tools\packaging\..\..\assets\Files.wxs}

The message with this PR: (resolved paths)

PS:139> Start-PSPackage -Type msi
Packaging RID: 'win7-x64'; Packaging Configuration: 'Release'
Packaging Source: 'E:\PowerShell\src\powershell-win-core\bin\Release\netcoreapp2.1\win7-x64\publish'
Packaging Type: msi
verifying no new files have been added or removed...
WARNING: {$(env.ProductSourcePath)\sos_amd64_amd64_4.6.26814.04.dll} is no longer in product and should be removed from {E:\PowerShell\assets\Files.wxs}
WARNING: new file in {$(env.ProductSourcePath)} with name {sos_amd64_amd64_4.6.26814.03.dll} in a {DirectoryRef} need to be added to {E:\PowerShell\assets\Files.wxs}
Updated xml saved to C:\Users\dongbow\AppData\Local\Temp\prumscbt.xax.wxs.
If component files were intentionally changed, such as due to moving to a newer .NET Core runtime, update 'E:\PowerShell\assets\Files.wxs' with the content from 'C:\Users\dongbow\AppData\Local\Temp\prumscbt.xax.wxs'.
Current files to not match  {E:\PowerShell\assets\Files.wxs}
At E:\PowerShell\tools\packaging\packaging.psm1:2724 char:9
+         throw "Current files to not match  {$FilesWxsPath}"
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (Current files t...sets\Files.wxs}:String) [], RuntimeException
+ FullyQualifiedErrorId : Current files to not match  {E:\PowerShell\assets\Files.wxs}

PR Checklist

$nuspecObj = [xml] $nuspecTemplate

if ( ($Dependency -ne $null) -and $Dependency.Count -gt 0 ) {
if ( ($null -ne $Dependency) -and $Dependency.Count -gt 0 ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder that we change this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean "why we change this"? It's reported as a warning from Script Analyzer.

Copy link
Member

@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking


$refBinPath = New-TempFolder
$SnkFilePath = Join-Path $PSScriptRoot -ChildPath '../../src/signing/visualstudiopublic.snk' -Resolve
$SnkFilePath = (Resolve-Path "$RepoRoot/src/signing/visualstudiopublic.snk").Path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Does this really need to be resolved? $RepoRoot was already resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to be safe just in case that it expects the path separator to be platform specific.
Will look into how this path is used and see if it really needs to be resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path is only used in New-ReferenceAssembly, which only runs on windows platform. So I can change it to use \ directory separator.

@daxian-dbw daxian-dbw merged commit 4926e15 into PowerShell:master Sep 25, 2018
@daxian-dbw daxian-dbw deleted the minor branch September 25, 2018 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants