Skip to content

Commit 0f4798e

Browse files
benhillisCopilot
andcommitted
WSLDVCPlugin.rc: use unmistakable placeholder sentinels
UpdateRCVersion.ps1 patches the .rc file via three string-Replace calls. The previous "placeholders" were: FILEVERSION 1,0,0,1 -> comma-form file version VALUE "FileVersion", "1.0.0.1" -> dot-form file version VALUE "ProductVersion", "InformationalVersion" -> InformationalVersion Each was a footgun: - 1.0.0.1 / 1,0,0,1 are plausible real version strings; a reader of the .rc file cannot tell they are placeholders, and any future commit that legitimately referenced them anywhere in the file would break the patch step. - "InformationalVersion" is the literal name of a real Windows VERSIONINFO value-key. Documenting or referencing the field name in another VALUE, comment, or BLOCK would silently corrupt the build. - The script is destructive (rewrites in place); accidentally running it twice would substitute into the previous substitution. Replace all three with sentinels nobody will ever introduce by accident: __FILEVERSION_COMMAS__ __FILEVERSION_DOTS__ __INFORMATIONAL_VERSION__ No behavior change. Local round-trip via pwsh confirms the produced .rc is byte-identical to the previous output (ProductVersion= "1.0.78-Beta3+sha.52f5039", FILEVERSION 1,0,78,0, etc.). Co-authored-by: Copilot <[email protected]>
1 parent 52f5039 commit 0f4798e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎WSLDVCPlugin/UpdateRCVersion.ps1‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ $versionComma = $fileVersion.Replace(".", ",")
1010
$informationalVersion = "$nugetVersion+sha.$sha"
1111

1212
$content = (Get-Content -Encoding "windows-1252" -Path ".\WSLDVCPlugin.rc")
13-
$content = $content.Replace("1,0,0,1", $versionComma)
14-
$content = $content.Replace("1.0.0.1", $fileVersion)
15-
$content = $content.Replace("InformationalVersion", $informationalVersion)
13+
$content = $content.Replace("__FILEVERSION_COMMAS__", $versionComma)
14+
$content = $content.Replace("__FILEVERSION_DOTS__", $fileVersion)
15+
$content = $content.Replace("__INFORMATIONAL_VERSION__", $informationalVersion)
1616

1717
Set-Content -Encoding "windows-1252" -Path ".\WSLDVCPlugin.rc" -Value $content

‎WSLDVCPlugin/WSLDVCPlugin.rc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 1,0,0,1
55-
PRODUCTVERSION 1,0,0,1
54+
FILEVERSION __FILEVERSION_COMMAS__
55+
PRODUCTVERSION __FILEVERSION_COMMAS__
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
6969
BEGIN
7070
VALUE "CompanyName", "© Microsoft Corporation. All rights reserved"
7171
VALUE "FileDescription", "WSL Remote Application List Plug-in"
72-
VALUE "FileVersion", "1.0.0.1"
72+
VALUE "FileVersion", "__FILEVERSION_DOTS__"
7373
VALUE "InternalName", "WSLDVCPl.dll"
7474
VALUE "LegalCopyright", "© Microsoft Corporation. All rights reserved"
7575
VALUE "OriginalFilename", "WSLDVCPl.dll"
7676
VALUE "ProductName", "WSL Remote Application List Plug-in"
77-
VALUE "ProductVersion", "InformationalVersion"
77+
VALUE "ProductVersion", "__INFORMATIONAL_VERSION__"
7878
END
7979
END
8080
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)