Dhoni
Dhoni

Reputation: 1234

How to change installation directory in squirrel auto update for WPF apps

I am trying to use Squirrel to Autoupdate my WPF application. It is installing the application in %LocalAppData% folder. I want to change this to C:\Program Files (x86) or Path choose by user.

I haven't found any doc related to this on their repo.So how can I ask for installation path while using Squirrel foe WPF application.

Is there any other better mechanism for update my wpf app with out downloading new .exe file from webpage manually by user ?.

public static async void CheckUpdate()
    {
        Environment.SetEnvironmentVariable("squirrel_temp", @"C:\Program Files (x86)");
        using (var mgr = new UpdateManager(@"C:\Users\jk\Documents\Visual Studio 2015\Projects\WpfApplication1\Releases"))
        {
            await mgr.UpdateApp();
        }
    }

Upvotes: 2

Views: 4901

Answers (1)

mm8
mm8

Reputation: 169150

A Squirrel app is installed to the directory specified by the squirrel_temp environment variable.

You can set this variable to a path in a command prompt prior to calling Update.exe:

set squirrel_temp=C:\Program Files (x86)

Please refer to the following pull request for more information: https://github.com/Squirrel/Squirrel.Windows/pull/846

Asking the user for an installation path while installing is not supported out of the box.

Upvotes: 1

Related Questions