Skip to content

Commit

Permalink
-set version metadata properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewis Kirkaldie committed Aug 24, 2022
1 parent e997b97 commit 5c00570
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 11 additions & 3 deletions Helpers/Product.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ static Product()
var assembly = Assembly.GetExecutingAssembly();

var appFile = Path.Combine(AppContext.BaseDirectory, "streamgoo");

if (File.Exists(appFile))
{
var versionInfo = FileVersionInfo.GetVersionInfo(appFile);
Expand All @@ -28,10 +27,19 @@ static Product()
}
else if (File.Exists($"{appFile}.exe"))
{
var versionInfo = FileVersionInfo.GetVersionInfo($"{appFile}.exe");
var filePath = $"{appFile}.exe";
var versionInfo = FileVersionInfo.GetVersionInfo(filePath);

Version = versionInfo.FileVersion;
BuildTime = File.GetCreationTime(appFile);
BuildTime = File.GetCreationTime(filePath);
}
else if (File.Exists($"{appFile}.dll"))
{
var filePath = $"{appFile}.dll";
var versionInfo = FileVersionInfo.GetVersionInfo(filePath);

Version = versionInfo.FileVersion;
BuildTime = File.GetCreationTime(filePath);
}

Name = "StreamGoo";
Expand Down
8 changes: 7 additions & 1 deletion StreamGoo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Version>2.0.0</Version>
<Copyright>2015-2022 Cinegy GmbH. All rights reserved</Copyright>
<Authors>Cinegy GmbH</Authors>
<Product>Cinegy Resource Coordination Service</Product>
<AssemblyVersion>2.0.0.1</AssemblyVersion>
<FileVersion>2.0.0.1</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5c00570

Please sign in to comment.