hackz.
[dcpomatic.git] / src / tools / dcpomatic_disk.cc
index c4a04aea8eee6cfe983851c2905698c9a0d772d9..73fb353046491b86bfdae32b4262054008bf8d02 100644 (file)
@@ -222,11 +222,36 @@ private:
                setup_sensitivity ();
        }
 
+
        void copy ()
        {
                DCPOMATIC_ASSERT (_drive->GetSelection() != wxNOT_FOUND);
                DCPOMATIC_ASSERT (static_cast<bool>(_dcp_path));
 
+               bool have_writer = true;
+               if (!_nanomsg.send(DISK_WRITER_PING "\n", 2000)) {
+                       have_writer = false;
+               } else {
+                       optional<string> reply = _nanomsg.receive (2000);
+                       if (!reply || *reply != DISK_WRITER_PONG) {
+                               have_writer = false;
+                       }
+               }
+
+               if (!have_writer) {
+#ifdef DCPOMATIC_WINDOWS
+                       MessageDialog* m = new MessageDialog (
+                               this,
+                               _("DCP-o-matic Disk Writer"),
+                               _("Do you see a 'User Account Control' dialogue asking about dcpomatic2_disk_writer.exe?  If so, click 'Yes', then try again.")
+                               );
+                       m->ShowModal ();
+                       m->Destroy ();
+#else
+                       throw CommunicationFailedError ();
+#endif
+               }
+
                Drive const& drive = _drives[_drive->GetSelection()];
                if (drive.mounted()) {
                        TryUnmountDialog* d = new TryUnmountDialog(this, drive.description());