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,32 +1,46 @@
|
||||
<!--
|
||||
This file allow for customizing your build process.
|
||||
This file allows for customizing your build process.
|
||||
See: https://learn.microsoft.com/visualstudio/msbuild/customize-your-build
|
||||
-->
|
||||
<Project>
|
||||
<!--
|
||||
Uncomment if you need to enable inclusion of another Directory.Build.props file from a parent directory
|
||||
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
|
||||
-->
|
||||
|
||||
<PropertyGroup>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>12</LangVersion>
|
||||
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
|
||||
<!--
|
||||
If you you like to see source generated files saved to disk you can enable the following:
|
||||
https://learn.microsoft.com/dotnet/csharp/roslyn-sdk/source-generators-overview?WT.mc_id=DT-MVP-5003472
|
||||
-->
|
||||
<!--<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>-->
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
This allows all projects to share the same user secrets file.
|
||||
If you want project to have their own, set it to a different GUID on each project.
|
||||
See: https://learn.microsoft.com/dotnet/architecture/microservices/secure-net-microservices-web-applications/developer-app-secrets-storage
|
||||
-->
|
||||
<PropertyGroup Label="User Secrets">
|
||||
<UserSecretsId>1ef91ee6-7b55-474e-ab2b-2d164b723a56</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
<!-- 🔹 Automatically derive version from latest Git tag -->
|
||||
<Target Name="GetVersionFromGit" BeforeTargets="GetAssemblyVersion">
|
||||
<!-- Get the most recent tag (like v1.1.1) -->
|
||||
<Exec Command="git describe --tags --abbrev=0" ConsoleToMSBuild="true" IgnoreExitCode="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="GitTag" />
|
||||
</Exec>
|
||||
|
||||
<!-- Strip leading 'v' if present -->
|
||||
<PropertyGroup>
|
||||
<GitVersion>$([System.Text.RegularExpressions.Regex]::Replace('$(GitTag)', '^v', ''))</GitVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Fallback if no tags exist yet -->
|
||||
<PropertyGroup Condition="'$(GitVersion)' == ''">
|
||||
<GitVersion>0.0.0</GitVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Apply to assembly and file versions -->
|
||||
<Message Text="🔖 Using version: $(GitVersion)" Importance="High" />
|
||||
<PropertyGroup>
|
||||
<Version>$(GitVersion)</Version>
|
||||
<FileVersion>$(GitVersion)</FileVersion>
|
||||
<AssemblyVersion>$(GitVersion)</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -57,8 +57,24 @@ namespace LD_SysInfo
|
||||
System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
|
||||
|
||||
InitializeComponent();
|
||||
var fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
|
||||
VersionTextBlock.Text = $"v{fvi.ProductVersion}";
|
||||
var exePath = Assembly.GetEntryAssembly()?.Location;
|
||||
|
||||
if (string.IsNullOrEmpty(exePath))
|
||||
{
|
||||
exePath = Process.GetCurrentProcess().MainModule?.FileName;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(exePath))
|
||||
{
|
||||
var fvi = FileVersionInfo.GetVersionInfo(exePath);
|
||||
var productVersion = fvi.ProductVersion ?? "0.0.0";
|
||||
var cleanVersion = productVersion.Split('+')[0];
|
||||
VersionTextBlock.Text = $"v{cleanVersion}";
|
||||
}
|
||||
else
|
||||
{
|
||||
VersionTextBlock.Text = "v0.0.0";
|
||||
}
|
||||
LoadConfig();
|
||||
DisplaySystemInfo();
|
||||
AutoLogin();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 isn’t 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>
|
||||
|
||||
Reference in New Issue
Block a user