col*_*rtz 5 c# wpf squirrel.windows
我一直在使用Squirrel.Windows成功部署WPF一段时间了.我让我的机器重新成像,RELEAESES文件Releases夹中的文件是从头开始重新创建的,因为我完全在我的文件中排除了这个文件夹.gitignore.这似乎打破了我重新映像之前创建的版本上的用户的自动更新功能.
我可以在RELEASES文件中设置什么来强制旧版本引入更新版本而不重新创建所有nuget包吗?
这是我RELEASES文件的相关部分.该版本的用户2.0.6121.16815不会自动迁移到底部的较新版本.
这是我的更新程序代码app.xaml.cs.不确定它是否相关,因为它在技术上运行良好.
Task.Run(async () =>
{
using (var mgr = new UpdateManager(updatePath, packageName))
{
var updates = await mgr.CheckForUpdate();
if (updates.ReleasesToApply.Any())
{
try
{
var lastVersion = updates.ReleasesToApply.OrderBy(x => x.Version).Last();
await mgr.DownloadReleases(updates.ReleasesToApply);
await mgr.ApplyReleases(updates);
try
{
latestExe = Path.Combine(mgr.RootAppDirectory, string.Concat("app-", lastVersion.Version), "App.exe");
log.Debug("Latest exe:" + latestExe);
mgr.CreateShortcutsForExecutable(latestExe, DefaultLocations, false);
}
catch(Exception ex)
{
log.Error("error creating shortcuts for executable",ex);
}
restart = true;
}
catch(Exception ex)
{
log.Error("Error pulling in updated files", ex);
}
}
else
{
//No updates
log.Debug("No updates available");
}
}
if (restart)
{
log.Debug("Updated App. Restarting...");
UpdateManager.RestartApp(latestExe);
}
}).Wait();
Run Code Online (Sandbox Code Playgroud)