Skip to content

Commit 72f2a40

Browse files
committed
Add Windows registry DisplayVersion (#5643)
1 parent aac15d0 commit 72f2a40

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ Other enhancements:
2020
* `stack upload` supports authentication with a Hackage API key (via
2121
`HACKAGE_KEY` environment variable).
2222

23+
* `DisplayVersion` in the Windows registry is now set by the installer,
24+
enabling tools like `winget` to properly read the version number.
25+
2326
Bug fixes:
2427

2528
* Ensure that `extra-path` works for case-insensitive `PATH`s on Windows.

etc/scripts/build-stack-installer.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Development.NSIS.Plugins.EnvVarUpdate
1616

1717
main :: IO ()
1818
main = do
19-
[srcPath, execPath, nsiPath] <- getArgs
19+
[srcPath, execPath, nsiPath, stackVersionStr] <- getArgs
2020

2121
writeFile (fromString nsiPath) $ nsis $ do
2222
_ <- constantStr "Name" "Haskell Stack"
@@ -43,6 +43,7 @@ main = do
4343

4444
-- Write the uninstall keys for Windows
4545
writeRegStr HKCU "Software/Microsoft/Windows/CurrentVersion/Uninstall/$Name" "DisplayName" "$Name"
46+
writeRegStr HKCU "Software/Microsoft/Windows/CurrentVersion/Uninstall/$Name" "DisplayVersion" (str stackVersionStr)
4647
writeRegStr HKCU "Software/Microsoft/Windows/CurrentVersion/Uninstall/$Name" "UninstallString" "\"$INSTDIR/uninstall-stack.exe\""
4748
writeRegDWORD HKCU "Software/Microsoft/Windows/CurrentVersion/Uninstall/$Name" "NoModify" 1
4849
writeRegDWORD HKCU "Software/Microsoft/Windows/CurrentVersion/Uninstall/$Name" "NoRepair" 1

etc/scripts/release.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ rules global@Global{..} args = do
259259
[ binaryExeFileName
260260
, binaryInstallerFileName
261261
, out
262+
, stackVersionStr global
262263
] :: Action ()
263264

264265
releaseBinDir </> binaryName </> stackExeFileName %> \out -> do

0 commit comments

Comments
 (0)