uwpdesktop-bridge

Desktop Bridge app got an error code when request update: 0x769e4192


The following is the code I refer to here and here. btnRequestUpdate_Click can be executed and can correctly ask me if I need to download the update, when I click "OK", I will get an error: "0x769e4192 (located in appName.exe) exception: Microsoft C++ exception: winrt::hresult_error, located in memory location 0x06a8f0a0"

I tried to use RequestDownloadStorePackageUpdatesAsync, but got the same error.

So how can I solve this problem? thanks a lot.

[ComImport]
[Guid("3E68D4BD-7135-4D10-8018-9FB6D9F33FA1")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IInitializeWithWindow
{
    void Initialize(IntPtr hwnd);
}

private async void btnRequestUpdate_Click(object sender, RoutedEventArgs e)
{
    var context = StoreContext.GetDefault();
    IInitializeWithWindow initWindow = (IInitializeWithWindow)(object)context;
    initWindow.Initialize(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle);

    IReadOnlyList<StorePackageUpdate> storePackageUpdates =
        await context.GetAppAndOptionalStorePackageUpdatesAsync();
    if (storePackageUpdates.Count == 0) return;
    IAsyncOperationWithProgress<StorePackageUpdateResult, StorePackageUpdateStatus> downloadOperation =
        context.RequestDownloadAndInstallStorePackageUpdatesAsync(storePackageUpdates);
    downloadOperation.Progress = (asyncInfo, progress) =>
    {
        Consolo.WriteLine($"progress: {progress}");
    };
}

Solution

  • I think I know what problems I have encountered before. The key is to distinguish between "packaged version (released version)" and "unpackaged version (debug version)". I cannot upgrade to "packaged version" from "unpackaged version". So I try to release both the higher version and the lower version of the app to the store, and then I can upgrade to the higher version through the lower version.

    In addition, using "package flights" to test the upgrade is much faster than using "submissions", because the "package flights" audit usually takes only half an hour.