我不擅长点击一次,所以我需要帮助来解决我的问题。
我制作了一个应用程序,并尝试通过clickonce部署我的应用程序。
但是,我不想通过单击一次自动更新。(此 ClickOnce from .NET Framework 文件夹)
因此,我从应用程序的.csproj中取消选中所有更新选项,并从msdn文档中获取编程更新源。
这是我的更新源。它使用 clickonce api。
public void UpdateStart()
{
if (this.deployInfo == null)
{
return;
}
this.deployInfo = ApplicationDeployment.CurrentDeployment;
UpdateCheckInfo info = null;
bool updateAvailable = false;
try
{
info = this.deployInfo.CheckForDetailedUpdate();
updateAvailable = info.UpdateAvailable;
}
catch (Exception ex)
{
return;
}
if (!updateAvailable)
return;
this.deployInfo.UpdateProgressChanged += (s, e) =>
{
UpdateProgressState(e.State);
this.UpdatePercent = e.ProgressPercentage;
};
this.deployInfo.UpdateCompleted += (s, e) =>
{
logger.I("Update process finish.");
string restartPath = GetClickonceRestartPath();
if (e.Cancelled)
{
restartPath = null;
}
if (e.Error != null)
{
restartPath = null;
}
RaiseCallback(restartPath);
};
this.deployInfo.UpdateAsync();
}
此代码运行良好。它从不调用 Clickonce 自己的更新 ui。 但是,如果我从 ApplicationDeployment 类调用 UpdateCancelAsync(),就会出现问题。
调用 UpdateCancelAsync() 并使用 .appref-ms 文件重新启动我的应用程序后, 会弹出 ClickOnce 的更新 ui,即使我从不检查任何更新选项。

我应该怎么做才能隐藏 ClickOnce 的 ui? 我错过了什么吗?
请让我知道如何隐藏它。
Note:此问题总结整理于: Clickonce update problem