Installer issue

Hi, I have a little problem with an Installer.

In my script I have a section that place a keyboard shortcut:

#!/usr/bin/perl
################################################################################
#
# Create Desktop shortcut for Swedish Menu Commands Document
#
################################################################################
$swedishKeyboardDocPath1 = $APPSUPPORT_PATH."/Finale Extra/PrintMusic 2014 Menykommandon.pdf";
$swedishKeyboardShortcut1 = $ENV{"HOME"}."/Desktop/PrintMusic 2014 Menykommandon.pdf";
if ( -e $swedishKeyboardDocPath1 ) {
    symlink($swedishKeyboardDocPath1, $swedishKeyboardShortcut1);
}

When I install this and there already exist a shortcut with the same name, I want the installer to replace it.
I hope I get some help from the forum.
/peli

Trying to create a symbolic link will fail if the name of the symlink to be created already exists. Try this instead:

#!/bin/ksh
################################################################################
#
# Create Desktop shortcut for Swedish Menu Commands Document
#
################################################################################
swedishKeyboardDocPath1="$APPSUPPORT_PATH/Finale Extra/PrintMusic 2014 Menykommandon.pdf"
swedishKeyboardShortcut1=~"/Desktop/PrintMusic 2014 Menykommandon.pdf"
if [ -e "$swedishKeyboardDocPath1" ]
then	rm -f "$swedishKeyboardShortcut1"
	ln -s "$swedishKeyboardDocPath1" "$swedishKeyboardShortcut1"
else	printf '%s: "%s" not found.\n' "${0##*/}" "$swedishKeyboardDocPath1"
	exit 1
fi

Note, however, that this will not work unless APPSUPPORT_PATH is an exported variable in your environment when you invoke this script.