Squirrel / Squirrel.Windows

An installation and update framework for Windows desktop apps
MIT License
7.35k stars 1.03k forks source link

Do not modify TaskBar icons with a similar application directory #1719

Closed jviotti closed 2 years ago

jviotti commented 3 years ago

When this program runs, it loops over all the symlinks created in the user's TaskBar in an attempt to update the symlinks corresponding to the application being installed.

The logic goes like this:

if (!shortcut.Target.StartsWith(rootAppDirectory, StringComparison.OrdinalIgnoreCase)) continue;

Now consider two applications where the application root directory of the first starts with the application root directory of the second:

When running Squirrel for the first application, Squirrel will incorrectly update and break the TaskBar symlink pointing to C:\\Users\\jv\\AppData\\Local\\PostmanCanary\\PostmanCanary.exe as C:\\Users\\jv\\AppData\\Local\\PostmanCanary starts with C:\\Users\\jv\\AppData\\Local\\Postman from a string point of view.

This commit ensures that we only modify TaskBar symlinks with the same application directory, ignoring other application directories that share the same prefix string.

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

robmen commented 3 years ago

Alternative solution to #1490 - we should pick one

jviotti commented 2 years ago

Closing stale PRs...