WIP Make it easier to build an installable package locally for WiX development and document it#5499
WIP Make it easier to build an installable package locally for WiX development and document it#5499bergmeister wants to merge 9 commits into
Conversation
|
|
||
| We currently have the issue [#3400](https://github.com/PowerShell/PowerShell/issues/3400) tracking this task. | ||
|
|
||
| ## Building an installer |
There was a problem hiding this comment.
We use Start-PSPackage function. See https://github.com/PowerShell/PowerShell/blob/cb048ea9f4f7ccc3612141ee76f7937b9ca1c823/docs/maintainers/releasing.md
There was a problem hiding this comment.
Start-PSPackage is not very developer friendly because it has requirements such as that the checkout must be at the root of the filesystem and that PowerShell has to be compiled in a very specific way. The purpose of this PR is to make it easier to build MSIs locally when changing WiX code.
There was a problem hiding this comment.
Start-PSPackage also does some other checks, but that's more intended for creating a release package and I can understand the scenario for a developer testing their wix changes. However, it's actually pretty easy to have PowerShell repo as your root using either New-PSDrive or Subst.
There was a problem hiding this comment.
I think we should support one entry point - it is easily to support (in docs too).
Also it will be best to have the same code (csproj?) to build on local and on GitHub.
| if ($null -eq (Get-Module packaging)) | ||
| { | ||
| # Import Get-PackageSemanticVersion function from packaging module | ||
| Import-Module "$PSScriptRoot\tools\packaging\packaging.psd1" |
There was a problem hiding this comment.
I was sure we were using auto-loading.
There was a problem hiding this comment.
See the example where it only imports build.psm1. We would need to have a module manifest for the build module then. Or maybe New-MSIPackage should be moved into the packaging module instead?
There was a problem hiding this comment.
New-MSIPackage should be moved
|
|
||
| <# | ||
| .Synopsis | ||
| Creates a Windows installer MSI file and assumes that the binaries are already built using 'Start-PSBuild'. |
There was a problem hiding this comment.
change the word file to package
|
|
||
| We currently have the issue [#3400](https://github.com/PowerShell/PowerShell/issues/3400) tracking this task. | ||
|
|
||
| ## Building an installer |
There was a problem hiding this comment.
Start-PSPackage also does some other checks, but that's more intended for creating a release package and I can understand the scenario for a developer testing their wix changes. However, it's actually pretty easy to have PowerShell repo as your root using either New-PSDrive or Subst.
|
|
||
| We currently have the issue [#3400](https://github.com/PowerShell/PowerShell/issues/3400) tracking this task. | ||
|
|
||
| ## Building an installer |
There was a problem hiding this comment.
Instead of calling it Building an installer, I think it's more correct to say Building an Installable Package (where installer is msi)
Codecov Report
@@ Coverage Diff @@
## master #5499 +/- ##
==========================================
+ Coverage 60.83% 60.84% +0.01%
==========================================
Files 924 929 +5
Lines 274195 273880 -315
==========================================
- Hits 166793 166642 -151
+ Misses 107402 107238 -164
Continue to review full report at Codecov.
|
| ````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' |
There was a problem hiding this comment.
New-MSI package should not be exposed.
There was a problem hiding this comment.
You could document how to use start-PsPackage for this purpose with the -SkipReleaseChecks parameter.
… expose instructions in building/windows-core.md
|
@bergmeister Could you please correct the PR title and description? |
|
@iSazonov OK. I've adapted the title and description now to make it clearer that it is about WiX development where one does care too much what exactly lands in the package. |
|
Thinking further about this, I think I prefer not exposing |
|
@SteveL-MSFT If you do not want to expose |
|
I think we should remove |
Tested it still work in a clean checkout
| Import-Module .\build.psm1 | ||
| Start-PSBuild | ||
| Import-Module .\tools\packaging\packaging.psd1 | ||
| Import-Module .\tools\packaging\packaging.psm1 |
There was a problem hiding this comment.
this line is no longer needed since it's part of packaging.psm1 already
There was a problem hiding this comment.
I see what you mean but the idea was to provide a copy-pasteable example that works out of the box. Would it be OK to rather squash the initialization as Import-Module .\build.psm1; Start-PSBuild; Import-Module .\tools\packaging\packaging.psm1? Otherwise I'll of course remove the line if you insist.
There was a problem hiding this comment.
For the comment based help, you would only see that if you already have the packaging module loaded, so it just seems weird. I think if you want to provide an easy cut-paste, perhaps it's better to have it in https://github.com/PowerShell/PowerShell/blob/master/docs/building/windows-core.md
| cd $RootPathOfPowerShellCheckout | ||
| Import-Module .\build.psm1 | ||
| Start-PSBuild | ||
| Import-Module .\tools\packaging\packaging.psm1 |
There was a problem hiding this comment.
Just point to import the folder as a module.
…o wix_dev_friendly
…o wix_dev_friendly
|
@bergmeister Please resolve merge conflicts. |
|
Ok, thanks for letting me know. I will come back to it soon (but not today) since it needs more time carefully extracting the diff because the conflict is quite horrible due to the move of a function that has received updates in the meantime. Maybe even a new PR with 2 separate commits (one with the improvements and one with the move) might be better to avoid accidentally reverting code changes. What do you think? |
|
@bergmeister Perhaps easy make new PR. |
Issue #5012 has highlighted that it is not easy to get started with development work on the Windows installer.
This PR documents for the first time how to build an installable package locally and simplifies the process by moving
New-MSIPackageto thepackagingmodule where it better belongs to and more defaults/validation are added as well.Since
New-MSIPackagethrows a very nice error with a download link to the required WiX toolset, I decided to not duplicate this in the documentation about having to install the WiX toolset.I guess the best reviewer is @SteveL-MSFT who recently did a lot of installer work.