HOWTO: Find the Installation Path of an Office 2000 ApplicationID: Q234788
|
This article demonstrates how to use the Windows Installer to find the installation path of Microsoft Office applications.
Office 2000 does not include path information in the shortcut links when installed. This is done so that the "Run on First Use" option can be used. When this option is used, the shortcuts will appear, but the applications will not be installed on the hard disk. When you click on the shortcut for the first time, the applications will be installed.
You can use the Windows Installer to get the path of the installed Office application. Follow the steps given below to create a console application that reports the directory of an installed Office application.
#include <windows.h>
#include <msi.h>
#include <ostream.h>
const char *Word = "{CC29E963-7BC2-11D1-A921-00A0C91E2AA2}";
const char *Excel = "{CC29E96F-7BC2-11D1-A921-00A0C91E2AA2}";
const char *PowerPoint = "{CC29E94B-7BC2-11D1-A921-00A0C91E2AA2}";
const char *Access = "{CC29E967-7BC2-11D1-A921-00A0C91E2AA2}";
int main(void)
{
DWORD size = 300;
INSTALLSTATE installstate;
char *sPath;
sPath = new char[size];
installstate = MsiGetComponentPath(
"{00000409-78E1-11D2-B60F-006097C998E7}",Word,sPath,&size);
if ((installstate == INSTALLSTATE_LOCAL) ||
(installstate == INSTALLSTATE_SOURCE))
cout << "Installed in: " << sPath << endl;
delete sPath;
return 0;
}
You can download the Windows Installer SDK, which includes the MSI.LIB file, from:
http://www.microsoft.com/msdownload/platformsdk/WinInst.htm
For more information on Office Automation, please visit the Microsoft Office Development support site at:
http://support.microsoft.com/support/officedev/
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Mark Durrett, Microsoft Corporation
Additional query words:
Keywords : kbVC500 kbVC600 kbGrpDSO kbOffice2000 kbDSupport
Version : WINDOWS:2000; winnt:5.0,6.0
Platform : WINDOWS winnt
Issue type : kbhowto
Last Reviewed: July 13, 1999