Deployment Solution

Office 2007 Silent Installation Lessons Learned 

05-02-2008 02:31 PM

If you have been holding back on installing Office 2007, you will most likely be installing Office 2007 on a multitude of systems. If you have already created a distribution method for Office 2007, turn around, do not pass go, this document is not for you. If you have not undertaken this journey yet, hold on to your pants and continue reading. The goal of this document is to help you achieve a comfort level that will take you into the advanced features of creating a silent installation, without you having to step into the same pot holes as I did. Please comment on this document in order to make future documents even better.

Sources:

Most of the information in this documentation was learned from the documents located at the following site: http://technet.microsoft.com/en-us/library/cc303401.aspx

Requirements:

Windows installer 3.1

First and foremost, windows installer must be version 3.1 or greater. Updating windows installer is relatively simple and below is some code to check the current version and update it if necessary. The installer can be downloaded at http://www.microsoft.com/downloads/details.aspx

You must first check the installed version to determine if an update is required. If required, call the windows installer update subroutine below to update the version to 3.1. The install code will run the installation and verify the return code against a list to verify success.

'~~~~~~~~~~~~ Variable Declarations ~~~~~~~~~~~~~~~~~
	Const For_Reading = 1
	Const For_Writing = 2
	Const For_Appending = 8
Dim strWinVer
Dim intRetVal
Dim strAuditFile
Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objShell = CreateObject("WScript.Shell")
strAuditLoc = "c:\MyCoName\audit\audit.log"
strInstLoc = "C:\MyCoName\install\Office2007\"

'######### MAIN #############
checkWinstallerVer
'###########################

'#######################################################Sub checkWinstallerVer
	'LOGIT "[checkWinstallerVer]"
	Set objWMIService = GetObject("winmgmts:" _ 
	& "{impersonationLevel=impersonate}!\\.\root\cimv2") 
	Set colFiles = objWMIService.ExecQuery _ 
	("Select * from CIM_Datafile Where name = 'C:\\Windows\\System32\\Msi.Dll'") 
	
	For Each objFile in colFiles 
		'LOGIT "Windows Installer Version Is : " & objFile.Version 
		strWinVer = Left(objFile.Version, 3)
		If strWinVer < 3.1 Then
			InstallWinstaller31
		End If
	Next
End Sub
'#######################################################Sub InstallWinstaller31
LOGIT "[InstallWinstaller31]"
	strLaunchCmd = strInstLoc & "WindowsInstaller31x86 /passive /norestart /forceappsclose"
		intRetVal = objShell.Run(strLaunchCmd,1,True)
			
			Select Case intRetVal
				Case 0
		 			'LOGIT "Windows Installer upgrade was successful"
				Case 3010
 					'LOGIT "Windows Installer upgrade was successful"
				Case Else
'LOGERROR "Windows Installer upgrade WAS NOT successful!! QUITTING INSTALLATION! Error: " & intRetVal
					WScript.Quit(51)
			End Select
End Sub

Some interesting interactions occurred while working on this project. Initially, the new MSP file sounded as though it would be the answer to a silent installation. The MSP file is the counterpart to the old transform file that was previously used to deploy Office in a silent manner. It is relatively simple to access and create a MSP file using the built in Office Customization Tool (OCT) but you must first be utilizing the proper version of Office 2007 setup. The version used in this example was Office 2007 ProPlus but the OCT is not available in some lesser versions. Please check with Microsoft to get additional information. Perhaps someone knowledgeable on this topic can provide additional information about this. If you are unsure what version you have, check the version.WW file located in the root of your installation media.

The options are: Enterprise.WW; ProPlus.WW; Standard.WW; Pro.WW

Now that the disclaimer has been offered, the OCT can be accessed using the simple command line "%path%\Setup.exe /Admin".

If you do not put the customization file in the Updates folder, you can use the Setup command-line option /adminfile to specify the fully-qualified path to the file.

MSP File

The problem with using the MSP file is that it can only be used on a system one time. It is not possible to create an installation of Word and using a MSP file to perform the installation, and then attempt to reconfigure or add another component, such as Outlook using a different MSP file. After the initial installation is performed using an MSP file, you must utilize another new format to do additional installations. This new method utilizes a XML file and is discussed below.

Config.xml

In the 2007 Office release, the role of the INI file has been largely taken over by the Config.xml file. If you are new to XML, don't fret. There are some initial rules you will need to know in order to keep yourself out of trouble.

Comments are wrapped with "<!-- Comment -->".

The text inside of the brackets can be formatted in any manner, but the text is case sensitive.

Example:

<MinOSRequirement VersionNT="501" WindowsBuild="2600" ServicePackLevel="2 or greater" />

Is parsed exactly the same as:

 <MinOSRequirement 
  VersionNT="501" 
  WindowsBuild="2600" 
  ServicePackLevel="2 or greater" 
/>

Below is the Config.xml file that was developed for my specific installation. MS Access has been removed because of compatibility issues between older versions on the new version. Hopefully the XML file will be very transparent to comprehend.

The only warning that can be offered is the uncommenting this section LIS CACHEACTION="CacheOnly" should you decide to uncomment this, note that the install will ONLY be copied to the target computer. NOTHING WILL BE INSTALLED!

Please see the attached file for the example.

For each product being installed, the OptionState Id must be specified and the installation type must be provided. Below is a snippet from Microsoft's website that discusses these options:

The OptionState element uses the following syntax: <OptionState Id="optionID" State="Absent" | "Advertise" | "Default" | "Local" [Children="force"]/> where: optionId is the identifier for a feature or sub-feature to install. Absent specifies that the feature or sub-feature is not installed. Advertise specifies to install the feature or sub-feature on first use. Default returns the feature or sub-feature to its default state. Local installs the feature or sub-feature on the user's computer. Force sets all features or sub-features to their specified states.

OptionState Id Items

Here is a list of the available OptionState Ids

  • ACCESSFiles: Microsoft Office Access databases.
  • Access_PIA: Primary interoperability assembly that allows Microsoft Office Access programmability with .NET Framework version 1.1 or greater.
  • AccessBarcodeControl: Barcode Control.
  • AccessHelpFiles: Help for Microsoft Office Access.
  • AccessWizards: Database experts that ask questions about a commonly used item you want to create, and then build the item for you.
  • CalendarControl: ActiveX control you can use to create fully programmable calendars in your forms and reports; includes Help files.
  • DeveloperWizards: Database experts that ask questions about a more advanced item you want to create, and then build the item for you.
  • AccessTemplatesIntl: Templates are complete Access database applications used to track, store, and report business and personal data. You can store the data within .accdb files or in lists on a Microsoft Windows SharePoint Services Web site.
  • EXCELFiles: Microsoft Office Excel.
  • Excel_PIA: Primary interoperability assembly that allows Microsoft Office Excel programmability with .NET Framework version 1.1 or greater.
  • ExcelAddinFiles: Microsoft Office Excel problem-solving tools and utilities.
  • ExcelHelpFiles: Help for Microsoft Office Excel.
  • ExcelSampleFiles: Easy-to-use examples for Microsoft Office Excel.
  • ExcelTemplatesFiles: Microsoft Office Excel Spreadsheet Templates for expense reports, invoices, timecards, purchase orders, and loan amortization.
  • GrooveFiles: Microsoft Office Groove.
  • OneNoteFiles: Microsoft Office OneNote.
  • OneNoteHandwritingFonts: Typefaces that enable you to type with text that looks like handwriting.
  • OneNoteHelpFiles: Help for Microsoft Office OneNote.
  • OneNotePIA: Primary interoperability assembly that allows Microsoft Office OneNote programmability with .NET Framework version 1.1 or greater.
  • OneNoteToAddIns: OneNote integration functionality with other applications.
  • OneNoteMobile: OneNote companion for Windows Mobile-powered devices.
  • OUTLOOKFiles: Microsoft Office Outlook.
  • Outlook_PIA: Primary interoperability assembly that allows Microsoft Office Outlook programmability with .NET Framework version 1.1 or greater.
  • OutlookHelpFiles: Help for Microsoft Office Outlook.
  • OutlookImportExportFiles: Import from and export to popular e-mail programs, personal information managers, and standard file formats.
  • OutlookStationeryFiles: Outlook Stationery.
  • OutlookVBScript: Debugging tool for Visual Basic Scripting Edition. Used to automate Outlook custom forms.
  • OutlookTemplateFiles: Outlook Template Files.
  • OutlookMessaging: Outlook Messaging Components.
  • OutlookAddIns: Outlook Add-Ins.
  • OutlookOms: Outlook Mobile Service.
  • PPTFiles: Microsoft Office PowerPoint.
  • OrgChartFiles: Program that can be used to revise a Microsoft Organization Chart OLE object created with previous versions of this program.
  • PowerPoint_PIA: Primary interoperability assembly that allows Microsoft Office PowerPoint programmability with .NET Framework version 1.1 or greater.
  • PPTPresentationTemplates: Templates and designs that help you create presentations.
  • PPTHelpFiles: Help for Microsoft Office PowerPoint.
  • PPTSoundFiles: Sounds used for Microsoft Office PowerPoint preset animation effects.
  • PPTViewerFiles: Packages the Microsoft Office PowerPoint Viewer and your presentations onto a CD.
  • PubPrimary: Microsoft Office Publisher.
  • PubComPrinting: Tools for printing color publications at commercial printing services.
  • Publisher_PIA: Primary interoperability assembly that allows Microsoft Office Publisher programmability with .NET Framework version 1.1 or greater.
  • PublisherFontSchemes: Tools to change the fonts used throughout your publication.
  • PublisherHelpFiles: Help for Microsoft Office Publisher.
  • PubPaperDirect: Online previews that show PaperDirect designs.
  • PubWizards: Tool that helps you create a particular kind of publication or change an object in a publication.
  • RMSFiles: Microsoft Office InterConnect.
  • RMSHelpFiles: Help for Microsoft Office InterConnect.
  • VisualStudio_PreviewServer_SPD: Microsoft ASP.NET Development Server.
  • WORDFiles: Microsoft Office Word.
  • Word_PIA: Primary interoperability assembly that allows Microsoft Office Word programmability with .NET Framework version 1.1 or greater.
  • WordBibliographyFiles: Files that you can use with the Word Bibliography feature.
  • WORDBordersFiles: Provides page borders that can be used to enhance documents.
  • WordCalligly: Microsoft Word Calligraphy Add-in.
  • WordEnvelopWizard: Microsoft Word Envelope Wizard Add-in.
  • WordGenko: Microsoft Word Genko Add-in.
  • WORDHelpFiles: Help for Microsoft Office Word.
  • WordQuickFormatsFiles: Word Quick Formats theme files.
  • WORDDocumentTemplates: Microsoft Office Word wizards and templates.
  • WordTableWizard: Microsoft Word Table Wizard Add-in.
  • XDOCSFiles: Microsoft Office InfoPath.
  • XDocs_PIA: Primary interoperability assembly that allows Microsoft Office InfoPath programmability with .NET Framework. version 1.1 or greater.
  • XDOCSHelpFiles: Help for Microsoft Office InfoPath.
  • XDOCSNoShipFiles: InfoPath NoShip Automation Support.
  • XDocsRegFormFiles: Tool for creating installable form templates.
  • XDocsSamples: Form templates that you can customize to suit your requirements or use immediately.
  • SHAREDFiles: Shared files for use with Microsoft Office.
  • AceRepl: Installs the Microsoft Office Access Database Replication Conflict Manager, which you can use to resolve conflicts between replicated databases.
  • CAGFiles: Collection of popular clip art that can be used to enhance Microsoft Office documents.
  • IMEMain_1028: Microsoft Office IME (Chinese Traditional).
  • IMEMain_1041: Microsoft Office IME (Japanese).
  • IMEMain_1042: Microsoft Office IME (Korean).
  • IMEMain_2052: Microsoft Office Pinyin IME.
  • ConvertersFiltersFile: File converters and graphics filters.
  • InternationalSupportFiles: Files for international support.
  • OArt_DocTheme: Set of coordinated design elements, including colors, fonts, fills, and effects that can be used within Microsoft Office documents.
  • OfficeDigitalSFiles: Digital certificate for signing a Visual Basic for Applications project. Allows you to avoid unnecessary security warnings.
  • OffproFonts: Fonts for International languages.
  • OsaNonBoot: Start menu shortcuts for creating and opening Microsoft Office documents.
  • ProofingTools: Tools for proofreading Office documents.
  • PubFontsSys: Extra fonts for greater design flexibility.
  • TCDRegistration: ActiveX control that allows Microsoft Office clip art and templates to be downloaded from Microsoft Office Online and to be opened automatically in the associated programs.
  • THEMESFiles: Set of coordinated design elements, including body and heading styles, background images, bullets, and horizontal lines.
  • VBAFiles: Components to support creating, editing and executing VBA macros in Office applications.
  • TOOLSFiles: Applications and support files for use with Microsoft Office.
  • DocServicesFiles: Document Update Utility that keeps documents on your computer up-to-date with copies of those documents in document workspaces.
  • EquationEditorFiles: Inserts mathematical symbols and equations into documents.
  • Forms_PIA: Primary interoperability assembly that allows Microsoft Forms 2.0 programmability with .NET Framework version 1.1 or greater.
  • GRAPHFiles: Creates charts from Microsoft Office Word, PowerPoint, and Access data.
  • HTMLSourceEditing : HTML source editor for HTML authoring of Office documents.
  • MsInfoFiles: Troubleshooting tool that gathers system and program configuration information.
  • MSOfficeDocumentImaging: Enables you to easily scan, perform optical character recognition (OCR), search through, extract text from, and view image documents.
  • MSTagPluginsFiles: Provides intelligent recognition of data types within Microsoft Office Excel and Word, and useful actions for working with the data types.
  • OISFiles: Microsoft Office Picture Manager is installed with the selected options.
  • OSESupp: Document publishing tools and collaboration tools for use with SharePoint Services or FrontPage Server Extensions, and an Office List component for use with Windows SharePoint Services.
  • QueryFiles: Provides direct database connectivity to analyze data in Microsoft Office Excel.
  • RefIEBarFiles: Enables you to use the Research tool and its collection of information services from Windows Internet Explorer.
  • SetLanguageFiles: Sets language options for all Office programs.
  • SmartTag_PIA: Primary interoperability assembly that allows smart tag programmability with .NET Framework version 1.1 or greater.
  • WebDriveFiles: Enables you to use Web Folders on Office-compatible Internet service providers.

Logging

By default, logging goes to the %temp% directory. This can be modified by changing this line:

<Logging Type="standard" Path="C:/MyCompany/audit/Office/" Template="Microsoft Office Professional Plus Setup(*).txt" />

Additional options are logging type can be standard or Verbose. Path can be a path of your choice and the template can be modified to any name of your choosing where the * will append a unique string in its place. You can also leave out the * and if the log file previously exists, it will append log data to existing log file that was created for subsequent installations.

Slipstreaming not required

Since service pack one has been released for Office 2007, you may want to include it in your installation. Previously you were required to slipstream the product and redistribute all of your source files. Well you will be happy to know that someone in Redmond was really looking out for you. To include patches in your new distribution, all you have to do is extract the files from the service pack release and place them in the "updates" directory. The installation automatically looks for updates at installation time, and installs them. This is not to be confused with future distribution of patches and only occurs at setup time.

Licensing and Altiris

My company is unique in that we do not just buy enterprise or pro for every system and provide a standard distribution. We purchase standard, pro and enterprise licenses and then have the pleasure of attempting to manage the numbers of each. Microsoft does not make this easy to manage. In addition, I will be distributing Office 2007 standard, but using the professional source media and removing the "Pro" components. Since Altiris inventories every executable I will be creating a dummy file named MSO2007Standard.exe or MSO2007Professional.exe for my standard or professional distribution. Any distribution that carries a Professional component will also receive the dummy file for professional. It is in this manner that I plan to track who has what version. The other option is to create a registry entry for add remove programs that will do much the same thing. The point is to have a source that you can control to keep the information straight.

Conclusion

My opinion of the installation goes a little something like this. It appears that Microsoft was looking out for the little people when they developed some of the options for the new version of office. It would have been nice to see a tool to actually create the xml file for you, similar to the tool included to create the MSP file. If one is available, I was not able to locate any information pertaining to it. There are so many options in the installation file that it is mind bending. Documentation is well written, however in true Microsoft fashion, it can be hard to comprehend.

Statistics
0 Favorited
0 Views
2 Files
0 Shares
0 Downloads
Attachment(s)
jpg file
Finish.jpg   27K   1 version
Uploaded - 02-25-2020
jpg file
Start.jpg   22K   1 version
Uploaded - 02-25-2020

Tags and Keywords

Comments

12-29-2009 06:35 AM

This is real good information. I 'm about to start packaging MS Office 2007 Pro Plus SP2. This will sur;y help in resolving the issues that i can come across.
Thanks all good people!

06-10-2009 02:45 PM

this was really nice piece of code; sorted my problem.

thanks a lot once agin . . .

06-10-2009 02:34 PM

efforts that you all have taken is really appreciable; looks like this will server as ready reckoner when i am in the game for 2007

04-19-2009 10:26 PM

Can we use MSDN license to deploy Office 2007 Ultimate version?

I found the answer to this.
This can not be done. Must be a volume lic

09-29-2008 03:46 PM

We have Office 2007 on one test machine and I have found that my email templates used in the Altiris Helpdesk Notify rules and not interpretting the colored banner. Rather I get a plain box, thin navy border with the banner text in it.
I have color-coded our existing emails, such as Sev 1 has a red banner, Reassigned is green, etc.
Any thoughts on what settings need to change in Outlook to continue to read these colored banners? Or if my HTML needs to change for my email templates?
Thank you!

07-02-2008 12:00 PM

It's possible to get the silent install to work without modifying config.xml. All of the documentation I've seen from MS indicates this too - although if the documentation were perfect, we wouldn't be having this discussion. ;-)
I'm haven't tested to see if it matters where the .msp files are located - I've just been so happy I could get it to work. :-) But since I'm working with several .msp files, I like the idea of keeping them in their own folder. Also, the updates folder starts getting somewhat cluttered when you start putting extracted updates into it. It gets even more fun when you realize each of the post-SP1 updates create their own .msp files too.
But using a command line that includes the location of the config.xml file seems to have been the magical trick to get it to work.
I'm installing Professional Plus, so I use this:
\\path to media\setup.exe /adminfile \\path to media\msp\My-settings.MSP /config \\path to media\ProPlus.WW\config.xml
The side note about installing the service pack is correct as well. You can also do that for all the Post SP fixes as well. Just use the "/extract" command (or /extract:\\path-to-updates-folder)
Larry

07-01-2008 05:00 PM

After more test, finally got the files to work not move around any files..
1. you create the custom.MSP file save it updates directory..
2. I used enterprise edition of office so I had to modify the first line of the file

remember to remove the "!--" marks on both side of the < > if you don't it's treated like a comment it won't actually work. Display level I left it basic to test application was installating.
I created a simple job on DS Console
\\servername\Office2007\setup.exe /adminfile updates\custom.msp /config Enterprise.WW\config.xml
Side note if you want to install the Service Pack
1. Download it from Microsoft Website
2. Open a DOS prompt find the .exe type in
Servicepack.exe /extract
then you grab those files place them in the Updates folder of the office install. Office will automatically install any updates from that folder no coding is needed.

06-30-2008 06:56 PM

Thank you for this...
[edited June 30]
I found a nice reference source to go along with this that resolves problems of the MSP file not being read properly at http://www.appdeploy.com/messageboards/tm.asp?m=33205. Scroll down to find the post form 'reds4eva'.
Larry

06-23-2008 11:08 AM

I just ran this script and I love this. For some reason lately, there has been a need to use the scanpst file and thanks to this script, there is an icon to get to it quickly rather than walking the user through searching for the exe file.
Excellent work.

06-21-2008 02:39 PM

Either MSP or XML file needs to be used
If using MSP put this in the updates folder and make sure there is NO XML file in either the updates folder or the "Enterprise" folder or whatever version you are installing folder
Worked for me
C

06-21-2008 10:55 AM

I am having the same problem where the setup refuses to use my msp file. I tried your suggestion of copying config.xml file to the root of office share point. This the setup ran but it installed "typical" office and ignored all the customizations in my msp file.
I opnened a call with MS and see what they say on Monday.

05-30-2008 01:28 PM

I read the article while using the config.xml file is great msp is alot easier to read.. put after several attempts and many msg boards I got code to work..
Installating Enterprise.WW Edition
1. \\server\share\office12\setup.exe /admin **Create the MSP file
after you configure your MSP file locate the file in the update directory
2. \\server\share\office12\Updates
Second task that I did was
3. Moved the config.xml file from Enterprise.WW folder and placed it ont he root
**\\server\share\office12\
modified the 1st line of the config.xml file
I removed the
4.
What I found out was that the MSP file is still reading part of the XML document when I didn't uncomment this line it would not perform unattend install.
Display Level you might want to first leave it to basic so that you could see the installation is working then move change it to none.
Job I created was
\\server\share\Office2007\setup.exe /adminfile updates\chcnb.msp
you don't have to specify the config.xml document according to microsoft if the config.xml file is on the root of the directory where the setup.exe file is located it will work.
If you want to incluse the SP1 for office 2007 also have to extract the Sp1.exe and put the msp files in the update directory. During the Installation process it will automatically install it. During my testing the process was taking about 20-24 minute sto finish the installation enjoy.

05-29-2008 02:33 AM

Thanks for such a useful information. This will definitly help all the people about to package Office 2007. You have really simplified work for all.. :)

05-09-2008 11:49 AM

Unfortunatley not. That is the something we have not needed here, but the batch file could be edited so it does not delete itself. In fact, the batch file would look like this:

echo off
c:
cd \
IF EXIST C:\Documents and settings\%USERNAME%\office.txt goto :end
IF NOT EXIST c:\office.txt goto :create
:create
echo off
copy "\\mncoraltcob02\Software Deployment\Office\Office 2007 Shortcuts\Microsoft Office Excel 2007.lnk" "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Internet Explorer\Quick launch\Microsoft Office Excel 2007.lnk"
copy "\\mncoraltcob02\Software Deployment\Office\Office 2007 Shortcuts\Microsoft Office Word 2007.lnk" "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Internet Explorer\Quick launch\Microsoft Office Word 2007.lnk"
echo .>"c:\Documents and settings\%USERNAME%\office.txt"
goto :end
:end

This will leave the batch file in the starup folder. Anytime someone logs in it would run, look for the txt file and if not found create the icons and marker txt file.

05-09-2008 06:44 AM

What if in case there are more than 1 user profile in the machine?
Will the above method [Batch File] creates a QuickLaunch shortcut to every user profile?

05-08-2008 07:12 PM

I was able to accomplish the same thing for Scenario 1 with a batch file placed in the startup folder. This would be for people like me who are a little behind the times.

'=================================================
echo off
c:
cd \
IF EXIST C:\office.txt goto :delete
IF NOT EXIST c:\office.txt goto :create
:delete
echo off
del "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\office.bat"
goto :end
:create
echo off
copy "\\mncoraltcob02\Software Deployment\Office\Office 2007 Shortcuts\Microsoft Office Excel 2007.lnk" "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Internet Explorer\Quick launch\Microsoft Office Excel 2007.lnk"
copy "\\mncoraltcob02\Software Deployment\Office\Office 2007 Shortcuts\Microsoft Office Word 2007.lnk" "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Internet Explorer\Quick launch\Microsoft Office Word 2007.lnk"
echo .>c:\office.txt
goto :delete
:end
'=================================================

The parts in the "" will need to be changed to match your file locations, but it works quite well.

05-08-2008 06:35 PM

After upgrading from MS Office XP Pro to MS Office 2007 Pro Plus, old SCANPST & SCANOST icons will be there [Start -> Programs -> Microsoft Office -> Tools -> Outlook 2002 OST Integrity Check & Personal Folders Scan and Repair Utility]
The new locations of the files:
C:\Program Files\Microsoft Office\Office12\SCANOST.EXE
C:\Program Files\Microsoft Office\Office12\SCANPST.EXE

We can write a vbscript which will search and delete old entries and also create new entries[icons]

'================================================
Dim fso
Dim WSHShell
Dim AppData, AppDataPath
Dim colFolders, colFolders1, colFolders2, cFolder, cFolder1
Dim sAllUsersProfile, oAllUsersFolder, oAllUsersFolder1
Dim sDocsAndSettings
Dim strComputer
strComputer = "."
'Set up environment
Set WSHShell = CreateObject("WScript.Shell")
Set fso = createobject("Scripting.FileSystemObject")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
prodir = WSHShell.ExpandEnvironmentStrings("%ProgramFiles%")

sAllUsersProfile = WSHShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
Set oAllUsersFolder = fso.GetFolder(sAllUsersProfile)
Set oAllUsersFolder1 = fso.GetFolder(sAllUsersProfile & "\Start Menu")
'============================================================================================
If fso.FileExists("C:\Program Files\Microsoft Office\Office12\SCANOST.EXE") then
'create SCANPST & SCANOST shorcut files under Tools
Set officetoolsFolder = fso.GetFolder(sAllUsersProfile & "\Start Menu\Programs\Microsoft Office\Microsoft Office Tools")
'DELETE PREVIOUS VERSION OF OFFOCE TOOLS (TOOLS) FOLDER IF IT EXISTS
If fso.FolderExists(sAllUsersProfile & "\Start Menu\Programs\Microsoft Office\Tools") Then
Set toolsFolder = fso.GetFolder(sAllUsersProfile & "\Start Menu\Programs\Microsoft Office\Tools")
fso.DeleteFolder toolsFolder,True
End If
'CREATE SCANOST ICON UNDER OFFICE TOOLS IF IT DOESN'T EXISTS
If fso.FileExists(sAllUsersProfile & "\Start Menu\Programs\Microsoft Office\Microsoft Office Tools\Outlook 2007 OST Integrity Check.lnk") Then
else
'CREATE SCANOST ICON UNDER Microsoft Office Tools
Set objSC = WSHShell.CreateShortcut(officetoolsFolder & "\Outlook 2007 OST Integrity Check.lnk")
objSC.IconLocation = "C:\Program Files\Microsoft Office\Office12\SCANOST.EXE, 0" ' 0 is the index
objSC.TargetPath = "C:\Program Files\Microsoft Office\Office12\SCANOST.EXE"
objSC.WindowStyle = 1 ' 1 = normal; 3 = maximize window; 7 = minimize
objSC.Save
End if
'CREATE SCANPST ICON UNDER OFFICE TOOLS IF IT DOESN'T EXISTS
If fso.FolderExists(sAllUsersProfile & "\Start Menu\Programs\Microsoft Office\Microsoft Office Tools\Personal Folders Scan and Repair Utility.lnk") Then
Else
'CREATE SCANPST ICON UNDER Microsoft Office Tools
Set objSC1 = WSHShell.CreateShortcut(officetoolsFolder & "\Personal Folders Scan and Repair Utility.lnk")
objSC1.IconLocation = "C:\Program Files\Microsoft Office\Office12\SCANPST.EXE, 0" ' 0 is the index
objSC1.TargetPath = "C:\Program Files\Microsoft Office\Office12\SCANPST.EXE"
objSC1.WindowStyle = 1 ' 1 = normal; 3 = maximize window; 7 = minimize
objSC1.Save
End If
End If
set fso = Nothing
Set WSHShell = Nothing
Wscript.Quit
'================================================

05-08-2008 05:30 PM

Scenario 1:


User related customizations like
- Adding shortcut icons to the quicklaunch bar
- Line spacing issue in word 2007

Solution:


These settings can be implemented via vbscript. The script is executed as part of post-install [after the completion of main installation]
Add source files [Normal.dotm file in case of line spacing] which are necessary, using "Add Files" section in OCT [ex loc: copy Normal.dotm file to "c:\windows\Temp\Office_2007\Microsoft"]

'=================================================
Windir = WSHShell.ExpandEnvironmentStrings("%windir%")
sAllUsersProfile = WSHShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
Set oAllUsersFolder = fso.GetFolder(sAllUsersProfile)
Set oFolder1 = fso.GetFolder(Windir & "\Temp\Office_2007")
'CREATING SHORCUT ICONS ON QUICKLAUNCH
Set objWMIService1 = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFolders1 = objWMIService1.ExecQuery _
("Select * from Win32_Directory where Name Like 'C:\\Documents and Setting%\\application dat%\\microsof%\\Internet Explorer\\Quick Launch'")
For Each objFolder in colFolders1

If fso.FileExists(objFolder.Name & "\Microsoft Access.lnk") Then
Else
Set objSC = WSHShell.CreateShortcut(objFolder.Name & "\Microsoft Access.lnk")
objSC.Description = "Microsoft Access"
objSC.IconLocation = "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE, 0" ' 0 is the index
objSC.TargetPath = "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"
objSC.WindowStyle = 1 ' 1 = normal; 3 = maximize window; 7 = minimize
objSC.Save
End If

if fso.FileExists(objFolder.Name & "\Microsoft Excel.lnk") Then
Else
Set objSC1 = WSHShell.CreateShortcut(objFolder.Name & "\Microsoft Excel.lnk")
objSC1.Description = "Microsoft Excel"
objSC1.IconLocation = "C:\Program Files\Microsoft Office\Office12\EXCEL.EXE, 0" ' 0 is the index
objSC1.TargetPath = "C:\Program Files\Microsoft Office\Office12\EXCEL.EXE"
objSC1.WindowStyle = 1 ' 1 = normal; 3 = maximize window; 7 = minimize
objSC1.Save
End If

if fso.FileExists(objFolder.Name & "\Microsoft Outlook.lnk") Then
Else
set objSC2 = WSHShell.CreateShortcut(objFolder.Name & "\Microsoft Outlook.lnk")
objSC2.Description = "Microsoft Outlook"
objSC2.IconLocation = "C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE, 0" ' 0 is the index
objSC2.TargetPath = "C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE"
objSC2.WindowStyle = 1 ' 1 = normal; 3 = maximize window; 7 = minimize
objSC2.Save
End If

If fso.FileExists(objFolder.Name & "\Microsoft PowerPoint.lnk") Then
Else
set objSC3 = WSHShell.CreateShortcut(objFolder.Name & "\Microsoft PowerPoint.lnk")
objSC3.Description = "Microsoft PowerPoint"
objSC3.IconLocation = "C:\Program Files\Microsoft Office\Office12\POWERPNT.EXE, 0" ' 0 is the index
objSC3.TargetPath = "C:\Program Files\Microsoft Office\Office12\POWERPNT.EXE"
objSC3.WindowStyle = 1 ' 1 = normal; 3 = maximize window; 7 = minimize
objSC3.Save
End If

If fso.FileExists(objFolder.Name & "\Microsoft Word.lnk") Then
Else
set objSC4 = WSHShell.CreateShortcut(objFolder.Name & "\Microsoft Word.lnk")
objSC4.Description = "Microsoft Word"
objSC4.IconLocation = "C:\Program Files\Microsoft Office\Office12\WINWORD.EXE, 0" ' 0 is the index
objSC4.TargetPath = "C:\Program Files\Microsoft Office\Office12\WINWORD.EXE"
objSC4.WindowStyle = 1 ' 1 = normal; 3 = maximize window; 7 = minimize
objSC4.Save
End If
'MsgBox "Quick Launch Icons are created"
Next
'COPY NORMAL.DOTM file to USER PROFILES
sDocsAndSettings = "C:\Documents and Settings\" ' Probably there is an environment variable or other variable
Set colFolders = fso.GetFolder(sDocsAndSettings) 'Collection of all profiles
For Each oFolder In colFolders.SubFolders
Select Case LCase(oFolder.Name)
Case "admin", "administrator", "newuser", "all users", "default user", "default user.original", "localservice", "networkservice"
'Do Nothing
Case Else
' Check for the path
If fso.FolderExists(sDocsAndSettings & oFolder.Name & "\local settings\application data") Then
'Copy folder to the destination
fso.CopyFolder oFolder1 & "\Microsoft", sDocsAndSettings & oFolder.Name & "\local settings\application data\" ,True
'MsgBox "Copied : " & sDocsAndSettings & oFolder.Name & "\local settings\application data"
End If
Next
'=================================================

Scenario 2:


Situation where we need to implement User specific custimizations which require HKCU registry entries to be added to the registry.
Example: To enable grammer & spell check options in Outlook 2007 we need to add the following registries:

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Word\Options]
"AutoGrammarWordMail"=dword:00000001
"AutoSpellWordMail"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\Shared Tools\Proofing Tools\1.0\Office]
"OutlookSpellingOptions"=dword:00000007

[OCT didn't work for us in the above case].

Solution:


Add all the HKCU registry entries to a .REG file [c:\HKCU.REG] and using ACTIVE SETUP you can run this file in silent mode so that when ever a user logs in, HKCU entries will be added to the registry.
In OCT under "Add registry Entries"

[HKLM\Software\Microsoft\Active Setup\Installed Components\Office_2007]
StubPath = regedit /s "C:\HKCU.REG"
Version = 1

05-07-2008 08:44 PM

thank you allot this article really helped me prevent some headaches. :D

05-04-2008 04:24 AM

Nice document with some very helpful ideas. Probably my colleagues will read that with pleasure when they start Office 2007 migration at customers' sites.

05-03-2008 10:30 PM

Great piece of information !!!
Handling Office installation has always been a challenge for the packagers.
Good keynote to begin with :-)

05-03-2008 10:05 AM

That comment is EXACTLY the reason I wrote the document! Thank you for your input!

05-02-2008 05:17 PM

Thank you for the insight into how our Office 2007 deployment might eventually go. While we have no immediate plans for releasing Office 2007. I appreciate the information you provided, so I know what I'm going to be up against when it comes time to roll it out.

Related Entries and Links

No Related Resource entered.