diff --git a/qml-player.pro b/qml-player.pro index 8145d9d..3d4ee30 100644 --- a/qml-player.pro +++ b/qml-player.pro @@ -22,7 +22,8 @@ RESOURCES += qml.qrc OUT_PWD_WIN = $${OUT_PWD} OUT_PWD_WIN ~= s,/,\\,g -NODE_CMD = $$PWD/tmp/bin-$$system(bash tools/uname.sh -o)-$$system(bash tools/uname.sh -a)/node + +!win32: NODE_CMD = $$PWD/tmp/bin-$$system(bash tools/uname.sh -o)-$$system(bash tools/uname.sh -a)/node maxc { copy_node.commands = $(COPY_DIR) $$NODE_CMD $$OUT_PWD/$$TARGET".app"/Contents/MacOS/ @@ -37,13 +38,13 @@ linux { } win32 { - NODE_CMD = $$PWD/tmp/bin-$$system(bash tools/uname.sh -o)-$$system(bash tools/uname.sh -a)/node.exe - OUT_PWD_WIN = $$shell_path($$OUT_PWD/release) + NODE_CMD = $$PWD/tmp/bin-windows-x86/node.exe + OUT_PWD_WIN = $$shell_path($$OUT_PWD/release/) CONFIG(debug, debug|release): OUT_PWD_WIN = $$shell_path($$OUT_PWD/debug) - - copy_node.commands = $(COPY_FILE) $$shell_path($$NODE_CMD) $$OUT_PWD_WIN - copy_node_path.commands = $(COPY_DIR) $$shell_path($$PWD/src/node_path) $$OUT_PWD_WIN - copy_app.commands = $(COPY_DIR) $$shell_path($$PWD/example/default) $$OUT_PWD_WIN + + copy_node.commands = $(COPY_FILE) $$shell_path($$NODE_CMD) $$OUT_PWD_WIN + copy_node_path.commands = $(COPY_DIR) $$shell_path($$PWD/src/node_path) $$OUT_PWD_WIN\node_path + copy_app.commands = $(COPY_DIR) $$shell_path($$PWD/example/default) $$OUT_PWD_WIN\default } first.depends = $(first) copy_node_path copy_app copy_node diff --git a/src/cpp/environment.cpp b/src/cpp/environment.cpp index f05f2d7..81795a8 100644 --- a/src/cpp/environment.cpp +++ b/src/cpp/environment.cpp @@ -116,7 +116,9 @@ QDir Environment::getDataPath() { QString Environment::getBundledAppPath() { QString result = NULL; #ifdef _WIN32 + QString binPath = QFileInfo( QCoreApplication::applicationFilePath() ).absolutePath(); + result = binPath + "/default/package.json"; #elif __linux__ QString binPath = QFileInfo( QCoreApplication::applicationFilePath() ).absolutePath(); diff --git a/tools/Makefile b/tools/Makefile index 572f16f..2a0be24 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -9,11 +9,20 @@ TMP_PATH:=$(PROJECT_PATH)/tmp OS:=$(shell $(TOOLS_PATH)/uname.sh -o) ARCH:=$(shell $(TOOLS_PATH)/uname.sh -a) -BIN_PATH:=$(TMP_PATH)/bin-$(OS)-$(ARCH) - NODE_OS:=$(shell $(TOOLS_PATH)/uname.sh -o -f node) NODE_ARCH:=$(shell $(TOOLS_PATH)/uname.sh -a -f node) +ifeq ($(OS), windows) + OS:=windows + ARCH:=x86 + NODE_OS:=win + NODE_ARCH:=x86 +endif + +BIN_PATH:=$(TMP_PATH)/bin-$(OS)-$(ARCH) + + + NODE_VERSION:=v7.1.0 QPM_VERSION:=v0.10.0 NPM_VERSION:=3.10.9 @@ -116,7 +125,10 @@ qpm-install: cd $(PROJECT_PATH) && $(QPM_CMD) install npm-install: - $(foreach pkg,$(NPM_PKGS),cd $(pkg);$(NPM_CMD) install) + for pkg in $(NPM_PKGS) ; do \ + cd $$pkg; \ + $(NPM_CMD) install; \ + done BASE_TOOLS:=$(BIN_PATH) $(NODE_CMD) $(QPM_CMD) $(BIN_PATH)/npm LINUX_TOOLS:=$(BIN_PATH)/appimagetool $(BIN_PATH)/linuxdeployqt $(BIN_PATH)/patchelf diff --git a/tools/uname.sh b/tools/uname.sh index 37d8818..ad8f4a9 100755 --- a/tools/uname.sh +++ b/tools/uname.sh @@ -17,7 +17,6 @@ case "$OSTYPE" in *) echo "unknown: $OSTYPE" ; exit 1; esac - format_node() { case "$arch" in x86_64) arch="x64";; @@ -26,6 +25,7 @@ format_node() { esac if [[ "$os" = windows ]]; then os=win + arch=x86 fi } while getopts "aof:" opt; do @@ -49,6 +49,10 @@ case "$format" in *) echo "illegal format vale: $format. (valid: ${valid_formats[@]}))" ; exit 1; esac +if [[ "$os" = windows ]]; then + arch=x86 +fi + if [[ "$show_arch" = true ]]; then echo "$arch" fi