Skip to content

Commit

Permalink
B2SBackglassServerRegisterApp: re-registering B2S.Server should first…
Browse files Browse the repository at this point in the history
… cleanup earlier entries #98
  • Loading branch information
JockeJarre committed Apr 20, 2024
1 parent a456db5 commit f13a572
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Public Class formBackglassServerRegApp
Dim regasmpath As String = String.Empty
Dim version As String = String.Empty
Dim dialogResult As DialogResult
Dim clsID As String = String.Empty

If Not CommandSilent Then
If CheckB2SServer(False) Then
Dim dllURI As String = "file://Unknown"
Try
Using regRoot As RegistryKey = Registry.ClassesRoot
Dim clsID As String = String.Empty
Using openKey As RegistryKey = regRoot.OpenSubKey("B2S.Server\CLSID", False)
If openKey IsNot Nothing Then
clsID = openKey.GetValue("")
Expand Down Expand Up @@ -83,6 +83,13 @@ Public Class formBackglassServerRegApp
ElseIf String.IsNullOrEmpty(regasmpath) Then
MessageBox.Show("Error, no regasmpath found.")
Else
' cleanup earlier B2S.Server entries
If clsID IsNot String.Empty Then
Using regRoot As RegistryKey = Registry.ClassesRoot
regRoot.DeleteSubKeyTree("B2S.Server", False)
regRoot.OpenSubKey("CLSID", True).DeleteSubKeyTree(clsID, False)
End Using
End If
' do the register operation
ShellAndWait(regasmpath, "B2SBackglassServer.DLL")
If IO.File.Exists("B2SBackglassServer64.DLL") Then
Expand Down

0 comments on commit f13a572

Please sign in to comment.