Fix #112729: Update pinned blender shortcut #113859

Merged
Ray molenkamp merged 8 commits from LazyDodo/blender:tmp_pin_fix into blender-v4.0-release 2023-11-01 01:45:02 +01:00
Member

Windows allows people to pin an application to their taskbar, when a
user pins blender, the data we set in
GHOST_WindowWin32::registerWindowAppUserModelProperties is used
which includes the path to the blender-launcher.exe. Now once that
shortcut is created on the taskbar, this will never be updated, if
people remove blender and install it again to a different path
(happens often when using nightly builds) this leads to the
situation where the shortcut on the taskbar points to a no longer
existing blender installation. Now you may think, just un-pin and
re-pin that should clear that right up! It doesn't, it'll keep using
the outdated path till the end of time and there's no window API call
we can do to update this information. However this shortcut is stored
in the user profile in a sub-foder we can easily query, from there, we
iterate over all files, look for the one that has our appid in it, and
when we find it, update the path to the blender launcher to the
current installation, bit of a hack, but Microsoft seemingly offers no
other way to deal with this problem.

Windows allows people to pin an application to their taskbar, when a user pins blender, the data we set in `GHOST_WindowWin32::registerWindowAppUserModelProperties` is used which includes the path to the `blender-launcher.exe`. Now once that shortcut is created on the taskbar, this will never be updated, if people remove blender and install it again to a different path (happens often when using nightly builds) this leads to the situation where the shortcut on the taskbar points to a no longer existing blender installation. Now you may think, just un-pin and re-pin that should clear that right up! It doesn't, it'll keep using the outdated path till the end of time and there's no window API call we can do to update this information. However this shortcut is stored in the user profile in a sub-foder we can easily query, from there, we iterate over all files, look for the one that has our appid in it, and when we find it, update the path to the blender launcher to the current installation, bit of a hack, but Microsoft seemingly offers no other way to deal with this problem.
Ray molenkamp added 3 commits 2023-10-17 18:49:58 +02:00
c002d44924 Fix #112729: Update pinned blender shortcut
Windows allows people to pin an application to their taskbar, when a
user pins blender, the data we set in
`GHOST_WindowWin32::registerWindowAppUserModelProperties` is used
which includes the path to the `blender-launcher.exe`. Now once that
shortcut is created on the taskbar, this will never be updated, if
people remove blender and install it again to a different path
(happens often when using nightly builds) this leads to the
situation where the shortcut on the taskbar points to a no longer
existing blender installation. Now you may think, just un-pin and
re-pin that should clear that right up! It doesn't, it'll keep using
the outdated path till the end of time and there's no window API call
we can do to update this information. However this shortcut is stored
in the user profile in a sub-foder we can easily query, from there, we
iterate over all files, look for the one that has our appid in it, and
when we find it, update the path to the blender launcher to the
current installation, bit of a hack, but Microsoft seemingly offers no
other way to deal with this problem.
buildbot/vexp-code-patch-coordinator Build done. Details
2f5ffedb65
codestyle
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR113859) when ready.
Ray molenkamp requested review from Harley Acheson 2023-10-18 15:38:23 +02:00
Member

For testing this, is this only when a Blender of the same version is installed to a different location? Or for all new installations?

For testing this, is this only when a Blender of the _same version_ is installed to a different location? Or for all new installations?
Author
Member

The app id is used to register these properties, which contains both the major and minor version ie (Blender4.0, Blender4.1) so "normal" users that just get our major releases are unlikely to hit this bug, people that use nightly builds that have a new folder every day and delete the old one, are very likely to run into it.

The app id is used to register these properties, which contains both the major and minor version ie (`Blender4.0`, `Blender4.1`) so "normal" users that just get our major releases are unlikely to hit this bug, people that use nightly builds that have a new folder every day and delete the old one, are _very_ likely to run into it.
Member

An interesting discovery is that Windows 11, unlike 10, seems to do a better job of link tracking changes to target path and executable. But can confirm that this PR does properly reset the pinned shortcut target correctly on its own.

The added function is small, works as advertised, and I can't find any issues with it.

An interesting discovery is that Windows 11, unlike 10, seems to do a better job of link tracking changes to target path and executable. But can confirm that this PR does properly reset the pinned shortcut target correctly on its own. The added function is small, works as advertised, and I can't find any issues with it.
Harley Acheson approved these changes 2023-10-20 17:42:35 +02:00
Ray molenkamp added 2 commits 2023-10-23 16:03:54 +02:00
Ray molenkamp changed title from Fix #112729: Update pinned blender shortcut to Fix #112729: Update pinned blender shortcut 2023-10-30 14:31:53 +01:00
LazyDodo changed target branch from main to blender-v4.0-release 2023-10-30 14:31:56 +01:00
Ray molenkamp added 1 commit 2023-10-30 14:32:35 +01:00
Ray molenkamp added 1 commit 2023-10-30 14:40:14 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
37c8f86a06
add missing license headers + comment fix
Author
Member

@blender-bot build windows

@blender-bot build windows
Ray molenkamp added 1 commit 2023-11-01 00:17:51 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
f44b9da425
fix missing declare
Author
Member

@blender-bot build windows

@blender-bot build windows
Ray molenkamp merged commit f6c52849b5 into blender-v4.0-release 2023-11-01 01:45:02 +01:00
Ray molenkamp deleted branch tmp_pin_fix 2023-11-01 01:45:07 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113859
No description provided.