diff --git a/code/src/Core/Locations/RemoteTemplatesLocation.cs b/code/src/Core/Locations/RemoteTemplatesLocation.cs
index 311692f23..c633a3fd6 100644
--- a/code/src/Core/Locations/RemoteTemplatesLocation.cs
+++ b/code/src/Core/Locations/RemoteTemplatesLocation.cs
@@ -162,16 +162,6 @@ namespace Microsoft.Templates.Core.Locations
}
}
- public static string GetVersionFromFile(string versionFilePath)
- {
- var version = "0.0.0";
- if (File.Exists(versionFilePath))
- {
- version = File.ReadAllText(versionFilePath);
- }
- return version;
- }
-
private static void SafeCleanUpTempFolder(string usedTempFolder)
{
try
diff --git a/code/src/Core/Locations/TemplatesLocation.cs b/code/src/Core/Locations/TemplatesLocation.cs
index 013fa681f..4ac772733 100644
--- a/code/src/Core/Locations/TemplatesLocation.cs
+++ b/code/src/Core/Locations/TemplatesLocation.cs
@@ -19,6 +19,12 @@ namespace Microsoft.Templates.Core.Locations
public abstract void Adquire(string workingFolder);
public abstract bool Update(string workingFolder);
+ public string GetVersion(string workingFolder)
+ {
+ var fileName = Path.Combine(workingFolder, Path.Combine(TemplatesName, VersionFileName));
+ return GetVersionFromFile(fileName);
+ }
+
protected static void SafeDelete(string directoryPath)
{
if (Directory.Exists(directoryPath))
@@ -50,5 +56,15 @@ namespace Microsoft.Templates.Core.Locations
CopyRecursive(directory, Path.Combine(targetDir, Path.GetFileName(directory)));
}
}
+
+ protected static string GetVersionFromFile(string versionFilePath)
+ {
+ var version = "0.0.0";
+ if (File.Exists(versionFilePath))
+ {
+ version = File.ReadAllText(versionFilePath);
+ }
+ return version;
+ }
}
}
diff --git a/code/src/Core/TemplatesRepository.cs b/code/src/Core/TemplatesRepository.cs
index fb6c388e5..19a7360a2 100644
--- a/code/src/Core/TemplatesRepository.cs
+++ b/code/src/Core/TemplatesRepository.cs
@@ -52,6 +52,12 @@ namespace Microsoft.Templates.Core
await AdquireContentAsync();
}
}
+
+ public string GetVersion()
+ {
+ return _location.GetVersion(WorkingFolder);
+ }
+
private async Task AdquireContentAsync()
{
SyncStatusChanged?.Invoke(this, SyncStatus.Adquiring);
diff --git a/code/src/Wizard/Host/WizardHost.xaml b/code/src/Wizard/Host/WizardHost.xaml
index fba509c45..63f6e04d3 100644
--- a/code/src/Wizard/Host/WizardHost.xaml
+++ b/code/src/Wizard/Host/WizardHost.xaml
@@ -39,8 +39,17 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/code/src/Wizard/Host/WizardHostViewModel.cs b/code/src/Wizard/Host/WizardHostViewModel.cs
index e9718792d..3cdcd4870 100644
--- a/code/src/Wizard/Host/WizardHostViewModel.cs
+++ b/code/src/Wizard/Host/WizardHostViewModel.cs
@@ -8,6 +8,7 @@ using Microsoft.Templates.Wizard.Steps;
using Microsoft.Templates.Wizard.ViewModels;
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
@@ -57,8 +58,12 @@ namespace Microsoft.Templates.Wizard.Host
try
{
+ WizardVersion = GetWizardVersion();
+
await GenContext.ToolBox.Repo.SynchronizeAsync();
Status = string.Empty;
+
+ TemplatesVersion = GenContext.ToolBox.Repo.GetVersion();
}
catch (Exception ex)
{
@@ -69,6 +74,14 @@ namespace Microsoft.Templates.Wizard.Host
}
}
+ private string GetWizardVersion()
+ {
+ string assemblyLocation = Assembly.GetExecutingAssembly().Location;
+ var versionInfo = FileVersionInfo.GetVersionInfo(assemblyLocation);
+
+ return versionInfo.FileVersion;
+ }
+
private string GetStatusText(SyncStatus status)
{
switch (status)
@@ -93,6 +106,20 @@ namespace Microsoft.Templates.Wizard.Host
set { SetProperty(ref _status, value); }
}
+ private string _wizardVersion;
+ public string WizardVersion
+ {
+ get { return _wizardVersion; }
+ set { SetProperty(ref _wizardVersion, value); }
+ }
+
+ private string _templatesVersion;
+ public string TemplatesVersion
+ {
+ get { return _templatesVersion; }
+ set { SetProperty(ref _templatesVersion, value); }
+ }
+
private string _stepTitle;
public string StepTitle
{
diff --git a/code/src/Wizard/Styles/WizardTheme.xaml b/code/src/Wizard/Styles/WizardTheme.xaml
index 57d89426a..25a10a179 100644
--- a/code/src/Wizard/Styles/WizardTheme.xaml
+++ b/code/src/Wizard/Styles/WizardTheme.xaml
@@ -29,10 +29,24 @@
+
+
+
+
+