Specify full path to dcpomatic2_dist_writer and tidy a few things up.
authorCarl Hetherington <cth@carlh.net>
Thu, 26 Mar 2020 19:42:09 +0000 (20:42 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 28 Mar 2020 18:47:28 +0000 (19:47 +0100)
src/lib/cross.h
src/lib/cross_linux.cc
src/lib/cross_osx.cc
src/lib/cross_windows.cc
src/tools/dcpomatic_dist.cc

index 06b5417bf463d3c48057a79905bcdcca1a8dd79c..63e542dc9074d0973c9405562ff6258c22d934c0 100644 (file)
@@ -45,6 +45,7 @@ extern std::string cpu_info ();
 extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path);
 extern std::list<std::pair<std::string, std::string> > mount_info ();
 extern boost::filesystem::path openssl_path ();
+extern boost::filesystem::path dist_writer_path ();
 #ifdef DCPOMATIC_OSX
 extern boost::filesystem::path app_contents ();
 #endif
index a609e19f0d096c406954b3a4e8cf708e47db2a73..5073abe08e9813bbc9e9a80dfaebab8ca7a5ac6f 100644 (file)
@@ -139,6 +139,12 @@ openssl_path ()
        return "dcpomatic2_openssl";
 }
 
+boost::filesystem::path
+dist_writer_path ()
+{
+       return "dcpomatic2_dist_writer";
+}
+
 /* Apparently there is no way to create an ofstream using a UTF-8
    filename under Windows.  We are hence reduced to using fopen
    with this wrapper.
index 2f6066285ae0381582e4809635ac5a76b922265a..52d3d647b1b568070955eadcc9a780de64424fcc 100644 (file)
@@ -136,6 +136,15 @@ openssl_path ()
        return path;
 }
 
+boost::filesystem::path
+dist_writer_path ()
+{
+       boost::filesystem::path path = app_contents();
+       path /= "MacOS";
+       path /= "dcpomatic2_dist_writer";
+       return path;
+}
+
 /* Apparently there is no way to create an ofstream using a UTF-8
    filename under Windows.  We are hence reduced to using fopen
    with this wrapper.
index b97e2bbd0a0656394c3519a26fdf453d3e2e3efe..8d3ddbb8fd30c1f3468bf71ffbac3186022df999 100644 (file)
@@ -105,16 +105,6 @@ cpu_info ()
        return info;
 }
 
-boost::filesystem::path
-shared_path ()
-{
-       wchar_t dir[512];
-       GetModuleFileName (GetModuleHandle (0), dir, sizeof (dir));
-       PathRemoveFileSpec (dir);
-       boost::filesystem::path path = dir;
-       return path.parent_path();
-}
-
 void
 run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 {
@@ -189,17 +179,31 @@ mount_info ()
        return m;
 }
 
-boost::filesystem::path
-openssl_path ()
+static boost::filesystem::path
+executable_path ()
 {
        wchar_t dir[512];
-       GetModuleFileName (GetModuleHandle (0), dir, sizeof (dir));
+       GetModuleFileName (GetModuleHandle(0), dir, sizeof(dir));
        PathRemoveFileSpec (dir);
+       return dir;
+}
 
-       boost::filesystem::path path = dir;
-       path /= "openssl.exe";
-       return path;
+boost::filesystem::path
+shared_path ()
+{
+       return executable_path().parent_path();
+}
 
+boost::filesystem::path
+openssl_path ()
+{
+       return executable_path() / "openssl.exe";
+}
+
+boost::filesystem::path
+dist_writer_path ()
+{
+       return executable_path() / "dcpomatic2_dist_writer.exe";
 }
 
 /* Apparently there is no way to create an ofstream using a UTF-8
index a9d8f9bdaeaf1ab8b203481924003b234f49d4eb..5f1778b6bd937fb551c74cd316a5c89c7e6f99de 100644 (file)
@@ -113,7 +113,7 @@ public:
 
                Bind (wxEVT_SIZE, boost::bind (&DOMFrame::sized, this, _1));
 
-               _writer = new boost::process::child ("dcpomatic2_dist_writer");
+               _writer = new boost::process::child (dist_writer_path());
        }
 
 private: