Squirrel.Windows
Squirrel.Windows copied to clipboard
WPF shortcut has incorrect target
Squirrel version(s) v2.0.0
Description When using the .exe generated by Squirrel the resulting desktop shortcut does not use the correct target.
Steps to recreate
- Generate a release:
"C:\Users\usernamehere\.nuget\packages\squirrel.windows\2.0.0\tools\Squirrel.exe" --releasify HelloWorld.1.0.2.nupkg --releaseDir "C:\SquirrelReleases"
- Run the exe generate as part of the release
- Try to use the desktop shortcut
Expected behavior Application starts
Actual behavior You get a message titled: Missing Shortcut saying: Windows is searching for HelloWorld.exe. To locate the file yourself, click Browse.
Additional information
When I open up the shortcut I see the the following:
Target C:\Users\usernamehere\AppData\Local\HelloWorld\HelloWorld.exe
Start In C:\Users\usernamehere\AppData\Local\HelloWorld\app-1.0.2
According to the docs it should be in the format:
Target: C:\Users\usernamehere\AppData\Local\HelloWorld\Update.exe --processStart HelloWorld.exe
Start in: C:\Users\usernamehere\AppData\Local\HelloWorld\app-1.0.2
Hello @kylelaverty .
When you open the generated nuget package (e.g. HelloWorld-1.0.0-full.nupkg), you should see a HelloWorld_ExecutionStub.exe
. This is generated in Releasify.
Below is an example:
You are right about the docs, but that has not been my personal experience using the tool.
Hi @owns , I am having the same issue as @kylelaverty, the shortcut has wrong target, looking at your comment, I see that I don't have MyApp_ExecutionStub.exe file, do you know by any chance why my project does not generate this file?
Hi @owns , I am having the same issue as @kylelaverty, the shortcut has wrong target, looking at your comment, I see that I don't have MyApp_ExecutionStub.exe file, do you know by any chance why my project does not generate this file?
Figured this is worth mentioning - I had previously created this issue for myself when I decided to change my app to a "Console Application" in the project's settings as I wanted a 'hybrid application' - this breaks it. As soon as I change my project back to a forms application (or whatever it says), the issue immediately resolved itself. I hope it's this simple for you too!
I have the same problem. With Winforms, "_ExecutionStub.exe" is generated, but not with WPF application.
The WPF application's name was "WpfBySquirrel", but Squirrel skip executable that name contains "squirrel.exe". I renamed the application and now it's work.
Full condition :
rp.CreateReleasePackage(Path.Combine(di.FullName, rp.SuggestedReleaseFileName), packagesDir, contentsPostProcessHook: pkgPath => {
new DirectoryInfo(pkgPath).GetAllFilesRecursively()
.Where(x => x.Name.ToLowerInvariant().EndsWith(".exe"))
.Where(x => !x.Name.ToLowerInvariant().Contains("squirrel.exe"))
.Where(x => Utility.IsFileTopLevelInPackage(x.FullName, pkgPath))
.Where(x => Utility.ExecutableUsesWin32Subsystem(x.FullName))
.ForEachAsync(x => createExecutableStubForExe(x.FullName))
.Wait();
@kylelaverty, why is the type of your "HelloWorld" application?
If it's console, I think Squirrel ignore the exe because ExecutableUsesWin32Subsystem
.
@vernou output type is set to WinExe but the application was called WpfTestSquirrel. So it sounds like that might have been the issue. I am currently swamped but I will try to find some time this weekend to make an app that does not have the word squirrel in it and see if I can get it to work.