Actual Installer
software installer

How to determine the location of WinWord.exe using Actual Installer?

Back

If you created a Word-based program which must be installed in the same folder as winword.exe, then Actual Installer can help you. The location of this file can be retrieved from the following Registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\X\Common\InstallRoot\Path
Where X is the version number of Microsoft Office:

11.0	Office 2003
12.0	Office 2007
14.0	Office 2010
15.0	Office 2013
16.0	Office 2016

To check these keys we wrote a small utility - "GETWINWORDDIR.EXE". If you launch this file it will show a full path to winword.exe (if Microsoft Office is installed) or a blank message otherwise.
Also, we added into this utility an ability to write the result to Registry (to allow a setup program read it). So to use its result in the setup program, you need to make the following:

Add GETWINWORDDIR.EXE to your project on the Files and Folders tab. For the file destination use: <SetupTempDir>.
This is a temporary folder of a setup program and used to store files that need to be executed Before Installation.

Then go to the System \ Commands tab and add the following:

File: 		<SetupTempDir>\GETWINWORDDIR.EXE
Parameters: 	/R /W
Launch on OS: 	All
Show: 		Normal
Timing: 	Before Installation
Wait: 		Yes

/R switch is used to write the path of WINWORD.EXE to the Registry key: HKCU\Software\GETWINWORDDIR.EXE\Path
/W switch is used to show a warning message if WINWORD.EXE is not found.

To read a path from Registry go to System \ Variables and add the following:

Variable Name: 	<MyVar1>
Registry Key: 	HKCU\Software\GETWINWORDDIR.EXE
Value Name: 	Path
Value Type: 	REG_SZ
Default Value: 

Now a variable <MyVar1> contains the path to the winword.exe file and you can use it anywhere in the setup program.

NOTE: If a user has Office Starter, Home, or Student Edition installed, there is no WinWord.exe , since it uses a Client Virtualization Handler. The path to launch a .DOC (.DOCX) files could be something like this:
"C:\Program Files (x86)\Common Files\microsoft shared\virtualization handler\cvh.exe" "Microsoft Word Starter 2010 9014006604190000" /n "%1"