Microsoft KB Archive/199033

= BUG: Bad default Start menu program in setup projects =

Article ID: 199033

Article Last Modified on 6/14/2006

-

APPLIES TO


 * Microsoft Visual J++ 6.0 Standard Edition

-



This article was previously published under Q199033



SYMPTOMS
When you wrap a Visual J++ 6.0 application project in a self-extracting executable that has an entry on the Start menu and the Start menu is set to the default properties, the following error occurs when you try to run the program from the Start menu:

WJView Error

ERROR: Could not execute Form1: The system cannot find the file specified.



CAUSE
When you select the Create an entry in the Start Menu check box, the default properties for a self-extracting setup project are as follows: Command line program=\wjview.exe Argument= /p /cp:p "" Form1 The problem occurs because Visual J++ 6.0 does not modify the project's target start location to point to ProjectXX.exe. Visual J++ 6.0 should point to ProjectXX.exe if you specify Windows EXE as the project packaging type. The launch dialog box, as well as any setup project deploying this type of project, always refers to the startup class independent of the packaging type.



RESOLUTION
To make your setup project create an entry in the Start menu when Windows binaries are deployed, change the default setup properties as follows: Command line program=\AppName.exe Argument="" NOTE: AppName is the name of the Windows application. For example, Project1 is the application name in the example in the MORE INFORMATION section of this article.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Start Visual J++ 6.0. In the New Project dialog box, click Windows Application to create a new Windows application project. Click Open. Project1 is created by default. In the Project Explorer window, right-click Project1, and click Project1 Properties.... In the Project1 Properties dialog box, click the Deployment tab, select Windows Binaries in the Outputs of type list, and click OK. From the File menu, click New Project. In the New Project dialog box, expand the Visual Studio folder and click the Distribution Units folder. Click Self-Extracting Setup to create a new self-extracting setup project. Setup1 is created by default. Make sure that the location of Setup1 is the same as Project1, and click Add to current solution.</li> In the Project Explorer window, right-click Setup1, click Add Project Outputs..., click Project1, and click OK.</li> In the Project Explorer window, right-click Setup1, and click Setup1 Properties....</li>  On the Target tab in the Setup1 Properties dialog box, select the Create an entry in the Start Menu check box and click OK.

NOTE: The default properties are set as follows: Command line program=<WinDir>\wjview.exe Argument= /p /cp:p "<APPDIR>" Form1 </li> In the Project Explorer window, right-click Solution and click Rebuild Solution to create Project1.exe and Setup1.exe.</li> Go to the folder that contains Setup1.exe. Double-click Setup1.exe to install the program.</li> Click Start, Programs, and Setup1.</li></ol>

RESULT: The error message occurs.

<div class="references_section">