Repository navigation
Keep installed FieldWorks independent of dev registry paths (LT-22840) - #1183
johnml1135 wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1183 +/- ##
==========================================
+ Coverage 39.88% 40.36% +0.47%
==========================================
Files 1542 1550 +8
Lines 355361 355615 +254
Branches 41320 41477 +157
==========================================
+ Hits 141753 143547 +1794
+ Misses 184253 182758 -1495
+ Partials 29355 29310 -45
🚀 New features to boost your workflow:
|
|
Update: removed the unused |
c9bf157 to
19d5858
Compare
jasonleenaylor
left a comment
There was a problem hiding this comment.
The HKCU override is deliberate. Per-user RootCodeDir, RootDataDir and ProjectsDir values let a user redirect an installation without touching HKLM, and that capability was designed specifically for FieldWorks in grad lab courses and for user support. Developer machines use the same mechanism on purpose (see the note at FieldWorks.cs:3574), and installing a release on a developer machine has never been a supported setup. I don't want the installed readers changed to accommodate that setup.
The testing that found this doesn't need code changes. To check LT-22836 against 9.3.10, any of these keeps the installed build away from your dev keys:
- Windows Sandbox or a VM, where HKCU starts clean
- a second local Windows account, since HKCU is per user
reg exporttheFieldWorks\9key, remove the values, test, thenreg import- a dev build of the
release/9.3.10branch, which uses its ownDistFilessince #1093
LT-22840 notes that the reader change can't fix the installed 9.3.10 anyway, so that machine needs the cleanup either way.
The reader changes also break cases the override serves:
ParatextLexiconPluginDirectoryFinderhas no dev-tree detection, so a plugin loaded by Paratext now ignores an HKCURootCodeDirthat points at a source tree.- Native
DirectoryFinder::FwRootDataDirinUtil.cppstill reads HKCU first, so managed and native code would disagree on the data directory. - In a dev run, Project Location with "move" moves every project out of the HKCU
ProjectsDir, but the new path lives only in memory. The next launch, dev or installed, finds an empty folder.
Please drop the reader filters and the ProjectsDirectory change, and keep the mkall.targets registry targets until someone runs the new-machine setup test that Hasso's note asks for. A smaller PR with the read-only Resolve-FieldWorksDevRegistry.ps1, the InitializeIcu fix for a missing ICU folder, and the test initializer change would be welcome. The repair script can go with it as an opt-in tool, but it should leave SilEncConverters40\DeveloperPluginDir alone.
This review was assisted by Claude Opus 5.5.
19d5858 to
a8e013b
Compare
|
Shrunk as you asked. The branch is now three commits on the original base:
Dropped: the installed-reader filters, the Paratext finder change and the On Windows: the build passes; |
Start here:
Build/Repair-DeveloperRegistry.ps1previews and, on request, removes source-tree overrides from the current user's registry.The launch preflight is read-only, including with
-Force. An opt-in repair can remove identified worktree code, data, ICU, encoding-converter root andsilfw://overrides. Test initialization no longer overwrites shared code and data paths, and ICU initialization skips registry paths that do not exist.HKCU overrides remain deliberate: installed and Paratext readers retain their existing precedence, and a projects-folder change still persists. The repair keeps
ProjectsDirandSilEncConverters40\DeveloperPluginDir; inspect-WhatIfbefore applying it. The build's registry targets remain available pending new-machine setup verification.Where to look
Repair-DeveloperRegistry.Tests.ps1: selective cleanup, preview and preserved values.InitializeFwRegistryHelperAttributeandFwDirectoryFinderTests: test setup does not rewrite shared directory values.FwUtils.ChooseIcuDataDirandIcuDataDirChoiceTests: an existing user ICU directory wins; otherwise try the machine value.Not here: no installed-reader source-tree filters, Paratext or Convert changes, or changes to
ProjectsDirectory. The repair cannot identify a checkout whoseFieldWorks.slnhas moved or been removed.Verification (Windows/x64, at
a8e013bef):.\build.ps1 -CommentHygiene -TokenHygiene: passed.Repair-DeveloperRegistry.Tests.ps1: 23 checks passed in Windows PowerShell 5.1 and PowerShell 7.FwUtilsTests: 489 of 493 passed. The 4 failures areDebugProcsTests.GetMessage_*(\nagainst\r\n). That file is unchanged from the base, and the same tests pass on the base in a CRLF checkout; the failing run used an LF checkout.test.ps1, and a manual Project Location move and relaunch.Next: review the cleanup scope.
Registry behavior
ICU_DATAstill wins when set. Otherwise an existing HKCU ICU directory wins over an existing HKLM directory, followed by the existing development-tree fallback. A nonexistent per-user path is skipped in favor of an existing machine path. Explicit repair can also remove source-tree encoding-converter repository andsilfw://values; it preserves values outside identified worktrees.This change is