risolto in questo modo:
codice:
Function RegistraFile(ByVal NomeFile As String, Optional ByVal Disinstalla As Boolean = False, Optional ByVal Silenzioso As Boolean = False) As Boolean
Dim Argomenti As String
Argomenti = String.Empty
If Disinstalla = True Then
Argomenti &= "/u "
End If
If Silenzioso = True Then
Argomenti &= "/s "
End If
Argomenti &= """" & NomeFile & """"
Return EseguiProgramma("regsvr32.exe", Environment.SystemDirectory, Argomenti)
End Function
Function EseguiProgramma(ByVal Programma As String, ByVal Path As String, ByVal Argomenti As String) As Boolean
Dim Proc As New Process
Proc.StartInfo.FileName = Programma
Proc.StartInfo.WorkingDirectory = Path
Proc.StartInfo.Arguments = Argomenti
Try
Proc.Start()
Proc.WaitForExit()
Proc.Close()
Return True
Catch ex As Exception
MessageBox.Show(ex.Message, "ADD-IN UPTADE!", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
Finally
Proc = Nothing
End Try
End Function
se avete un modo più semplice, sono sempre aperto a nuove prospettive...