-
Notifications
You must be signed in to change notification settings - Fork 8.1k
WIP Make it easier to build an installable package locally for WiX development and document it #5499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs/building/windows-core.md
Outdated
|
|
||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use Start-PSPackage function. See https://github.com/PowerShell/PowerShell/blob/cb048ea9f4f7ccc3612141ee76f7937b9ca1c823/docs/maintainers/releasing.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
build.psm1
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was sure we were using auto-loading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New-MSIPackage should be moved
build.psm1
Outdated
|
|
||
| <# | ||
| .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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the word file to package
docs/building/windows-core.md
Outdated
|
|
||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
docs/building/windows-core.md
Outdated
|
|
||
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
docs/building/windows-core.md
Outdated
| ````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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New-MSI package should not be exposed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could document how to use start-PsPackage for this purpose with the -SkipReleaseChecks parameter.
TravisEz13
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
… 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
tools/packaging/packaging.psm1
Outdated
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is no longer needed since it's part of packaging.psm1 already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
tools/packaging/packaging.psm1
Outdated
| cd $RootPathOfPowerShellCheckout | ||
| Import-Module .\build.psm1 | ||
| Start-PSBuild | ||
| Import-Module .\tools\packaging\packaging.psm1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.