Ankush Butole
Ankush Butole

Reputation: 151

How to auto-increment the version in AppxManifest.xml when appx is created using MakeAppx tool?

I created appx package using makeappx.exe. Also I did the changes on Jenkins so that on each build I could have appx as output. Now on each build I am getting appx with same version number as this version is set in AppxManifest.xml I want to increment the version of appx package on each build. How to do so?

Upvotes: 0

Views: 1146

Answers (2)

mike
mike

Reputation: 11

If you use a Debug version, try this step:

  1. map file

MakeAppx.exe need a map file to finish the work, most of the information are included in this file: obj\x64\Debug\package.map.txt

Open it, it the 2nd line, it refer to a file: bin\x64\Debug\Core\AppxManifest.xml

  1. AppxManifest.xml

Open this file, you can find this information in line 10:

Modify the version number, then pack your project like this:

"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\MakeAppx.exe" pack /l /h sha256 /f ".\obj\x64\Debug\package.map.txt" /o /p .\AppPackages\test.msix

The the test.msix file version number changed!

  1. Automatic change version number

Save the version number in some where(like a file), and before you call MakeAppx.exe, increase the number and update it in the AppxManifest.xml

Upvotes: 1

Sunteen Wu
Sunteen Wu

Reputation: 10627

The version can be updated in Package.appxmanifest of the project before every time it is built. For example:

<Identity Name="3ec95549-...7a30bb0" Publisher="CN=publisher" Version="1.2.0.0" />

After the project build, you could find the version in AppxManifest.xml. But you could just edit the AppxManifest.xml to update the version before package.

MakeAppx.exe defined the package version depend on the version inside AppxManifest.xml.MakeAppx.exe doesn't have command to re-set the package version for creating an app package. You may not update the version through MakeAppx.exe.

But if you create an app bundle, you can specifies the version number of the bundle by /bv command of MakeAppx.exe. Details please reference "Create an app bundle section" of Create an app package with the MakeAppx.exe tool.

Upvotes: 0

Related Questions