简体   繁体   中英

What is the Update.exe specified in "Update.exe not found, not a Squirrel-installed app" error?

I am trying to implement auto-update feature in my WPF application. So I am testing out a scratch project and following this guide .

This is my MainWindow.xaml :

<Window x:Class="AutoUpdate.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" Loaded="MainWindow_OnLoaded"
        Title="MainWindow" Height="350" Width="525">
    <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.FontSize="20">
        <TextBlock x:Name="CurrentVersion" Text="Loading..."/>
        <TextBlock x:Name="NewVersion" />
    </StackPanel>
</Window>

Then, my xaml.cs file:

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
    {
        using (var updateManager = new UpdateManager(@"C:\AutoUpdate\Releases"))
        {
            CurrentVersion.Text = $"Current version: {updateManager.CurrentlyInstalledVersion()}";
            var releaseEntry = await updateManager.UpdateApp();
            NewVersion.Text = $"Update Version: {releaseEntry?.Version.ToString() ?? "No update"}";
        }
    }
}

The only thing I did different is creating the .nupkg as I created it through NugetPackageExplorer . But I got the following error when run:

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

What is the Update.exe needed? I have it in my localappdata of my app. What could be missing?

You need first release your app with squirrel.exe --releasify and then install the app with Setup.exe or Setup.msi - it will work.

You cannot debug squirrel UpdateManager - but there is one way: you can first install your app released by squirrel on you computer and then copy Update.exe (from %LocalAppData%/YourAppName/) to parent directory of yours binary files in project. (ProjectName/Bin/Debug or ProjectName/Bin/Release).

For more info: https://github.com/Squirrel/Squirrel.Windows

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM