0

Situation

We created and signed a MSIX package of our .NET MAUI app for distribution outside MS Store and Installation with App-Installer.

Problem

While (up to now) most of testing users don`t have any problems with installation with MS App-Installer, in one case installation fails showing this message: "App Installer failed to install package dependencies. Ask the developer for -package[!]."

Tries

Because I don't have a clue, what package exactly could be missing, I searched for some error logs / error codes in Event Viewer (here: Application and Services Logs -> Microsoft -> Windows -> AppxDeployment-Server), following these instructions , but could not find anything in AppxDeployment-Server.

Could anyone please tell me, where else to find logs for failed msix installation? Or does maybe anyone could give me a suggestion, what could be the reason for the failing installation?

Mirh
  • 1
  • 3

2 Answers2

0

When there are issues with the installation, you can investigate the artifacts provided by AppInstaller.

First, AppInstaller provides error code failures. If the error code for any failure is not sufficient to determine what is wrong, the AppInstaller also logs all interactions to the Event Viewer.

You will find the logs here: Application and Services Logs -> Microsoft -> Windows -> AppxDeployment-Server.

You can use the Event Viewer or PowerShell to access those events. To learn more about how to view the events, see Troubleshooting packaging, deployment, and query of Windows apps.

To learn more about AppInstaller troubleshooting, see Troubleshoot Appinstaller Issues.

Guangyu Bai - MSFT
  • 2,555
  • 1
  • 2
  • 8
  • Hi, thanks for your suggestions. Curiously, AppxDeployment-Server does not contain any logs for this installation. What could be the reason? Could you please tell me, where else I can look out for error codes? – Mirh Feb 22 '23 at 09:30
  • You can check this link about [Trusted certificates](https://learn.microsoft.com/en-us/windows/msix/app-installer/troubleshoot-appinstaller-issues#prerequisites) it related to the windows version. The problem might be related to the certificate used to sign the package must be trusted by the device. – Guangyu Bai - MSFT Feb 23 '23 at 02:46
  • If the app package is built in Release mode configuration, the framework dependencies will be obtained from the Microsoft Store. However, if the app is built in Debug mode configuration, the dependencies will be obtained from the location specified in the `.appinstaller` file. – Guangyu Bai - MSFT Feb 23 '23 at 02:59
  • For I could not find the logs generated by AppInstaller, I tried to install the msix with Power Shell and finally found out that the missing dependency is WindowsAppRuntime. When Users are logged in MS Store, this dependency will be installed automatically. But because we want the users to be able to install our software without being logged into MS Store, we might need an *.appinstaller file, is this right? Could you please tell me how to add the WindowsAppRuntime as a dependency package to an *.appinstaller file? I just could not figure out what uri does one have to specify. – Mirh Feb 27 '23 at 16:44
  • You can read this [Tutorial: Use the bootstrapper API in an app packaged with external location or unpackaged that uses the Windows App SDK](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/tutorial-unpackaged-deployment?tabs=csharp). – Guangyu Bai - MSFT Feb 28 '23 at 08:54
  • Thanks, but our app is installed by using msix, so we can not follow this tutorial. At the moment I try this [Approach](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/deploy-packaged-apps) but run into this [issue](https://github.com/microsoft/WindowsAppSDK/issues/2684). While [adding platform definition](https://github.com/microsoft/WindowsAppSDK/discussions/3026) to `dotnet publish` command helps for publishing the app, the programm can not be started from Visual Studio any more...if anyone knows how to deal with this issue I would be very thankful! – Mirh Feb 28 '23 at 10:06
0

We found a solution that works in our context:

  • Getting Logs: While a failing Installation with AppInstaller did not leed to logs in Event Viewer, Installation with Power Shell was more verbose and so we could figure out that missing dependency was WindowsAppRuntime.
  • Adding WindowsAppRuntime: If users are logged in MS Store while performing installation of the app, missing dependency is fulfilled automatically by Store. For we would like to allow an installation outside MS Store we had to find another solution. So we added following lines to our *.csproj for using WASDK as self-contained:
  • <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> and
  • <Target Name="_RemoveFrameworkReferences" BeforeTargets="_ConvertItems;>_CalculateInputsForGenerateCurrentProjectAppxManifest"> <ItemGroup> <FrameworkSdkReference Remove="@(FrameworkSdkReference)" Condition="$([System.String]::Copy('%(FrameworkSdkReference.SDKName)').StartsWith('Microsoft.WindowsAppRuntime.'))" /> </ItemGroup> </Target>

as described here. Unfortunaley this causes a error "The platform 'AnyCPU' is not supported for Self Contained mode" so we had to add "-p:Platform=... option to our dotnet publish command as described here. For being able to start our program in VS we also had to add <Platforms>AnyCPU;x64</Platforms> solution wide to all of the *.csproj files with VS Configuration Manager.

Mirh
  • 1
  • 3