#!/usr/bin/perl -w
# (c) Copyright 2003. CodeWeavers, Inc.
use strict;

my $name0=$0;
$name0 =~ s+^.*/++;

my $cx_root;
BEGIN {
    $cx_root=$ARGV[0] || $ENV{"CX_ROOT"} || "/opt/cxoffice";
    push @INC, "$cx_root/lib/perl";
}
use CXLog;
use CXUtils;

$ENV{"CX_ROOT"}=$cx_root;
my $dotwine="$cx_root/support/dotwine";

if ($> != 0)
{
    print STDERR "$name0:error: you must be root to run this script\n";
    exit 1;
}
if (-d $dotwine)
{
    print STDERR "$name0:error: '$dotwine' already exists\n";
    exit 1;
}

my $rc=CXUtils::cxsystem("$cx_root/support/templates/dotwine/setup/setup",
                         "--create","--updater","wineprefixcreate",
                         $dotwine);
exit $rc;
