diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp index 6713e58670..a456841360 100644 --- a/qga/vss-win32/install.cpp +++ b/qga/vss-win32/install.cpp @@ -443,6 +443,17 @@ STDAPI DllRegisterServer(void) VSS_PROV_SOFTWARE, const_cast(QGA_PROVIDER_VERSION), g_gProviderVersion); + if (hr == (long int) VSS_E_PROVIDER_ALREADY_REGISTERED) { + DllUnregisterServer(); + hr = pVssAdmin->RegisterProvider(g_gProviderId, CLSID_QGAVSSProvider, + const_cast + (QGA_PROVIDER_LNAME), + VSS_PROV_SOFTWARE, + const_cast + (QGA_PROVIDER_VERSION), + g_gProviderVersion); + } + if (FAILED(hr)) { errmsg_dialog(hr, "RegisterProvider failed"); }