Salve,
ho la necessità di far fare un aggiornamento, e cancellare il programma dell'aggiornamento dopo l'update.

Non vorrei dover chiamare la shell, od altri eseguibili, è possibile fare tutto tramite codice?
Ho tentato lanciando un thread diverso, ma mi restituisce un errore

Sub Main
Dim myThread As System.Threading.Thread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf Aggiorna))
myThread.Start()
Me.Close()
End Sub

Private Sub Aggiorna()
Thread.Sleep(5000)
Try
Dim di As IO.DirectoryInfo = New IO.DirectoryInfo(My.Application.Info.DirectoryPath )
For Each File As IO.FileInfo In di.GetFiles()
File.Delete()
Next
Catch ex As Exception
MsgBox(ex.Message + vbCrLf + ex.StackTrace)
End Try


End Sub

Grazie a tutti coloro vorranno aiutarmi, a presto