Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong DisplayVersion registry key written in Windows 11 #14629

Closed
jonathan-b-wiebe opened this issue Apr 24, 2024 · 13 comments
Closed

Wrong DisplayVersion registry key written in Windows 11 #14629

jonathan-b-wiebe opened this issue Apr 24, 2024 · 13 comments
Labels

Comments

@jonathan-b-wiebe
Copy link

Steps to reproduce

  1. Open a terminal and install vim using the command 'winget install vim.vim'. As of today Vim 9.1.0312_x64.exe is downloaded and installed.
  2. Type the command 'winget upgrade'. The results will show that version 9.1.0 is installed and 9.1.0312 is available.
  3. Open vim. This will show that installed version is indeed 9.1.0312.
  4. Open the registry editor and go to the key: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.1
  5. Note that the DisplayVersion is set t0 9.1.0. This is also the source of the version shown in Settings -> Apps -> Installed Apps.
  6. Manually installing the latest version from the vim-win32-installer site (9.1.0368) will update the registry key to 9.1.0000, which is still incorrect.

Expected behaviour

  1. Winget should show that version 9.1.0312 is installed and not show that an update is available.
  2. Settings -> Apps -> Installed Apps should show version 9.1.312 is installed.
  3. The registry key should be set to 9.1.0312.

Version of Vim

9.1.0312

Environment

Windows 11-23H2

Logs and stack traces

No response

@chrisbra
Copy link
Member

Isn't that a problem with winget then, if it works when manually installing?

@jonathan-b-wiebe
Copy link
Author

Manually installing the latest version from the vim-win32-installer site (9.1.0368) will update the registry key to 9.1.0000, which is still incorrect. The registry key should be set to 9.1.0312.

@chrisbra
Copy link
Member

I don't think this is true, here on my current system (Win10), it shows the correct version:
grafik
grafik

@jonathan-b-wiebe
Copy link
Author

I have re-installed using the same version you are running (9.1.0136) and it indeed works correctly.
I will uninstall and reinstall with newer versions to determine when this behavour started.
Thanks for your help!

@jonathan-b-wiebe
Copy link
Author

I can now confirm that this behaviour started somewhere between version 9.1.0282 and 9.1.0296. I cannot get move exact then this because these are two consecutive released on the vim-win32-installer site and I am not set up to compile vim in order to test the intermediate versions between these.
Installing version 9.1.0282 shows the following in the registry:
image
Installing version 9.1.0296 shows the following:
image
Re-installing version 9.1.0282 returns the key to the correct value.

@RestorerZ
Copy link
Contributor

@jonathan-b-wiebe
And can you please install the latest version with “vim-win32-install” and see what you get in your registry?
https://github.com/vim/vim-win32-installer/releases/tag/v9.1.0368

@chrisbra
Copy link
Member

Hm, I don't see any potential changes between v9.1.282 and v9.1.296 that could cause this.

@chrisbra
Copy link
Member

I guess this one here: vim/vim-win32-installer@672d8c5 ?

@jonathan-b-wiebe
Copy link
Author

Installing gvim_9.1.0368_x64.exe results in the following registry key:
image

@RestorerZ
Copy link
Contributor

I'm afraid it has to do with this pull request #338 and #14471

@RestorerZ
Copy link
Contributor

Installing gvim_9.1.0368_x64.exe results in the following registry key:

Thank you. I'll check it out now.

@RestorerZ
Copy link
Contributor

That's probably it.

vim/src/dosinst.c

Line 1657 in a4c085a

sprintf(version_string, VIM_VERSION_SHORT "." VIM_VERSION_PATCHLEVEL_STR);

It's possible that this should fix it.

diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index aec9efaf9..4d03a722b 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -1321,6 +1321,10 @@ $(OUTDIR):
 
 CFLAGS_INST = /nologo /O2 -DNDEBUG -DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) $(CFLAGS_DEPR)
 
+!IFDEF PATCHLEVEL
+CFLAGS_INST=	$(CFLAGS_INST) -DVIM_VERSION_PATCHLEVEL=$(PATCHLEVEL)
+!ENDIF
+
 install.exe: dosinst.c dosinst.h version.h
 	$(CC) $(CFLAGS_INST) dosinst.c kernel32.lib shell32.lib \
 		user32.lib ole32.lib advapi32.lib uuid.lib \

I'll have to check it again.

@RestorerZ
Copy link
Contributor

Yeah, everything seems to be working as it should.
prg-vim-inst-ptchlvl
reg-vim-inst-ptchlvl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants