Metro App Version Information Software

How can I get the version number of my application in metro javascript?

For example, this is the version of our application 1.2, how can I get the version number in my javascript metacode?

+7
source share
3 answers

You can use the Windows.ApplicationModel.Package.current.id.version object to reference the version specified in the application manifest.

The version object contains the properties "build, major, minor and revision".

See http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.package.aspx for details

+9
source

Use this helper method to get the version as a full string :

function getAppVersion() { var p = Windows.ApplicationModel.Package.current.id.version; return p.major + "." + p.minor + "." + p.build + "." + p.revision; } 

To display it to the user:

 document.getElementById("version").innerHTML = "version " + getAppVersion(); 

It is assumed that you add this tag:

 <span id="version"></span> 
+11
source

How about this

 function getCurrentApplicationVersion() { var currentVersion = Windows.ApplicationModel.Package.current.id.version; var values = []; for (var key in currentVersion) { values.push(currentVersion[key]); } return values.join('.'); } 
0
source

All Articles