Torna al Thread
Imports System.ComponentModel
Imports System.Configuration.Install
Public Class ProjectInstaller
Public Sub New()
MyBase.New()
'Chiamata richiesta da Progettazione componenti.
InitializeComponent()
'Aggiungere il codice di inizializzazione dopo la chiamata a InitializeComponent
End Sub
Public Overrides Sub Commit(ByVal savedState As System.Collections.IDictionary)
'MsgBox("About to call the base class commit method", MsgBoxStyle.Information)
Dim ckey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine
ckey.OpenSubKey("SYSTEM\CurrentControlSet\Services\NomeServizio", True)
If ckey Is Nothing Then
MsgBox("La chiave non esiste errore di sistema", MsgBoxStyle.Information)
Else
' MsgBox("La chiave esiste", MsgBoxStyle.Information)
If DirectCast(ckey.GetValueNames, IList).IndexOf("Type") = -1 Then
' MsgBox("La valore non esiste", MsgBoxStyle.Information)
ckey.OpenSubKey("SYSTEM\CurrentControlSet\Services\NomeServizio", True).SetValue("Type", CType(272, Integer))
Else
ckey.OpenSubKey("SYSTEM\CurrentControlSet\Services\NomeServizio", True).SetValue("Type", CType(272, Integer))
Dim val As String
val = ckey.GetValue("Type").ToString
' MsgBox("La valore è " + val)
' MsgBox("La valore esiste", MsgBoxStyle.Information)
End If
End If
End Sub
End Class