VB.NET - Working with Click-Once



Update Application Synchronously using ClickOnce

'Assembly: System.Deployment.dll
'Namespace: Microsoft.VisualBasic 

If My.Application.IsNetworkDeployed Then
    My.Application.Deployment.Update()
End If

Update Application Asynchronously using ClickOnce

'Assembly: System.Deployment.dll
'Namespace: System.Deployment
'Namespace: Microsoft.VisualBasic

If My.Application.IsNetworkDeployed Then
	My.Application.Deployment.UpdateAsync()
End If

Download Files Synchronously with ClickOnce

'Assembly: System.Deployment.dll
'Namespace: System.Deployment

'File download Group: "syntaxscripts"

If My.Application.IsNetworkDeployed Then
	If Not(My.Application.Deployment.IsFileGroupDownloaded("syntaxscripts")) Then
		 My.Application.Deployment.DownloadFileGroup("syntaxscripts")
	End If
End If

Check for Update to ClickOnce Application

'Assembly: System.Deployment.dll
'Namespace: System.Deployment

If My.Application.IsNetworkDeployed() 
	If My.Application.Deployment.CheckForUpdate() Then
		'do something
 	End If
End If

Check for Current Version using ClickOnce

'Assembly: System.Deployment.dll
'Namespace: System.Deployment

If My.Application.IsNetworkDeployed Then
	Dim v AS Version = My.Application.Deployment.CurrentVersion
	Dim d AS Date = My.Application.Deployment.TimeOfLastUpdateCheck
End If

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.