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

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

Closed
wants to merge 1 commit into from
Closed

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

wants to merge 1 commit into from

Conversation

jviotti
Copy link

@jviotti jviotti commented May 6, 2021

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:

  • C:\\Users\\jv\\AppData\\Local\\Postman\\Postman.exe
  • C:\\Users\\jv\\AppData\\Local\\PostmanCanary\\PostmanCanary.exe

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 [email protected]

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:

- `C:\\Users\\jv\\AppData\\Local\\Postman\\Postman.exe`
- `C:\\Users\\jv\\AppData\\Local\\PostmanCanary\\PostmanCanary.exe`

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 <[email protected]>
@robmen
Copy link
Contributor

robmen commented Oct 3, 2021

Alternative solution to #1490 - we should pick one

@jviotti
Copy link
Author

jviotti commented Aug 15, 2022

Closing stale PRs...

@jviotti jviotti closed this Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants