57 lines
2.4 KiB
XML
57 lines
2.4 KiB
XML
<Project Sdk="WixToolset.Sdk/6.0.0">
|
|
|
|
<!-- ✅ Defaults -->
|
|
<PropertyGroup>
|
|
<Version>0.0.0</Version>
|
|
<Platform>x64</Platform>
|
|
<InstallerPlatform>x64</InstallerPlatform>
|
|
<EmbedCab>true</EmbedCab>
|
|
<WixExtensionInclude>WixToolset.UI.wixext</WixExtensionInclude>
|
|
</PropertyGroup>
|
|
|
|
<!-- ✅ STEP 1: Run Git BEFORE WiX compilation -->
|
|
<Target Name="SetVersionFromGit" BeforeTargets="BeforeBuild">
|
|
<Exec Command="git describe --tags --abbrev=0" ConsoleToMSBuild="true" IgnoreExitCode="true">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="GitTag" />
|
|
</Exec>
|
|
|
|
<PropertyGroup Condition="'$(GitTag)' != ''">
|
|
<GitTagTrimmed>$([System.Text.RegularExpressions.Regex]::Replace('$(GitTag)', '\s', ''))</GitTagTrimmed>
|
|
<GitVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(GitTagTrimmed)', '^v', ''))</GitVersion>
|
|
<Version>$(GitVersion)</Version>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<DefineConstants>
|
|
Version=$(Version);
|
|
PublishDir=C:\Users\Sonder\source\repos\psg-oversight-app\PublishDir
|
|
</DefineConstants>
|
|
<OutputName>OversightInstaller_$(Version)_$(Platform)</OutputName>
|
|
</PropertyGroup>
|
|
|
|
<Message Text="📦 Building OversightInstaller version $(Version)" Importance="high" />
|
|
<Message Text="📦 WiX DefineConstants=$(DefineConstants)" Importance="high" />
|
|
</Target>
|
|
|
|
<!-- ✅ STEP 2: Rename the MSI after build -->
|
|
<Target Name="RenameMsi" AfterTargets="Build">
|
|
<PropertyGroup>
|
|
<BuiltMsi>$(OutputPath)OversightInstaller_$(Version)_$(Platform).msi</BuiltMsi>
|
|
<ActualMsi>$(OutputPath)OversightInstaller.msi</ActualMsi>
|
|
</PropertyGroup>
|
|
|
|
<Message Text="📦 Renaming $(ActualMsi) → $(BuiltMsi)" Importance="high" />
|
|
<Exec Command="move /Y "$(ActualMsi)" "$(BuiltMsi)"" />
|
|
</Target>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="WixToolset.UI.wixext" />
|
|
<WixSource Include="HarvestedFiles.wxs" />
|
|
<Content Include="Assets\DLShortcut.ico" CopyToOutputDirectory="Always" />
|
|
<Content Include="Assets\trayicon.ico" CopyToOutputDirectory="Always" />
|
|
<Content Include="bpl.rtf" CopyToOutputDirectory="Always" />
|
|
<None Include="Assets\windowsdesktop-runtime-8.0.13-win-x64.exe" />
|
|
</ItemGroup>
|
|
|
|
</Project>
|