SOLVED

Application crash on Windows 10 Enterprise LTSC when using AppInstaller

Brass Contributor

I have a .NET Windows Forms app packaged with MSIX and Automatic Updates configured using the AppInstaller feature.

 

It works fine on Windows 10 Professional edition, but my target version is Windows 10 Enterprise LTSC version 1809. Here the app crashes on startup. Error details from Event Viewer:

 

Faulting application name: MyApp.exe, version: 0.1.0.104, time stamp: 0x6194a27a
Faulting module name: RPCRT4.dll, version: 10.0.17763.2237, time stamp: 0x06296516
Exception code: 0xc0000005
Fault offset: 0x000000000002dbc7
Faulting process ID: 0x1fe0
Faulting application start time: 0x01d7e1d1d8ee79b3
Faulting application path: C:\Program Files\WindowsApps\MyApp.1.0.104_neutral__nz9tp4yz656p2\MyApp\MyApp.exe
Faulting module path: C:\Windows\System32\RPCRT4.dll
Report ID: ea9c6804-f5c4-4ddc-8ee0-c79fd012f3cd
Faulting package full name: MyApp_0.1.0.104_neutral__nz9tp4yz656p2
Faulting package-relative application ID: App

 

From what I read RPCRT4.dll is related to RPC calls. 

 

This is how the app is installed using Powershell. Files are hosted on az Azure App Service.

 

 

 

Add-AppPackage -AppInstallerFile https://my-domain.com/MyApp.appinstaller

 

 

If I install the app using the *.msixbundle file, it works. But I lose automatic updates this way. This means that the issue is not in the application code, it's related to MSIX. 

 

 

Add-AppXPackage https://my-domain.com/MyApp_0.1.0.104_Test/MyApp_0.1.0.104_AnyCPU.msixbundle

 

 

Something to do with the AppInstaller, it seems to fail when checking for updates? Maybe some kind of permission missing? Already tried running as Administrator.

 

Based on the Supported Platforms documentation, Windows 10 Enterprise LTSC should have support for AppInstaller.

 

 

 

https://docs.microsoft.com/en-us/windows/msix/supported-platforms

 

2 Replies

It seems like Windows 10 Enterprise LTSC build 1809 doesn't support checking for updates programmatically.

 

I followed the description from here https://techcommunity.microsoft.com/t5/windows-dev-appconsult/handling-application-updates-with-app-...

 

private async Task CheckForUpdates()
{
    var result = await Package.Current.CheckUpdateAvailabilityAsync();
    if (result.Availability == PackageUpdateAvailability.Available)
    {
        MessageBox.Show("There's a new update! Restart your app to install it");
    }
}

It crashes the app, even though I have global error handling configured.

 

After I removed the code and related DLLs, the app installer is working. 

best response confirmed by szilardd (Brass Contributor)
Solution

I got it working using the `Microsoft.Windows.SDK.Contracts` NuGet package instead of the approach described above (had to convert from package.config to PackageReference)

https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-enhance#earlier-versi...

Sample code

 

var packageManager = new PackageManager();
var currentPackage = packageManager.FindPackageForUser(string.Empty, Package.Current.Id.FullName);
var result = await currentPackage.CheckUpdateAvailabilityAsync();

if (result.ExtendedError != null) {
    LogError("Update availability error", result.ExtendedError);
}

var hasUpdate = (result.Availability == PackageUpdateAvailability.Available);

if (hasUpdate) {
    // there is an update available
}

 



1 best response

Accepted Solutions
best response confirmed by szilardd (Brass Contributor)
Solution

I got it working using the `Microsoft.Windows.SDK.Contracts` NuGet package instead of the approach described above (had to convert from package.config to PackageReference)

https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-enhance#earlier-versi...

Sample code

 

var packageManager = new PackageManager();
var currentPackage = packageManager.FindPackageForUser(string.Empty, Package.Current.Id.FullName);
var result = await currentPackage.CheckUpdateAvailabilityAsync();

if (result.ExtendedError != null) {
    LogError("Update availability error", result.ExtendedError);
}

var hasUpdate = (result.Availability == PackageUpdateAvailability.Available);

if (hasUpdate) {
    // there is an update available
}

 



View solution in original post