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:
2025-10-10 14:32:49 +08:00
parent bab6cf7b75
commit 62cf2425b1
4 changed files with 170 additions and 83 deletions

View File

@@ -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 &quot;$(ActualMsi)&quot; &quot;$(BuiltMsi)&quot;" />
</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>

View File

@@ -1,39 +1,54 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="Oversight" Manufacturer="Paragon Systems Group" Version="1.0.0.0" UpgradeCode="e0e26d46-ed26-425e-a1bb-9bc76523ae6b">
<MajorUpgrade DowngradeErrorMessage="A newer version of this application is already installed." />
<!-- ✅ Safe default in case $(var.Version) is undefined -->
<?ifndef Version?>
<?define Version="0.0.0"?>
<?endif?>
<WixVariable
Id="WixUILicenseRtf"
Value="bpl.rtf"
/>
<!-- 🔍 Properties -->
<Property Id="ARPPRODUCTICON" Value="DLShortcutIcon" />
<Property Id="SERVER_URL" Value="http://your-default-server/api/register" />
<Package
Name="Oversight"
Manufacturer="Paragon Systems Group"
Version="$(var.Version)"
UpgradeCode="e0e26d46-ed26-425e-a1bb-9bc76523ae6b">
<Property Id="DisplayVersion" Value="$(var.Version)" />
<!-- 🔁 Automatic major-upgrade behavior -->
<MajorUpgrade DowngradeErrorMessage="A newer version of this application is already installed." />
<!-- ✅ Only define custom ARP metadata that isnt built-in -->
<Property Id="ARPPRODUCTICON" Value="DLShortcutIcon" />
<Property Id="ARPHELPLINK" Value="https://psg.net.au/" />
<Property Id="ARPCONTACT" Value="support@psg.net.au" />
<Property Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" />
<!-- Optional custom properties -->
<Property Id="SERVER_URL" Value="http://your-default-server/api/register" />
<Property Id="APP_EXECUTABLE" Value="PSG-Oversight.exe" />
<!-- 💬 EULA -->
<WixVariable Id="WixUILicenseRtf" Value="bpl.rtf" />
<!-- 🔧 UI -->
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" />
<ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" />
<!-- 🎨 Icon for Add/Remove Programs -->
<Icon Id="DLShortcutIcon" SourceFile="Assets\DLShortcut.ico" />
<!-- 🎨 Icon for Add/Remove Programs -->
<Icon Id="DLShortcutIcon" SourceFile="Assets\DLShortcut.ico" />
<!-- 📂 Installation Directory -->
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Oversight">
<!-- 📂 Installation Directory -->
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="PSGROOT" Name="PSG">
<Directory Id="INSTALLFOLDER" Name="Oversight">
<!-- Your files and harvested components go here -->
</Directory>
</Directory>
</StandardDirectory>
<!-- 📦 Application Files -->
<ComponentGroupRef Id="AppFiles" />
<!-- 📁 Assets Folder -->
</Directory>
</StandardDirectory>
<ComponentGroupRef Id="AppFiles" />
<!-- 📁 Start Menu Shortcut -->
<!-- 📁 Start Menu Shortcut -->
<StandardDirectory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Oversight">
<Component Id="StartMenuShortcutComponent" Guid="4C5466A9-CE33-48AE-B80C-08915A864DF2">
@@ -46,19 +61,39 @@
IconIndex="0" />
<RemoveFile Id="RemoveStartMenuShortcut" Name="Oversight.lnk" On="uninstall" />
<RemoveFolder Id="RemoveStartMenuFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\Oversight" Name="StartMenuShortcut" Type="integer" Value="1" KeyPath="yes"/>
<RegistryValue Root="HKCU" Key="Software\Oversight"
Name="StartMenuShortcut" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</StandardDirectory>
<!-- 📦 Feature References -->
<Feature Id="Main" Title="DL SysInfo" Level="1">
<ComponentGroupRef Id="AppFiles" />
<ComponentRef Id="StartMenuShortcutComponent" />
</Feature>
<!-- 💿 Media -->
<Media Id="1" Cabinet="embedded.cab" EmbedCab="yes" />
<!-- 64-bit component so ARP keys go to HKLM\Software (not Wow6432Node) -->
<Component Id="AppMetadata" Guid="E62354E8-3C7B-4B13-AFE2-A1E65A7F2E77" Bitness="always64">
<RegistryKey
Root="HKLM"
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode]">
<!-- Nice, branded ARP entry -->
<RegistryValue Name="DisplayName" Value="Oversight" Type="string" />
<RegistryValue Name="Publisher" Value="Paragon Systems Group" Type="string" />
<!-- Make version show in Control Panel; compile-time value from your wixproj -->
<RegistryValue Name="DisplayVersion" Value="$(var.Version)" Type="string" KeyPath="yes" />
</RegistryKey>
</Component>
</Package>
<!-- 🧱 Primary Feature -->
<Feature Id="Main" Title="DL SysInfo" Level="1">
<ComponentGroupRef Id="AppFiles" />
<ComponentRef Id="StartMenuShortcutComponent" />
<ComponentRef Id="AppMetadata" />
</Feature>
<!-- 💿 Media -->
<Media Id="1" Cabinet="embedded.cab" EmbedCab="yes" />
</Package>
</Wix>