Skip to content

Commit

Permalink
Add AssemblyInfo patching with version information
Browse files Browse the repository at this point in the history
  • Loading branch information
codebrain committed Oct 26, 2018
1 parent de911a1 commit 11dd759
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions installer/build/scripts/Build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,33 @@ open System
open System.Diagnostics
open System.IO
open Fake
open Fake.Git
open Products.Products
open Products.Paths
open Products
open System.Text
open Fake.FileHelper
open Fake.AssemblyInfoFile

module Builder =

let patchAssemblyInformation (version:Version) =
let version = version.FullVersion
let commitHash = Information.getCurrentHash()
CreateCSharpAssemblyInfo (MsiDir @@ "Properties/AssemblyInfo.cs")
[Attribute.Title "Installer"
Attribute.Description "Elasticsearch ODBC Installer."
Attribute.Guid "44555887-c439-470c-944d-8866ec3d7067"
Attribute.Product "Elasticsearch ODBC Installer"
Attribute.Metadata("GitBuildHash", commitHash)
Attribute.Company "Elasticsearch B.V."
Attribute.Copyright "Elastic License. Copyright Elasticsearch."
Attribute.Trademark "Elasticsearch is a trademark of Elasticsearch B.V."
Attribute.Version version
Attribute.FileVersion version
Attribute.InformationalVersion version // Attribute.Version and Attribute.FileVersion normalize the version number, so retain the prelease suffix
]

let Sign file (product : ProductVersions) =
tracefn "Signing MSI"
let release = getBuildParam "release" = "1"
Expand Down Expand Up @@ -70,6 +89,8 @@ module Builder =
product.Versions
|> List.iter(fun version ->

patchAssemblyInformation (version)

let exitCode = ExecProcess (fun info ->
info.FileName <- sprintf "%sOdbcInstaller" MsiBuildDir
info.WorkingDirectory <- MsiDir
Expand Down

0 comments on commit 11dd759

Please sign in to comment.