PatternMaker 7.5

Informations

Creator Meddelanden
gap Anonymous

Warning

This installer is a beta script. It means that it might not work as expected

Informations

Platforms:
Downloads: 8662
Wine: System

Feedbacks

Description

A CAD program for Clothing Design.

Source code

 
# Create the setup window
POL_SetupWindow_Init
 
# Required
POL_Debug_Init
 
# Set up the initial page
POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"
 
# Test for a new enough Bash
# Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
# Removed warnings since all versions of OSX use Bash < 4
if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
    # POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
    # POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
else
    declare -a PATTERNS_CHOSEN
    declare -A PATTERN_URLS
    declare -A PATTERN_DIGESTS
 
    PATTERN_URLS=(
        [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
    [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
    [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
    [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
    [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
    [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
    [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
    [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
    [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
    [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
    [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
    [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
    [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
    [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
    )
    PATTERN_DIGESTS=(
        [Juniors]="af6b2608c2bd58cffc92240a155802ac"
    [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
    [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
    [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
    [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
    [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
    [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
    [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
    [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
    [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
    [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
    [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
    [Super Pants]="76be51f9f3eb2318deab5b008869b191"
    [Men]="4c63bec7897419aee20541f05695333e"
    )
 
    function prompt_patterns() {
        local IFS="~"
        POL_SetupWindow_checkbox_list "$(eval_gettext "What patterns would you like to install?")" "${TITLE}" "${!PATTERN_URLS[*]}" "~"
        PATTERNS_CHOSEN=( $APP_ANSWER )
    }
 
    # Ask which patterns they want
    prompt_patterns
fi
 
if [ -n $MACROTOOL_URL ]; then
    POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
fi
if [ ${APP_ANSWER} == FALSE ]; then
    MACROTOOL_URL=""
fi
 
# Create a temporary directory we can use
POL_System_TmpCreate "${PREFIX}"
# ...and enter it
cd "${POL_System_TmpDir}"
 
# Install into the PatternMaker Wine environment
POL_Wine_SelectPrefix "${PREFIX}"
 
# Create the environment if it does not yet exist
POL_Wine_PrefixCreate
 
POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
if [ ${APP_ANSWER} == FALSE ]; then
    DELETE_DOWNLOADS="1"
    POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
fi
 
POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
if [ -n $MACROTOOL_URL ]; then
    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
fi
if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
    done
fi
 
# Apply a registry tweak to open PDF files in the native viewer
POL_Call POL_Function_SetNativeExtension "pdf"
 
# Run the installer
POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
# And the macro installer
if [ -n $MACROTOOL_URL ]; then
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
fi
if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
    # And the pattern installers
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
    done
fi
 
# Create a shortcut
POL_Shortcut "PatVer7_5.exe" "${TITLE}"
 
if [ -n $MACROTOOL_URL ]; then
     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
fi
 
POL_SetupWindow_Close
 
# Clean up after ourselves
POL_System_TmpDelete
[ -n $DELETE_DOWNLOADS ] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"
 
# The script will be signed; prevent bash from trying
# to run the signature
exit 0

Contributions

Filters:

Contribute
Member Meddelanden
gap Thursday 9 July 2015 at 9:49
gap Anonymous

Information

This update has been approved by the team.

Differences

@@ -1,44 +1,24 @@
-#!/usr/bin/env playonlinux-bash
-# Date : (2015-05-17 23-19)
-# Last revision : (2015-06-10 12-59)
-# Wine version used : 1.6.2
-# Distribution used to test : Ubuntu
-# Author : Alex Elsayed <eternaleye@gmail.com>
-
-# Must be run under PlayOn*
-[[ -z "$PLAYONLINUX" ]] && exit 0
-
-# Load the PlayOnLinux scripting library
-source "$PLAYONLINUX/lib/sources"
-
-TITLE="PatternMaker"
-PREFIX="PatternMaker"
-# Note: This is assumed to end in /INSTALLER_NAME
-INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
-INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
-MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
-MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"
-DELETE_DOWNLOADS=""
-
+ 
 # Create the setup window
 POL_SetupWindow_Init
-
+ 
 # Required
 POL_Debug_Init
-
+ 
 # Set up the initial page
 POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"
-
+ 
 # Test for a new enough Bash
 # Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
-if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then
-    POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
-    POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
+# Removed warnings since all versions of OSX use Bash < 4
+if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
+    # POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
+    # POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
 else
     declare -a PATTERNS_CHOSEN
     declare -A PATTERN_URLS
     declare -A PATTERN_DIGESTS
-
+ 
     PATTERN_URLS=(
         [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
     [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
@@ -71,82 +51,82 @@
     [Super Pants]="76be51f9f3eb2318deab5b008869b191"
     [Men]="4c63bec7897419aee20541f05695333e"
     )
-
+ 
     function prompt_patterns() {
         local IFS="~"
         POL_SetupWindow_checkbox_list "$(eval_gettext "What patterns would you like to install?")" "${TITLE}" "${!PATTERN_URLS[*]}" "~"
         PATTERNS_CHOSEN=( $APP_ANSWER )
     }
-
+ 
     # Ask which patterns they want
     prompt_patterns
 fi
-
-if [[ -n $MACROTOOL_URL ]]; then
+ 
+if [ -n $MACROTOOL_URL ]; then
     POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
 fi
-if [[ ${APP_ANSWER} == FALSE ]]; then
+if [ ${APP_ANSWER} == FALSE ]; then
     MACROTOOL_URL=""
 fi
-
+ 
 # Create a temporary directory we can use
 POL_System_TmpCreate "${PREFIX}"
 # ...and enter it
 cd "${POL_System_TmpDir}"
-
+ 
 # Install into the PatternMaker Wine environment
 POL_Wine_SelectPrefix "${PREFIX}"
-
+ 
 # Create the environment if it does not yet exist
 POL_Wine_PrefixCreate
-
+ 
 POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
-if [[ ${APP_ANSWER} == FALSE ]]; then
+if [ ${APP_ANSWER} == FALSE ]; then
     DELETE_DOWNLOADS="1"
     POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
 fi
-
+ 
 POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
 # Download the installer, verifying it against a digest
 POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
-if [[ -n $MACROTOOL_URL ]]; then
+if [ -n $MACROTOOL_URL ]; then
     POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
 fi
-if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
     for pat in "${PATTERNS_CHOSEN[@]}"; do
         POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
     done
 fi
-
+ 
 # Apply a registry tweak to open PDF files in the native viewer
 POL_Call POL_Function_SetNativeExtension "pdf"
-
+ 
 # Run the installer
 POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
 # And the macro installer
-if [[ -n $MACROTOOL_URL ]]; then
+if [ -n $MACROTOOL_URL ]; then
     POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
 fi
-if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
     # And the pattern installers
     for pat in "${PATTERNS_CHOSEN[@]}"; do
         POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
     done
 fi
-
+ 
 # Create a shortcut
 POL_Shortcut "PatVer7_5.exe" "${TITLE}"
-
-if [[ -n $MACROTOOL_URL ]]; then
+ 
+if [ -n $MACROTOOL_URL ]; then
      POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
 fi
-
+ 
 POL_SetupWindow_Close
-
+ 
 # Clean up after ourselves
 POL_System_TmpDelete
-[[ -n $DELETE_DOWNLOADS ]] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"
-
+[ -n $DELETE_DOWNLOADS ] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"
+ 
 # The script will be signed; prevent bash from trying
 # to run the signature
-exit 0;
\ No newline at end of file
+exit 0
\ No newline at end of file

New source code

 
# Create the setup window
POL_SetupWindow_Init
 
# Required
POL_Debug_Init
 
# Set up the initial page
POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"
 
# Test for a new enough Bash
# Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
# Removed warnings since all versions of OSX use Bash < 4
if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
    # POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
    # POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
else
    declare -a PATTERNS_CHOSEN
    declare -A PATTERN_URLS
    declare -A PATTERN_DIGESTS
 
    PATTERN_URLS=(
        [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
    [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
    [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
    [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
    [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
    [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
    [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
    [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
    [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
    [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
    [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
    [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
    [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
    [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
    )
    PATTERN_DIGESTS=(
        [Juniors]="af6b2608c2bd58cffc92240a155802ac"
    [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
    [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
    [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
    [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
    [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
    [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
    [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
    [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
    [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
    [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
    [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
    [Super Pants]="76be51f9f3eb2318deab5b008869b191"
    [Men]="4c63bec7897419aee20541f05695333e"
    )
 
    function prompt_patterns() {
        local IFS="~"
        POL_SetupWindow_checkbox_list "$(eval_gettext "What patterns would you like to install?")" "${TITLE}" "${!PATTERN_URLS[*]}" "~"
        PATTERNS_CHOSEN=( $APP_ANSWER )
    }
 
    # Ask which patterns they want
    prompt_patterns
fi
 
if [ -n $MACROTOOL_URL ]; then
    POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
fi
if [ ${APP_ANSWER} == FALSE ]; then
    MACROTOOL_URL=""
fi
 
# Create a temporary directory we can use
POL_System_TmpCreate "${PREFIX}"
# ...and enter it
cd "${POL_System_TmpDir}"
 
# Install into the PatternMaker Wine environment
POL_Wine_SelectPrefix "${PREFIX}"
 
# Create the environment if it does not yet exist
POL_Wine_PrefixCreate
 
POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
if [ ${APP_ANSWER} == FALSE ]; then
    DELETE_DOWNLOADS="1"
    POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
fi
 
POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
if [ -n $MACROTOOL_URL ]; then
    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
fi
if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
    done
fi
 
# Apply a registry tweak to open PDF files in the native viewer
POL_Call POL_Function_SetNativeExtension "pdf"
 
# Run the installer
POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
# And the macro installer
if [ -n $MACROTOOL_URL ]; then
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
fi
if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
    # And the pattern installers
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
    done
fi
 
# Create a shortcut
POL_Shortcut "PatVer7_5.exe" "${TITLE}"
 
if [ -n $MACROTOOL_URL ]; then
     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
fi
 
POL_SetupWindow_Close
 
# Clean up after ourselves
POL_System_TmpDelete
[ -n $DELETE_DOWNLOADS ] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"
 
# The script will be signed; prevent bash from trying
# to run the signature
exit 0

Svar

gap Friday 12 June 2015 at 3:43
gap Anonymous

Warning

This update has not been approved yet by the team.
Use it at your own risk

Meddelanden

Thanks Petch for reviewing the code.

Thanks Ronin for testing!  I have added the WINEVERSION="1.6.2".  It is one line of code.  Do I need to add something else?  I am not a bash programmer so I can make newbie mistakes. 

The repository for this script is at https://bitbucket.org/publicpm/pmonplayonmac 

I am looking forward to getting this approved so I can start promoting Play On Linux/Play On Mac on the PatternMaker website.

Differences

@@ -1,6 +1,6 @@
 #!/usr/bin/env playonlinux-bash
 # Date : (2015-05-17 23-19)
-# Last revision : (2015-06-10 12-59)
+# Last revision : (2015-06-10 13-32)
 # Wine version used : 1.6.2
 # Distribution used to test : Ubuntu
 # Author : Alex Elsayed <eternaleye@gmail.com>
@@ -11,6 +11,7 @@
 # Load the PlayOnLinux scripting library
 source "$PLAYONLINUX/lib/sources"
 
+WINEVERSION="1.6.2"
 TITLE="PatternMaker"
 PREFIX="PatternMaker"
 # Note: This is assumed to end in /INSTALLER_NAME
@@ -41,35 +42,35 @@
 
     PATTERN_URLS=(
         [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
-    [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
-    [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
-    [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
-    [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
-    [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
-    [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
-    [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
-    [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
-    [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
-    [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
-    [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
-    [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
-    [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
+        [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
+        [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
+        [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
+        [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
+        [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
+        [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
+        [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
+        [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
+        [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
+        [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
+        [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
+        [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
+        [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
     )
     PATTERN_DIGESTS=(
         [Juniors]="af6b2608c2bd58cffc92240a155802ac"
-    [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
-    [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
-    [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
-    [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
-    [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
-    [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
-    [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
-    [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
-    [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
-    [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
-    [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
-    [Super Pants]="76be51f9f3eb2318deab5b008869b191"
-    [Men]="4c63bec7897419aee20541f05695333e"
+        [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
+        [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
+        [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
+        [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
+        [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
+        [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
+        [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
+        [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
+        [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
+        [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
+        [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
+        [Super Pants]="76be51f9f3eb2318deab5b008869b191"
+        [Men]="4c63bec7897419aee20541f05695333e"
     )
 
     function prompt_patterns() {
@@ -149,4 +150,4 @@
 
 # The script will be signed; prevent bash from trying
 # to run the signature
-exit 0;
\ No newline at end of file
+exit 0;

New source code

#!/usr/bin/env playonlinux-bash
# Date : (2015-05-17 23-19)
# Last revision : (2015-06-10 13-32)
# Wine version used : 1.6.2
# Distribution used to test : Ubuntu
# Author : Alex Elsayed <eternaleye@gmail.com>

# Must be run under PlayOn*
[[ -z "$PLAYONLINUX" ]] && exit 0

# Load the PlayOnLinux scripting library
source "$PLAYONLINUX/lib/sources"

WINEVERSION="1.6.2"
TITLE="PatternMaker"
PREFIX="PatternMaker"
# Note: This is assumed to end in /INSTALLER_NAME
INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"
DELETE_DOWNLOADS=""

# Create the setup window
POL_SetupWindow_Init

# Required
POL_Debug_Init

# Set up the initial page
POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"

# Test for a new enough Bash
# Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then
    POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
    POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
else
    declare -a PATTERNS_CHOSEN
    declare -A PATTERN_URLS
    declare -A PATTERN_DIGESTS

    PATTERN_URLS=(
        [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
        [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
        [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
        [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
        [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
        [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
        [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
        [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
        [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
        [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
        [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
        [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
        [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
        [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
    )
    PATTERN_DIGESTS=(
        [Juniors]="af6b2608c2bd58cffc92240a155802ac"
        [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
        [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
        [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
        [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
        [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
        [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
        [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
        [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
        [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
        [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
        [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
        [Super Pants]="76be51f9f3eb2318deab5b008869b191"
        [Men]="4c63bec7897419aee20541f05695333e"
    )

    function prompt_patterns() {
        local IFS="~"
        POL_SetupWindow_checkbox_list "$(eval_gettext "What patterns would you like to install?")" "${TITLE}" "${!PATTERN_URLS[*]}" "~"
        PATTERNS_CHOSEN=( $APP_ANSWER )
    }

    # Ask which patterns they want
    prompt_patterns
fi

if [[ -n $MACROTOOL_URL ]]; then
    POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
fi
if [[ ${APP_ANSWER} == FALSE ]]; then
    MACROTOOL_URL=""
fi

# Create a temporary directory we can use
POL_System_TmpCreate "${PREFIX}"
# ...and enter it
cd "${POL_System_TmpDir}"

# Install into the PatternMaker Wine environment
POL_Wine_SelectPrefix "${PREFIX}"

# Create the environment if it does not yet exist
POL_Wine_PrefixCreate

POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
if [[ ${APP_ANSWER} == FALSE ]]; then
    DELETE_DOWNLOADS="1"
    POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
fi

POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
if [[ -n $MACROTOOL_URL ]]; then
    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
fi
if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
    done
fi

# Apply a registry tweak to open PDF files in the native viewer
POL_Call POL_Function_SetNativeExtension "pdf"

# Run the installer
POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
# And the macro installer
if [[ -n $MACROTOOL_URL ]]; then
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
fi
if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
    # And the pattern installers
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
    done
fi

# Create a shortcut
POL_Shortcut "PatVer7_5.exe" "${TITLE}"

if [[ -n $MACROTOOL_URL ]]; then
     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
fi

POL_SetupWindow_Close

# Clean up after ourselves
POL_System_TmpDelete
[[ -n $DELETE_DOWNLOADS ]] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"

# The script will be signed; prevent bash from trying
# to run the signature
exit 0;

Svar

Friday 12 June 2015 at 7:06
You would just need to change line 102 to:

POL_Wine_PrefixCreate "$WINEVERSION"

and that is it. The rest is automated, and it will associate that WineBuild with that virtual drive. :)
Ronin DUSETTE Thursday 11 June 2015 at 6:14
Ronin DUSETTE

Warning

This update has not been approved yet by the team.
Use it at your own risk

Meddelanden

Removing extra brackets around true/false statements.

Differences

@@ -5,10 +5,7 @@
 # Distribution used to test : Ubuntu
 # Author : Alex Elsayed <eternaleye@gmail.com>
 
-# Must be run under PlayOn*
-[[ -z "$PLAYONLINUX" ]] && exit 0
-
-# Load the PlayOnLinux scripting library
+[ "$PLAYONLINUX" = "" ] && exit 0
 source "$PLAYONLINUX/lib/sources"
 
 TITLE="PatternMaker"
@@ -31,7 +28,7 @@
 
 # Test for a new enough Bash
 # Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
-if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then
+if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
     POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
     POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
 else
@@ -82,10 +79,10 @@
     prompt_patterns
 fi
 
-if [[ -n $MACROTOOL_URL ]]; then
+if [ -n $MACROTOOL_URL ]; then
     POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
 fi
-if [[ ${APP_ANSWER} == FALSE ]]; then
+if [ ${APP_ANSWER} == FALSE ]; then
     MACROTOOL_URL=""
 fi
 
@@ -101,7 +98,7 @@
 POL_Wine_PrefixCreate
 
 POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
-if [[ ${APP_ANSWER} == FALSE ]]; then
+if [ ${APP_ANSWER} == FALSE ]; then
     DELETE_DOWNLOADS="1"
     POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
 fi
@@ -109,10 +106,10 @@
 POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
 # Download the installer, verifying it against a digest
 POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
-if [[ -n $MACROTOOL_URL ]]; then
+if [ -n $MACROTOOL_URL ]; then
     POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
 fi
-if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
     for pat in "${PATTERNS_CHOSEN[@]}"; do
         POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
     done
@@ -124,10 +121,10 @@
 # Run the installer
 POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
 # And the macro installer
-if [[ -n $MACROTOOL_URL ]]; then
+if [ -n $MACROTOOL_URL ]; then
     POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
 fi
-if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
     # And the pattern installers
     for pat in "${PATTERNS_CHOSEN[@]}"; do
         POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
@@ -137,7 +134,7 @@
 # Create a shortcut
 POL_Shortcut "PatVer7_5.exe" "${TITLE}"
 
-if [[ -n $MACROTOOL_URL ]]; then
+if [ -n $MACROTOOL_URL ]; then
      POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
 fi
 
@@ -145,8 +142,8 @@
 
 # Clean up after ourselves
 POL_System_TmpDelete
-[[ -n $DELETE_DOWNLOADS ]] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"
+[ -n $DELETE_DOWNLOADS ] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"
 
 # The script will be signed; prevent bash from trying
 # to run the signature
-exit 0;
\ No newline at end of file
+exit 0
\ No newline at end of file

New source code

#!/usr/bin/env playonlinux-bash
# Date : (2015-05-17 23-19)
# Last revision : (2015-06-10 12-59)
# Wine version used : 1.6.2
# Distribution used to test : Ubuntu
# Author : Alex Elsayed <eternaleye@gmail.com>

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="PatternMaker"
PREFIX="PatternMaker"
# Note: This is assumed to end in /INSTALLER_NAME
INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"
DELETE_DOWNLOADS=""

# Create the setup window
POL_SetupWindow_Init

# Required
POL_Debug_Init

# Set up the initial page
POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"

# Test for a new enough Bash
# Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
    POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
    POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
else
    declare -a PATTERNS_CHOSEN
    declare -A PATTERN_URLS
    declare -A PATTERN_DIGESTS

    PATTERN_URLS=(
        [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
    [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
    [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
    [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
    [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
    [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
    [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
    [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
    [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
    [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
    [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
    [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
    [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
    [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
    )
    PATTERN_DIGESTS=(
        [Juniors]="af6b2608c2bd58cffc92240a155802ac"
    [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
    [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
    [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
    [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
    [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
    [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
    [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
    [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
    [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
    [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
    [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
    [Super Pants]="76be51f9f3eb2318deab5b008869b191"
    [Men]="4c63bec7897419aee20541f05695333e"
    )

    function prompt_patterns() {
        local IFS="~"
        POL_SetupWindow_checkbox_list "$(eval_gettext "What patterns would you like to install?")" "${TITLE}" "${!PATTERN_URLS[*]}" "~"
        PATTERNS_CHOSEN=( $APP_ANSWER )
    }

    # Ask which patterns they want
    prompt_patterns
fi

if [ -n $MACROTOOL_URL ]; then
    POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
fi
if [ ${APP_ANSWER} == FALSE ]; then
    MACROTOOL_URL=""
fi

# Create a temporary directory we can use
POL_System_TmpCreate "${PREFIX}"
# ...and enter it
cd "${POL_System_TmpDir}"

# Install into the PatternMaker Wine environment
POL_Wine_SelectPrefix "${PREFIX}"

# Create the environment if it does not yet exist
POL_Wine_PrefixCreate

POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
if [ ${APP_ANSWER} == FALSE ]; then
    DELETE_DOWNLOADS="1"
    POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
fi

POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
if [ -n $MACROTOOL_URL ]; then
    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
fi
if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
    done
fi

# Apply a registry tweak to open PDF files in the native viewer
POL_Call POL_Function_SetNativeExtension "pdf"

# Run the installer
POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
# And the macro installer
if [ -n $MACROTOOL_URL ]; then
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
fi
if [ ${BASH_VERSINFO[0]} -ge 4 ]; then
    # And the pattern installers
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
    done
fi

# Create a shortcut
POL_Shortcut "PatVer7_5.exe" "${TITLE}"

if [ -n $MACROTOOL_URL ]; then
     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
fi

POL_SetupWindow_Close

# Clean up after ourselves
POL_System_TmpDelete
[ -n $DELETE_DOWNLOADS ] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"

# The script will be signed; prevent bash from trying
# to run the signature
exit 0

Svar

Thursday 11 June 2015 at 6:48
I tested this on Wine 1.7.44 and 1.6.2 (which is what the script was tested on). 1.7.44 has a lot of graphic errors, but switching to 1.6.2 fixes them. This is why I personally think declaring a WINEVERSION should be mandatory, and leave it up to the actual user to use the system WIne if they choose. My system Wine causes all sorts of graphic issues, but since we know that 1.6.2 works fine, you can be certain that everyone uses that Wine version, since their system Wine could literally be anything (vanilla Wine of any version, patched, wine-staging, etc.).

I recommend declaring WINEVERSION="1.6.2" and using that variable in the script when invoking Wine. That way users with versions other than that don't have to worry (which is one of the great parts about POL). As of now, this could be glitchy for any user not using 1.6.2, which is easily taken care of through POL. :)
Thursday 11 June 2015 at 7:06
Both single and double bracket syntax exist in Bash, with differences that were not used in this script; Still, the script was perfectly valid
Thursday 11 June 2015 at 7:09
Ok. I had just never seen them used as such, and tested it fine without the double brackets. Just trying to help. Sorry.

That being said, I still stand by my statement about the Wine versions (it tested glitchy on my system Wine, but using the specific one it was tested with worked fine) being declared. From a compatibility standpoint, there is no reason not to since it can easily be done, but yeah. I won't bring it up anymore. 
Thursday 11 June 2015 at 7:16
I reverted it back to the previous version.
Anonymous
Thursday 11 June 2015 at 8:08
petch, I think I might actually rely on the double-bracket behavior - IIRC, -n and -z aren't reliable (especially unquoted) with [ (an executable) rather than [[ (a builtin syntax construct) - this is why in autotools-generated scripts and other, older POSIX sh scripts, you see the old [ "x$VAR" = "x" ] trick.
Anonymous
Thursday 11 June 2015 at 8:11
Ronin, I've noted some similar issues - I intend to do further testing, and narrow down the range of versions it is broken on. At very least, it'd be nice to figure out what kind of bug to send upstream to Wine. In the meantime, I'll see about going for 1.6.2 in the next version.
Thursday 11 June 2015 at 18:05
Yes; I highly recommend simply declaring a WINEVERSION variable with 1.6.2, then you never have to worry about it again (2 lines of code). Basically, right now, anyone on Arch will see glitches, because Arch does not use the stable Wine versions on it's system Wine (always uses the newest releases); basically, as the script stands, it is broken on pretty much any Arch-based system until that variable is declared and used. That is why I suggest it always be included, as it eliminates compatibility problems, and is one of the main features of POL. I am sorry for being redundant. It's just that this whole script is essentially broken for a whole series of distros, just because of 2 lines of code. haha. To me, it is an "elephant in the room", so to speak. It also makes it one less thing you have to troubleshoot (because users will report problems here, and that is one problem that can be taken care of before it is actually a problem).
Anonymous
Thursday 11 June 2015 at 19:02
Yes, It's likely this POL script will go with WINEVERSION=1.6.2 for now. However, as someone who is a sysadmin for $DAYJOB as well as having done distro packaging, I really do have to view it as a partial solution at best. Version pinning is suboptimal because while it's often billed as avoiding bugs in new versions, it also does two deeply suboptimal things: avoids fixes in new versions, and prevents regressions in new versions from being found. The former often causes breakage when, say, the program a script is for begins using new features. And the latter means such regressions are generally not caught until it's been too much time to easily track down (or fix) the source of the error.

Eventually, 1.7 will become 1.8, and any regressions that hadn't been caught will inflict themselves even on those who stick with stable.

Honestly, I'd be much more sanguine if WINEVERSION was instead WINEREQUIREMENT, which specified a list of constraints along the lines of "<=1.7 | (>1.7.30 & < 1.7.50)", and tried to satisfy it with the newest valid version.
Thursday 11 June 2015 at 19:10
Either way, you are declaring a Wine version that has tested working, instead of relying on the system Wine version, which you have no control over.

As someone who has written a bunch of scripts and tested them on quite a few systems, declaring a Wine version (and simply keeping it up to date when it needs to be) negates any issues. Do whatever you want. lol. You will have to troubleshoot the issues that arise. :)

WINEVERSION is the required, working version for Wine. All it is doing it telling the script to download the version of Wine required for it to work. There is no need to over-complicate it. Simply declaring a Wine version variable and using it will tell POL to do the rest (it is all automated).

In a perfect world, all programs would work through the newest Wine version. That, however, is not the case; that is where POL comes in. It can download and assign a Wine version per-application. If it is tested correctly, it will continue to work. If the program is updated, and issues arise, then users should report the bugs so that, if needed, the Wine version in the script can be updated.

Yes, it is a partial solution, because Wine is not perfect. If it was, POL would not exist. :)
Thursday 11 June 2015 at 19:12
Yup, constraints system has been envisioned, getting it right is something different though...
A middleground solution could also be to have pseudo-versions say $WINE_LATEST_STABLE and $WINE_LATEST_UNSTABLE (maybe $WINE_LATEST_STAGING now too), filled by the client from data published by the web server...
Some of the ideas I've been toying around for some time already ;)
Thursday 11 June 2015 at 19:14
Just a quick example:

https://www.playonlinux.com/en/app-2316-Adobe_Photoshop_CS6.html

That program requires a specific version of Wine with a specific patch. If you were to rely on the system Wine, that program would not work at all, and the user would be required to find the version of Wine needed, find the patches, download the source, compile and install it, and then run the script. Declaring a WINEVERSION eliminates that need, and makes it easier for users and far, far more compatible across multiple systems. Again, it is up to you; just trying to make less work for you.
Thursday 11 June 2015 at 19:14
@petch - That would be pretty cool. Maybe something for POL5? :D
Anonymous
Thursday 11 June 2015 at 19:18
Ronin, I _did_ say the script will likely go with a WINEVERSION. I was just expanding on some of my reasoning for not being as excited/optimistic about the benefits as you seem to be.

petch, a constraint system could be done relatively simply if you follow the Haskell example of a list of non-overlapping ranges - checking if a version is acceptable is then just a matter of (for each version in range, if version in range, return true, done, return false). This can, in fact, specify any set of valid versions, so it loses no expressive power.
Anonymous
Thursday 11 June 2015 at 19:22
A very simple syntax might be splitting ranges on whitespace (or comma), splitting left and right on ".." (will never be in a Wine version), and treating standalone versions as single-element ranges. Inclusive ranges would likely work best in terms of semantics: the constraint would just be lowest_tested..highest_tested in many cases.

WINEREQUIRE="1.5.9..1.68, 1.7.3, 1.7.5..1.7.20"
Thursday 11 June 2015 at 19:30
" I was just expanding on some of my reasoning for not being as excited/optimistic about the benefits as you seem to be."

Um, not excited/optimistic. I KNOW it works better from personal experience. IMO, it is lazy and sloppy to not utilize one of the main features that almost every single script uses to make it more compatible for the users that will be trying to install it.

There are hundreds of Wine versions.... how would you compile testing data? Really, that seems immensely more complicated than just telling it what version to use and updating as reports come in. In programming, being concise and explicit is better than assumption. At least from my experience.

I give up. :)
Thursday 11 June 2015 at 19:32
You keep saying "simply....". Our code is hosted on GitHub. Show us. :D
Thursday 11 June 2015 at 19:37
yes, patterns could be interesting too, say 1.6.* if you know that any of those versions do work (and hope that any 1.6.3 would be a bugfix-only release and probably work too).
But syntax is not the only issue here, you have to consider the policies, ie if several already installed Wine versions match, which one to pick? If none match, which one to download? (and favor reuse).
As new versions of Wine are released, should the client attempt something?
And then you wonder if all this is not overkill, because most likely you'll be in two cases:
- programs that seem to work with the recent versions of Wine, and picking the latest available is probably the best course of action. If some new version breaks it you'll have to, and be able to, set the version to use by hand. The other case being programs that already do not work best with recent versions, so same case.
Thursday 11 June 2015 at 20:01
I just tested in on wife's system, too. Mint with wine-staging 1.7.44 installed as the system Wine... script results in glitchy program. Switching to 1.6.2 fixes it. Same bug, two systems, fixed by a declared Wine version. ;) I go play video games now. lol.
Sunday 5 July 2015 at 12:08
I made a RFC about Wine "pseudoversions" https://www.playonlinux.com/en/issue-5099.html

Ändrat av RoninDusette

gap Wednesday 10 June 2015 at 22:22
gap Anonymous

Warning

This update has not been approved yet by the team.
Use it at your own risk

Differences

@@ -0,0 +1,152 @@
+#!/usr/bin/env playonlinux-bash
+# Date : (2015-05-17 23-19)
+# Last revision : (2015-06-10 12-59)
+# Wine version used : 1.6.2
+# Distribution used to test : Ubuntu
+# Author : Alex Elsayed <eternaleye@gmail.com>
+
+# Must be run under PlayOn*
+[[ -z "$PLAYONLINUX" ]] && exit 0
+
+# Load the PlayOnLinux scripting library
+source "$PLAYONLINUX/lib/sources"
+
+TITLE="PatternMaker"
+PREFIX="PatternMaker"
+# Note: This is assumed to end in /INSTALLER_NAME
+INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
+INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
+MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
+MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"
+DELETE_DOWNLOADS=""
+
+# Create the setup window
+POL_SetupWindow_Init
+
+# Required
+POL_Debug_Init
+
+# Set up the initial page
+POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"
+
+# Test for a new enough Bash
+# Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
+if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then
+    POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
+    POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
+else
+    declare -a PATTERNS_CHOSEN
+    declare -A PATTERN_URLS
+    declare -A PATTERN_DIGESTS
+
+    PATTERN_URLS=(
+        [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
+    [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
+    [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
+    [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
+    [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
+    [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
+    [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
+    [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
+    [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
+    [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
+    [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
+    [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
+    [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
+    [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
+    )
+    PATTERN_DIGESTS=(
+        [Juniors]="af6b2608c2bd58cffc92240a155802ac"
+    [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
+    [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
+    [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
+    [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
+    [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
+    [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
+    [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
+    [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
+    [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
+    [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
+    [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
+    [Super Pants]="76be51f9f3eb2318deab5b008869b191"
+    [Men]="4c63bec7897419aee20541f05695333e"
+    )
+
+    function prompt_patterns() {
+        local IFS="~"
+        POL_SetupWindow_checkbox_list "$(eval_gettext "What patterns would you like to install?")" "${TITLE}" "${!PATTERN_URLS[*]}" "~"
+        PATTERNS_CHOSEN=( $APP_ANSWER )
+    }
+
+    # Ask which patterns they want
+    prompt_patterns
+fi
+
+if [[ -n $MACROTOOL_URL ]]; then
+    POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
+fi
+if [[ ${APP_ANSWER} == FALSE ]]; then
+    MACROTOOL_URL=""
+fi
+
+# Create a temporary directory we can use
+POL_System_TmpCreate "${PREFIX}"
+# ...and enter it
+cd "${POL_System_TmpDir}"
+
+# Install into the PatternMaker Wine environment
+POL_Wine_SelectPrefix "${PREFIX}"
+
+# Create the environment if it does not yet exist
+POL_Wine_PrefixCreate
+
+POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
+if [[ ${APP_ANSWER} == FALSE ]]; then
+    DELETE_DOWNLOADS="1"
+    POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
+fi
+
+POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
+# Download the installer, verifying it against a digest
+POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
+if [[ -n $MACROTOOL_URL ]]; then
+    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
+fi
+if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+    for pat in "${PATTERNS_CHOSEN[@]}"; do
+        POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
+    done
+fi
+
+# Apply a registry tweak to open PDF files in the native viewer
+POL_Call POL_Function_SetNativeExtension "pdf"
+
+# Run the installer
+POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
+# And the macro installer
+if [[ -n $MACROTOOL_URL ]]; then
+    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
+fi
+if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+    # And the pattern installers
+    for pat in "${PATTERNS_CHOSEN[@]}"; do
+        POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
+    done
+fi
+
+# Create a shortcut
+POL_Shortcut "PatVer7_5.exe" "${TITLE}"
+
+if [[ -n $MACROTOOL_URL ]]; then
+     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
+fi
+
+POL_SetupWindow_Close
+
+# Clean up after ourselves
+POL_System_TmpDelete
+[[ -n $DELETE_DOWNLOADS ]] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"
+
+# The script will be signed; prevent bash from trying
+# to run the signature
+exit 0;
\ No newline at end of file

New source code

#!/usr/bin/env playonlinux-bash
# Date : (2015-05-17 23-19)
# Last revision : (2015-06-10 12-59)
# Wine version used : 1.6.2
# Distribution used to test : Ubuntu
# Author : Alex Elsayed <eternaleye@gmail.com>

# Must be run under PlayOn*
[[ -z "$PLAYONLINUX" ]] && exit 0

# Load the PlayOnLinux scripting library
source "$PLAYONLINUX/lib/sources"

TITLE="PatternMaker"
PREFIX="PatternMaker"
# Note: This is assumed to end in /INSTALLER_NAME
INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"
DELETE_DOWNLOADS=""

# Create the setup window
POL_SetupWindow_Init

# Required
POL_Debug_Init

# Set up the initial page
POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"

# Test for a new enough Bash
# Fixes runtime error on OS X 10.6.8 (with Bash 3.2.48)
if [[ ${BASH_VERSINFO[0]} -lt 4 ]]; then
    POL_Debug_Error "This version of Bash doesn't support associative arrays, some functionality may not be usable"
    POL_SetupWindow_message "$(eval_gettext "As your system has an old version of Bash, this script will be unable to install any patterns for you")" "$TITLE"
else
    declare -a PATTERNS_CHOSEN
    declare -A PATTERN_URLS
    declare -A PATTERN_DIGESTS

    PATTERN_URLS=(
        [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe"
    [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe"
    [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe"
    [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe"
    [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe"
    [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe"
    [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe"
    [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe"
    [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe"
    [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe"
    [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe"
    [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe"
    [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe"
    [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe"
    )
    PATTERN_DIGESTS=(
        [Juniors]="af6b2608c2bd58cffc92240a155802ac"
    [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb"
    [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87"
    [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936"
    [Renaissance Corset]="c3db9895a68d886d49100e9163377f12"
    [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1"
    [Sportswear]="8134c599093a6efb41c826e30f2a7b29"
    [Dog Suit]="626c552d11535269f6c51a12984b2c2f"
    [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841"
    [Super Skirt]="a1f176557b60eec95d065c57c0c17601"
    [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8"
    [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc"
    [Super Pants]="76be51f9f3eb2318deab5b008869b191"
    [Men]="4c63bec7897419aee20541f05695333e"
    )

    function prompt_patterns() {
        local IFS="~"
        POL_SetupWindow_checkbox_list "$(eval_gettext "What patterns would you like to install?")" "${TITLE}" "${!PATTERN_URLS[*]}" "~"
        PATTERNS_CHOSEN=( $APP_ANSWER )
    }

    # Ask which patterns they want
    prompt_patterns
fi

if [[ -n $MACROTOOL_URL ]]; then
    POL_SetupWindow_question "$(eval_gettext "Would you like to install the PatternMaker MacroGenerator?")" "$TITLE"
fi
if [[ ${APP_ANSWER} == FALSE ]]; then
    MACROTOOL_URL=""
fi

# Create a temporary directory we can use
POL_System_TmpCreate "${PREFIX}"
# ...and enter it
cd "${POL_System_TmpDir}"

# Install into the PatternMaker Wine environment
POL_Wine_SelectPrefix "${PREFIX}"

# Create the environment if it does not yet exist
POL_Wine_PrefixCreate

POL_SetupWindow_question "$(eval_gettext "Several installers will be downloaded, and may be beneficial to keep afterwards. Would you like to keep them?")" "$TITLE"
if [[ ${APP_ANSWER} == FALSE ]]; then
    DELETE_DOWNLOADS="1"
    POL_SetupWindow_message "$(eval_gettext "Understood. All downloaded files will be deleted when finished.")"
fi

POL_SetupWindow_message "$(eval_gettext "Downloading installers...")"
# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
if [[ -n $MACROTOOL_URL ]]; then
    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
fi
if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
    done
fi

# Apply a registry tweak to open PDF files in the native viewer
POL_Call POL_Function_SetNativeExtension "pdf"

# Run the installer
POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
# And the macro installer
if [[ -n $MACROTOOL_URL ]]; then
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
fi
if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
    # And the pattern installers
    for pat in "${PATTERNS_CHOSEN[@]}"; do
        POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
    done
fi

# Create a shortcut
POL_Shortcut "PatVer7_5.exe" "${TITLE}"

if [[ -n $MACROTOOL_URL ]]; then
     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
fi

POL_SetupWindow_Close

# Clean up after ourselves
POL_System_TmpDelete
[[ -n $DELETE_DOWNLOADS ]] && rm -r "${POL_USER_ROOT}/ressources/${TITLE}"

# The script will be signed; prevent bash from trying
# to run the signature
exit 0;

Svar

gap Tuesday 9 June 2015 at 23:35
gap Anonymous

Warning

This update has not been approved yet by the team.
Use it at your own risk

Differences

@@ -0,0 +1,111 @@
+#!/usr/bin/env playonlinux-bash
+# Date : (2015-05-17 23-19)
+# Last revision : (2015-06-09 07-59)
+# Wine version used : 1.6.2
+# Distribution used to test : Ubuntu
+# Author : Alex Elsayed <eternaleye@gmail.com>
+
+# Must be run under PlayOn*
+[[ -z "$PLAYONLINUX" ]] && exit 0
+
+# Load the PlayOnLinux scripting library
+source "$PLAYONLINUX/lib/sources"
+
+TITLE="PatternMaker"
+PREFIX="PatternMaker"
+# Note: This is assumed to end in /INSTALLER_NAME
+INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
+INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
+MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
+MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"
+
+declare -a PATTERN_NAMES
+declare -A PATTERN_URLS
+declare -A PATTERN_DIGESTS
+
+PATTERN_NAMES=( "Basic Blocks" "Coat/Robe" "Dog Suit" "Juniors" "Lingerie" "Men" "Raglan" "Renaissance Corset" "Sportswear" "Super Jacket" "Super Pants" "Super Skirt" "Womens Volume 1" "Womens Volume 2" )
+PATTERN_URLS=( [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe" [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe" [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe" [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe" [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe" [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe" [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe" [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe" [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe" [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe" [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe" [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe" [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe" [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe" )
+PATTERN_DIGESTS=( [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc" [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb" [Dog Suit]="626c552d11535269f6c51a12984b2c2f" [Juniors]="af6b2608c2bd58cffc92240a155802ac" [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841" [Men]="4c63bec7897419aee20541f05695333e" [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8" [Renaissance Corset]="c3db9895a68d886d49100e9163377f12" [Sportswear]="8134c599093a6efb41c826e30f2a7b29" [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936" [Super Pants]="76be51f9f3eb2318deab5b008869b191" [Super Skirt]="a1f176557b60eec95d065c57c0c17601" [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87" [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1" )
+
+function prompt_patterns() {
+    local IFS="~"
+    POL_SetupWindow_checkbox_list "What patterns would you like to install?" "${TITLE}" "${PATTERN_NAMES[*]}" "~"
+    PATTERN_NAMES=( $APP_ANSWER )
+}
+
+# Create the setup window
+POL_SetupWindow_Init
+
+# Required
+POL_Debug_Init
+
+# Set up the initial page
+POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"
+
+# Ask which patterns they want
+prompt_patterns
+
+if [[ -n $MACROTOOL_URL ]]; then
+    POL_SetupWindow_question "Would you like to install the PatternMaker MacroGenerator?" "$TITLE"
+fi
+if [[ ${APP_ANSWER} == FALSE ]]; then
+    MACROTOOL_URL=""
+fi
+
+# Create a temporary directory we can use
+POL_System_TmpCreate "${PREFIX}"
+# ...and enter it
+cd "${POL_System_TmpDir}"
+
+# Install into the PatternMaker Wine environment
+POL_Wine_SelectPrefix "${PREFIX}"
+
+# Create the environment if it does not yet exist
+if ! POL_Wine_PrefixExists; then
+    POL_Wine_PrefixCreate
+fi
+
+POL_SetupWindow_message "Downloading installers..."
+# Download the installer, verifying it against a digest
+POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
+if [[ -n $MACROTOOL_URL ]]; then
+    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
+fi
+for pat in "${PATTERN_NAMES[@]}"; do
+    POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
+done
+
+# Prepare a registry tweak to open PDF files in the native viewer
+cat <<REGISTRY > "${POL_System_TmpDir}/pdfassoc.reg"
+[HKEY_CLASSES_ROOT\.pdf]
+@="PDFfile"
+"Content Type"="application/pdf"
+[HKEY_CLASSES_ROOT\PDFfile\Shell\Open\command]
+@="winebrowser \"%1\""
+REGISTRY
+
+# Apply said registry tweak
+POL_Wine regedit "${POL_System_TmpDir}/pdfassoc.reg"
+
+# Run the installer
+POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
+# And the macro installer
+if [[ -n $MACROTOOL_URL ]]; then
+    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
+fi
+# And the pattern installers
+for pat in "${PATTERN_NAMES[@]}"; do
+    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
+done
+
+# Create a shortcut
+POL_Shortcut "PatVer7_5.exe" "${TITLE}"
+
+if [[ -n $MACROTOOL_URL ]]; then
+     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
+fi
+
+POL_SetupWindow_Close
+
+# Clean up after ourselves
+POL_System_TmpDelete
\ No newline at end of file

New source code

#!/usr/bin/env playonlinux-bash
# Date : (2015-05-17 23-19)
# Last revision : (2015-06-09 07-59)
# Wine version used : 1.6.2
# Distribution used to test : Ubuntu
# Author : Alex Elsayed <eternaleye@gmail.com>

# Must be run under PlayOn*
[[ -z "$PLAYONLINUX" ]] && exit 0

# Load the PlayOnLinux scripting library
source "$PLAYONLINUX/lib/sources"

TITLE="PatternMaker"
PREFIX="PatternMaker"
# Note: This is assumed to end in /INSTALLER_NAME
INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"

declare -a PATTERN_NAMES
declare -A PATTERN_URLS
declare -A PATTERN_DIGESTS

PATTERN_NAMES=( "Basic Blocks" "Coat/Robe" "Dog Suit" "Juniors" "Lingerie" "Men" "Raglan" "Renaissance Corset" "Sportswear" "Super Jacket" "Super Pants" "Super Skirt" "Womens Volume 1" "Womens Volume 2" )
PATTERN_URLS=( [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe" [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe" [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe" [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe" [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe" [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe" [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe" [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe" [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe" [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe" [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe" [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe" [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe" [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe" )
PATTERN_DIGESTS=( [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc" [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb" [Dog Suit]="626c552d11535269f6c51a12984b2c2f" [Juniors]="af6b2608c2bd58cffc92240a155802ac" [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841" [Men]="4c63bec7897419aee20541f05695333e" [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8" [Renaissance Corset]="c3db9895a68d886d49100e9163377f12" [Sportswear]="8134c599093a6efb41c826e30f2a7b29" [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936" [Super Pants]="76be51f9f3eb2318deab5b008869b191" [Super Skirt]="a1f176557b60eec95d065c57c0c17601" [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87" [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1" )

function prompt_patterns() {
    local IFS="~"
    POL_SetupWindow_checkbox_list "What patterns would you like to install?" "${TITLE}" "${PATTERN_NAMES[*]}" "~"
    PATTERN_NAMES=( $APP_ANSWER )
}

# Create the setup window
POL_SetupWindow_Init

# Required
POL_Debug_Init

# Set up the initial page
POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"

# Ask which patterns they want
prompt_patterns

if [[ -n $MACROTOOL_URL ]]; then
    POL_SetupWindow_question "Would you like to install the PatternMaker MacroGenerator?" "$TITLE"
fi
if [[ ${APP_ANSWER} == FALSE ]]; then
    MACROTOOL_URL=""
fi

# Create a temporary directory we can use
POL_System_TmpCreate "${PREFIX}"
# ...and enter it
cd "${POL_System_TmpDir}"

# Install into the PatternMaker Wine environment
POL_Wine_SelectPrefix "${PREFIX}"

# Create the environment if it does not yet exist
if ! POL_Wine_PrefixExists; then
    POL_Wine_PrefixCreate
fi

POL_SetupWindow_message "Downloading installers..."
# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
if [[ -n $MACROTOOL_URL ]]; then
    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
fi
for pat in "${PATTERN_NAMES[@]}"; do
    POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
done

# Prepare a registry tweak to open PDF files in the native viewer
cat <<REGISTRY > "${POL_System_TmpDir}/pdfassoc.reg"
[HKEY_CLASSES_ROOT\.pdf]
@="PDFfile"
"Content Type"="application/pdf"
[HKEY_CLASSES_ROOT\PDFfile\Shell\Open\command]
@="winebrowser \"%1\""
REGISTRY

# Apply said registry tweak
POL_Wine regedit "${POL_System_TmpDir}/pdfassoc.reg"

# Run the installer
POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
# And the macro installer
if [[ -n $MACROTOOL_URL ]]; then
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
fi
# And the pattern installers
for pat in "${PATTERN_NAMES[@]}"; do
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
done

# Create a shortcut
POL_Shortcut "PatVer7_5.exe" "${TITLE}"

if [[ -n $MACROTOOL_URL ]]; then
     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
fi

POL_SetupWindow_Close

# Clean up after ourselves
POL_System_TmpDelete

Svar

Anonymous
Tuesday 9 June 2015 at 23:37
Missed how to upload the source code the first time around. Sorry. Also, accidentally typoed the name - "PattenMaker" where it should be "PatternMaker" - I'm not seeing a way to edit this; am I missing something obvious?
Wednesday 10 June 2015 at 18:55
First, nice arrays and associate arrays work :)
Ok, now for the review:
POL_SetupWindow_checkbox_list "What patterns would you like to install?" "${TITLE}" "${PATTERN_NAMES[*]}" "~"
All user-oriented messages (here, the question) should support localization, see http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_10:_Script_Translation

# Create the environment if it does not yet exist
if ! POL_Wine_PrefixExists; then
POL_Wine_PrefixCreate
fi
PrefixCreate will already ask the user whether (s)he'd like to overwrite or erase an existing prefix (since 4.1.9), so this just makes it more complicated for users to reinstall from scratch, I'm not convinced this is an improvement.
And the test is wrong, it should be if [ "$(POL_Wine_PrefixExists $PREFIX)" != "True" ]; then ...

# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
Since the resources directory is totally hidden from user eyes (no report of how much disk space it takes, no visible way to clear it), as a general rule it has been used only for files reusable between scripts, and mainly for components.

# Prepare a registry tweak to open PDF files in the native viewer
...
POL_Wine regedit "${POL_System_TmpDir}/pdfassoc.reg"

You can use POL_Call POL_Function_SetNativeExtension "pdf" to the same effect

And the script should end with exit 0, the script will be GPG signed, adding exit will prevent Bash from trying to execute the signature ;)
Anonymous
Wednesday 10 June 2015 at 19:08
Thanks for the compliment re: arrays :D
Anonymous
Wednesday 10 June 2015 at 19:16
Gah, hard to write multi-line comments when enter sends...

Anyway, thanks for the review! The full script is actually generated from a template and per-component snippets, which is why the arrays are a thing. I'll definitely fix up the localization bit.

I'll also remove the PrefixExists check; it was a holdover from a prior version where I tried doing separate installers for PatternMaker (the tool itself) and other sub-tools or data installers. Moving to a single meta-installer has basically obviated the reason it was added.

I use POL_Download_Resource for a few reasons:
1.) Re-running the installer to install more of the patterns is a use case we explicitly intend to support, and redownloading the main installer for that is a bit annoying.
2.) The "patterns" really are components (actually data files used by PatternMaker), and the user may very well reuse them in a subsequent run of the tool (or when they update the PatternMaker main program itself)
3.) POL_Download seems to go into /tmp, which on a number of distros is a tmpfs.

If you'd like, though, perhaps adding a yes/no on "Keep downloaded files after installation has finished?" and deleting them in the script on "no" would suffice?

SetNativeExtension looks perfect, no idea how I missed that!

And I'll definitely add the exit 0; for some reason I thought the GPG sigs would be in detached mode.
Wednesday 10 June 2015 at 19:54
"3.) POL_Download seems to go into /tmp, which on a number of distros is a tmpfs."

You have to run POL_System_TmpCreate "$TITLE" to create a temp folder in POL's root folder, you can cd to it with cd "$POL_System_TmpDir", and clean it up after you are done with POL_System_TmpDelete. :)
Anonymous
Wednesday 10 June 2015 at 20:02
Ah, thanks Ronin. Still, the fact that the components/installer do have real use cases for reuse makes me more tempted to use ..._Resource's subdir support (which the script already does via $TITLE), and give the user the choice of removal or preservation.
Wednesday 10 June 2015 at 20:03
POL_Download downloads in the current directory, what about downloading in the virtual drive instead? So the file will be around for adding software components for as long as the virtual drive is not totally erased...
Anonymous
Wednesday 10 June 2015 at 21:36
petch, the problem with that is that these are installers, just ones which may be useful to keep around. If the user is doing a clean reinstall (exactly where they'd benefit!), they'd choose to wipe the prefix on re-running the script... eliminating the downloaded files.
gap Tuesday 9 June 2015 at 17:24
gap Anonymous

Meddelanden

#!/usr/bin/env playonlinux-bash
# Date : (2015-05-17 23-19)
# Last revision : (2015-06-09 07-59)
# Wine version used : 1.6.2
# Distribution used to test : Ubuntu
# Author : Alex Elsayed <eternaleye@gmail.com>

# Must be run under PlayOn*
[[ -z "$PLAYONLINUX" ]] && exit 0

# Load the PlayOnLinux scripting library
source "$PLAYONLINUX/lib/sources"

TITLE="PatternMaker"
PREFIX="PatternMaker"
# Note: This is assumed to end in /INSTALLER_NAME
INSTALLER_URL="http://www.patternmakerusa.com/downloads/PatternMaker7_5_Setup.exe"
INSTALLER_DIGEST="f2625e0b06a58cddf026abf873a58ed2"
MACROTOOL_URL="http://www.patternmakerusa.com/downloads/MacroGen4_5_Setup.exe"
MACROTOOL_DIGEST="c54cf396c9e53135eeb1fefc7cfd9201"

declare -a PATTERN_NAMES
declare -A PATTERN_URLS
declare -A PATTERN_DIGESTS

PATTERN_NAMES=( "Basic Blocks" "Coat/Robe" "Dog Suit" "Juniors" "Lingerie" "Men" "Raglan" "Renaissance Corset" "Sportswear" "Super Jacket" "Super Pants" "Super Skirt" "Womens Volume 1" "Womens Volume 2" )
PATTERN_URLS=( [Basic Blocks]="http://www.patternmakerusa.com/downloads/Blocks_PM75.exe" [Coat/Robe]="http://www.patternmakerusa.com/downloads/CoatRobe_PM75.exe" [Dog Suit]="http://www.patternmakerusa.com/downloads/DogSuit_PM75.exe" [Juniors]="http://www.patternmakerusa.com/downloads/Juniors_PM75.exe" [Lingerie]="http://www.patternmakerusa.com/downloads/Lingerie_PM75.exe" [Men]="http://www.patternmakerusa.com/downloads/Men_PM75.exe" [Raglan]="http://www.patternmakerusa.com/downloads/Raglan_PM75.exe" [Renaissance Corset]="http://www.patternmakerusa.com/downloads/Corset_PM75.exe" [Sportswear]="http://www.patternmakerusa.com/downloads/Sportswear_PM75.exe" [Super Jacket]="http://www.patternmakerusa.com/downloads/SuperJkt_PM75.exe" [Super Pants]="http://www.patternmakerusa.com/downloads/SuperPants_PM75.exe" [Super Skirt]="http://www.patternmakerusa.com/downloads/SuperSkirt_PM75.exe" [Womens Volume 1]="http://www.patternmakerusa.com/downloads/Women1_PM75.exe" [Womens Volume 2]="http://www.patternmakerusa.com/downloads/Women2_PM75.exe" )
PATTERN_DIGESTS=( [Basic Blocks]="cf740e237a4d557a9baf26a097fa6ecc" [Coat/Robe]="d7cf9812fc001c7734f9b136158acbbb" [Dog Suit]="626c552d11535269f6c51a12984b2c2f" [Juniors]="af6b2608c2bd58cffc92240a155802ac" [Lingerie]="2f80a4a894b9fb69d64463bc43fb8841" [Men]="4c63bec7897419aee20541f05695333e" [Raglan]="29f906bf37243dd30cc8e6d02b0b52d8" [Renaissance Corset]="c3db9895a68d886d49100e9163377f12" [Sportswear]="8134c599093a6efb41c826e30f2a7b29" [Super Jacket]="bc3ed65c190967c1853e6fc14c67e936" [Super Pants]="76be51f9f3eb2318deab5b008869b191" [Super Skirt]="a1f176557b60eec95d065c57c0c17601" [Womens Volume 1]="6d51a3747dc00d28f6aedc02d067fb87" [Womens Volume 2]="60317ea8e0d3e0dab742934ecb4abdf1" )

function prompt_patterns() {
    local IFS="~"
    POL_SetupWindow_checkbox_list "What patterns would you like to install?" "${TITLE}" "${PATTERN_NAMES[*]}" "~"
    PATTERN_NAMES=( $APP_ANSWER )
}

# Create the setup window
POL_SetupWindow_Init

# Required
POL_Debug_Init

# Set up the initial page
POL_SetupWindow_presentation "$TITLE" "PatternMaker Software" "http://www.patternmakerusa.com" "Alex Elsayed" "$PREFIX"

# Ask which patterns they want
prompt_patterns

if [[ -n $MACROTOOL_URL ]]; then
    POL_SetupWindow_question "Would you like to install the PatternMaker MacroGenerator?" "$TITLE"
fi
if [[ ${APP_ANSWER} == FALSE ]]; then
    MACROTOOL_URL=""
fi

# Create a temporary directory we can use
POL_System_TmpCreate "${PREFIX}"
# ...and enter it
cd "${POL_System_TmpDir}"

# Install into the PatternMaker Wine environment
POL_Wine_SelectPrefix "${PREFIX}"

# Create the environment if it does not yet exist
if ! POL_Wine_PrefixExists; then
    POL_Wine_PrefixCreate
fi

POL_SetupWindow_message "Downloading installers..."
# Download the installer, verifying it against a digest
POL_Download_Resource "${INSTALLER_URL}" "${INSTALLER_DIGEST}" "${TITLE}"
if [[ -n $MACROTOOL_URL ]]; then
    POL_Download_Resource "${MACROTOOL_URL}" "${MACROTOOL_DIGEST}" "${TITLE}"
fi
for pat in "${PATTERN_NAMES[@]}"; do
    POL_Download_Resource "${PATTERN_URLS["${pat}"]}" "${PATTERN_DIGESTS["${pat}"]}" "${TITLE}"
done

# Prepare a registry tweak to open PDF files in the native viewer
cat <<REGISTRY > "${POL_System_TmpDir}/pdfassoc.reg"
[HKEY_CLASSES_ROOT\.pdf]
@="PDFfile"
"Content Type"="application/pdf"
[HKEY_CLASSES_ROOT\PDFfile\Shell\Open\command]
@="winebrowser \"%1\""
REGISTRY

# Apply said registry tweak
POL_Wine regedit "${POL_System_TmpDir}/pdfassoc.reg"

# Run the installer
POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${INSTALLER_URL}")"
# And the macro installer
if [[ -n $MACROTOOL_URL ]]; then
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${MACROTOOL_URL}")"
fi
# And the pattern installers
for pat in "${PATTERN_NAMES[@]}"; do
    POL_Wine "${POL_USER_ROOT}/ressources/${TITLE}/$(basename "${PATTERN_URLS["${pat}"]}")"
done

# Create a shortcut
POL_Shortcut "PatVer7_5.exe" "${TITLE}"

if [[ -n $MACROTOOL_URL ]]; then
     POL_Shortcut "MacroGen4_5.exe" "${TITLE} MacroGenerator"
fi

POL_SetupWindow_Close

# Clean up after ourselves
POL_System_TmpDelete

Svar