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
This commit is contained in:
Kacper Michajłow authored and sfan5 committed 2026-02-05 23:23:38 +01:00
1 parent 339ac9b305
commit 97867450ba
1 file changed
+4 -4
+4 -4
View File
@@ -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");