Skip to content

Packaging Console Application generates a broken shortcut #1098

@Keboo

Description

@Keboo

I was looking to distribute a console application using Squirrel. I had previously done similar with a WPF application and it worked great.

The install and the updates work as expected, but the shortcuts that are generated do not work correctly.
It appears that something with the stub executables could be to blame (PR #868).

After installation the generated shortcut looks like this:
image

Here are the contents of %LocalAppData%\HelloWorld:
image

There is a HelloWorld.exe at the root, but it is an empty file (note the size).

Looking a bit further it is clear that when releasify'ing my nuget, it does not generate an execution stub for my exe because it is subsystem 3 (related issue #945).

However on install that 0 byte file shows up and the generated shortcut fails.
This may be the same issue that is reported in #967

My questions:

  • Is Squirrel is expected to be a deployment solution for console applications?
  • If so, is this a bug, or am I doing something wrong?

Squirrel Version: 1.7.7

Sample console application:

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
            Task.Run(CheckForUpdate).Wait();
            Console.ReadLine();
        }

        private static async Task CheckForUpdate()
        {
            using (var updateManager = new UpdateManager(@"C:\SquirrelReleases"))
            {
                Console.WriteLine($"Current version: {updateManager.CurrentlyInstalledVersion()}");
                var releaseEntry = await updateManager.UpdateApp();
                Console.WriteLine($"Update Version: {releaseEntry?.Version.ToString() ?? "No update"}");
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions