question

bvp-1872 avatar image
1 Vote"
bvp-1872 asked Gil1-3101 commented

Win32 converted with Desktop Bridge purchase failed.

I have created tow minimal project to reproduce the problem.
You can download from github https://github.com/bvp898/UWP_DesktopBridge_Purchase.git
The shared code Store.cs is copied from microsoft's document.

Project Purchase_UWP is a UWP project, work fine.
Project Purchase_NetDestop is a Win32 project, converted with Desktop Bridge. It always return "The purchase did not complete. The customer may have cancelled the purchase. ExtendedError: ", the purchase dialog dose not show up.

Please help me with the problem, I need to add purchase for subscription in Win32 app.

partner-center-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have narrowed down the problem.
Computer with windows 10.0.17134.1246 got this Win32 converted with Desktop Bridge purchase failed problem.
Computer with windows 10.0.18362.1082 work fine.
Is that a bug of system?
Which version of Win10 fixed this bug?

0 Votes 0 ·
RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered bvp-1872 commented

Hello,

Welcome to Microsoft Q&A!

I could not run your sample on my side. But I created a new WinForms app and test about this. The popup window shows correctly and there is no error when I purchase a subscription. I'm using windows 10 build 19041.

You mentioned that it only happens on build 17134. Is it a signal case or it happens on all the devices with 17134? Currently, my suggestion is that you might need to set the target version higher than build 18362.



Thank you.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, the problem have been narrowed down.
If I right click the app at start menu -> more -> run as administrator, the problem will reproduce on my computer with Windows 10.0.18362.1082.
But how can I keep my app run without admin privilege at all kinds of computers.

0 Votes 0 ·
bvp-1872 avatar image
0 Votes"
bvp-1872 answered Gil1-3101 commented

I tested in Virtual machine with Windows 10.0.18362.1082, the problem still exist. Don't know why one of my computer worked.
Is that your WinForms app a win32 project and package with Desktop bridge?
I am buiding with target versioin 19041.
Below is the error log. (Store have been logined in, ExtendedError is empty)



info:Windows::Services::Store::StoreContext::RequestPurchaseAsync(9P28P93430J0) invoked. (CV:HelkHwlJxEmd+tei.2.7) [Windows::Services::Store::StoreContext::RequestPurchaseAsync]
ModLoad: 00000000`6b300000 00000000`6b35d000 C:\Windows\SysWOW64\CoreShellAPI.dll
:jsonRequest: {"StoreId":"9P28P93430J0","ParentProductId":"9NLVZ8WTBGW1","HasPreviewCapability":true,"Version":"3","InvokedApi":"RequestPurchase","UserId":"00037FFEBA565603","DeviceContext":"moId=Public&oemId=Public&scmId=Public","CV":"HelkHwlJxEmd+tei.2.7.1.2.1"} [Windows::Services::Store::PurchaseOperation::_Purchase]
ModLoad: 00000000`6b280000 00000000`6b2ff000 C:\Windows\SysWOW64\twinui.appcore.dll
:jsonResponse: {"purchaseStatus":"NotPurchased"} [Windows::Services::Store::PurchaseOperation::_Purchase]
The purchase did not complete. The customer may have cancelled the purchase. ExtendedError:

· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I'd suggest you test it on build 19041 which I have confirmed.
And also, based on the error message, the code is running correctly. The issue is that the user canceled the purchase.
At last, the windows store won't accept apps that require running as administrators. It is mentioned here: Prepare to package a desktop application


0 Votes 0 ·

I tested in Virtual machine with Windows 10 1803/1809/1903.
If the user account is Administrator, the app will run with admin privilege in default, then purchase dialog failed to popup.
I don't need the admin privilege, How to force my app always run without admin privilege?

In Windows 10 2004, the app run fine.
But Windows 10 1803/1809/1903 still cover a lots of users.



0 Votes 0 ·

My test account is also an Administrator. Using the Administrator account won't let the app run with admin privilege unless you choose to run as Administrator. Have you checked if there is are some functions in your app that will request admin privilege automatically?

0 Votes 0 ·
Show more comments

Using the Administrator account won't let the app run with admin privilege
Some computers will do that, on those computer with the problem, I create account which is not administrator, then everything work fine.
On virtual machine with Windows 10 1803/1809/1903, this will reproduce.
My example app has no functions request admin privilege automatically.
There is an popular app that also encounter the problem, I can reproduce it on my computer,
Purchase dialog do not show up when click "Unlock Pro"
https://github.com/Snipaste/feedback/issues/1059
The users also found that it is related to admin privilege.
This is an article by microsoft worker also pointed out "Don’t run app with admin privilege, otherwise may not see the purchase diaglog box popup."
http://flwe.azurewebsites.net/2018/05/03/enable-in-app-product-purchases-for-desktop-bridge-converted-applications/#comment-956
But there is no way that I can avoid this.

0 Votes 0 ·

After discussion, it seems that you are using the system built-in administrator account to run the app. The account will always run things as elevated. To avoid this issue, you could just disable the system built-in administrator account and use normal “admin” accounts (people in the administrators group).

0 Votes 0 ·
tscholl89 avatar image
0 Votes"
tscholl89 answered

A lot of my users are having the same problem,
Any news on this bug?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.