I'm not good at clickonce so I need help to solve my problem.
I made a application, and I trying to deploy my app via clickonce.
But, I do not want to auto update by clickonce.(this clickonce from .net framework folder)
So I uncheck all of update option from .csproj for application and I get a programmatically update source from msdn docs.
this is my update source. It using 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();
}
This code works well. It never call Clickonce's own update ui.
But if I call UpdateCancelAsync() from ApplicationDeployment class, It makes problem.
After call UpdateCancelAsync() and restart my application with .appref-ms file,
ClickOnce's update ui is popuped, even I never check any update options.
What should I do for hide that ClickOnce's ui?
Did I miss something?
Please let me know how to hide it.