Skip to content

Commit 81eeb76

Browse files
chore: skip Setup/SetupBootstrapper build when WiX is not installed
Agent-Logs-Url: https://github.com/spaghettidba/WorkloadTools/sessions/9e17984c-014d-4765-a5f1-b320fe77795b Co-authored-by: spaghettidba <7592822+spaghettidba@users.noreply.github.com>
1 parent 803484a commit 81eeb76

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Setup/Setup.wixproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@
5858
<PropertyGroup>
5959
<PostBuildEvent>call $(ProjectDir)postbuild.bat "$(TargetPath)" "$(TargetDir)WorkloadTools_$(Platform)$(TargetExt)"</PostBuildEvent>
6060
</PropertyGroup>
61-
<Import Project="$(WixTargetsPath)" />
61+
<Import Project="$(WixTargetsPath)" Condition="Exists('$(WixTargetsPath)')" />
6262
<Target Name="EnsureWixTargetsImported" BeforeTargets="PrepareForBuild" Condition=" '$(WixTargetsImported)' == '' ">
63-
<Error Text="WiX Toolset v3 build targets were not found at '$(WixTargetsPath)'. Please install WiX Toolset v3.x from https://wixtoolset.org/." />
63+
<Warning Text="WiX Toolset v3 build targets were not found at '$(WixTargetsPath)'. Build skipped. Use buildmsi.ps1 to build the installer." />
64+
</Target>
65+
<Target Name="Build" Condition=" '$(WixTargetsImported)' == '' ">
66+
<Message Text="Setup project skipped: WiX Toolset v3 is not installed. Use buildmsi.ps1 to build the installer." Importance="high" />
6467
</Target>
6568
</Project>

SetupBootstrapper/SetupBootstrapper.wixproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@
6161
<PropertyGroup>
6262
<PostBuildEvent>call $(ProjectDir)postbuild.bat "$(TargetPath)" "$(TargetDir)WorkloadTools_$(Platform)$(TargetExt)"</PostBuildEvent>
6363
</PropertyGroup>
64-
<Import Project="$(WixTargetsPath)" />
64+
<Import Project="$(WixTargetsPath)" Condition="Exists('$(WixTargetsPath)')" />
6565
<Target Name="EnsureWixTargetsImported" BeforeTargets="PrepareForBuild" Condition=" '$(WixTargetsImported)' == '' ">
66-
<Error Text="WiX Toolset v3 build targets were not found at '$(WixTargetsPath)'. Please install WiX Toolset v3.x from https://wixtoolset.org/." />
66+
<Warning Text="WiX Toolset v3 build targets were not found at '$(WixTargetsPath)'. Build skipped. Use buildexe.ps1 to build the bootstrapper." />
67+
</Target>
68+
<Target Name="Build" Condition=" '$(WixTargetsImported)' == '' ">
69+
<Message Text="SetupBootstrapper project skipped: WiX Toolset v3 is not installed. Use buildexe.ps1 to build the bootstrapper." Importance="high" />
6770
</Target>
6871
</Project>

0 commit comments

Comments
 (0)