File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,8 +183,17 @@ await This.ErrorIfThrows(() =>
183183
184184 public static void CreateShortcutForThisExe ( this IUpdateManager This )
185185 {
186- This . CreateShortcutsForExecutable ( Path . GetFileName (
187- Assembly . GetEntryAssembly ( ) . Location ) ,
186+ string entrypoint = Assembly . GetEntryAssembly ( ) . Location ;
187+ if ( String . Equals ( Path . GetExtension ( entrypoint ) , ".dll" , StringComparison . OrdinalIgnoreCase ) ) {
188+ // This happens in .NET Core apps. A shortcut to a .dll doesn't work, so replace with the .exe.
189+ string candidateExe = Path . Combine ( Path . GetDirectoryName ( entrypoint ) , Path . GetFileNameWithoutExtension ( entrypoint ) ) + ".exe" ;
190+ if ( File . Exists ( candidateExe ) ) {
191+ entrypoint = candidateExe ;
192+ }
193+ }
194+
195+ This . CreateShortcutsForExecutable (
196+ Path . GetFileName ( entrypoint ) ,
188197 ShortcutLocation . Desktop | ShortcutLocation . StartMenu ,
189198 Environment . CommandLine . Contains ( "squirrel-install" ) == false ,
190199 null , null ) ;
You can’t perform that action at this time.
0 commit comments