Tutorial: how to virtualize Office 2007 SP3 with Spoon Studio

Discussion in 'Virtualization' started by a_catalin, Nov 2, 2011.

  1. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    #1 a_catalin, Nov 2, 2011
    Last edited: Nov 5, 2011
    I received a request by PM to make such a tutorial.

    What you need:
    1. VirtualBox
    2. installation CD/DVD for each OS in which this application would run. It's not absolutely necessary to install for all these OS's and you can use only Windows XP x86 but it will increase the chances that it will work fine on the other OS's as well.
    3. Spoon Studio last version (9.5.2025 is now the latest)
    4. Spoon Studio 9.1. If you use only one OS in VirtualBox it's not necessary.
    5. Microsoft Office 2007 + SP3 + Language pack + proofing tools for your language.

    Install each OS in VirtualBox, install Spoon Studio last version and at "Shared folders" set an folder that you will use to copy the project from the virtual machine to the real computer. It will be mounted in the virtual machine as a new drive letter.
    Take a snapshot and set each machine to restore the latest snapshot when you close it.

    Start each Os in VirtualBox. Start Spoon Studio and click on "Capture before" (don't use the wizard).
    Install Microsoft Office 2007 SP3, Language Pack and proofing tools.
    I would recommend installing only what you'll really use, since its speed dependent on its final size. Also select on each one "Run all from My computer".
    Delete C:\MSOCACHE folder.
    Go to "c:\WINDOWS\Installer" folder (it's usually hidden so you need to modify your File Manager to see it). Erase $PatchCache$ folder and every other file. Finally you'll have only some folders like this: "{350C97B0-3D7C-4EE8-BAA9-00BCB3D54227}".
    Start the exes that you will use and deactivate online update completely. You can customize them if you want.
    Some shortcuts point to exes in those folders from "c:\WINDOWS\Installer" folder. Recreate them to point to the real exes from c:\Program Files.
    For example Microsoft Office 2007 Language Preferences.lnk has to point to "C:\Program Files\Microsoft Office\Office12\SETLANG.EXE".

    To ensure that all the child processes are closed when you close the virtual application do this:
    In Internet Explorer, select Tools > Internet Options. On the Advanced tab, select the Disable Script Debugging (Other) check box and the Disable Script Debugging (Internet Explorer) check box (if any was unchecked).
    In the Windows control panel, select Regional and Language Options. On the Languages tab, click Details. On the Advanced tab, select the Turn off advanced text services check box.
    From the desktop, select Start > Run and run the "Regsvr32.exe /u msimtf.dll" and the "Regsvr32.exe /u Msctf.dll" commands. These two are necessary when you install in Windows XP, in Windows Vista/7 they are not absolutely necessary.

    In Spoon Studio's interface click on "Capture and diff". Save the project in that mounted drive that is connected to the folder on the real computer. If you used multiple OS's in VirtualBox save each project in its own folder.
    In Windows Vista/7 projects delete:
    - FileSystem >> System Drive >> Windows >> winsxs\ManifestCache folder from interface and "Files\OS\winsxs\ManifestCache" from HDD;
    - FileSystem >> System Drive >> Windows >> Microsoft.NET\Framework\v2.0.50727\ngen_service.log" file from interface and "Files\OS\Microsoft.NET\Framework\v2.0.50727\ngen_service.log" file from Hdd.
    This is just "garbage" which sometimes appears in the captured installation, it's not absolutely necessary to delete them.

    If you captured in multiple OS's in VirtualBox, on the real computer start Spoon Studio 9.1. Go to Advanced >> Merge Platforms. Select the xappl file for each OS, set a name for a xappl in "Merge Configuration path" and click on Merge.
    Close Spoon Studio 9.1 and start the latest version. Load the saved project.
    Go to Settings >> Property. Uncheck Inherit properties. Click on Browse and select "Files\Default\ProgramFilesCommon\Microsoft Shared\OFFICE12\MSOXMLED.EXE" or "Files\ProgramFilesCommon\Microsoft Shared\OFFICE12\MSOXMLED.EXE" for one OS.
    You can modify also the other values from the edit boxes.
    Go to Settings >> Process configuration.
    At "Application sandbox location" use something like "@APPDIR@\MicrosoftOffice2007SP3Files" for portable and "@APPDATALOCAL@\MicrosoftOffice2007SP3" for "static".
    For portable you can also check "Compress payload" if you will load the application from a slow storage device but on a computer with fast CPU. It will increase the startup speed.
    On the top of Spoon Studio's interface click on "Multiple" and uncheck all of them.
    For the Output file name you can choose something like "Microsoft Office 2007 Sp3 Portable.dat" if you're making a portable application, otherwise change the "dat" extension to "exe".
    In Setup section you can choose to make an MSI installer for the application (if it's "static"). If the "Compress payload" is not checked it will save space on your storage device. Also it will associate file extensions with exe files from the virtual environment and it will create shortcuts.
    Click on Build.

    If you want to make a portable application you can use ExeBuilder to create the exe files.
     
  2. providensia

    providensia MDL Novice

    Aug 7, 2009
    6
    0
    0
    thanks nice tutorial :)
     
  3. wiryawang

    wiryawang MDL Junior Member

    May 10, 2007
    54
    2
    0
    Great Tutorial, will give it a try, how about Tutorial for Office 2010 ? Any luck doing it happen on Office 2010 using Spoon Studio?
     
  4. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    Unfortunately the current version of Spoon Studio has some problems with Office 2010 which can be solved only by the programmers who made it...
     
  5. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    I made some small improvements to the tutorial...
     
  6. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,780
    180
    Could only manage to get it working on plain XP SP3. Win 7 x86 (on a number of tries) did not work (created app was giving all kind of error never running at all)

    The app created on XP works fine even on Win7 x64

    Only issue I have is that double click on docx gives error Office2007SP3.exe (the exe I create) can not be found, but after OK the document opens fine

    sebus
     
  7. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    #7 a_catalin, Nov 19, 2011
    Last edited: Nov 19, 2011
    (OP)
    Ok.
    The docx association was set by you manually or have you used the msi installer made by SpoonStudio/ZAV?
    If you use the snapshot to clean the virtual machine when you try the virtualized Office in the virtual machine shows the same error? And on other computers too?
     
  8. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,780
    180
    I did not use msi (not really keen on it). I suppose the association was set manually (it was not me testing it, I gave it to my co-worker)

    I can only answer the other 2 Q on Monday

    sebus
     
  9. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    Well, usually the file associations made by the msi work better.
    On the other hand when the virtualized application was not started for some time (so is not cached/buffered in memory) it will sometimes generate problems because it will not load fast enough for the function that is starting it. For example I have some problems with Total Commander: I browse a compressed file in a panel and double click on a doc file. Word is starting slowly and says that the file doesn't exist. I try again, is starting fast and this time is loading the doc file. What is happening: Total Commander is uncompressing the doc file in temp folder and is waiting for Word to load it. After some time is giving up and is erasing it.
     
  10. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,780
    180
    No matter what I try, I (or my users) get this error, which is really annoying

    Anybody has any more suggestions?

    sebus
     
  11. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    I assume you tested in a clean virtual machine and you have the same error.
    I will send a pm with the links to my version, so you can test with it. This way we will know for sure that the problem is with the OS or with your virtualized Office.
     
  12. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,780
    180
    I think the problem is with the way virtual apps work... not the OS or the version user/built

    If I start Word from the shortcut to the exe all works fine

    It is only the association & double click execution that does give the error

    sebus
     
  13. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    I'm not so sure.
    You can try to duplicate the docx association made by my msi in registry so it will work with your exe...
    I remember that if you set the association using "Open with" it will not work ok 100% (probably because it's using DDE).
    If you want I will send you a program that captures registry changes. It will help you find the docx association...
     
  14. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,780
    180
    #14 sebus, Jun 20, 2012
    Last edited: Jun 20, 2012
    Thanks, but I am fine with that, I will do it tomorrow & post my findings

    I wonder if it has anything to do with the fact that I also used ExeBuilder to create the actual exes

    sebus
     
  15. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    #15 a_catalin, Jun 20, 2012
    Last edited: Jun 20, 2012
    (OP)
    Well, it might, because the exes generated by ExeBuilder are designed to access the dat files normally so they are not sending the DDE parameters.
    Instead of using just one exe, you're trying to send the docx name to an exe that it will load another exe (with the dat extension).
    Anyway I didn't made ExeBuilder for "static" applications, I made it for portable aplications.

    But you never mentioned that before, I assumed that you have only the exe generated by Spoon Studio.
    I'm curious what advantages you see by using the exes generated by ExeBuilder?
     
  16. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,895
    1,780
    180
    It was one of my many projects going on some time ago. At the time it was looking like a good clean solution (portable apps are nice, they leave no s**t on the local machine)

    In fact none of my files is .dat (it is actually Office2007.exe)

    sebus
     
  17. Gabee8

    Gabee8 MDL Novice

    Oct 3, 2010
    2
    0
    0
    I create office 2k7 portable this tutorial.

    Start for word or excel show this messenge:
    "Microsoft Office has not been installed for the current user"

    Delete this folder:
    %PROGRAMDATA%\Microsoft\Office\Data

    and no changes...

    Please help.
     
  18. a_catalin

    a_catalin MDL Member

    Mar 4, 2011
    166
    62
    10
    Hi.
    What kind of key have you used? Volume license key or other type?
     
  19. Gabee8

    Gabee8 MDL Novice

    Oct 3, 2010
    2
    0
    0
    Enterprise (hungarian) office. No activation this office.

    I create summer this office portable this tutorial. OS: Win xp virtualbox (but now windows 7 os create) and working office portable but 1 bug in the program: spell check not working!

    That's create new portable app.
    (sorry my bad english)