POL_innoextract
Informations
Créateur | Messages |
---|---|
Yepoleb
|
InformationCet installateur a été accepté par l'équipe. InformationsPlate-formes : Retours d'expérience0 0 DescriptionExtracts an Inno Setup file and moves the files to an install directory. This is especially useful to work around the GOG installer. Uses the innoextract tool from http://constexpr.org/innoextract/ Usage
ParametersPOL_innoextract <setup_file> <temp_dir> <install_path> [additional_args]
Code source#!/bin/bash # Date : (2015-12-07 06-36) # Last revision : (2015-12-19 18-28) # Distribution used to test : Debian Sid (Unstable) # Author : Gabriel Huber huberg18@gmail.com # Script licence : GPL v.2 local INSTALLER_FILE="$1" local TEMP_DIR="$2" local INSTALL_PATH="$3" local ADDITIONAL_ARGS="$4" if [ ! "$INSTALLER_FILE" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALLER_FILE not set.')" fi if [ ! "$TEMP_DIR" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: TEMP_DIR not set.')" fi if [ ! "$INSTALL_PATH" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALL_PATH not set.')" fi # Check if we have innoextract innoextract --version >/dev/null 2>&1 if [ $? -ne 0 ]; then POL_Debug_Fatal "$(eval_gettext 'Could not find innoextract binary. Install the "innoextract" package or see http://constexpr.org/innoextract for more information on how to install, then run the script again.')" else POL_Debug_Message "Found innoextract" fi POL_SetupWindow_pulsebar "$(eval_gettext 'Extracting game files...')" "$TITLE" # Extract installer data local INNO_LOGFILE="${TEMP_DIR}/innoextract.log" local LAST_PERCENTAGE="0" # Fix return code for piped commands set -o pipefail # -e = extract, -q = quiet, -c = no color, -p = enable progress bar, # -d = output directory innoextract -e -q -c 0 -p 1 -d $ADDITIONAL_ARGS "$TEMP_DIR" \ "$INSTALLER_FILE" 2>&1 | \ tee "$INNO_LOGFILE" | \ while read -d $'\r' input; do PERCENTAGE="$(echo "$input" | grep -o -P '\d+(?=\.\d+%)')" if [ "$PERCENTAGE" ] && [ "$PERCENTAGE" -ne "$LAST_PERCENTAGE" ]; then # Wait for the last pulse update to finish, so we don't spawn # too many processes wait # Run the command asyncronously because it takes about 300ms to finish POL_SetupWindow_pulse "$PERCENTAGE" & LAST_PERCENTAGE="$PERCENTAGE" fi done # Check return code of innoextract and show the logfile if it failed if [ $? -ne 0 ]; then POL_SetupWindow_file "$(eval_gettext 'Failed to extract files. Is innoextract is up to date and the input file valid?')" "$TITLE" "$INNO_LOGFILE" POL_SetupWindow_Close exit $EXIT_ERROR fi # Some applications can have files with leading whitespace, which gets ignored # by the installer. If you find a case where this is intentional, please # notify me. # Find files with leading whitespace characters find "${TEMP_DIR}/app" -name " *" -print0 | \ while read -d $'\0' FILENAME; do BASE="$(basename "$FILENAME")" DIR="$(dirname "$FILENAME")" # Replace leading whitespace with nothing BASE_TRIM="$(echo "$BASE" | sed -e 's/^ *//')" # Rename the file mv "$FILENAME" "${DIR}/${BASE_TRIM}" done # Remove the install folder if it exists if [ -e "$INSTALL_PATH" ]; then rm -r "$INSTALL_PATH" fi # Make sure parent directory exists mkdir -p "$(dirname "$INSTALL_PATH")" # Move the app folder mv "${TEMP_DIR}/app" "$INSTALL_PATH" POL_Debug_Message "${INSTALLER_FILE} successfully installed to ${INSTALL_PATH}" |
Contributions
Filters:
ContribuerMembre | Messages |
Yepoleb | Dimanche 3 Janvier 2016 à 1:13 |
Yepoleb
|
InformationCette mise à jour a été acceptée par l'équipe MessagesTIL about the difference between single and double quotes.
Differences@@ -66,10 +66,10 @@ # Find files with leading whitespace characters find "${TEMP_DIR}/app" -name " *" -print0 | \ while read -d $'\0' FILENAME; do - BASE="$(basename '$FILENAME')" - DIR="$(dirname '$FILENAME')" + BASE="$(basename "$FILENAME")" + DIR="$(dirname "$FILENAME")" # Replace leading whitespace with nothing - BASE_TRIM="$(echo '$BASE' | sed -e 's/^ *//')" + BASE_TRIM="$(echo "$BASE" | sed -e 's/^ *//')" # Rename the file mv "$FILENAME" "${DIR}/${BASE_TRIM}" @@ -80,6 +80,8 @@ rm -r "$INSTALL_PATH" fi # Make sure parent directory exists -mkdir -p "$(dirname '$INSTALL_PATH')" +mkdir -p "$(dirname "$INSTALL_PATH")" # Move the app folder mv "${TEMP_DIR}/app" "$INSTALL_PATH" + +POL_Debug_Message "${INSTALLER_FILE} successfully installed to ${INSTALL_PATH}" Nouveau code source#!/bin/bash # Date : (2015-12-07 06-36) # Last revision : (2015-12-19 18-28) # Distribution used to test : Debian Sid (Unstable) # Author : Gabriel Huber huberg18@gmail.com # Script licence : GPL v.2 local INSTALLER_FILE="$1" local TEMP_DIR="$2" local INSTALL_PATH="$3" local ADDITIONAL_ARGS="$4" if [ ! "$INSTALLER_FILE" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALLER_FILE not set.')" fi if [ ! "$TEMP_DIR" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: TEMP_DIR not set.')" fi if [ ! "$INSTALL_PATH" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALL_PATH not set.')" fi # Check if we have innoextract innoextract --version >/dev/null 2>&1 if [ $? -ne 0 ]; then POL_Debug_Fatal "$(eval_gettext 'Could not find innoextract binary. Install the "innoextract" package or see http://constexpr.org/innoextract for more information on how to install, then run the script again.')" else POL_Debug_Message "Found innoextract" fi POL_SetupWindow_pulsebar "$(eval_gettext 'Extracting game files...')" "$TITLE" # Extract installer data local INNO_LOGFILE="${TEMP_DIR}/innoextract.log" local LAST_PERCENTAGE="0" # Fix return code for piped commands set -o pipefail # -e = extract, -q = quiet, -c = no color, -p = enable progress bar, # -d = output directory innoextract -e -q -c 0 -p 1 -d $ADDITIONAL_ARGS "$TEMP_DIR" \ "$INSTALLER_FILE" 2>&1 | \ tee "$INNO_LOGFILE" | \ while read -d $'\r' input; do PERCENTAGE="$(echo "$input" | grep -o -P '\d+(?=\.\d+%)')" if [ "$PERCENTAGE" ] && [ "$PERCENTAGE" -ne "$LAST_PERCENTAGE" ]; then # Wait for the last pulse update to finish, so we don't spawn # too many processes wait # Run the command asyncronously because it takes about 300ms to finish POL_SetupWindow_pulse "$PERCENTAGE" & LAST_PERCENTAGE="$PERCENTAGE" fi done # Check return code of innoextract and show the logfile if it failed if [ $? -ne 0 ]; then POL_SetupWindow_file "$(eval_gettext 'Failed to extract files. Is innoextract is up to date and the input file valid?')" "$TITLE" "$INNO_LOGFILE" POL_SetupWindow_Close exit $EXIT_ERROR fi # Some applications can have files with leading whitespace, which gets ignored # by the installer. If you find a case where this is intentional, please # notify me. # Find files with leading whitespace characters find "${TEMP_DIR}/app" -name " *" -print0 | \ while read -d $'\0' FILENAME; do BASE="$(basename "$FILENAME")" DIR="$(dirname "$FILENAME")" # Replace leading whitespace with nothing BASE_TRIM="$(echo "$BASE" | sed -e 's/^ *//')" # Rename the file mv "$FILENAME" "${DIR}/${BASE_TRIM}" done # Remove the install folder if it exists if [ -e "$INSTALL_PATH" ]; then rm -r "$INSTALL_PATH" fi # Make sure parent directory exists mkdir -p "$(dirname "$INSTALL_PATH")" # Move the app folder mv "${TEMP_DIR}/app" "$INSTALL_PATH" POL_Debug_Message "${INSTALLER_FILE} successfully installed to ${INSTALL_PATH}" Réponses |
Yepoleb | Mercredi 23 Décembre 2015 à 5:22 |
Yepoleb
|
WarningCette mise à jour n'a pas été approuvée par l'équipe. Messages
Differences@@ -0,0 +1,85 @@ +#!/bin/bash +# Date : (2015-12-07 06-36) +# Last revision : (2015-12-19 18-28) +# Distribution used to test : Debian Sid (Unstable) +# Author : Gabriel Huber huberg18@gmail.com +# Script licence : GPL v.2 + +local INSTALLER_FILE="$1" +local TEMP_DIR="$2" +local INSTALL_PATH="$3" +local ADDITIONAL_ARGS="$4" + +if [ ! "$INSTALLER_FILE" ]; then + POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALLER_FILE not set.')" +fi +if [ ! "$TEMP_DIR" ]; then + POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: TEMP_DIR not set.')" +fi +if [ ! "$INSTALL_PATH" ]; then + POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALL_PATH not set.')" +fi + +# Check if we have innoextract +innoextract --version >/dev/null 2>&1 +if [ $? -ne 0 ]; then + POL_Debug_Fatal "$(eval_gettext 'Could not find innoextract binary. Install the "innoextract" package or see http://constexpr.org/innoextract for more information on how to install, then run the script again.')" +else + POL_Debug_Message "Found innoextract" +fi + +POL_SetupWindow_pulsebar "$(eval_gettext 'Extracting game files...')" "$TITLE" + +# Extract installer data +local INNO_LOGFILE="${TEMP_DIR}/innoextract.log" +local LAST_PERCENTAGE="0" +# Fix return code for piped commands +set -o pipefail +# -e = extract, -q = quiet, -c = no color, -p = enable progress bar, +# -d = output directory +innoextract -e -q -c 0 -p 1 -d $ADDITIONAL_ARGS "$TEMP_DIR" \ + "$INSTALLER_FILE" 2>&1 | \ + tee "$INNO_LOGFILE" | \ + while read -d $'\r' input; do + PERCENTAGE="$(echo "$input" | grep -o -P '\d+(?=\.\d+%)')" + if [ "$PERCENTAGE" ] && [ "$PERCENTAGE" -ne "$LAST_PERCENTAGE" ]; then + # Wait for the last pulse update to finish, so we don't spawn + # too many processes + wait + # Run the command asyncronously because it takes about 300ms to finish + POL_SetupWindow_pulse "$PERCENTAGE" & + LAST_PERCENTAGE="$PERCENTAGE" + fi +done + +# Check return code of innoextract and show the logfile if it failed +if [ $? -ne 0 ]; then + POL_SetupWindow_file "$(eval_gettext 'Failed to extract files. Is innoextract is up to date and the input file valid?')" "$TITLE" "$INNO_LOGFILE" + POL_SetupWindow_Close + exit $EXIT_ERROR +fi + +# Some applications can have files with leading whitespace, which gets ignored +# by the installer. If you find a case where this is intentional, please +# notify me. + +# Find files with leading whitespace characters +find "${TEMP_DIR}/app" -name " *" -print0 | \ + while read -d $'\0' FILENAME; do + BASE="$(basename '$FILENAME')" + DIR="$(dirname '$FILENAME')" + # Replace leading whitespace with nothing + BASE_TRIM="$(echo '$BASE' | sed -e 's/^ *//')" + + # Rename the file + mv "$FILENAME" "${DIR}/${BASE_TRIM}" +done + +# Remove the install folder if it exists +if [ -e "$INSTALL_PATH" ]; then + rm -r "$INSTALL_PATH" +fi +# Make sure parent directory exists +mkdir -p "$(dirname '$INSTALL_PATH')" +# Move the app folder +mv "${TEMP_DIR}/app" "$INSTALL_PATH" Nouveau code source#!/bin/bash # Date : (2015-12-07 06-36) # Last revision : (2015-12-19 18-28) # Distribution used to test : Debian Sid (Unstable) # Author : Gabriel Huber huberg18@gmail.com # Script licence : GPL v.2 local INSTALLER_FILE="$1" local TEMP_DIR="$2" local INSTALL_PATH="$3" local ADDITIONAL_ARGS="$4" if [ ! "$INSTALLER_FILE" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALLER_FILE not set.')" fi if [ ! "$TEMP_DIR" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: TEMP_DIR not set.')" fi if [ ! "$INSTALL_PATH" ]; then POL_Debug_Fatal "$(eval_gettext 'POL_innoextract failed: INSTALL_PATH not set.')" fi # Check if we have innoextract innoextract --version >/dev/null 2>&1 if [ $? -ne 0 ]; then POL_Debug_Fatal "$(eval_gettext 'Could not find innoextract binary. Install the "innoextract" package or see http://constexpr.org/innoextract for more information on how to install, then run the script again.')" else POL_Debug_Message "Found innoextract" fi POL_SetupWindow_pulsebar "$(eval_gettext 'Extracting game files...')" "$TITLE" # Extract installer data local INNO_LOGFILE="${TEMP_DIR}/innoextract.log" local LAST_PERCENTAGE="0" # Fix return code for piped commands set -o pipefail # -e = extract, -q = quiet, -c = no color, -p = enable progress bar, # -d = output directory innoextract -e -q -c 0 -p 1 -d $ADDITIONAL_ARGS "$TEMP_DIR" \ "$INSTALLER_FILE" 2>&1 | \ tee "$INNO_LOGFILE" | \ while read -d $'\r' input; do PERCENTAGE="$(echo "$input" | grep -o -P '\d+(?=\.\d+%)')" if [ "$PERCENTAGE" ] && [ "$PERCENTAGE" -ne "$LAST_PERCENTAGE" ]; then # Wait for the last pulse update to finish, so we don't spawn # too many processes wait # Run the command asyncronously because it takes about 300ms to finish POL_SetupWindow_pulse "$PERCENTAGE" & LAST_PERCENTAGE="$PERCENTAGE" fi done # Check return code of innoextract and show the logfile if it failed if [ $? -ne 0 ]; then POL_SetupWindow_file "$(eval_gettext 'Failed to extract files. Is innoextract is up to date and the input file valid?')" "$TITLE" "$INNO_LOGFILE" POL_SetupWindow_Close exit $EXIT_ERROR fi # Some applications can have files with leading whitespace, which gets ignored # by the installer. If you find a case where this is intentional, please # notify me. # Find files with leading whitespace characters find "${TEMP_DIR}/app" -name " *" -print0 | \ while read -d $'\0' FILENAME; do BASE="$(basename '$FILENAME')" DIR="$(dirname '$FILENAME')" # Replace leading whitespace with nothing BASE_TRIM="$(echo '$BASE' | sed -e 's/^ *//')" # Rename the file mv "$FILENAME" "${DIR}/${BASE_TRIM}" done # Remove the install folder if it exists if [ -e "$INSTALL_PATH" ]; then rm -r "$INSTALL_PATH" fi # Make sure parent directory exists mkdir -p "$(dirname '$INSTALL_PATH')" # Move the app folder mv "${TEMP_DIR}/app" "$INSTALL_PATH" Réponses |
Yepoleb | Lundi 21 Décembre 2015 à 5:38 |
Yepoleb
|
WarningCette mise à jour n'a pas été approuvée par l'équipe. Differences@@ -0,0 +1,96 @@ +#!/bin/bash +# Date : (2015-12-07 06-36) +# Last revision : (2015-12-19 18-28) +# Distribution used to test : Debian Sid (Unstable) +# Author : Gabriel Huber huberg18@gmail.com +# Script licence : GPL v.2 + +INSTALLER_FILE="$1" +TEMP_DIR="$2" +INSTALL_PATH="$3" +ADDITIONAL_ARGS="$4" + +display_error () +{ + POL_SetupWindow_message "$1" + POL_SetupWindow_Close + exit $EXIT_ERROR +} + +if [ ! "$INSTALLER_FILE" ]; then + display_error "$(eval_gettext 'Error: INSTALLER_FILE not set.')" +fi +if [ ! "$TEMP_DIR" ]; then + display_error "$(eval_gettext 'Error: TEMP_DIR not set.')" +fi +if [ ! "$INSTALL_PATH" ]; then + display_error "$(eval_gettext 'Error: INSTALL_PATH not set.')" +fi + +# Check if we have innoextract +if [! innoextract --version >/dev/null 2>&1 ]; then + display_error "$(eval_gettext 'Could not find innoextract binary. Install the \"innoextract\" package or see http://constexpr.org/innoextract for more information on how to install, then run the script again.')" +else + POL_Debug_Message "Found innoextract" +fi + +POL_SetupWindow_pulsebar "$(eval_gettext 'Extracting game files...')" "$TITLE" + +# Extract installer data +INNO_LOGFILE="${TEMP_DIR}/innoextract.log" +LAST_PERCENTAGE="0" +# Fix return code for piped commands +set -o pipefail +# -e = extract, -q = quiet, -c = no color, -p = enable progress bar, +# -d = output directory +innoextract -e -q -c 0 -p 1 -d $ADDITIONAL_ARGS "$TEMP_DIR" \ + "$INSTALLER_FILE" 2>&1 | \ + tee "$INNO_LOGFILE" | \ + while read -d $'\r' input; do + PERCENTAGE="$(echo "$input" | grep -o -P '\d+(?=\.\d+%)')" + if [ "$PERCENTAGE" ] && [ "$PERCENTAGE" -ne "$LAST_PERCENTAGE" ]; then + # Wait for the last pulse update to finish, so we don't spawn + # too many processes + wait + # Run the command asyncronously because it takes about 300ms to finish + POL_SetupWindow_pulse "$PERCENTAGE" & + LAST_PERCENTAGE="$PERCENTAGE" + fi +done + +EXITCODE=$? +# Wait for the last percentage update to finish +wait + +echo "Exitcode ${EXITCODE}" +# Check return code of innoextract and show the logfile if it failed +if [ $EXITCODE -ne 0 ]; then + POL_SetupWindow_file "$(eval_gettext 'Failed to extract files. Check if innoextract is up to date and the input file is valid. Read logfile for more information:')" "$TITLE" "$INNO_LOGFILE" + POL_SetupWindow_Close + exit $EXIT_ERROR +fi + +# Some applications can have files with leading whitespace, which gets ignored +# by the installer. If you find a case where this is intentional, please +# notify me. + +# Find files with leading whitespace characters. +find "${TEMP_DIR}/app" -name " *" -print0 | \ + while read -d $'\0' FILENAME; do + BASE="$(basename '$FILENAME')" + DIR="$(dirname '$FILENAME')" + # Replace leading whitespace with nothing + BASE_TRIM="$(echo '$BASE' | sed -e 's/^ *//')" + + # Rename the file + mv "$FILENAME" "${DIR}/${BASE_TRIM}" +done + +# Remove the install folder if it exists +if [ -e "$INSTALL_PATH" ]; then + rm -r "$INSTALL_PATH" +fi +# Make sure parent directory exists +mkdir -p "$(dirname "$INSTALL_PATH")" +# Move the app folder +mv "${TEMP_DIR}/app" "$INSTALL_PATH" Nouveau code source#!/bin/bash # Date : (2015-12-07 06-36) # Last revision : (2015-12-19 18-28) # Distribution used to test : Debian Sid (Unstable) # Author : Gabriel Huber huberg18@gmail.com # Script licence : GPL v.2 INSTALLER_FILE="$1" TEMP_DIR="$2" INSTALL_PATH="$3" ADDITIONAL_ARGS="$4" display_error () { POL_SetupWindow_message "$1" POL_SetupWindow_Close exit $EXIT_ERROR } if [ ! "$INSTALLER_FILE" ]; then display_error "$(eval_gettext 'Error: INSTALLER_FILE not set.')" fi if [ ! "$TEMP_DIR" ]; then display_error "$(eval_gettext 'Error: TEMP_DIR not set.')" fi if [ ! "$INSTALL_PATH" ]; then display_error "$(eval_gettext 'Error: INSTALL_PATH not set.')" fi # Check if we have innoextract if [! innoextract --version >/dev/null 2>&1 ]; then display_error "$(eval_gettext 'Could not find innoextract binary. Install the \"innoextract\" package or see http://constexpr.org/innoextract for more information on how to install, then run the script again.')" else POL_Debug_Message "Found innoextract" fi POL_SetupWindow_pulsebar "$(eval_gettext 'Extracting game files...')" "$TITLE" # Extract installer data INNO_LOGFILE="${TEMP_DIR}/innoextract.log" LAST_PERCENTAGE="0" # Fix return code for piped commands set -o pipefail # -e = extract, -q = quiet, -c = no color, -p = enable progress bar, # -d = output directory innoextract -e -q -c 0 -p 1 -d $ADDITIONAL_ARGS "$TEMP_DIR" \ "$INSTALLER_FILE" 2>&1 | \ tee "$INNO_LOGFILE" | \ while read -d $'\r' input; do PERCENTAGE="$(echo "$input" | grep -o -P '\d+(?=\.\d+%)')" if [ "$PERCENTAGE" ] && [ "$PERCENTAGE" -ne "$LAST_PERCENTAGE" ]; then # Wait for the last pulse update to finish, so we don't spawn # too many processes wait # Run the command asyncronously because it takes about 300ms to finish POL_SetupWindow_pulse "$PERCENTAGE" & LAST_PERCENTAGE="$PERCENTAGE" fi done EXITCODE=$? # Wait for the last percentage update to finish wait echo "Exitcode ${EXITCODE}" # Check return code of innoextract and show the logfile if it failed if [ $EXITCODE -ne 0 ]; then POL_SetupWindow_file "$(eval_gettext 'Failed to extract files. Check if innoextract is up to date and the input file is valid. Read logfile for more information:')" "$TITLE" "$INNO_LOGFILE" POL_SetupWindow_Close exit $EXIT_ERROR fi # Some applications can have files with leading whitespace, which gets ignored # by the installer. If you find a case where this is intentional, please # notify me. # Find files with leading whitespace characters. find "${TEMP_DIR}/app" -name " *" -print0 | \ while read -d $'\0' FILENAME; do BASE="$(basename '$FILENAME')" DIR="$(dirname '$FILENAME')" # Replace leading whitespace with nothing BASE_TRIM="$(echo '$BASE' | sed -e 's/^ *//')" # Rename the file mv "$FILENAME" "${DIR}/${BASE_TRIM}" done # Remove the install folder if it exists if [ -e "$INSTALL_PATH" ]; then rm -r "$INSTALL_PATH" fi # Make sure parent directory exists mkdir -p "$(dirname "$INSTALL_PATH")" # Move the app folder mv "${TEMP_DIR}/app" "$INSTALL_PATH" Réponses |
This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com