The forum

[Script] PDF-XChange Viewer

Author Replies
Fredo Saturday 21 July 2012 at 15:30
FredoAnonymous

This is my first POL script. It installs the free PDF-XChange Viewer.

Please let me know what you think.

Frederik


#!/bin/bash
# Date : (2012-07-21 14-31)
# Last revision : (2012-07-21 14-31)
# Wine version used : 1.4
# Distribution used to test : Ubuntu 12.04 LTS
# Author : Frederik Elwert <frederik.elwert@web.de>

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

DOWNLOAD_LOCATION="http://www.tracker-software.com/downloads/PDFXVwer.exe"
DOWNLOAD_MD5="4adc75c30869a85da9b51464d52c6315"
EXECUTABLE="PDFXCview.exe"
PREFIX="PDFXChangeViewer"
TITLE="PDF-XChange Viewer"
APPAUTHOR="tracker"
APPURL="http://www.tracker-software.com/"
SCRIPTAUTHOR="Frederik Elwert"

POL_SetupWindow_Init
POL_Debug_Init

POL_SetupWindow_presentation "$TITLE" "$APPAUTHOR" "$APPURL" "$SCRIPTAUTHOR" "$PREFIX"

# Choose install method
POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"
POL_Debug_Message "Selected install method: $INSTALL_METHOD"

if [ "$INSTALL_METHOD" = "DOWNLOAD" ]
then
# Create temporary directory
POL_System_TmpCreate "POL_PDFXChange_Install"
# Download installer
cd "$POL_System_TmpDir"
POL_Debug_Message "Downloading installer from $DOWNLOAD_LOCATION into $POL_System_TmpDir."
POL_Download "$DOWNLOAD_LOCATION" "$DOWNLOAD_MD5"
INSTALLER="$(basename $DOWNLOAD_LOCATION)"
elif [ "$INSTALL_METHOD" = "LOCAL" ]
then
POL_SetupWindow_browse "$(eval_gettext "Please select the setup file to run.")" "$TITLE"
INSTALLER="$APP_ANSWER"
fi

# Create prefix
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate
# Install
POL_SetupWindow_wait "$(eval_gettext "Please wait while $TITLE is installed.")" "$TITLE"
POL_Debug_Message "Installing $TITLE from $INSTALLER."
POL_Wine start /unix "$INSTALLER"
POL_Wine_WaitExit "$TITLE"
# Finish installation
POL_Shortcut "$EXECUTABLE" "$TITLE"

# Clean up
if [ -d "$POL_System_TmpDir" ]
then
POL_System_TmpDelete
fi

POL_SetupWindow_message "$(eval_gettext "$TITLE has been successfully installed.")" "$TITLE"
POL_SetupWindow_Close
exit
Quentin PÂRIS Saturday 21 July 2012 at 17:12
Quentin PÂRISAnonymous

Replace POL_SetupWindow_wait "$(eval_gettext "Please wait while $TITLE is installed.")" "$TITLE" with POL_SetupWindow_WaitBefore "$TITLE"

Remove if [ -d "$POL_System_TmpDir" ] and place POL_System_TmpDelete in the good if

And then it should be ok, you can send it to validation

Thank you

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 dmcayonlinux.com