Repository navigation
chore(package): regenerate installer strings in LF checkouts - #2149
Conversation
TextTransform.exe fails with CS1519 when the template has LF line endings, which is what a checkout with core.autocrlf=input or false produces, since Strings.g.tt has no eol attribute. T4 then replaces Strings.g.cs with `ErrorGeneratingOutput`, so the failed run also corrupts the working tree. Write the temporary template with CRLF endings whatever the checkout uses, and restore the generated files from their original bytes when TextTransform fails, so a failed run exits non-zero and changes nothing. Regenerating also restores the trailing tabs the template emits on five Agent Tunnel constants of the Gateway Strings.g.cs, which had been added without them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reproduction and proofCheckout with Before (master script, LF templates), for both The script exits 1, but After, all checks run with
The 5-line Lines changed
Note LLM-assisted content (no human feedback). |
There was a problem hiding this comment.
🟡 Changes recommended
Rollback can leave earlier projects’ changes and newly created outputs behind, violating the unchanged-on-failure guarantee.
2 open issues
What changed in this PR
This PR makes installer localization regeneration work in LF checkouts and adds rollback when TextTransform fails.
Changes:
- Normalize temporary T4 templates to CRLF before execution.
- Save existing generated files and restore their bytes on transformation failure.
- Restore generator-emitted trailing tabs on five Gateway constants, with no functional C# changes.
| File | Description |
|---|---|
package/WindowsManaged/Resources/Strings.g.cs |
Align five constants with generated whitespace. |
package/Update-InstallerLocalization.ps1 |
Normalize template line endings and add failure rollback. |
Review effort: Balanced
Snapshot the generated files of all selected projects before running T4, and on failure remove outputs the run created before restoring the rest, so a failure in a later project does not keep the earlier project's changes or a new ErrorGeneratingOutput file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

TextTransform.exe fails with CS1519 when the template has LF line endings, which is what a checkout with core.autocrlf=input or false produces, since Strings.g.tt has no eol attribute. T4 then replaces Strings.g.cs with
ErrorGeneratingOutput, so the failed run also corrupts the working tree.Write the temporary template with CRLF endings whatever the checkout uses. When TextTransform fails for any selected project, remove the outputs the run created and restore the generated files of every selected project from their original bytes, so a failed run exits non-zero and changes nothing.
Regenerating also restores the trailing tabs the template emits on five Agent Tunnel constants of the Gateway Strings.g.cs, which had been added without them.
🤖 Generated with Claude Code