Files
velopack/docs/2.1-Integrating-Debugging.md
Ken Bailey 49b6b866bb Reformatting of docs with a Getting Started and Advanced topics section.
Removed /specs help files to avoid confusion.
2015-12-23 22:54:50 -07:00

2.2 KiB

Squirrel.Windows / 2. Advanced Usage / 2.1 More Integrating

2.1 Integrating: Debugging

The following tips will help you to debug the integration of the update process in your application.

Update.exe not found?

Executing MyApp from Visual Studio will execute the update process and you will get the following exception from the UpdateManager:

Update.exe not found, not a Squirrel-installed app?

The UpdateManager is expecting to find the Update.exe application installed one directory up from the EXE (e.g., the \bin directory for default Visual Studio projects).

To resolve this, you can simply place a file named Update.exe or you can copy the Squirrel.exe from the MyApp\packages\squirrel.windows.1.2.2.tools directory and rename it Update.exe (this is the actual Update.exe packaged inside Setup.exe).

Executing MyApp from Visual Studio will now cause it to complete the update process and your \bin directory will resemble the %LocalAppData\MyApp% install directory:

Simulating an Install and First Run

If the install of your application doesn't seem to be working, you can explore the behavior by executing the install steps from the command line:

C:\user\AppData\Local\MyApp> Update.exe --squirrel-install 1.0.0
C:\user\AppData\Local\MyApp> Update.exe --squirrel-firstrun

The first cmd should create some shortcuts then immediately exit, then the 2nd one should start your app (source)

Catching Update Exceptions

You can catch thrown exceptions and log the results.

Task.Run(async () =>
{
    try
    {
        using (var mgr = new UpdateManager("C:\\Projects\\MyApp\\Releases"))
        {
            await mgr.UpdateApp();
        }
    }
    catch (Exception ex)
    {
    	 // perform logging here or inform user here...
    }
});

Alternatively, set up Splat Logging, see here for an example.


Return: 2.1 More Integrating