#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
PREFIX=
"Office2010"
WINEVERSION=
"1.5.3"
TITLE=
"Microsoft Office 2010"
shortcutWord=
"Microsoft Word 2010"
shortcutExcel=
"Microsoft Excel 2010"
shortcutPowerpoint=
"Microsoft Powerpoint 2010"
shortcutOneNote=
"Microsoft OneNote 2010"
shortcutOutlook=
"Microsoft Outlook 2010"
POL_SetupWindow_Init
POL_RequiredVersion 4.0.18 || POL_Debug_Fatal
"$TITLE won't work with $APPLICATION_TITLE $VERSION\\nPlease update"
if
[
"$POL_OS"
=
"Linux"
];
then
wbinfo -V || POL_Debug_Fatal
"Please install winbind before installing $TITLE"
fi
POL_Debug_Init
POL_System_SetArch
"x86"
POL_Wine_SelectPrefix
"$PREFIX"
if
[
"$(POL_Wine_PrefixExists "
$PREFIX
")"
==
"True"
];
then
POL_SetupWindow_menu
"$(eval_gettext 'Wineprefix $PREFIX already exists!!!\\n\\nWhat would you prefer to do?')"
"$TITLE"
"Reinstall $TITLE~~~Activate installed $TITLE"
"~~~"
performAction=
"$APP_ANSWER"
else
performAction=
"Install $TITLE in new wineprefix"
fi
if
[
"$performAction"
!=
"Activate installed $TITLE"
];
then
if
[
"$performAction"
==
"Reinstall $TITLE"
];
then
POL_SetupWindow_question
"$(eval_gettext 'Do you really want to delete wineprefix $PREFIX?\\n')"
"$TITLE"
if
[
"$APP_ANSWER"
==
"TRUE"
];
then
rm
-Rf
"$POL_USER_ROOT//wineprefix/$PREFIX/"
rm
"$POL_USER_ROOT//shortcuts//$shortcutWord"
rm
"$POL_USER_ROOT//shortcuts//$shortcutExcel"
rm
"$POL_USER_ROOT//shortcuts//$shortcutPowerpoint"
rm
"$POL_USER_ROOT//shortcuts//$shortcutOneNote"
rm
"$POL_USER_ROOT//shortcuts//$shortcutOutlook"
fi
fi
POL_Wine_PrefixCreate
"$WINEVERSION"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"x86/setup.exe"
"setup.exe"
cd
"$CDROM"
Set_OS win7
POL_Call
POL_Install_dotnet20
POL_Wine_WaitBefore
"$TITLE"
cd
"$CDROM"
POL_Wine
"$CDROM_SETUP"
POL_Wine_WaitExit
"$TITLE"
sleep
10
POL_Call
POL_Install_msxml6
POL_Call
POL_Function_OverrideDLL native riched20 msxml6
POL_Call
POL_Function_OverrideDLL native,
builtin
urlmon
POL_Shortcut
"WINWORD.EXE"
"$shortcutWord"
POL_Shortcut
"EXCEL.EXE"
"$shortcutExcel"
POL_Shortcut
"POWERPNT.EXE"
"$shortcutPowerpoint"
POL_Shortcut
"ONENOTE.EXE"
"$shortcutOneNote"
POL_Shortcut
"OUTLOOK.EXE"
"$shortcutOutlook"
POL_Extension_Write doc
"$shortcutWord"
POL_Extension_Write docx
"$shortcutWord"
POL_Extension_Write xls
"$shortcutExcel"
POL_Extension_Write xlsx
"$shortcutExcel"
POL_Extension_Write ppt
"$shortcutPowerpoint"
POL_Extension_Write pptx
"$shortcutPowerpoint"
POL_SetupWindow_message
"$(eval_gettext '$TITLE has been installed successfully\\n\\nIf an installation Windows prevent your programs from running, restart the script and choose option "
Reinstall $TITLE
"!')"
"$TITLE"
POL_SetupWindow_question
"$(eval_gettext 'Do you want to activate your $TITLE?\\n\\nYou can also skip this step and activate $TITLE\\nlater by restarting this script.')"
"$TITLE"
activateMSOffice=
"$APP_ANSWER"
else
activateMSOffice=
"TRUE"
fi
if
[
"$activateMSOffice"
==
"TRUE"
];
then
POL_Wine_SelectPrefix
"$PREFIX"
POL_SetupWindow_menu
"$(eval_gettext 'Which type of activation?')"
"$TITLE"
"Volume Activation (KMS)~~~Skip activation"
"~~~"
if
[
"$APP_ANSWER"
==
"Volume Activation (KMS)"
];
then
dataCorrect=
"FALSE"
while
[
"$dataCorrect"
!=
"TRUE"
];
do
licenseServerName=
""
POL_SetupWindow_textbox
"$(eval_gettext 'Insert address of license server!')"
"$TITLE"
licenseServerName=$APP_ANSWER
POL_SetupWindow_textbox
"$(eval_gettext 'Insert port of license server!')"
"$TITLE"
licenseServerPort=$APP_ANSWER
POL_SetupWindow_question
"$(eval_gettext 'Are the data for the license server correct?\\nCan these values be added to the registry?\\n\\nLicense server name: $licenseServerName\\nLicense server port: $licenseServerPort')"
"$TITLE"
dataCorrect=$APP_ANSWER
done
cd
"$POL_USER_ROOT//wineprefix/$PREFIX/"
echo
"[HKEY_LOCAL_MACHINE\\\\Software\\\\Microsoft\\\\OfficeSoftwareProtectionPlatform]"
> VLKMSServ.reg
echo
"\\"
KeyManagementServiceName\\
"=\\"
$licenseServerName\\
""
>> VLKMSServ.reg
echo
"\\"
KeyManagementServicePort\\
"=\\"
$licenseServerPort\\
""
>> VLKMSServ.reg
POL_Wine
regedit VLKMSServ.reg
sleep
2
rm
VLKMSServ.reg
POL_SetupWindow_message
"$(eval_gettext '$TITLE should be activated now.\\nMaybe two starts of $TITLE are necessary:\\nOne for initialising and one for registration.\\n\\nJust start, close and restart $TITLE!')"
"$TITLE"
elif
[
"$APP_ANSWER"
==
"Volume Activation (MAK)"
];
then
echo
fi
fi
POL_SetupWindow_Close
exit