views:

424

answers:

1

I am building an InstallShield project using the InstallShield MSBuild targets. I have been struggling with overriding the path variables. Nothing I do seems to be picked up by the InstallShield build. The help page was not very... helpful.

+1  A: 

There are a few gotchas that are not addressed in the documentation. In your .isproj file, place your path overrides within an ItemGroup like so. The item must be named “InstallShieldPathVariableOverrides” and contain one “PathVariable” element.:

<!-- Override Path Variables for the project -->
<ItemGroup>
  <InstallShieldPathVariableOverrides Include="$(AnMSBuildVariable)\Win32\Installer">
    <PathVariable>MY_BUILD_PATH</PathVariable>
  </InstallShieldPathVariableOverrides>
  <InstallShieldPathVariableOverrides Include="$(AnMSBuildVariable)\Win32\Installer\Reports">
    <PathVariable>MY_REPORTS_PATH</PathVariable>
  </InstallShieldPathVariableOverrides>
</ItemGroup>

Also, if you have child path variables that include an overridden path, you have to over-ride those too: the inheritence won’t pick up the inherited override. (See the example, the original path variable may have defined MY_REPORTS_PATH as MY_BUILD_PATH\Reports but it must be explicitly overridden.)

Aidan Ryan