]> localhost Git - SCSI2SD-V6.git/commitdiff
Fixes to run dfu-util from scsi2sd-util6 on mac v6.0.5
authorMichael McMaster <michael@codesrc.com>
Sat, 13 Aug 2016 21:11:23 +0000 (07:11 +1000)
committerMichael McMaster <michael@codesrc.com>
Sat, 13 Aug 2016 21:11:23 +0000 (07:11 +1000)
src/scsi2sd-util6/Makefile
src/scsi2sd-util6/scsi2sd-util.cc

index b0669595c231311585409a80292983b9bd36c23b..28a10367b54fd441e51a8320e9c145808339a59e 100755 (executable)
@@ -113,7 +113,7 @@ $(BUILD)/scsi2sd-util6.dmg: $(BUILD)/scsi2sd-util6 $(BUILD)/dfu-util/buildstamp
        mkdir -p $(dir $@)/dmg
        cp $(BUILD)/scsi2sd-util6 $(BUILD)/dfu-util/src/dfu-util $(dir $@)/dmg
        chmod a+rx $(dir $@)/dmg/*
-       hdiutil create -srcfolder $(dir $@)/dmg $@
+       hdiutil create -volname scsi2sd-util6 -srcfolder $(dir $@)/dmg $@
 endif
 
 export CC CXX
index c91de120a48ada7487e12f6d897fe5b3803435e0..4f1209f834f97c99435331b28ebf4d9ae0f8e2ed 100644 (file)
@@ -32,6 +32,7 @@
 #include <wx/utils.h>
 #include <wx/wfstream.h>
 #include <wx/windowptr.h>
+#include <wx/stdpaths.h>
 #include <wx/stream.h>
 #include <wx/thread.h>
 #include <wx/txtstrm.h>
@@ -533,8 +534,19 @@ private:
 
 
                std::stringstream ss;
+#ifdef __WINDOWS__
                ss << "dfu-util --download \""
                        << filename.c_str() << "\" --alt 0 --reset";
+#else
+               if (wxExecute("which dfu-util", wxEXEC_SYNC) == 0)
+               {
+                       ss << "dfu-util ";
+               } else {
+                       wxFileName exePath(wxStandardPaths::Get().GetExecutablePath());
+                       ss << exePath.GetPathWithSep() << "dfu-util ";
+               }
+               ss << "--download \"" << filename.c_str() << "\" --alt 0 --reset";
+#endif
 
                wxLogMessage("Running: %s", ss.str());
 
@@ -546,19 +558,6 @@ private:
                        wxEXEC_ASYNC,
                        myConsoleProcess.get()
                        );
-#ifndef __WINDOWS__
-               if (!result)
-               {
-                       // Try again using the current directory
-                       cmd = std::string("./") + cmd;
-                       wxLogMessage("Running: %s", cmd);
-                       result = wxExecute(
-                               cmd.c_str(),
-                               wxEXEC_ASYNC,
-                               myConsoleProcess.get()
-                               );
-               }
-#endif
                if (!result)
                {
                        wxMessageBox(