Updates to Safari launching now that 3.0.4 is released
[WebKit-https.git] / WebKitTools / FindSafari / FindSafari.cpp
index 8580602ca4e57264ff92023cd9fecedf6d77cf8e..f2ec2a8d8a8a6faa0bc01daf3f157da0ac6bfff6 100644 (file)
@@ -57,9 +57,7 @@ static TCHAR* getStringValue(HKEY key, LPCTSTR valueName)
 
 static LPOLESTR getWebViewCLSID()
 {
-    // FIXME <rdar://5505062>: Once WebKit switches to truly version-independent
-    // ProgIDs, this should just become "WebKit.WebView".
-    LPCTSTR webViewProgID = TEXT("WebKit.WebView.3");
+    LPCTSTR webViewProgID = TEXT("WebKit.WebView");
 
     CLSID clsid = CLSID_NULL;
     HRESULT hr = CLSIDFromProgID(webViewProgID, &clsid);
@@ -130,7 +128,26 @@ int _tmain(int argc, TCHAR* argv[])
         return 1;
     }
 
-    _tprintf(TEXT("%s"), path);
+    if (argc < 2 || _tcscmp(argv[1], TEXT("/printSafariLauncher"))) {
+        _tprintf(TEXT("%s"), path);
+        free(path);
+        return 0;
+    }
+
+    TCHAR* lines[] = {
+        TEXT("@echo off"),
+        TEXT("mkdir 2>NUL \"%%TMP%%\\WebKitNightly\\Safari.resources\""),
+        TEXT("xcopy /y /i /d \"%sSafari.exe\" \"%%TMP%%\\WebKitNightly\""),
+        TEXT("xcopy /y /i /d /e \"%sSafari.resources\" \"%%TMP%%\\WebKitNightly\\Safari.resources\""),
+        TEXT("set PATH=\"%%CD%%;%s;%%PATH%%\""),
+        TEXT("\"%%TMP%%\\WebKitNightly\\Safari.exe\" /customWebKit"),
+    };
+
+    for (int i = 0; i < ARRAYSIZE(lines); ++i) {
+        _tprintf(lines[i], path);
+        _tprintf(TEXT("\n"));
+    }
+
     free(path);
     return 0;
 }