Add -PrepareOnly switch to New-WtWingetPackage for pre-packaging customization#260
Merged
Merged
Conversation
2 tasks
Copilot
AI
changed the title
[WIP] Fix partial package creation to leave source files
Add -PrepareOnly switch to New-WtWingetPackage for pre-packaging customization
Jul 3, 2026
There was a problem hiding this comment.
Pull request overview
Adds a -PrepareOnly option to the WinTuner/WingetIntune packaging flow so users can generate a fully-populated package folder (installer + scripts + metadata) for customization without producing an .intunewin.
Changes:
- Introduces
PackageOptions.PrepareOnlyand wires it throughNew-WtWingetPackage -PrepareOnly. - Updates
IntuneManagerto download installers into the output package folder and skipIIntunePackager.CreatePackagewhenPrepareOnlyis set. - Makes
WingetPackage.PackageFilenullable and adds tests for both EXE and MSI PrepareOnly paths.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/WingetIntune.Tests/Intune/IntuneManagerTests.cs | Adds PrepareOnly test coverage (EXE/MSI) and registers Kiota JSON serializers for isolation. |
| src/WingetIntune/Models/WingetPackage.cs | Makes PackageFile nullable to represent “no .intunewin produced”. |
| src/WingetIntune/Models/PackageOptions.cs | Adds PrepareOnly option to the packaging options model. |
| src/WingetIntune/Intune/IntuneManager.cs | Routes installer downloads to output folder and skips .intunewin creation when PrepareOnly is true. |
| src/Svrooij.WinTuner.CmdLets/Commands/NewWtWingetPackage.cs | Adds -PrepareOnly switch and passes it into PackageOptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+260
to
+263
| var logoPath = Path.GetFullPath(Path.Combine(outputPackageFolder, "..", "logo.png")); | ||
| var installerPath = Path.Combine(outputPackageFolder, installerFilename); | ||
| var installerUrl = "https://github.com/microsoft/PowerToys/releases/download/v0.91.1/PowerToysSetup-0.91.1-x64.exe"; | ||
| var installerHash = "AABBCC"; |
Comment on lines
+331
to
+333
| var installer = IntuneTestConstants.azureCliPackageInfo.Installers!.First(); | ||
| var installerPath = Path.Combine(outputPackageFolder, installer.InstallerFilename!); | ||
| var logoPath = Path.GetFullPath(Path.Combine(outputPackageFolder, "..", "logo.png")); |
Comment on lines
34
to
38
| /// <summary> | ||
| /// The filename of the intunewin file | ||
| /// </summary> | ||
| public string PackageFile { get; set; } | ||
| public string? PackageFile { get; set; } | ||
|
|
svrooij
marked this pull request as ready for review
July 3, 2026 21:32
svrooij
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-PartialPackagecreates a.partial.intunewinfor direct upload — it does not leave raw source files for customization. Users who need to swap scripts (e.g., custom uninstall logic) before packaging had no supported path to do so.Adds a new
-PrepareOnlyswitch that downloads the installer and generates all supporting files (install/uninstall/detection scripts,app.json,readme.txt) directly into the output package folder, then stops — no.intunewinis created.Changes
PackageOptions— newPrepareOnlybool propertyWingetPackage—PackageFilemade nullable (string?); returned asnullwhen no.intunewinis producedIntuneManager— bothGenerateMsiPackageandGenerateNoneMsiInstallerroute the installer download to the output folder (instead of temp) and skipIIntunePackager.CreatePackagewhenPrepareOnly = trueNewWtWingetPackage— new-PrepareOnlySwitchParameterwired through toPackageOptionsIntuneManagerTestscovering EXE and MSIPrepareOnlypaths; static constructor added to register Kiota JSON serializers for test isolation (previously tests only passed due to implicit registration ordering fromGraphStoreAppUploaderTests)