2

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();
        }
    }
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
djkpA
  • 1,224
  • 2
  • 27
  • 57

1 Answers1

1

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.

mm8
  • 163,881
  • 10
  • 57
  • 88
  • I have done what you said, but there is no change in installation path. Updated with code. I used `Environment.SetEnvironmentVariable("squirrel_temp", @"C:\Program Files (x86)");` to set env variable – djkpA Mar 23 '17 at 14:58
  • Which version of Squirrel are you using? Try the latest (1.5.2). – mm8 Mar 23 '17 at 15:07
  • Yeah 1.5.2 installed in my project.Is that the correct way I used to set `squirrel_temp`? – djkpA Mar 23 '17 at 15:15
  • I don't understand where you are doing this. As I mentioned, do it in a command prompt *before* you run Setup.exe. – mm8 Mar 23 '17 at 15:16
  • Will it consider and work on my client systems if I just do that in my command prompt? How is this gonna work? I am a bit confusing here – djkpA Mar 23 '17 at 15:19
  • Of course you need to set the environment variable on all client machines that runs Update.exe... – mm8 Mar 23 '17 at 15:20
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/138842/discussion-between-djkp-and-mm8). – djkpA Mar 23 '17 at 15:21