From f13a572f6ed8c5909935cf4ad3d887a361c500c1 Mon Sep 17 00:00:00 2001 From: Jarr3 Date: Sat, 20 Apr 2024 18:58:36 +0200 Subject: [PATCH] B2SBackglassServerRegisterApp: re-registering B2S.Server should first cleanup earlier entries #98 --- .../formBackglassServerRegApp.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/b2sbackglassserverregisterapp/b2sbackglassserverregisterapp/formBackglassServerRegApp.vb b/b2sbackglassserverregisterapp/b2sbackglassserverregisterapp/formBackglassServerRegApp.vb index a436a32..4e8ae99 100644 --- a/b2sbackglassserverregisterapp/b2sbackglassserverregisterapp/formBackglassServerRegApp.vb +++ b/b2sbackglassserverregisterapp/b2sbackglassserverregisterapp/formBackglassServerRegApp.vb @@ -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("") @@ -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