Video Screencast Help
Scheduled Maintenance: Symantec Connect is scheduled to be down Saturday, April 19 from 10am to 2pm Pacific Standard Time (GMT: 5pm to 9pm) for server migration and upgrade.
Please accept our apologies in advance for any inconvenience this might cause.

Capturing Office on Windows 7

Created: 01 Apr 2010 • Updated: 29 Jul 2010 | 16 comments
Language Translations
Jordan's picture
+3 3 Votes
Login to vote

Many veteran SWV users know that we tell people not to capture Office 2007 or Office 2010 on Windows 7 (or Vista) because of transacted installs, but I’ve never really gone into why and how you can capture Office on Windows 7 and deploy it properly.

This article builds on my previous article on Microsoft Office issues like fonts and short file names but does not repeat that information in full.

Transactions

Office 2007 requires Microsoft Visual C++ 2005 Runtime to run, and Microsoft Visual C++ 2005 Redistributable is a transacted install.  Why that’s a problem is when SWV is working to place content into a layer if a transacted install comes up our driver SWV stops following the procedure because SWV doesn’t know how to handle transactions.  Because of this anything that’s being transacted during the install gets installed, or leaked, into the base instead of into the layer. 

Since everything is in the base after the install the layer will work just fine when you test it on the machine it was captured on, but when you migrate it from one machine to another the leaked items—in the case of Microsoft Visual C++ 2005 Redistributable registry keys and SxS files—don’t exist so Office runs a repair to reinstall all the missing Microsoft Visual C++ 2005 Redistributable components.  Because this repair is also is transacted everything, once again, goes to the base instead of to the layer.

Office 2007

So how do you get around this?  Simply install Microsoft Visual C++ 2005 runtime to the base before running your virtualized application, but not just any version of Microsoft Visual C++ 2005 Redistributable —as Office expects version 8.0.50727.42 to be on the machine.  Since there can be more then on version of VS2005 installed on a machine, and unlike .Net now backwards compatible, you’ll have to check to make sure you’ve got the correct version on the system.
This can be simply done via WMI by querying against the Win32_Product object like so:

 

strComputer = "."

	Set objWMIService = GetObject("winmgmts:" _

	    & "{impersonationLevel=impersonate}!\\" _

	    & strComputer & "\root\cimv2")

	Set colSoftware = objWMIService.ExecQuery(_

	    "Select * from Win32_Product " & _

	    "Where Caption =" _

	        & " 'Microsoft Visual C++ 2005 Redistributable' AND Version="_

	& " '8.0.50727.42' ")

	For Each objItem in colSoftware

	    Wscript.Echo "Name: " & objItem.Name

	    Wscript.Echo "Version: " & objItem.Version

	Next

 

Install the correct version

The correct version of Microsoft Visual C++ 2005 Redistributable can be downloaded directly from Microsoft via this link http://www.microsoft.com/downloads/details.aspx?familyid=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en

The installer needs to be version 6.0.2900.2180 and once installed you can check in the Control Panel to make sure the correct version of Microsoft Visual C++ 2005 Redistributable, version 8.0.50727.42, was installed.

Office 2007 SP2 and above

If capturing SP2 of Office you’ll need to install version 8.0.50727.42 as well as version 8.0.50727.762 which is SP1 of the VC++ 2005 runtime. 

Install the correct version

The correct version of Microsoft Visual C++ 2005 SP1 Redistributable can be downloaded directly from Microsoft via this link http://www.microsoft.com/downloads/details.aspx?fa...
The installer needs to be version 6.0.3790.0 and once installed you can check in the Control Panel to make sure the correct version of Microsoft Visual C++ 2005 Redistributable, version 8.0.50727.762, was installed.

Office 2010

Like Office 2007 Microsoft Visual C++ Runtimes are required for Office 2010, however they’re a different version then Office 2007 as you’ll need the Visual C++ 2008 SP1 Runtime which is version 9.0.30729. Below I’ve modified the WMI script that we used to detect the Visual C++ 2005 Runtime that Office 2007 needs to look for the correct version for Office 2010:

 

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery(_
    "Select * from Win32_Product " & _
    "Where Caption =" _
        & " 'Microsoft Visual C++ 2008 Redistributable – x86 9.0.30729.17' AND Version="_
& " 9.0.30726' ")
For Each objItem in colSoftware
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Version: " & objItem.Version
Next
 

 

Install the correct version

The correct version of Visual C++ 2008 Redistributable can be downloaded directly from Microsoft via this link http://www.microsoft.com/downloads/details.aspx?fa...

The installer needs to be version 9.0.30729.17 and once installed you can check in the Control Panel to make sure the correct version of Microsoft Visual C++ 2008 – x86 Redistributable, version 9.0.30729, was installed.

Capture Best Practices

Visual C++ Runtime

The method in this article will work just fine if you capture without the required Microsoft Visual C++  Redistributable in the base as long as it’s installed on the client machine before Office is run, but Microsoft Visual C++ should be installed to the base, in other words not captured into a layer, before capturing Office into a layer.  The reasoning behind this is that the layer will see what’s in the layer before it sees what’s in the base.  So if you have some Microsoft Visual C++ Redistributable DLLs in your layer and the base and then an update comes out for Microsoft Visual C++ Redistributable that Office needs and it’s installed to the base then Office will still see the old DLLs that are in the layer.

Short File Names

Many of the issues with Office in a layer are related to short file names (8.3 names) and on Windows 7 the issue still exists due to the default folders named Microsoft that are included with a Windows 7 install.  The easiest way around this is to install Office to a non default location that won’t generate the 8.3 name Micros~1, examples would be MSOffice2007 or Office2007.  See the article referenced at the beginning of this guide for more information such as some of the issues caused by short file names.

Comments 16 CommentsJump to latest comment

trb48's picture

Would it help to install Visual C++ to the base when creating a Office 2007 layer in XP?

0
Login to vote
Jordan's picture

I would suggest it if you're going from XP -> Win7 then this just your layer smaller and prevents any possible conflicts if Microsoft ever releases a patch for the VCruntime that isn't a Service Pack that installs independently.   If you're exporting from XP -> XP then this would add a step and not quite as useful.

If a forum post solves your problem please flag is as the solution

0
Login to vote
Palvaran's picture

Thanks so much for that Jordan!  I am hoping this can help us with some of the more complicated packages such as Autocad.

My only question is how do you query the WMI interface?  Is it as simple as taking the query, creating a .vbs file, and running it inside of a command window?

Systems Administrator
Rice University

Remember, "The happiness of your life, depends on the quality of your thoughts."

0
Login to vote
Palvaran's picture

Ok I think I see.  https://www-secure.symantec.com/connect/articles/quick-way-write-svs-scripts 

You just customize the query from inside that tool is that correct or is there a better way to do it?

Systems Administrator
Rice University

Remember, "The happiness of your life, depends on the quality of your thoughts."

0
Login to vote
Jordan's picture

There are two article by me, one covering WMI with VBS and the second with how to do it with C#, that cover how to do this.

Here's the link to my VBS article https://www-secure.symantec.com/connect/articles/svs-and-wmi-windows-management-instrumentation

For autocad make sure that .Net (3.5 i believe), visual C++ 2005 runtime are in the base and not the layer.  Also it appears that the licensing server also has to be in the base as well if you're using that.

If a forum post solves your problem please flag is as the solution

0
Login to vote
EddieNYC's picture

Has anyone been able to capture and run perfectly using the 2010 RC?

To capture here's what I did.

WIN 7 vanilla, added the C++ on base:
1. capture using the cmd.exe capture method on SWV 6 SP2 MP1
2. at the point where it says it doens't have permission, regedit.exe int the cmd.exe window and give network permissions to the office security hive
3. complete the capture

Import to another Win7 regular machine with our applications and what not.
1. import and activate (no issues)
2. When you run any office app for the first time, it goes through some office config thing then opens
3. If you open the trust center then click Trust Center settings under options, it will hang
4. If you open Word, it gives you the not enough resources to display error (even after you copy the fonts to the base - as copyfonts.exe doesn't work for SP1 MP1 or use the exclude [FONTS] option to the layer).  Also only 3 of the 100+ fonts is displayed in the font drop down...

I also tried using the newer builds betas (6.2.1291 and 6.1.5124) which capture the layer without needing to allow the trust center settings in the registry, but they fail to import.

"Rather fail with honor than succeed by fraud." - Sophecles

0
Login to vote
Jordan's picture

I have, but Office 2010 will only be supported. I believe, in SWV 6.2 and later (the beta doesn't have all the fixes in it).

You're capturing it correctly however you're not laying down C++ in the base of the machine where office is being run, that will fix #2 on your list.  #3 we're looking into and #4 is fixed in 6.2 as well.

If a forum post solves your problem please flag is as the solution

0
Login to vote
EddieNYC's picture

Thanks Jordan.  I'll contact our rep to get the latest beta 6.2 build for testing then.  Is there any ETA of when the dev team will get 6.2 into production?

Oh yes, forgot to mention that the C++ libraries were installed to the base on the target machine as well.

"Rather fail with honor than succeed by fraud." - Sophecles

0
Login to vote
EddieNYC's picture

Jordan on the target machine the Visual C++ 2008 libraries are installed but it still goes through that initial config (at least with the RC installer) if you run any office 2010 RC app for the first time...

Also looks like RTM is due out next week...  do we know if the SWV dev team has resolved these issues in 6.2 yet so that we can deploy it out as a layer for our Office 2010 pilot?

"Rather fail with honor than succeed by fraud." - Sophecles

0
Login to vote
Jordan's picture

From my testing with the current internal build they all have.  You still need to lay down the Visual C++ libraries if capturing on Win7 (Remember that office 2010 requires 2008 SP1) but all the other issues (fonts, trust center) should be working.

If a forum post solves your problem please flag is as the solution

0
Login to vote
EddieNYC's picture

Is there any ETA on 6.2 SWV's release?  Ideally I'd like to build the RTM layer when it is out for software assurance in 5 days (April 27th).

"Rather fail with honor than succeed by fraud." - Sophecles

0
Login to vote
Jordan's picture

I don't comment on release dates on Connect but I can tell you that it won't be out this month.

If a forum post solves your problem please flag is as the solution

0
Login to vote
EddieNYC's picture

Ok.  I'll ask my Symantec enterprise support rep to get me the internal 6.2 build then so that way I can test against it and report any issues with the RTM if any.  Thanks for the help so far Jordan, it's much appreciated!

"Rather fail with honor than succeed by fraud." - Sophecles

0
Login to vote
ManelR's picture

Hi Jordan,

If you install VC++ 2005 Runtime SP1 after VC++ 2005 Runtime you'll get 8.0.56336 version in the control panel.

And, if you install ATL patch for VC++ 2005 Runtime you'll get 8.0.59193 version in the control panel.

The only order to have all versions is to setup first SP1 and next the original runtime: you'll get 8.0.50727.42 and 8.0.50727.762.

So the question is:

- If we setup directly the version with the ATL patch and we have an Office 2007 installation with MSP updates in the UPDATES directory (for example, SP2), will this be enough for capturing right under Windows 2007?

Thanks.

PS: For capturing the Document Imaging printer you'll need to do the same as for capturing the Acrobat one, isn't it?

Edit: I've just installed, for testing, Project 2007 with updates (including SP2) and I don't get any VC++ 2005 runtime installed. The only runtime is the VC++ 2008 included with 6.1 SP6 MP1. Is the installation detecting this runtime as "good" for their purposes? If yes, there is a need to update the instructions ;-)

IT Systems Manager
LCFIB - Computing Lab
Barcelona School of Informatics
Universitat Politècnica de Catalunya - Barcelona Tech
0
Login to vote
Jordan's picture

My guess for the ATL issue is yes, this would behave the same way in the base as in the layer, because to install the ATL patch you need to have the runtimes installed in the first place.  But I've never tested them.

For the printer you are correct, I've never tried it, but it should be the same as any other printer you want to capture with SWV.

If a forum post solves your problem please flag is as the solution

0
Login to vote
stephenix1015's picture

Molleindustria shows us what should be obvious, calling to our attention the detrimental effects of videogames, the flaws in modern parenting, and America’s use of drones in conflicts in the Middle East. -
Michael Courouleau

-1
Login to vote