Updated to include new dir, inclusion of tags. Version appears in Control Panel now. Also appears in TItlebar of AppWindow.
This commit is contained in:
@@ -1,34 +1,56 @@
|
||||
<Project Sdk="WixToolset.Sdk/6.0.0">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="WixToolset.UI.wixext" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Force embedding files into the MSI (no external .cab file) -->
|
||||
<EmbedCab>true</EmbedCab>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<WixExtensionInclude>WixToolset.UI.wixext</WixExtensionInclude>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DefineConstants>PublishDir=C:\Users\Sonder\source\repos\psg-oversight-app\PublishDir</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\DLShortcut.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Assets\trayicon.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixSource Include="HarvestedFiles.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="bpl.rtf">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Assets\windowsdesktop-runtime-8.0.13-win-x64.exe" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
<!-- ✅ 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>
|
||||
|
||||
Reference in New Issue
Block a user