【问题标题】:What is the Update.exe specified in "Update.exe not found, not a Squirrel-installed app" error?“找不到 Update.exe,不是 Squirrel 安装的应用程序”错误中指定的 Update.exe 是什么?
【发布时间】:2021-03-18 23:48:25
【问题描述】:

我正在尝试在我的 WPF 应用程序中实现自动更新功能。所以我正在测试一个临时项目并关注this guide

这是我的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>

然后,我的xaml.cs 文件:

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"}";
        }
    }
}

我所做的唯一不同之处在于创建 .nupkg,因为我是通过 NugetPackageExplorer 创建的。但是运行时出现以下错误:

Update.exe 未找到,不是 Squirrel 安装的应用程序?

Update.exe 需要什么?我在我的应用程序的localappdata 中有它。可能缺少什么?

【问题讨论】:

标签: c# squirrel.windows


【解决方案1】:

您需要首先使用 squirrel.exe --releasify 发布您的应用,然后使用 Setup.exe 或 Setup.msi 安装该应用 - 它会起作用。

您无法调试 squirrel UpdateManager - 但有一种方法:您可以先在您的计算机上安装由 squirrel 发布的应用程序,然后将 Update.exe(来自 %LocalAppData%/YourAppName/)复制到您的二进制文件的父目录项目。 (ProjectName/Bin/Debug 或 ProjectName/Bin/Release)。

欲了解更多信息:https://github.com/Squirrel/Squirrel.Windows

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-23
    • 2022-07-06
    • 1970-01-01
    • 2021-06-11
    • 2021-01-26
    • 1970-01-01
    • 2013-07-30
    相关资源
    最近更新 更多