diff --git a/scripts/deploy-dmg.sh b/scripts/deploy-dmg.sh index 48ad328..c30e205 100755 --- a/scripts/deploy-dmg.sh +++ b/scripts/deploy-dmg.sh @@ -126,6 +126,16 @@ for lib_base in "${FFMPEG_LIBS[@]}"; do fi done +echo "Bundling iproxy..." +IPROXY_PATH="$(which iproxy)" +if [ -z "${IPROXY_PATH}" ]; then + echo "Error: iproxy not found in PATH" + exit 1 +fi + +cp "${IPROXY_PATH}" "${APP_PATH}/Contents/MacOS/" +chmod +x "${APP_PATH}/Contents/MacOS/iproxy" + macdeployqt "${APP_PATH}" -qmldir=qml -verbose=2 codesign --force --deep -s - "${APP_PATH}" diff --git a/src/sshterminalwidget.cpp b/src/sshterminalwidget.cpp index 7c043d1..d6bd2f6 100644 --- a/src/sshterminalwidget.cpp +++ b/src/sshterminalwidget.cpp @@ -283,12 +283,15 @@ void SSHTerminalWidget::initWiredDevice() qDebug() << "Starting iproxy with args:" << args; QString iproxyPath; + QString appDirPath = QCoreApplication::applicationDirPath(); + QString bundledIproxyPath = appDirPath + "/iproxy"; - /* - Check if running in AppImage - this is set by the plugin script - */ - if (qEnvironmentVariableIsSet("IPROXY_BIN_APPIMAGE")) { + /* MacOS bundled iproxy */ + if (QFileInfo(bundledIproxyPath).isExecutable()) { + iproxyPath = bundledIproxyPath; + } + /* AppImage - this is set by the plugin script */ + else if (qEnvironmentVariableIsSet("IPROXY_BIN_APPIMAGE")) { iproxyPath = qgetenv("IPROXY_BIN_APPIMAGE"); if (iproxyPath.isEmpty()) { showError("Error: Running in AppImage mode, but "