Repository navigation
Fix relative paths, optional-app dependencies, and launcher -Source detection - #2
Conversation
…etection - Resolve -WorkDir, -LogDir and -DownloadDir against the PowerShell location instead of the process directory, before any relaunch, and forward the resolved paths so the elevated child (which starts in System32) uses the folders the user meant. -Source Local without -WorkDir now keeps the caller's folder across UAC. - Skip a companion or additional app whose dependencies are missing and report a partial failure, instead of aborting before the Store is installed. Missing Store dependencies still stop the run (exit 4). - Match -Source in Install-Store.cmd only as a whole option, so paths such as D:\my-source-pkgs no longer suppress the -Source Auto default. - Add regression tests for each case, including a launcher test that runs the real detection line from Install-Store.cmd. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
Fixes four issues found while reviewing the current installer on
main.-WorkDir,-LogDirand-DownloadDirwere made absolute with[IO.Path]::GetFullPath, which uses the process directory, not the PowerShell location. For example,cd D:\followed by-DownloadOnly -DownloadDir StorePkgscould write to another folder. Paths now resolve against$PWDthroughResolve-UserPath.powershell.exestarts inSystem32. Before this fix,irm … | iexwith-Source Local(no-WorkDir) would look for packages inC:\Windows\System32.Install-Store.cmdmatched "-source" inside other text.findstr /c:"-Source"matched paths likeD:\my-source-pkgs. The launcher then dropped its-Source Autodefault, so the script downloaded packages instead of using the local ones. It now matches only a whole-Source/-Source:option.The dependency check is split into
Get-PackageDependencyState, whichGet-DependencyInstallOrderand the newTest-OptionalAppDependencyboth use. README anddocs/installer-reliability.mdare updated to match.Tests
tests/Test-CmdLauncher.ps1runs the real detection line fromInstall-Store.cmd.Test-InstallerFlow.ps1adds cases for a relative-WorkDir,-Source Localwith no-WorkDir, and an optional app with a missing dependency.Test-ScopeAndCleanup.ps1checks that relaunch forwards resolved paths.install.ps1andInstall-Store.cmd.Not covered: real deployment, UAC, and SYSTEM runs on a disposable LTSC 2021/2024 machine.
🤖 Generated with Claude Code
Summary by CodeRabbit
-Sourceoptions without mistaking paths or longer option names for them.