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
#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>
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());
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(