Forum Discussion

JohnMcC1983's avatar
JohnMcC1983
Copper Contributor
Aug 07, 2023

appinstaller and msixbundle version number issues

Hello.

I am using makeappx to output an msixbundle manually and following the below steps:

 

I copy an Appmanifest.xml template into my compiled directory and in the Identity attribute, set the version number (for example 1.0.0.0).  I use the following commands to:

 

build the appx file: 
makeappx pack /d [path_to_compiled_directory] /p "[package_name]" /m [path_to_appxmanifest_file]      
(The appx is created in the compiled directory.  I also use signtool to sign the appx with my certificate)


build the msix file: 
makeappx pack /l /d [path_to_compiled_directory] /p [path_to_installer_directory_with_msix_filename]
(I use signtool to sign the appx with my certificate)


build the msixbundle:
  makeappx bundle /d [path_to_installer_directory_with_msix_filename] /p [path_to_installer_directory_with_msixbundle_filename]
(I use signtool to sign the appx with my certificate)

 

I have created an appinstaller template (below) which is pushed to the same directory as the msixbundle.

{URI_APPINSTALLER} is replaced with the path to the appinstaller,  {URI_MSIXBUNDLE} is replaced with the path to the msixbundle and {VERSION_NO} is replaced with the same version number that was set in the Appmanifest.xml (in this case 1.0.0.0)

 

<?xml version="1.0" encoding="utf-8"?>

<AppInstaller

                Uri="{URI_APPINSTALLER}"

                Version="{VERSION_NO}" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2">

                <MainBundle

                                Name="te5ab33b-77g6-20a5-k44c-b8660e4d1ba9"

                                Version="{VERSION_NO}"

                                Publisher="CN=John, OU=John, O=John, L=Manchester, C=GB"

                                Uri="{URI_MSIXBUNDLE}" />

                <UpdateSettings>

                                <OnLaunch

                                                HoursBetweenUpdateChecks="0" />

                </UpdateSettings>

</AppInstaller>

 

When I attempt to install via the appinstaller I get the error message:

 

App installation failed with error message: The package full name returned from the AppxManifest (te5ab33b-77g6-20a5-k44c-b8660e4d1ba9_2023.721.1455.0_neutral_~_34j3tktyc7pna)

does not match the name generated from the AppInstaller (te5ab33b-77g6-20a5-k44c-b8660e4d1ba9_1.0.0.0_neutral_~_34j3tktyc7pna).

Please ensure that the package attributes specified in the .appinstaller file match the package attributes referenced in file:///C:/temp/MSIX/Demo/John.msixbundle. (0x8008020c)

 

If I install using the msixbundle, it works ok, however I can see in the WindowsApp folder, I get two folders

 

I can see in the folder with the version 2023.721.1445.0 that there is an appxBundleManifest.xml with an auto generated version number.

 

Can anyone let me know if there is a way to set this version number to the same as the appxmanifest file when issuing the mkeappx bundle command?  I was under the impression that it should have picked up the appxmanifest.xml file and used the information in this for its version number?


Many thanks and regards

 

John

 

3 Replies

    • JohnMcC1983's avatar
      JohnMcC1983
      Copper Contributor

      isac08270 I fixed the issue.  When calling makeappx.exe" bundle  you can specify : /bv [versionNumber] which marries everything up.

      Good luck

      • isac08270's avatar
        isac08270
        Copper Contributor
        It worked like a charm. Thanks for the help!

Resources