#!/usr/bin/perl

my $result = 0;

# Remove the WebKit plug-in unless the user has QuickTime 7.0 or above
$result = GetPathEntry("/System/Library/Frameworks/QuickTime.framework/Resources/Info.plist", "CFBundleVersion");
if ($result lt "7.0")
{
	system("/bin/rm -rf '/Library/Internet Plug-Ins/Flip4Mac WMV Plugin.webplugin'");
}

exit 0;


sub GetPathEntry
{
    my $path            = $_[0];
    my $entry           = $_[1];

    my $oldSeperator = $/;
    $/ = \0;

    open( PLIST, "$path") || do {
        return 0;
    };

    $plistData = <PLIST>;
    $plistData =~ /<dict>(.*?)<\/dict>/gis;

    @items = split(/<key>/, $plistData);

    shift @items;
    foreach $item (@items) {
        $item =~ /(.*?)<\/key>.*?<string>(.*?)<\/string>/gis;
        $versiondata{ $1 } = $2;
    }

    close(PLIST);

    $/ = $oldSeperator;

    return $versiondata{$entry};
 }
 