The forum

A script that works with MS Office 2007 sp2 slipstream cd...

Tested a changed office 2007 script that works with slipstream sp2

Author Replies
Jump to the page: 1 - 2
Unkuiri Friday 17 September 2010 at 18:58
Unkuiri

Wine version: 1.3.0
Distribution: Ubuntu
Distribution version: 10.04
Coments:
Hi, I've changed the Office 2007 script in order to use wine 1.3.0 instead of the 1.2 rc1 version used and it installed all the updates Ihad in the "Updates" folder in cd (off course they had to be extracted like is said here: http://community.winsupersite.com/blogs/paul/archive/2009/04/28/slipstream-office-2007-with-sp2.aspx)

The changed script is here:
#!/bin/bash
# Date : (2009-06-25 11-00)
# Last revision : (2010-09-15 08-00)
# Wine version used : 1.3.0
# Distribution used to test : Ubuntu 10.04
# Author : NSLW
# Licence : Retail
# Depend : ImageMagick
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
}
 
#procedure for patching Office2007
patch_Office2007()
{
POL_SetupWindow_browse "Select service pack file" "$TYTUL" ""
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
wine "$APP_ANSWER"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
}
 
TYTUL="MS Office 2007"
PREFIX="Office2007"
WORKINGWINEVERSION="1.3.0"
 
EXENAME[0]="WINWORD"
APPNAME[0]="Word"
ICOINDEX[0]="*_wordicon.0.png"
 
EXENAME[1]="EXCEL"
APPNAME[1]="Excel"
ICOINDEX[1]="*_xlicons.0.png"
 
EXENAME[2]="POWERPNT"
APPNAME[2]="PowerPoint"
ICOINDEX[2]="*_pptico.0.png"
 
EXENAME[3]="ONENOTE"
APPNAME[3]="OneNote"
ICOINDEX[3]="*_joticon.0.png"
 
EXENAME[4]="INFOPATH"
APPNAME[4]="InfoPath"
ICOINDEX[4]="*_inficon.0.png"
 
EXENAME[5]="MSPUB"
APPNAME[5]="Publisher"
ICOINDEX[5]="*_pubs.0.png"
 
EXENAME[6]="OUTLOOK" # do not work
APPNAME[6]="Outlook"
ICOINDEX[6]="*_outicon.0.png"
 
EXENAME[7]="MSACCESS" # do not work
APPNAME[7]="Access"
ICOINDEX[7]="*_accicons.0.png"
 
EXENAME[8]="GROOVE" # do not work
APPNAME[8]d="Groove"
ICOINDEX[8]="*_grooveicon.png"
 
DOWNLOADLINK[0]="http://download.microsoft.com/download/d/3/4/d342efa6-3266-4157-a2ec-5174867be706/vcredist_x86.exe"
COMPONENTNAME[0]="Visual C++ 2005"
WINETRICKSNAME[0]="vcrun2005"
 
DOWNLOADLINK[1]="http://download.microsoft.com/download/2/8/a/28a5a346-1be1-4049-b554-3bc5f3174353/WindowsXP-Windows2000-Script56-KB917344-x86-enu.exe"
COMPONENTNAME[1]="Windows Scripting Host"
WINETRICKSNAME[1]="wsh56"
 
DOWNLOADLINK[2]="http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi"
COMPONENTNAME[2]="MSXML3"
WINETRICKSNAME[2]="msxml3"
 
DOWNLOADLINK[3]="http://download.microsoft.com/download/winntsp/Patch/RTF/NT4/EN-US/Q249973i.EXE"
COMPONENTNAME[3]="Native Rich Text Editor Support 20"
WINETRICKSNAME[3]="riched20"
 
DOWNLOADLINK[4]="http://download.microsoft.com/download/ie5/Update/1/WIN98/EN-US/3725.exe"
COMPONENTNAME[4]="wininet from IE 5.0.1"
WINETRICKSNAME[4]="wininet"
 
wget http://upload.wikimedia.org/wikipedia/en/8/81/MS_Office_2007_Logo.svg --output-document="$REPERTOIRE/tmp/leftnotrotated.png"
convert "$REPERTOIRE/tmp/leftnotrotated.png" -rotate 270 "$REPERTOIRE/tmp/leftnotscaled.png"
convert "$REPERTOIRE/tmp/leftnotscaled.png" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"
 
POL_SetupWindow_presentation "$TYTUL" "Microsoft" "www.microsoft.com" "NSLW" "$PREFIX" 
 
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
 
#asking about service pack
#if [ -e "$REPERTOIRE/configurations/installed/Microsoft Office Word 2007" ]; then
#POL_SetupWindow_menu "What do you want to do?" "Actions" "Install service pack" "~"
 
#if [ "$APP_ANSWER" == "Install service pack" ]; then
#	patch_Office2007
#fi
 
#POL_SetupWindow_Close
#exit
#fi
 
#asking for CDROM and checking if it's correct one
POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "setup.exe"
 
#downloading specific Wine
POL_SetupWindow_install_wine "$WORKINGWINEVERSION"
Use_WineVersion "$WORKINGWINEVERSION"
 
#creating application's own prefix
POL_SetupWindow_prefixcreate
 
#fetching PROGRAMFILES environmental variable
PROGRAMFILES="Program Files" 
POL_LoadVar_PROGRAMFILES
 
mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
 
#downloading files
for i in `seq 0 4`;
do
if [ ! -e ${DOWNLOADLINK[$i]##*/} ]then
POL_SetupWindow_download "PlayOnLinux is downloading ${COMPONENTNAME[$i]}" "${COMPONENTNAME[$i]}" "${DOWNLOADLINK[$i]}"
fi
done 
 
cd "$REPERTOIRE/ressources"
#downloading winetricks
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "4d9334cf063ef6eff593ef33f304023311fc9f8a" ]; then
wget http://winezeug.googlecode.com/svn/trunk/winetricks --output-document=winetricks
fi
 
#installing Visual C++ 2005 runtime libraries
POL_SetupWindow_wait_next_signal "Installing Visual C++ 2005 runtime libraries..." "$TYTUL"
bash winetricks -q vcrun2005
POL_SetupWindow_detect_exit
 
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
cd "$CDROM"
wine "setup.exe"
POL_SetupWindow_detect_exit
 
cd "$REPERTOIRE/ressources"
 
#installing
for i in `seq 1 4`;
do
POL_SetupWindow_wait_next_signal "PlayOnLinux is installing ${COMPONENTNAME[$i]}..." "$TYTUL"
bash winetricks -q ${WINETRICKSNAME[$i]}
POL_SetupWindow_detect_exit
done
 
bash winetricks -q fontsmooth-enable
 
#installing ie6
POL_SetupWindow_wait_next_signal "PlayOnLinux is downloading and installing Internet Explorer 6\\n\\nPlease be patient ca. 12 MB is being downloaded." "$TYTUL"
bash winetricks ie6
POL_SetupWindow_detect_exit
 
#overriding dlls required for displaying help
cd "$WINEPREFIX/drive_c/windows/temp"
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DllOverrides]" > override.reg
echo "\\"usp10\\"=\\"native,builtin\\"" >> override.reg
echo "\\"riched20\\"=\\"native\\"" >> override.reg
regedit override.reg
 
#making shortcuts
for i in `seq 0 5`;
do
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Office/Office12"
if [ -e "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Office/Office12/${EXENAME[$i]}.EXE" ]; then
POL_SetupWindow_make_icon_for_shortcut "Microsoft Office ${APPNAME[$i]} 2007" "${ICOINDEX[$i]}"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Microsoft Office/Office12" "${EXENAME[$i]}.EXE" "" "Microsoft Office ${APPNAME[$i]} 2007" "" ""
Set_WineVersion_Assign "$WORKINGWINEVERSION" "Microsoft Office ${APPNAME[$i]} 2007"
 
appdir=$(detect_appdir "Microsoft Office ${APPNAME[$i]} 2007")
cd "$REPERTOIRE/configurations/installed"
mv "Microsoft Office ${APPNAME[$i]} 2007" "Microsoft Office ${APPNAME[$i]} 2007.bak"
cat "Microsoft Office ${APPNAME[$i]} 2007.bak" | head -n5 > "Microsoft Office ${APPNAME[$i]} 2007"
echo "docname=\\${1##*/}" >> "Microsoft Office ${APPNAME[$i]} 2007"
echo "docpath=\\${1%/*}" >> "Microsoft Office ${APPNAME[$i]} 2007"
echo "cd \\"\\$docpath\\"" >> "Microsoft Office ${APPNAME[$i]} 2007"
echo "wine \\"$appdir/${EXENAME[$i]}.EXE\\" \\"\\$docname\\"" >> "Microsoft Office ${APPNAME[$i]} 2007"
rm "Microsoft Office ${APPNAME[$i]} 2007.bak"
 
fi
done 
 
#asking about patching
#POL_SetupWindow_question "Do you want to apply service pack?" "$TYTUL"
#if [ "$APP_ANSWER" == "TRUE" ] ;then
#patch_Office2007
#fi
 
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
 
POL_SetupWindow_reboot
POL_SetupWindow_Close
exit


There remain some problems mainly with file associations, I solved them in my own way, but we need a definitive Solution.

Hope this helps anyone.

Edited by Unkuiri

Aymeric P. Friday 17 September 2010 at 21:42
Aymeric P.

Hi,

Can you change this script for replace usage of winetricks by POL_Call function.
e.g: replace all line about msxml3 by "POL_Call POL_Install_msxml3"
You can find all POL_Call function here: http://www.playonmac.com/repository/?cat=100

Former member.
Aymeric P. Friday 17 September 2010 at 21:42
Aymeric P.

Hi,

Can you change this script for replace usage of winetricks by POL_Call function.
e.g: replace all line about msxml3 by "POL_Call POL_Install_msxml3"
You can find all POL_Call function here: http://www.playonmac.com/repository/?cat=100

Former member.
Unkuiri Monday 20 September 2010 at 14:48
Unkuiri

Yeah I can try...:)...I'm new to this, I'll do my best and post here the result...Thanks
Unkuiri Monday 20 September 2010 at 15:55
Unkuiri

I can't find a POL_Call function for wininet (Wininet from IE 5.0.1), is it necessary for the correct instalation or functioning?Should I keep winetricks to install this package?How can I do for IE 6?
GNU_Raziel Monday 20 September 2010 at 20:06
GNU_Raziel

You can make a new function for this package if it's not already done, that's easy.

We've decided to not accept any script using winetricks now, and scripts that already use it will be modified as soon as possible.

Edited by GNU_Raziel

Unkuiri Monday 20 September 2010 at 21:52
Unkuiri

How can I do it? Should I use the script from the repository for Internet explorer 6 as a base?

For wininet from IE 5.0.1 should i use this?:
POL_Call POL_Function_OverrideDLL native,builtin wininet

How can I use with this function the downloaded wininet.dll from this part of the script?:

DOWNLOADLINK[4]="http://download.microsoft.com/download/ie5/Update/1/WIN98/EN-US/3725.exe"
COMPONENTNAME[4]="wininet from IE 5.0.1"
WINETRICKSNAME[4]="wininet"

(I suppose this is necessary for the good functioning of the program/installation)
Unkuiri Monday 20 September 2010 at 21:57
Unkuiri

Any idea to make the drag and drop of pictures work? for example in Word now I can copy-paste a picture from the net to word or powerpoint perfectly but it would be cool for drag and drop to work...:P

Thanks for your help..:)...
Unkuiri Tuesday 21 September 2010 at 0:44
Unkuiri

I've made a script to install the wininet from IE 5.0.1 (based on another function script), here it goes:
#!/bin/bash
# PlayOnLinux Function
 
# Date : (2010-09-20 23-28)
# Author : Unkuiri
# Licence : 
# Depend : none
 
cd "$REPERTOIRE/ressources"
#downloading wininet from IE 5.0.1
if [ ! -e "3725.exe" ]; 
then
POL_SetupWindow_download "Downloading" "wininet" "http://download.microsoft.com/download/ie5/Update/1/WIN98/EN-US/3725.exe"
fi
 
POL_SetupWindow_wait_next_signal "PlayOnLinux is installing wininet" "wininet"
 
cd "$REPERTOIRE/ressources"
mkdir "wininet"
cd wininet
cabextract "../3725.exe"
 
mv "./wininet.dll" "$WINEPREFIX/drive_c/windows/system32"
 
cat << EOF > OGL.reg
[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DllOverrides]"wininet"="native,builtin"
EOF
regedit OGL.reg
 
cd "$REPERTOIRE/ressources"
rm -rf "wininet"
 
POL_SetupWindow_detect_exit


What do you think?Can this work?Can I submit it to validation?
Unkuiri Tuesday 21 September 2010 at 1:09
Unkuiri

(Answering my own question (the drag and drop problem): http://bugs.winehq.org/show_bug.cgi?id=24289)
Unkuiri Tuesday 21 September 2010 at 4:54
Unkuiri

I've taken away all the "winetricks" from the office script and made two functions scripts for wininet (from IE 5.0.1) and for ie6, should I submit them to validation or should I put them here first? Because they may need some corrections, I'm not an experienced scripter...:incertain:

Edited by Unkuiri

GNU_Raziel Tuesday 21 September 2010 at 10:12
GNU_Raziel

It seems good, call it POL_Install_wininet and submit it as a function, when it's done i will validate it so you will be able to test you office 2007 script with this function and see if all is ok.

Oh, and delete this part too :
POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
}
.
.
.
POL_SetupWindow_make_icon_for_shortcut "Microsoft Office ${APPNAME[$i]} 2007" "${ICOINDEX[$i]}"


and use :
POL_SetupWindow_auto_shortcut "$PREFIX" "main_application_exec.exe" "" "$TITLE" ""

instead of POL_SetupWindow_make_shortcut. It's a newer and cleaner way. If POL cannot extract icon by itself then provide it as png file (32x32 minimum) and I will add it to the server.

I may be boring for you but we want to clean all the mess done in some scripts with time, we will re-post soon a complete guide to make clean scripts.

Edited by GNU_Raziel

GNU_Raziel Tuesday 21 September 2010 at 10:21
GNU_Raziel

Functions validated, make the last modifications to your script, test it and submit it when all is ok/clean :)
Unkuiri Tuesday 21 September 2010 at 14:40
Unkuiri

Should I delete all the parts about the shourtcut-making?:
for i in `seq 0 5`;
do
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Office/Office12"
if [ -e "$WINEPREFIX/drive_c/$PROGRAMFILES/Microsoft Office/Office12/${EXENAME[$i]}.EXE" ]; then
POL_SetupWindow_make_icon_for_shortcut "Microsoft Office ${APPNAME[$i]} 2007" "${ICOINDEX[$i]}"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Microsoft Office/Office12" "${EXENAME[$i]}.EXE" "" "Microsoft Office ${APPNAME[$i]} 2007" "" ""
Set_WineVersion_Assign "$WORKINGWINEVERSION" "Microsoft Office ${APPNAME[$i]} 2007"
 
appdir=$(detect_appdir "Microsoft Office ${APPNAME[$i]} 2007")
cd "$REPERTOIRE/configurations/installed"
mv "Microsoft Office ${APPNAME[$i]} 2007" "Microsoft Office ${APPNAME[$i]} 2007.bak"
cat "Microsoft Office ${APPNAME[$i]} 2007.bak" | head -n5 > "Microsoft Office ${APPNAME[$i]} 2007"
echo "docname=\\${1##*/}" >> "Microsoft Office ${APPNAME[$i]} 2007"
echo "docpath=\\${1%/*}" >> "Microsoft Office ${APPNAME[$i]} 2007"
echo "cd \\"\\$docpath\\"" >> "Microsoft Office ${APPNAME[$i]} 2007"
echo "wine \\"$appdir/${EXENAME[$i]}.EXE\\" \\"\\$docname\\"" >> "Microsoft Office ${APPNAME[$i]} 2007"
rm "Microsoft Office ${APPNAME[$i]} 2007.bak"
 
fi
done 
Unkuiri Tuesday 21 September 2010 at 16:34
Unkuiri

I need to edit the POL_Install_ie6 script, is giving an error...
I need to delete the part:
POL_SetupWindow_auto_shortcut "InternetExplorer6" "iexplore.exe" "" "Internet Explorer 6"
that appears in the end and calls for a Prefix that does not exist and we don't need a shortcut for ie6 in PlayOnLinux, we are installing other apps with this function...
Unkuiri Tuesday 21 September 2010 at 16:42
Unkuiri

With some more editions:
#PlayOnLinux Function file
#Installs Internet Explorer 6
 
POL_SetupWindow_Init
 
MS_LICENCE="$SITE/divers/ie_license.txt"
 
cd $REPERTOIRE/tmp/
wget "$MS_LICENCE" -q
 
POL_SetupWindow_licence "Please read this carrefully" "Licence" "$REPERTOIRE/tmp/ie_license.txt"
 
 
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
POL_Call POL_Install_msls31
POL_Call POL_Function_OverrideDLL native,builtin iexplore.exe itircl itss jscript mlang mshtml msimtf shdoclc shdocvw shlwapi urlmon
 
POL_LoadVar_PROGRAMFILES
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Internet Explorer/"
mv iexplore.exe iexplore.bak
cd ..
 
cd "$WINEPREFIX/drive_c/windows/system32"
for dll in itircl itss jscript mlang mshtml msimtf shdoclc shdocvw shlwapi urlmon
do
  [ -f "$dll.dll" ] && mv "$dll.dll" "$dll.bak"
done
 
Set_OS win2k
 
mkdir "$REPERTOIRE/tmp/ie6"
cd "$REPERTOIRE/tmp/ie6"
POL_SetupWindow_download "Downloading ie6sites.dat" "Internet Explorer 6" "http://www.microsoft.com/windows/ie/ie6sp1/download/rtw/x86/ie6sites.dat"
POL_SetupWindow_download "Downloading ie6setup.exe" "Internet Explorer 6" "http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/EN-US/ie6setup.exe"
 
cd "$WINEPREFIX/drive_c/windows/system32"
rm browseui.dll
rm inseng.dll
 
cd "$REPERTOIRE/tmp/ie6"
POL_SetupWindow_wait_next_signal "Installing internet explorer 6" "Internet Explorer 6"
wget $SITE/divers/ie6reg.reg
wine regedit ie6reg.reg
wine ie6setup.exe
POL_SetupWindow_detect_exit
 
POL_SetupWindow_pulsebar "Installing libraries" "Internet Explorer 6"
cd "$WINEPREFIX/drive_c/windows/system32"
PULSE=0
for file in actxprxy.dll browseui.dll browsewm.dll cdfview.dll ddraw.dll dispex.dll dsound.dll iedkcs32.dll iepeers.dll iesetup.dll imgutil.dll inetcomm.dll isetup.dll jscript.dll laprxy.dll mlang.dll mshtml.dll mshtmled.dll msi.dll msident.dll msoeacct.dll msrating.dll mstime.dll msxml3.dll occache.dll ole32.dll oleaut32.dll olepro32.dll pngfilt.dll quartz.dll rpcrt4.dll rsabase.dll rsaenh.dll scrobj.dll scrrun.dll shdocvw.dll shell32.dll urlmon.dll vbscript.dll webcheck.dll wshcon.dll wshext.dll asctrls.ocx hhctrl.ocx mscomct2.ocx plugin.ocx proctexe.ocx tdc.ocx webcheck.dll wshom.ocx
do
  sleep 0.1
  POL_SetupWindow_set_text "$file"
  wine regsvr32 /i $file
  [ $PULSE = 100 ] || PULSE=$(( PULSE + 2 )) 
  POL_SetupWindow_pulse $PULSE
done
 
POL_SetupWindow_improve_fonts
 
POL_SetupWindow_detect_exit
GNU_Raziel Tuesday 21 September 2010 at 19:34
GNU_Raziel

Unkuiri Wednesday 22 September 2010 at 0:40
Unkuiri

The function: "POL_SetupWindow_auto_shortcut" isn't working, here we need to make many shortcuts for the same prefix and it only makes one...:(..
GNU_Raziel Wednesday 22 September 2010 at 1:38
GNU_Raziel

You mean with differents arguments ? then it's easy :

POL_SetupWindow_auto_shortcut "TARGETED_PREFIX" "NAME_OF_THE_EXEC.exe" "ICON_FOR_THE_EXE" "LAUNCHER_NAME" "ARGUMENTS_FOR_THE_EXE"


for example :
POL_SetupWindow_auto_shortcut "steam" "steam.exe" "" "Launching HL2" "-appid 220  -heapsize 256000"
POL_SetupWindow_auto_shortcut "steam" "steam.exe" "" "Launching CSS" "-appid 240  -heapsize 256000"


As long as you do not give the same launcher name, you can make as many auto_shortcut commands as you want :)

Edited by GNU_Raziel

Unkuiri Wednesday 22 September 2010 at 4:03
Unkuiri

I mean for example something like this:
POL_SetupWindow_auto_shortcut "$PREFIX" "${EXENAME[$i]}.EXE" "${ICONINDEX[$i]}" "Microsoft Office ${APPNAME[$i]} 2007" ""
(with the arguments given before in the script.)
Why this doesn't work?Should I make one for each icon i want to add?

(SOLVED - I was missing the initial part about "seq"...sorry...:P)

Edited by Unkuiri

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