Skip to content

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