-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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
remove duplicate startup entries #3012
Conversation
fixes #3011 Signed-off-by: ahmadali shafiee <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me, but someone else must approve.
The status of the
It's impossible to have duplicate registry entries, unless you manually add them after starting the app. Or the check process may have failed to cover some edge cases. |
as I've explained on #3011, I've experienced it after upgrade. I'm not sure from which version but I guess it was from 4.2.1 to 4.3.0. I was experiencing the issue on two different machines |
also there's an issue with the
if the loop reaches the |
Please take another look at As for the issue, I doubt if it's caused by the update. Can you reproduce it and provide detailed steps? |
the lets assume whe the foreach loop reaches the |
Signed-off-by: ahmadali shafiee <[email protected]>
It's impossible to have duplicate registry entries in the first place, unless you manually add them after starting the app, which shouldn't be covered by the checker. |
Signed-off-by: ahmadali shafiee <[email protected]>
the case |
I've fixed the issue of check method on my latest commit. the only difference is that I don't just check for |
here's a detailed way to reproduce this issue:
and there will be two |
and the current
|
Signed-off-by: ahmadali shafiee <[email protected]>
Thank you for your contribution and detailed explanations! 😊 |
yw ;) if you're going to merge it now, just let me adjust one more thing |
Signed-off-by: ahmadali shafiee <[email protected]>
@@ -14,7 +14,7 @@ static class AutoStartup | |||
|
|||
// Don't use Application.ExecutablePath | |||
// see https://stackoverflow.com/questions/12945805/odd-c-sharp-path-issue | |||
|
|||
private static string Key = "Shadowsocks_" + Program.ExecutablePath.GetHashCode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string.GetHashCode() are not guranteed same between different versions, it's the possible reason why there's two different entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true, the other issue is that the source string (which we calculate hash of) has been changed from ced49e2. it used to be hash of Application.StartupPath
but it changed to Program.ExecutablePath
What is the purpose of your pull request?
Description of your pull request and other information
fixes #3011