8

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?

Community
  • 1
  • 1
tholesen
  • 460
  • 5
  • 10
  • 1
    I found that changing the `Identity.Name` is what is causing this error. Only changing the `DisplayName` is fine. I know this does not solve your problem, but I just wanted to add this observation. I guess the identity name is somehow burned into some of the binaries in the appx package - but I have not been able to find any details about that yet. – Lasse Christiansen Aug 25 '15 at 07:49
  • 1
    We did a bunch of things about this earlier this week. We've come to the conclusion that this is not possible at this moment. The reason is that the .pri file (that msbuild creates) contains a reference to the Identity as given in original (before running msbuild) appxmanifest file. Only msbuild can generate this pri file (AFAIK)... – Tom Wuyts Mar 18 '16 at 13:06
  • That's too bad! Is this issue still true? – m00nbeam360.0 Aug 16 '16 at 19:27

0 Answers0