Summary: Is it possible to modify app package identity after compilation using makeappx.exe?
I have a windows store app (for LOB sideloading, not for the store), which I need to create multiple copies (variants/instances) of, because I need to be able to install and run multiple versions of the app at the same time as a single user. Say my app is called MyMultiInstanceApp, I want to clone it into two apps called MyMultiInstanceApp-Prod and MyMultiInstanceApp-Test, because having these, I can install and run the *-Prod app in version 1.0 and the *-Test app in version 1.1 simultaneously.
I can achieve this by making multiple builds in Visual Studio and changing the package identity (name) in the manifest before each build - as described in Locally deploy parallel versions of a Windows Store App.
However, I would like to do it after build time, by making the copies based on the initial .appx package and I have it almost working using makeappx.exe and signtool.exe, but after installing e.g. MyMultiInstanceApp-Test, the app hangs on startup.
My approach is the following:
1) Create the initial .appx file by building solution in VS or through msbuild
2) Unpack the appx using:
makeappx.exe unpack /p MyMultiInstanceApp.appx /d unpacked
3) Modify the package identity in AppxManifest.xml to be:
<Identity Name="MyMultiInstanceApp-Test" Publisher="CN=JohnDoe" Version="1.1.0.0" ProcessorArchitecture="neutral" />
<Properties>
<DisplayName>MyMultiInstanceApp-Test</DisplayName>
...
4) Re-package the app using:
makeappx.exe pack /d unpacked /p MyMultiInstanceApp-Test.appx
5) Sign the package using the same certificate as used for the initial package using:
signtool.exe sign /a /v /fd SHA256 /f MyCert.pfx MyMultiInstanceApp-Test.appx
Installation of the new MultiInstanceApp-Test.appx seems successful, but when trying to start it - it just hangs and the following is visible in the Event Viewer under the entry:
\Applications and Services Logs\Microsoft\Windows\Apps\Microsoft-Windows-TWinUI/Operational:
[INFORMATION] Activation of app MyMultiInstanceApp-Test_pf28w44wh44hy!App attempted. Execution state: Attempted activation of the app, 0, The operation completed successfully.
[ERROR] Activation of the app MyMultiInstanceApp-Test_pf28w44wh44hy!App for the Windows.Launch contract failed with error: The remote procedure call failed.
Am I missing something or is modification of package identity not possible after compilation?