Trim leading zeros from AppX package version (dotnet/core-setup#2587)
authorGaurav Khanna <gkhanna@microsoft.com>
Thu, 1 Jun 2017 20:03:09 +0000 (13:03 -0700)
committerGitHub <noreply@github.com>
Thu, 1 Jun 2017 20:03:09 +0000 (13:03 -0700)
* Trim leading zeros from AppX package version

* Use properties for Build and Revision version for AppX.

Commit migrated from https://github.com/dotnet/core-setup/commit/f76a4f863f2f70496033e35a8c45a50a8a882c1c

src/installer/pkg/projects/Microsoft.NET.CoreRuntime/Microsoft.NET.CoreRuntime.depproj

index cb4e453..e5192ee 100644 (file)
@@ -14,6 +14,9 @@
     <AppxIdentityName>Microsoft.NET.CoreRuntime.$(MajorVersion).$(MinorVersion)</AppxIdentityName>
     <AppxDisplayName>Microsoft.NET.CoreRuntime.$(MajorVersion).$(MinorVersion)</AppxDisplayName>
     
+    <BuildVersionAppX>$([System.Int32]::Parse($(BuildNumberMajor)))</BuildVersionAppX>
+    <RevisionVersionAppX>$([System.Int32]::Parse($(BuildNumberMinor)))</RevisionVersionAppX>
+
     <!-- path to contents of appx that will be zipped -->
     <AppxOutputPath>$(IntermediateOutputPath)$(AppxIdentityName)</AppxOutputPath>
     <OutputPath>$(IntermediateOutputPath)$(AppxIdentityName)</OutputPath>
@@ -61,7 +64,7 @@
           Inputs="$(AppxManifestTemplate)"
           Outputs="$(AppxManifest)">
     <WriteLinesToFile File="$(AppxManifest)"
-                      Lines="$([System.IO.File]::ReadAllText($(AppxManifestTemplate)).Replace('[AppxBuildArch]', $(Platform)).Replace('[AppxVersion]',$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)).Replace('[AppxIdentityName]',$(AppxIdentityName)).Replace('[AppxDisplayName]',$(AppxDisplayName)))"
+                      Lines="$([System.IO.File]::ReadAllText($(AppxManifestTemplate)).Replace('[AppxBuildArch]', $(Platform)).Replace('[AppxVersion]',$(MajorVersion).$(MinorVersion).$(BuildVersionAppX).$(RevisionVersionAppX)).Replace('[AppxIdentityName]',$(AppxIdentityName)).Replace('[AppxDisplayName]',$(AppxDisplayName)))"
                       Overwrite="true" />
     <ItemGroup>
       <FileWrites Include="$(AppxManifest)" />