Using the VSSolutionFolder Path Variable with Visual Studio Solutions

InstallShield 2015

Project: This information applies to the following project types:

Advanced UI
Basic MSI
InstallScript
InstallScript MSI
Merge Module
Suite/Advanced UI

A predefined path variable called VSSolutionFolder is available in projects to reference a higher-level base directory. This support enables you to have in your InstallShield projects static links to files in sibling projects that are within the Visual Studio solution folder; if you work on the projects on a different machine, the static links that use the VSSolutionFolder path variable can reference the correct paths for the files in sibling projects.

The VSSolutionFolder path variable is defined automatically whenever an InstallShield project is opened from within a Visual Studio solution. It is also defined automatically if you are using MSBuild to build a solution that contains an InstallShield project. However, in other scenarios, when the InstallShield project is opened without the Visual Studio solution, VSSolutionFolder cannot be defined automatically. For example, if you open the InstallShield project in InstallShield directly, without having Visual Studio open, VSSolutionFolder is not defined. Similarly, if you use the command-line tool IsCmdBld.exe, or if you use MSBuild with an .isproj file, VSSolutionFolder is not defined. If you are using IsCmdBld.exe to build a release in InstallShield project, use the -L command-line parameter to set the value of VSSolutionFolder. If you are using MSBuild, use the PathVariables parameter to set the value of VSSolutionFolder. This parameter is exposed as the ItemGroup InstallShieldPathVariableOverrides when the default targets file is used.

If you include in your InstallShield project a source file whose path includes the VSSolutionFolder path variable and build it in an environment that does not support the VSSolutionFolder path variable, build errors such as the following ones may occur:

-6103: Could not find file <VSSolutionFolder>\MyFile.exe
-6271: File <VSSolutionFolder>\MyFile.exe not found. An error occurred building the MsiFileHash table record for this file. Verify that the file exists in the specified location.

See Also