Tweak winetricks to install MSOffice from local folder

Winetricks is a very handy and useful application for installing a lot of windows applications on Linux systems. It is available in the Ubuntu wine ppa . Recent editions of the winetricks application allows you to install MSOFFICE 2007 and 2003 very easily. It creates a separate wineprefix for the MSOffice and makes installation a breeze. There is no need to install any extra .exe file. It auto-launches the setup.exe file as well! However, there is one caveat. It only allows installation from a cd or dvd  .
If you have the ms office setup in your hard drive, it will not recognise it and you will have to run pillar to post to install it from a different location. But, the good news is, since winetricks is a bash program, it can easily be tweaked.
If you have installed winetricks from ubuntu wine ppa, you are most likely to find the file in /usr/bin
So, to edit it, open the file in your favourite editor. I use vi, but for the sake of simplicity, I will use gedit. 
Open the winetricks in gedit by pasting the following command in Alt+F2
gksu gedit /usr/bin/winetricks
The system will ask for your password, enter the password. Once the file is opened, go to line no 7815 and comment out the line
“w_mount OFFICE12” by adding “#” in front . So the final change would look like this :
#w_mount OFFICE12
Do the same for the next line, 7816 . The final change should look like this:
#w_read_key
Now, add the path to where your MS Office setup file is stored. For example, if the file is stored in /home/username/Downloads/MSOffice2007, then add a command in the next line like this:
cd /home/username/Downloads/MSOffice2007
Now, 12 lines below, comment out the line in blue, 
$WINE ${W_ISO_MOUNT_LETTER}:setup.exe /config “$W_TMP_WIN”config.xml
so that it looks like this
#$WINE ${W_ISO_MOUNT_LETTER}:setup.exe /config “$W_TMP_WIN”config.xml
and then add this line
$WINE setup.exe /config “$W_TMP_WIN”config.xml
and 14 lines below, comment out
w_try $WINE ${W_ISO_MOUNT_LETTER}:setup.exe
and add
 w_try $WINE setup.exe

Note: if you find the line numbers confusing, just search for the words in gedit. 

Save the file  and then run winetricks from the dash or the terminal. Now, winetricks will directly run the setup.exe file without any intervention. All you would need to do is furnish the Serial Key.

You can use the same procedure for Office 2003. Just use the section which says w_mount OFFICE11

PS: This tutorial does not encourage you to install pirated copy of MSOffice in any way. We always recommend users to use the free LibreOffice which is just as good. If you need to use MSOffice, please buy a legitimate copy before installing.

Leave a Reply

tuxtrixmod
Scroll to Top