- /* On Mac OS X, using DYLD_LIBRARY_PATH, we actually set the
- * directory, not the file. */
-#ifdef __APPLE__
- binary.trimFilename();
+ os::String wrapperPath = findWrapper(wrapperFilename);
+
+ if (!wrapperPath.length()) {
+ std::cerr << "error: failed to find " << wrapperFilename << "\n";
+ goto exit;
+ }
+
+#if defined(_WIN32)
+ /* On Windows copy the wrapper to the program directory.
+ */
+ if (!copyWrapper(wrapperPath, argv[0], verbose)) {
+ goto exit;
+ }
+#endif /* _WIN32 */
+
+#if defined(__APPLE__)
+ /* On Mac OS X, using DYLD_LIBRARY_PATH, we actually set the
+ * directory, not the file. */
+ wrapperPath.trimFilename();