Permalink
Browse files

1.0.2.2: OSX - use abgx360 binary within .app bundle

  • Loading branch information...
vin047 committed Sep 2, 2016
1 parent 79811f6 commit 905c72df54a60e24f52e323ef1934d83950376a8
Showing with 16 additions and 0 deletions.
  1. +12 −0 src/abgx360gui.cpp
  2. +4 −0 src/abgx360gui.h
View
@@ -1357,6 +1357,18 @@ void abgx360gui::UIUpdate(wxUpdateUIEvent& WXUNUSED(event))
if (Maximize->IsChecked()) cmd += wxT("-geometry 80x400+0+0 ");
cmd += wxT("-e '");
#endif
// locate abgx360 binary within an OSX .app bundle
#if defined(__APPLE__)
CFURLRef abgx360url = CFBundleCopyAuxiliaryExecutableURL(CFBundleGetMainBundle(), CFSTR("abgx360"));
char abgx360path[512]; // large size, just in case
abgx360path[0] = '\"'; // double quote at start, to escape all spaces in binary path
CFURLGetFileSystemRepresentation(abgx360url, true, reinterpret_cast<UInt8*>(&abgx360path[1]), 511);
if(abgx360path[1] != '\0')
cmd = cmd + abgx360path + "\" -"; // full path to abgx360 binary, plus end double quote, plus hyphen
else // string is empty (e.g. not started from an app bundle), use default value. abgx360 binary must be in PATH
#endif
cmd += wxT("abgx360 -");
if (Verbosity->GetCurrentSelection() == 0) cmd += wxT("n"); // low verbosity
else if (Verbosity->GetCurrentSelection() == 2) cmd += wxT("v"); // high verbosity
View
@@ -61,6 +61,10 @@
#include <ddk/ntddstor.h> // device i/o stuff
#endif
#ifdef __APPLE__
#include <CoreFoundation/CFBundle.h> // for OSX bundle-related stuff
#endif
////Dialog Style Start
#undef abgx360gui_STYLE
#define abgx360gui_STYLE wxCAPTION | wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCLOSE_BOX

0 comments on commit 905c72d

Please sign in to comment.