Revised build versioning

Changed the build versioning to use an incrementing build version per build (and revision version per release build) as per https://stackoverflow.com/questions/826777/how-to-have-an-auto-incrementing-version-number-visual-studio. This uses an AssemblyInfo.tt T4 template to customise the versioning so that the application version can be set using the AssemblyVersion variable within the Visual Studio application properties. This makes it dead easy to change!

The Wix Program.wxs was also changed to use that new 4 digit version number as the versioning, which should help immensely with beta testing updates. No more asking people to uninstall the previous version as the new build will automatically upgrade the earlier version!
This commit is contained in:
Terry MacDonald 2021-09-30 10:26:17 +13:00
parent 9531dc717a
commit 9eafe478fc
11 changed files with 390 additions and 42 deletions

View File

@ -122,6 +122,7 @@
<Compile Include="ImageUtils.cs" /> <Compile Include="ImageUtils.cs" />
<Compile Include="ProcessUtils.cs" /> <Compile Include="ProcessUtils.cs" />
<Compile Include="ProgramSettings.cs" /> <Compile Include="ProgramSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
@ -168,6 +169,12 @@
<Compile Include="UIForms\ShortcutLibraryForm.Designer.cs"> <Compile Include="UIForms\ShortcutLibraryForm.Designer.cs">
<DependentUpon>ShortcutLibraryForm.cs</DependentUpon> <DependentUpon>ShortcutLibraryForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UIForms\StartMessageForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UIForms\StartMessageForm.Designer.cs">
<DependentUpon>StartMessageForm.cs</DependentUpon>
</Compile>
<Compile Include="UIForms\StartProgramControl.cs"> <Compile Include="UIForms\StartProgramControl.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
@ -199,7 +206,6 @@
<DependentUpon>DisplayProfileForm.cs</DependentUpon> <DependentUpon>DisplayProfileForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Resources\Language.resx"> <EmbeddedResource Include="Resources\Language.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Language.Designer.cs</LastGenOutput> <LastGenOutput>Language.Designer.cs</LastGenOutput>
@ -234,6 +240,9 @@
<DependentUpon>ShortcutLibraryForm.cs</DependentUpon> <DependentUpon>ShortcutLibraryForm.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UIForms\StartMessageForm.resx">
<DependentUpon>StartMessageForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UIForms\StartProgramControl.resx"> <EmbeddedResource Include="UIForms\StartProgramControl.resx">
<DependentUpon>StartProgramControl.cs</DependentUpon> <DependentUpon>StartProgramControl.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -369,6 +378,9 @@
</COMReference> </COMReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>"$(DevEnvDir)TextTransform.exe" -a !!BuildConfiguration!$(Configuration) "$(ProjectDir)Properties\AssemblyInfo.tt"</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -1014,7 +1014,8 @@ namespace DisplayMagician {
if (args.IsUpdateAvailable) if (args.IsUpdateAvailable)
{ {
logger.Info($"MainForm/AutoUpdaterOnCheckForUpdateEvent - There is an upgrade to version {args.CurrentVersion} available from {args.DownloadURL}. We're using version {args.InstalledVersion} at the moment."); logger.Info($"MainForm/AutoUpdaterOnCheckForUpdateEvent - There is an upgrade to version {args.CurrentVersion} available from {args.DownloadURL}. We're using version {args.InstalledVersion} at the moment.");
DialogResult dialogResult; DialogResult dialogResult;
if (args.Mandatory.Value) if (args.Mandatory.Value)
{ {
logger.Info($"MainForm/AutoUpdaterOnCheckForUpdateEvent - New version {args.CurrentVersion} available. Current version is {args.InstalledVersion}. Mandatory upgrade."); logger.Info($"MainForm/AutoUpdaterOnCheckForUpdateEvent - New version {args.CurrentVersion} available. Current version is {args.InstalledVersion}. Mandatory upgrade.");
@ -1037,7 +1038,7 @@ namespace DisplayMagician {
} }
// Uncomment the following line if you want to show standard update dialog instead. // Uncomment the following line if you want to show standard update dialog instead.
// AutoUpdater.ShowUpdateForm(args); //AutoUpdater.ShowUpdateForm(args);
if (dialogResult.Equals(DialogResult.Yes) || dialogResult.Equals(DialogResult.OK)) if (dialogResult.Equals(DialogResult.Yes) || dialogResult.Equals(DialogResult.OK))
{ {

View File

@ -1,18 +1,17 @@
using System;
using System.Resources; using System;
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DisplayMagician")] [assembly: AssemblyTitle("DisplayMagician")]
[assembly: AssemblyDescription("Automatically run your games with a different display profile and revert when finished.")] [assembly: AssemblyDescription("Automatically run your games with a different display profile and revert when finished.")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("LittleBitBig")] [assembly: AssemblyCompany("LittleBitBig")]
[assembly: AssemblyProduct("DisplayMagician")] [assembly: AssemblyProduct("DisplayMagician")]
[assembly: AssemblyCopyright("Copyright © Terry MacDonald 2020-2021")] [assembly: AssemblyCopyright("Copyright © Terry MacDonald 2020-2021")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@ -26,19 +25,9 @@ using System.Runtime.InteropServices;
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")] [assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information for an assembly consists of the following four values: // Version information
// [assembly: AssemblyVersion("2.0.0.1")]
// Major Version [assembly: AssemblyFileVersion("2.0.0.1")]
// Minor Version [assembly: NeutralResourcesLanguageAttribute( "en" )]
// Build Number [assembly: CLSCompliant(true)]
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: CLSCompliant(true)]

View File

@ -0,0 +1,44 @@
using System;
using System.Resources;
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DisplayMagician")]
[assembly: AssemblyDescription("Automatically run your games with a different display profile and revert when finished.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("LittleBitBig")]
[assembly: AssemblyProduct("DisplayMagician")]
[assembly: AssemblyCopyright("Copyright © Terry MacDonald 2020-2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: CLSCompliant(true)]

View File

@ -0,0 +1,57 @@
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".cs" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#
string output = File.ReadAllText(this.Host.ResolvePath("AssemblyInfo.cs"));
Regex pattern = new Regex("AssemblyVersion\\(\"(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<revision>\\d+)\\.(?<build>\\d+)\"\\)");
MatchCollection matches = pattern.Matches(output);
if( matches.Count == 1 )
{
major = Convert.ToInt32(matches[0].Groups["major"].Value);
minor = Convert.ToInt32(matches[0].Groups["minor"].Value);
build = Convert.ToInt32(matches[0].Groups["build"].Value) + 1;
revision = Convert.ToInt32(matches[0].Groups["revision"].Value);
if( this.Host.ResolveParameterValue("-","-","BuildConfiguration") == "Release" )
revision++;
}
#>
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// General Information
[assembly: AssemblyTitle("DisplayMagician")]
[assembly: AssemblyDescription("Automatically run your games with a different display profile and revert when finished.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("LittleBitBig")]
[assembly: AssemblyProduct("DisplayMagician")]
[assembly: AssemblyCopyright("Copyright © Terry MacDonald 2020-2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information
[assembly: AssemblyVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.<#= this.build #>")]
[assembly: AssemblyFileVersion("<#= this.major #>.<#= this.minor #>.<#= this.revision #>.<#= this.build #>")]
[assembly: NeutralResourcesLanguageAttribute( "en" )]
[assembly: CLSCompliant(true)]
<#+
int major = 2;
int minor = 0;
int revision = 0;
int build = 0;
#>

View File

@ -0,0 +1,99 @@

namespace DisplayMagician.UIForms
{
partial class StartMessageForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lbl_profile_shown = new System.Windows.Forms.Label();
this.rtb_message = new System.Windows.Forms.RichTextBox();
this.btn_back = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lbl_profile_shown
//
this.lbl_profile_shown.AutoSize = true;
this.lbl_profile_shown.BackColor = System.Drawing.Color.Black;
this.lbl_profile_shown.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lbl_profile_shown.ForeColor = System.Drawing.Color.White;
this.lbl_profile_shown.Location = new System.Drawing.Point(478, 18);
this.lbl_profile_shown.Name = "lbl_profile_shown";
this.lbl_profile_shown.Size = new System.Drawing.Size(318, 29);
this.lbl_profile_shown.TabIndex = 20;
this.lbl_profile_shown.Text = "Important Upgrade Message";
//
// rtb_message
//
this.rtb_message.Location = new System.Drawing.Point(0, 62);
this.rtb_message.Name = "rtb_message";
this.rtb_message.ReadOnly = true;
this.rtb_message.Size = new System.Drawing.Size(1275, 732);
this.rtb_message.TabIndex = 21;
this.rtb_message.Text = "";
//
// btn_back
//
this.btn_back.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn_back.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btn_back.FlatAppearance.MouseDownBackColor = System.Drawing.Color.IndianRed;
this.btn_back.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Brown;
this.btn_back.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_back.ForeColor = System.Drawing.Color.White;
this.btn_back.Location = new System.Drawing.Point(1187, 809);
this.btn_back.Name = "btn_back";
this.btn_back.Size = new System.Drawing.Size(75, 23);
this.btn_back.TabIndex = 22;
this.btn_back.Text = "&Back";
this.btn_back.UseVisualStyleBackColor = true;
this.btn_back.Click += new System.EventHandler(this.btn_back_Click);
//
// StartMessageForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(1274, 844);
this.Controls.Add(this.btn_back);
this.Controls.Add(this.rtb_message);
this.Controls.Add(this.lbl_profile_shown);
this.Name = "StartMessageForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "DisplayMagician - Startup Message";
this.Load += new System.EventHandler(this.StartMessageForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbl_profile_shown;
private System.Windows.Forms.RichTextBox rtb_message;
private System.Windows.Forms.Button btn_back;
}
}

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace DisplayMagician.UIForms
{
public partial class StartMessageForm : Form
{
public string Filename;
public StartMessageForm()
{
InitializeComponent();
}
private void btn_back_Click(object sender, EventArgs e)
{
this.Close();
}
private void StartMessageForm_Load(object sender, EventArgs e)
{
if (File.Exists(Filename))
{
rtb_message.LoadFile(Filename, RichTextBoxStreamType.RichText);
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -21,7 +21,7 @@
<File Id="filDE7F24A649EB60701DC0EC41FE83CBBE" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\CircularProgressBar.dll" /> <File Id="filDE7F24A649EB60701DC0EC41FE83CBBE" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\CircularProgressBar.dll" />
</Component> </Component>
<Component Id="cmp7EE113DB90D07F08FCE70C1861DEA947" Guid="{1E72FC84-ACAD-4A17-85B4-4D14A745882F}"> <Component Id="cmp7EE113DB90D07F08FCE70C1861DEA947" Guid="{1E72FC84-ACAD-4A17-85B4-4D14A745882F}">
<File Id="filF7D383DE2E27A23D8552666CEA0DDC80" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\DisplayMagician.exe" /> <File Id="DisplayMagicianExe" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\DisplayMagician.exe" />
</Component> </Component>
<Component Id="cmpCF520827D65E51E3ECB59344A6F528D0" Guid="{13A3918C-64B7-40B5-8AFE-362620B43184}"> <Component Id="cmpCF520827D65E51E3ECB59344A6F528D0" Guid="{13A3918C-64B7-40B5-8AFE-362620B43184}">
<File Id="fil2841FB135B81D3B7EF6634B1E3E562DA" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\DisplayMagician.exe.config" /> <File Id="fil2841FB135B81D3B7EF6634B1E3E562DA" KeyPath="yes" Source="$(var.DisplayMagician.TargetDir)\DisplayMagician.exe.config" />

View File

@ -1,16 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Include> <Include>
<!--
Versioning. These have to be changed for upgrades.
It's not enough to just include newer files.
-->
<?define MajorVersion="2" ?>
<?define MinorVersion="0" ?>
<?define PatchVersion="0" ?>
<!-- Revision is NOT used by WiX in the upgrade procedure -->
<!-- Full version number to display -->
<?define VersionNumber="$(var.MajorVersion).$(var.MinorVersion).$(var.PatchVersion)" ?>
<!-- <!--
Upgrade code HAS to be the same for all updates. Upgrade code HAS to be the same for all updates.
Once you've chosen it don't change it. Once you've chosen it don't change it.

View File

@ -9,18 +9,18 @@
Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build. Id="*" is to enable upgrading. * means that the product ID will be autogenerated on each build.
Name is made of localized product name and version number. Name is made of localized product name and version number.
--> -->
<Product Id="*" Name="!(loc.ProductName)" Language="!(loc.LANG)" Version="$(var.VersionNumber)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)"> <Product Id="*" Name="!(loc.ProductName)" Language="!(loc.LANG)" Version="!(bind.fileVersion.DisplayMagicianExe)" Manufacturer="!(loc.ManufacturerName)" UpgradeCode="$(var.UpgradeCode)">
<!-- Define the minimum supported installer version (3.0) and that the install should be done for the whole machine not just the current user --> <!-- Define the minimum supported installer version (3.0) and that the install should be done for the whole machine not just the current user -->
<Package InstallerVersion="314" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" Platform="x64"/> <Package InstallerVersion="314" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" Platform="x64"/>
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<!-- Upgrade settings. This will be explained in more detail in a future post --> <!-- Upgrade settings. This will be explained in more detail in a future post -->
<Upgrade Id="$(var.UpgradeCode)"> <Upgrade Id="$(var.UpgradeCode)">
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.VersionNumber)" IncludeMinimum="no" Property="NEWERFOUND" /> <UpgradeVersion OnlyDetect="yes" Minimum="!(bind.fileVersion.DisplayMagicianExe)" IncludeMinimum="no" Property="NEWERFOUND" />
<UpgradeVersion OnlyDetect="yes" Minimum="$(var.VersionNumber)" Maximum="$(var.VersionNumber)" IncludeMinimum="yes" IncludeMaximum="yes" Property="SELFFOUND" /> <UpgradeVersion OnlyDetect="yes" Minimum="!(bind.fileVersion.DisplayMagicianExe)" Maximum="!(bind.fileVersion.DisplayMagicianExe)" IncludeMinimum="yes" IncludeMaximum="yes" Property="SELFFOUND" />
<UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="no" Maximum="$(var.VersionNumber)" IncludeMaximum="no" Property="OLDER_VERSION_FOUND" IgnoreRemoveFailure="yes" /> <UpgradeVersion Minimum="0.0.0.0" IncludeMinimum="no" Maximum="!(bind.fileVersion.DisplayMagicianExe)" IncludeMaximum="no" Property="OLDER_VERSION_FOUND" IgnoreRemoveFailure="yes" />
</Upgrade> </Upgrade>
<CustomAction Id='AlreadyUpdated' Error='!(loc.ProductName) has already been updated to $(var.VersionNumber) or newer. If you want to reinstall this version then uninstall !(loc.ProductName) first.' /> <CustomAction Id='AlreadyUpdated' Error='!(loc.ProductName) has already been updated to !(bind.fileVersion.DisplayMagicianExe) or newer. If you want to reinstall this version then uninstall !(loc.ProductName) first.' />
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' /> <CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />
<!--<Condition Message="A newer version of [ProductName] is already installed."> <!--<Condition Message="A newer version of [ProductName] is already installed.">