diff --git a/make/scripts/win_sdk_install.sh b/make/scripts/win_sdk_install.sh index 45d91cef9..9837a3c97 100644 --- a/make/scripts/win_sdk_install.sh +++ b/make/scripts/win_sdk_install.sh @@ -36,12 +36,10 @@ fi # Tools URLs to fetch WGET_URL="http://librepilot.github.io/tools/wget.exe" MAKE_URL="http://librepilot.github.io/tools/make.exe" -SEVENZIP_URL="http://librepilot.github.io/tools/7za.exe" # Expected tools paths WGET="$TOOLS_DIR/bin/`basename \"$WGET_URL\"`" MAKE="$TOOLS_DIR/bin/`basename \"$MAKE_URL\"`" -SEVENZIP="$TOOLS_DIR/bin/`basename \"$SEVENZIP_URL\"`" # wget is necessary to fetch other files WGET_NAME="`basename \"$WGET\"`" @@ -97,20 +95,9 @@ if [ ! -x "$MAKE" ]; then fi fi -# 7-Zip is necessary to install some SDKs -if [ ! -x "$SEVENZIP" ]; then - echo "$SCRIPT_NAME: $SEVENZIP_NAME not found, fetching from $SEVENZIP_URL" - SEVENZIP_DIR="`dirname \"$SEVENZIP\"`" - mkdir -p "$SEVENZIP_DIR" - $WGET --no-check-certificate -N --content-disposition -P "$SEVENZIP_DIR" "$SEVENZIP_URL" - if [ $? -ne 0 ]; then - echo "$SCRIPT_NAME: $SEVENZIP_NAME fetch error, hope it's in the path..." - SEVENZIP_NAME="`basename \"$SEVENZIP\"`" - SEVENZIP="$SEVENZIP_NAME" - fi -fi # Finally we can fetch all SDKs using top level Makefile cd "$ROOT_DIR" +./tool_install.sh 7z echo "Run 'tools/bin/make all_sdk_install' to install the other tools" echo " or 'tools/bin/make help' for more info on make targets" diff --git a/make/tool_install/7z.sh b/make/tool_install/7z.sh new file mode 100644 index 000000000..65debf69b --- /dev/null +++ b/make/tool_install/7z.sh @@ -0,0 +1,31 @@ +# tool_url="http://www.7-zip.org/a/7z920.exe" +#tool_url="http://www.7-zip.org/a/7z920.msi" +tool_url="http://librepilot.github.io/tools/7za.exe" + +tool_install_name="bin/7za.exe" +tool_extract_dir="$tools_dir/bin" + +bin_dir=$tool_extract_dir + +no_extract=true + +module_file=bin + +#Override +function validate_target { [ "$uname" = Windows ]; } + +# Override +function dddownload_and_extract +{ + local full_tool_install_name="$tools_dir/bin/$tool_install_name" + if ! [ -e "$full_tool_install_name" ] || $force + then + download_and_verify && \ + rm -rf "$full_tool_install_name" && \ + mkdir -p "$(dirname "$full_tool_install_name")" && \ + mv "$downloaded_file" "$full_tool_install_name" + #msiexec //i "$downloaded_file" //q INSTALLDIR="$tools_dir" + #cmd //C "$downloaded_file" /S /D="${tools_dir//\//\\}" + fi +} +