]> source.dussan.org Git - tigervnc.git/commitdiff
Don't fail old service cleanup
authorPierre Ossman <ossman@cendio.se>
Thu, 18 Aug 2016 14:48:55 +0000 (16:48 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 18 Aug 2016 14:49:29 +0000 (16:49 +0200)
(cherry picked from commit c7860c2cb66f2752119a6557bd58a1c672b96716)

win/winvnc/winvnc.cxx

index 57f9f3d405cb35c98df4ec551601f0f09f7cfff1..aa41bcbf6a1cb536a772bc0e17fa5800fa46b940 100644 (file)
@@ -170,8 +170,16 @@ static void processParams(int argc, char** argv) {
         i = argc;
 
         // Try to clean up earlier services we've had
-        rfb::win32::unregisterService("WinVNC4");
-        rfb::win32::unregisterService("TigerVNC Server");
+        try {
+          rfb::win32::unregisterService("WinVNC4");
+        } catch (rdr::SystemException) {
+          // Do nothing as we might fail simply because there was no
+          // service to remove
+        }
+        try {
+          rfb::win32::unregisterService("TigerVNC Server");
+        } catch (rdr::SystemException) {
+        }
 
         if (rfb::win32::registerService(VNCServerService::Name,
                                         _T("TigerVNC Server"),