Microsoft KB Archive/272219

= PRB: Visual FoxPro App Installed with Visual Studio Installer Creates Foxuser Files on Desktop =

Article ID: 272219

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition
 * Microsoft Visual Studio Installer 1.0
 * Microsoft Visual Studio Installer 1.1

-



This article was previously published under Q272219



SYMPTOMS
When a user starts an executable file that was developed with Visual FoxPro (VFP) from a desktop shortcut that was created by a Visual Studio Installer (VSI) package, the user may see two new files on the desktop. The names of these files may vary, but they are usually Foxuser.dbf and Foxuser.fpt.



CAUSE
The Foxuser.dbf and Foxuser.fpt pair make up a resource file for the VFP application, storing useful information such as window positions, Browse window configurations, and label definitions. By default, a VFP application automatically creates these two files on startup, unless configured otherwise (see the &quot;Resolution&quot; section for more information). These files are usually created in the same folder as the application, or in the START IN folder if the application is started by means of a shortcut.

Installation packages that are created with Visual Studio Installer can create shortcuts to applications that they install. However, it is not possible to change the START IN property of these shortcuts from the VSI interface. As a result, the START IN property is set by default to the folder that contains the shortcut. The VFP application creates its Foxuser files in the START IN folder of the shortcut, which in this case is the user's desktop.



RESOLUTION
There are two ways to prevent this behavior:   Configure the VFP application that you are are distributing with VSI to not create a resource file. To do this, include a Config.fpw file with the application and adding the following line of code to it: RESOURCE = OFF -or-

 Use the Orca table editing tool, which is available in the Windows Installer Software Development Kit (SDK), to set the START IN property of the shortcuts that are contained in the .msi file. For information on installing Orca, click the article number below to view the article in the Microsoft Knowledge Base:

255905 HOWTO: Use the Orca Database Editor to Edit Windows Installer Files

After you have installed Orca, follow the steps below to change the START IN property of the shortcuts that your VSI package creates.

NOTE: These steps assume that you have already built your VFP application installation package with VSI.  Start Orca and from the main menu, select File and then select Open. Locate and select the .msi package that you created with VSI. With the .msi table open, scroll through the list on the left-hand side of the Orca window, locate the entry for &quot;Shortcut&quot;, and click it. When you click the &quot;Shortcut&quot; entry, records appear in the right-hand pane of the Orca window, one for each shortcut that you created. In the right-hand pane, select each entry and replace the empty WkDir field with TARGETDIR .</li> Save and close the .msi file, and then install your application. The Foxuser.* files should be created in the same folder as the EXE when it is started from the desktop shortcut.</li></ol>

IMPORTANT: You will need to do this each time that you rebuild your installation package with VSI, because each rebuild sets the WkDir field to its default state.</li></ul>

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol>  In Visual FoxPro, create a simple &quot;Hello World&quot; EXE. To force the creation of a resource file, include a Config.fpw file with the EXE that contains the following line: RESOURCE=ON </li> Use VSI to create an installation package (including the proper merge modules) and create a desktop shortcut using the File System window. For additional information on using VSI with VFP applications, see the &quot;References&quot; section below.</li> Install your VFP application using the VSI package that you created.</li> After the installation is complete, double-click the desktop shortcut to your application. You should see two new files, Foxuser.dbf and Foxuser.fpt, on the desktop.</li></ol>

<div class="references_section">