From 97867450ba54d391611db29a2cd7c39e018ebecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Thu, 5 Feb 2026 15:30:41 +0100 Subject: [PATCH] osdep/w32_register: fix EstimatedSize Move PathCchRemoveFileSpec after actually getting the file size. It must have been swapped at some point by accident. Also use correct unit for the size. Fixes: #17375 --- osdep/w32_register.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osdep/w32_register.c b/osdep/w32_register.c index 5a7e2da288..214ce7210d 100644 --- a/osdep/w32_register.c +++ b/osdep/w32_register.c @@ -413,12 +413,12 @@ static void w32_register(struct MPContext *mpctx) reg_add_str(log, root, KEY_MPV_UNINSTALL, L"URLInfoAbout", L"https://mpv.io"); reg_add_str(log, root, KEY_MPV_UNINSTALL, L"URLUpdateInfo", L"https://mpv.io/installation"); - if (SUCCEEDED(PathCchRemoveFileSpec(mpv_path, MP_PATH_MAX))) - reg_add_str(log, root, KEY_MPV_UNINSTALL, L"InstallLocation", mpv_path); - uint64_t size = get_file_size(mpv_path); if (size) - reg_add_dwr(log, root, KEY_MPV_UNINSTALL, L"EstimatedSize", size); + reg_add_dwr(log, root, KEY_MPV_UNINSTALL, L"EstimatedSize", size / 1024); + + if (SUCCEEDED(PathCchRemoveFileSpec(mpv_path, MP_PATH_MAX))) + reg_add_str(log, root, KEY_MPV_UNINSTALL, L"InstallLocation", mpv_path); mp_msg(log, MSGL_INFO, "mpv has been successfully registered.\n"); mp_msg(log, MSGL_INFO, "Note: The mpv binary has not been copied or moved. Please keep it in the current directory.\n");