-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix CreateShortcutForThisExe
for .NET Core apps
#1752
Conversation
So, someone else proposed this solution as well and I'm not super excited about it, because lots of other projects also have DLLs with the same name as EXEs (remember that Squirrel is used for many non-C# projects as well). If you can come up with a better way of detecting the .NET Core EXE stub (perhaps by peeking in the PE header bytes) that'd be Better than just seeing the DLL with the same name |
Thanks for looking, @anaisbetts. But I think you may be confusing this fix with #1692, which fixes a different problem and jumps from .exe to .dll. I think your concern there has some validity because you're jumping from an .exe which may itself be legit to a dll. |
@AArnott That works for me, fix the style to match and I'm sold ( |
18aa015
to
2d5f27c
Compare
Done |
src/Squirrel/IUpdateManager.cs
Outdated
// This happens in .NET Core apps. A shortcut to a .dll doesn't work, so replace with the .exe. | ||
string candidateExe = Path.Combine(Path.GetDirectoryName(entrypoint), Path.GetFileNameWithoutExtension(entrypoint)) + ".exe"; | ||
if (File.Exists(candidateExe)) | ||
{ |
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.
⬆️
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.
🤦♂️
An .editorconfig file to help conform to this would be great.
Fixed.
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.
For sure, I should add that
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.
@anaisbetts see #1482 for an attempt.
The entrypoint assembly is reported as being a .dll in the .NET Core case. A shortcut to the dll is *not* what the developer expects and it doesn't work for the user. Instead, look for a nearby .exe with the same file name and use that.
2d5f27c
to
1c610dc
Compare
The entrypoint assembly is reported as being a .dll in the .NET Core case. A shortcut to the dll is not what the developer expects and it doesn't work for the user. Instead, look for a nearby .exe with the same file name and use that.