Build fix for VC++ Express
[WebKit-https.git] / WebKitTools / FindSafari / FindSafari.cpp
index 8580602ca4e57264ff92023cd9fecedf6d77cf8e..12fa35be8db85ea7a8477ee299f3db15cfa041e0 100644 (file)
@@ -130,7 +130,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;
 }