The Target values of the shortcuts are wrong after you install a Windows Installer package that was created by using Visual Studio .NET (830612)



The information in this article applies to:

  • Microsoft Windows Installer 2.0
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition

SYMPTOMS

You can create a Microsoft Windows Installer package by using the Setup and Deployment Projects option in Microsoft Visual Studio .NET. However, if the installer package contains a shortcut file, the path of the destination file that appears in the Target box in the properties of the shortcut file after you install the package is wrong.

CAUSE

This behavior occurs because the Create Shortcut functionality in Microsoft Windows does not support the use of Windows Installer Descriptor shortcuts.

WORKAROUND

To work around this problem, edit the installer package (the .msi file) to change the target value of the shortcut.

You can use the Orca database editor to edit the installer package. The Orca database editor is available as part of the Microsoft Windows Installer Software Development Kit (SDK). To download the Windows Installer SDK, visit the following Microsoft Web site: For additional information about the Orca database editor, click the following article number to view the article in the Microsoft Knowledge Base:

255905 HOWTO: Use the Orca database editor to edit Windows Installer files

To work around this problem, follow these steps:
  1. Edit the installer package by using the Orca database editor:
    1. Start Orca.
    2. On the File menu, click Open.
    3. In the Open dialog box, locate the folder that contains the Setupproj1.msi file.

      Note For more information about the Setupproj1.msi file that is created in the C:\Setupprojects\Setupproj1\Debug folder, see step 3 in the "More Information" section of this article.
    4. Click the Setupproj1.msi file, and then click Open.
    5. In the Tables pane, click File.
    6. In the right pane, select the row that has the value WINAPP1.EXE|Winapp1.exe in the FileName column, and then copy the associated value that appears in the File column.
    7. In the Tables pane, click Shortcut.
    8. In the right pane, select the row that has the value SHORTC~1.EXE|Shortcut to Winapp1.exe in the Name column.
    9. In the Target column, replace the existing value with the value that you copied in step f.
    10. On the File menu, click Save, and then quit the Orca database editor.
  2. Install the Setup project.

    Note If the Setupproj1 Setup project is already installed on your computer, remove it before you follow these steps.
    1. In Windows Explorer, locate the folder that contains the Setupproj1.msi file. By default, this is the C:\Setupprojects\Setup1\Debug folder.
    2. Double-click the Setupproj1.msi file. The Setup Wizard starts.
    3. On the Welcome to the Setupproj1 Setup Wizard page, click Next.
    4. On the Select Installation Folder page, type C:\InstalledProjects\Setupproj1 in the Folder box, and then click Next.
    5. On the Confirm Installation page, click Next.
    6. On the Installation Complete page, click Close.
  3. Verify the target value of the shortcut:
    1. In Windows Explorer, locate the C:\InstalledProjects\Setupproj1 folder.
    2. Right-click the Shortcut to Winapp1.exe file, and then click Properties.
    3. In the Shortcut to Winapp1.exe Properties dialog box, click the Shortcut tab.
    4. On the Shortcut tab, notice that the value that appears in the Target box is C:\InstalledProjects\Setupproj1\bin\Winapp1.exe.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to reproduce the problem

To reproduce this problem, follow these steps:
  1. Create a Windows Application project:
    1. Start Visual Studio .NET.
    2. On the File menu, point to New, and then click Project. The New Project dialog box appears.
    3. Under Project Types, click Visual C# Projects.
    4. Under Templates, click Windows Application.
    5. In the Name box, type Winapp1.
    6. In the Location box, type C:\Winprojects, and then click OK.
    7. On the Build menu, click Build Solution.
  2. Create a Windows Installer project:
    1. Start Visual Studio .NET.
    2. On the File menu, point to New, and then click Project. The New Project dialog box appears.
    3. Under Project Types, click Setup and Deployment Projects.
    4. Under Templates, click Setup Project.
    5. In the Name box, type Setupproj1.
    6. In the Location box, type C:\Setupprojects, and then click OK.
  3. Add files to Setupproj1:
    1. Add the files from the Winapp1 folder to Setupproj1:
      1. On the File System (Setupproj1) tab, right-click Application Folder, point to Add, and then click File. The Add Files dialog box appears.
      2. In the Add Files dialog box, locate the C:\Winprojects\Winapp1 folder.
      3. Select all the files that appear in the Winapp1 folder, and then click Open.
    2. Add the Bin folder to Setupproj1:
      1. In the File System (Setupproj1) window, right-click the Application Folder folder, point to Add, and then click Folder.
      2. For the name of the new folder, type bin.
    3. Add the Winapp1.exe file from the C:\Winprojects\Winapp1\Bin\Debug folder to Setupproj1:
      1. On the File System (Setupproj1) tab, right-click the bin folder, point to Add, and then click File. The Add Files dialog box appears.
      2. In the Add Files dialog box, locate the C:\Winprojects\Winapp1\Bin\Debug folder.
      3. Click the Winapp1.exe file, and then click Open.
    4. Add a shortcut file to Setupproj1:
      1. In the right pane, right-click Winapp1.exe, and then click Create Shortcut to Winapp1.exe.
      2. Move the Shortcut to Winapp1.exe file to the Application Folder folder.
    5. On the Build menu, click Build Solution. The Setupproj1.msi file is created in the C:\Setupprojects\Setupproj1\Debug folder.

      back to the "Workaround" section
  4. Quit Visual Studio .NET.
  5. Install the Setup file:
    1. In Windows Explorer, locate the C:\Setupprojects\Setupproj1\Debug folder.
    2. Double-click the Setupproj1.msi file. The Setup Wizard starts.
    3. On the Welcome to the Setupproj1 Setup Wizard page, click Next.
    4. On the Select Installation Folder page, type C:\InstalledProjects\Setupproj1 in the Folder box, and then click Next.
    5. On the Confirm Installation page, click Next.
    6. On the Installation Complete page, click Close.
  6. Verify that the shortcut file for the destination file exists:
    1. In Windows Explorer, locate the C:\InstalledProjects\Setupproj1 folder.
    2. Right-click the Shortcut to Winapp1.exe file, and then click Properties. The Shortcut to Winapp1.exe Properties dialog box appears.
    3. Click the Shortcut tab.
    4. On the Shortcut tab, notice that the value in the Target box is Setupproj1. This is the name of the Windows installer project that you created in step 2.

      The expected value in the Target box is C:\InstalledProjects\Setupproj1\bin\Winapp1.exe. This is the path of the destination file that you created this shortcut to in step 3d.

Modification Type:MinorLast Reviewed:5/23/2005
Keywords:kbDeployment kbsetup kbPDWizard kbIDEProject kbAppWizard kbprb KB830612 kbAudDeveloper