Office: Specifying Working Directory in a Custom Setup Script (122846)



The information in this article applies to:

  • Microsoft Office for Windows 4.2
  • Microsoft Office for Windows 4.3
  • Microsoft Office for Windows 95, when used with:
    • the operating system: Microsoft Windows NT

This article was previously published under Q122846

SUMMARY

In Microsoft Office, you can automatically modify the working directory for a program when you run the Setup program by editing the AddProgmanItem line in the Setup.stf file.

NOTE: This applies to Microsoft Office for Windows 95 only under Microsoft Windows NT with the standard user interface.

WARNING: This modification may not be supported by Microsoft Technical Support (MTS). MTS will support some modifications to a BACKUP copy of the Setup.stf file. Note also that while MTS may help customers modify specific lines of an STF, we will not rewrite the entire file in order to achieve a desired configuration. As a general rule, support is limited to options that can normally be changed by a user during a standard installation of the application.

MORE INFORMATION

The AddProgmanItem line has the following format (note that the headers in the table below are for illustration purposes only. They do not appear in the actual .stf file).

AddProgmanItem Line

Microsoft Office for Windows 95:
Office Directory, Program Directory, Program File, Working Directory
--------------------------------------------------------------------

 'MSOffice<Microsoft Office>,MSExcel<Microsoft
 Excel>,%s\EXCEL.EXE,C:\MyName<C:\MyName>,,,,,,
				
NOTE: Long file name directory names are enclosed in angle brackets. Microsoft Office 4.x:
AddProgmanItem, Program Group,    Icon Label,       Path to .exe,    Other
--------------------------------------------------------------------------

 AddProgmanItem,"Microsoft Office","Microsoft Query","%s\MSQUERY.EXE",""
				

Specifying the Working Directory

In Microsoft Office for Windows 95, the working directory is the fourth item in the line. Remember that long file names for directories are enclosed in angle brackets. If the directory is the same for both the long and standard length file and directory names, you can place the same statement inside the brackets, for example:

C:\Myname<C:\Myname>

In Office 4.x, you specify the working directory for a program in the last parameter (the Other parameter). This parameter can contain several items. For example, if you want to set the working directory for Microsoft Query to the x:\User\Data directory, make the following modification to the AddProgramItem line:

AddProgmanItem "Microsoft Office","Microsoft Query","%s\MSQUERY.EXE", ",,,,X:\User\Data"

Modifying the Setup.stf File

To open the Setup.stf file and locate the AddProgmanItem line, use the following steps:

CAUTION: Microsoft does not support modifications to the .stf file. Be sure to make a backup copy of this file before you attempt to modify it.

  1. In Microsoft Excel, open the .stf file that you want to edit.
  2. In the Text Import Wizard dialog box, click Next until step 3 of the wizard appears.
  3. In the Text Import Wizard - Step 3 Of 3 dialog box, under Data Preview, drag the vertical scrollbar indicator down until Object ID appears in the Data Preview window. Click the first column to select it. Hold the SHIFT key down, drag the horizontal scrollbar to the right until the last column is displayed in the Data Preview window, and then click the last column.

    All of the columns (at least 15 columns) should be selected.
  4. Under Column Data Format, click Text, and then click Finish.

    CAUTION: If you do not click Text in this step, Microsoft Excel reads some of the entries in the edited .stf file incorrectly. When this occurs, you receive Setup Parse errors when you run Setup.
  5. Select cell A1, and then click Find on the Edit menu. In the Find What box type "AddProgmanItem" (without the quotation marks), and then click OK.
Microsoft Excel finds the first of several instances where AddProgmanItem occurs in the Setup.stf file.

For additional information, please see the following article in the Microsoft Knowledge Base:

119357 OFF: "How to Create a Custom Installation Script" (WC1046)


Modification Type:MinorLast Reviewed:8/16/2005
Keywords:kbinfo kbsetup KB122846