Fix CreateShortcutForThisExe for .NET Core apps#1752
Fix CreateShortcutForThisExe for .NET Core apps#1752anaisbetts merged 1 commit intoSquirrel:developfrom
CreateShortcutForThisExe for .NET Core apps#1752Conversation
|
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.
🤦♂️
An .editorconfig file to help conform to this would be great.
Fixed.
There was a problem hiding this comment.
For sure, I should add that
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.