📜 ⬆️ ⬇️

Publishing Desktop Applications in Windows Store using Desktop Application Converter

Not so long ago, we published a corporate desktop application developed by us, which complements the functionality of Skype for Business. For example, it can “humanly” keep the history of correspondence, as all “decent” instant messengers do, can send messages offline, it allows to organize contacts and many more things that Skype for Business lacked. And when it became possible to share the application using the Windows Store, we decided to use this opportunity. In the article we will tell how it happened and what it cost us.


About the development process itself and about what the idea of ​​working with SfB in Suppression Mode (SfB suppression) cost us, read here .


EasyLy was developed as a WPF & Lync SDK desktop application for Windows, and of course, we wanted to share our development with the world. Publication of "classic" desktop applications (without metro-interface) became available not so long ago, we didn’t have any experience at all, so we began to learn how to download our application in the Windows Store.


Start


The whole point was to use the Desktop Application Converter to convert the application to the AppX package for UWP (Universal Windows Platform) so that it could be downloaded to the Windows Store.


It should be noted that not any desktop application can be placed in the store. It must meet the requirements described in this article .


For the conversion process itself, you need OS “Anniversary update of Windows 10 Pro” or “Corporate” (10.0.14393.0 and later) x64. You will also need to install Microsoft Windows 10 SDK . And before working with the converter you will need to download one of the basic Windows 10 images .


IMPORTANT: The version of the operating system build must exactly match the version of the BaseImage-xxxxx.wim image.


After reading the article on how to work with the converter , we developed a script system for Command Prompt and Power Shell, which generated AppxManifest.xml and the final AppX package.


And finally, everything was ready to download EasyLy.appx in the Windows Store. Honestly, we did not expect that the process of placing the application would be so extended in time, but in total we took about two months to do it. We also did not expect that in front of us will wait for strange mistakes that will have to fight together with Microsoft employees. Emotions of the team were at the redistribution, but still we succeeded. That these were errors and how we eliminated them, read below.


Error, and not one.


At the first attempt to publish to the Windows Store, we received four errors.


  1. Package acceptance validation error:


  2. Package acceptance validation error: The PublisherDisplayName element in the applet list of EasyLy.signed.appx is GROVETY, INC.


  3. Package acceptance validation of the app manifest. The package EasyLy.signed.appx specifies 1.61.6088.26940.


  4. The package of the package of acceptance of the package of validity of the appLife.signed.appx: schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities

We fixed the error number 3 with the version. It turned out that it is forbidden to have a version revision (last version version), non-zero (major.minor [.build [.revision]]). Well, that was easy.


It was: DesktopAppConverter.exe ... -Version 1.61.6088.26940
It became: DesktopAppConverter.exe ... -Version 1.61. 6088.0


In the future, we also refused the build version: DesktopAppConverter.exe ... -Version 1.61.0.0


There were still three errors.


1. Package acceptance validation error: The PublisherDisplayName element in the app is an app of GROVETY, INC.
2. Package acceptance validation error: EasyLy.s.appx: schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities
3. Package acceptance validation error: Your developer account doesn’t have permission to submit apps converted to the Desktop App Converter at this time.


Error number 1 has been fixed with the name of the certificate in AppxManifest.xml:


: <PublisherDisplayName>GROVETY, INC</PublisherDisplayName> : <PublisherDisplayName>GROVETY INC</PublisherDisplayName> 

To be honest, it was strange that this fix worked, and it is unclear how much the certificate name is compared with, because in the properties of the AppX package in the “Digital Signatures” section, the certificate name was just a semicolon, and the developers didn’t have access to the Windows Store interface (to see what the publisher’s name looks like and that it is generally there), because the publication was marketing department.


image


After that, there were errors that spoke about some problem related to the account through which it was impossible to put AppX.


1. Package acceptance validation error: EasyLy.s.appx: schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities
2. Package acceptance validation error: Your developer account doesn’t have permission to access apps converted to the Desktop App Converter at this time.


What to do with these errors was suggested to us by one of the authors of habrahabr, asommer . As it turned out, all new desktop applications require manual validation - and for this you need to write to tech support.


We left the application here , and within a few days a Microsoft employee contacted us.


Finding solutions with Microsoft


We organized a conference for Skype for Business, where we were told that EasyLy is a desktop application that extends the functionality of Skype4B, for example, it is able to save the history of conversations. And according to the results of the meeting they sent the APPX file with the application for verification.


Also, in parallel, I had to sign another agreement with Microsoft - Centennial Early Adopter Program Addendum.


Communication was made difficult by the fact that Microsoft employees were in America, and the time difference was 10 hours. As a result, we had to communicate late in the evening, and wait a day for a response to the letters.


After some time, we received a letter from Microsoft. They have questions about how EasyLy integrates with Skype for Business. They needed to make sure that EasyLy could work normally with the next version of Skype for Business.


In general, it was necessary to prepare a technical description in English. At the same time, they agreed that if something remains unclear, we will again hold an online rally.
Fortunately, our description turned out to be enough, and a Microsoft employee assured us that the approval process is underway.


Test of strength


We didn’t expect Microsoft to conduct any more tests on our application. A Microsoft representative said that our application was approved for the Windows Store, but did not pass the CARE test. In addition, he pointed out the possibility of using additional API functions available only for convertible applications. Of these features, we chose autorun with the user’s login and added the following section to the <Application> element in AppxManifest.xml:


 <Extensions> <desktop:Extension EntryPoint="Windows.FullTrustApplication" Executable="EasyLy.exe" Category="windows.startupTask"> <desktop:StartupTask DisplayName="EasyLy" Enabled="true" TaskId="GROVETYINC.EasyLyCorp.Startup"/> </desktop:Extension> </Extensions> 

A little more about the CARE test. Judging by the report of the passage, which they sent us, the following things are checked:


Test for Drivers and Services (Drivers cannot be installed)
Test for DDE Exec registry verbs (DDE Exec warning)
Validate Appx Manifest (Application Identity Name can't be empty)
Security profile settings (EXE can not be requested admin elevation, EXE can not request UIAccess)
Validate PE integrity (PE Files must be validly signed)


EasyLy failed on the second paragraph. The program accessed non-standard registry keys. This has been fixed.


Now that all problems have been solved, we anticipated the joy of victory and the long-awaited download of EasyLy in the Windows Store. But luck was not on our side again and the next mistakes appeared:


1. Invalid package identity name: EasyLy (expected: GROVETYINC.EasyLyCorp).
2. Invalid package family name: EasyLy_04mzw0hspzxdg (expected: GROVETYINC.EasyLyCorp_8qq6gc35dw28r)
3. Invalid package publisher name: CN = ”GROVETY, INC”, O = ”GROVETY, INC”, L = Wilmington, S = ”Delaware”, C = US (expected: CN = 71A49F4D-5C79-40F1-A333-B79F06F50E03 )
4. This package uses a display name that you have not reserved: EasyLy


It seems that Microsoft decided to carefully not report all errors at once, but issue them in parts, and show each next part only after correcting all the errors in the previous one. It may be right, because if we saw all the errors at once, the likelihood that we would decide to continue would definitely be less. But now, when half the journey was completed, I didn’t want to step back.


Microsoft answered the following:


  1. It is not clear what it is. Try to fix the remaining errors first.
  2. That's right, the package being registered is called “GROVETYINC.EasyLyCorp_8qq6gc35dw28r”.
  3. Remove the comma from the publisher name.
  4. The name of the registered application is “EasyLy Corp”.

Was: DesktopAppConverter.exe ... -Publisher "CN = GROVETY"
Now: DesktopAppConverter.exe ... -Publisher "CN = GROVETY INC" -PackageDisplayName "EasyLy Corp" -AppDisplayName "EasyLy" -AppExecutable "EasyLy.exe"
After these changes, error number 4 went away.


Trying to eliminate the error, # 1 added -PackageName “GROVETYINC.EasyLyCorp” to the converter settings, but received an incomprehensible error during the conversion:


 Error: PowerShell Error Record: Could not find a part of the path. PowerShell Stack Trace: at <ScriptBlock>, C:\Program Files\WindowsApps\Microsoft.DesktopAppConverter_1.0.1.0_x64__8wekyb3d8bbwe\DesktopAppConverter.ps1: line 719 at <ScriptBlock>, <No file>: line 1 Inner Exception[0]: System.IO.DirectoryNotFoundException: Could not find a part of the path. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.MoveTo(String destFileName) at Microsoft.PowerShell.Commands.FileSystemProvider.MoveFileInfoItem(FileInfo file, String destination, Boolean force, Boolean output) Inner Exception Stack Trace[0] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.MoveTo(String destFileName) at Microsoft.PowerShell.Commands.FileSystemProvider.MoveFileInfoItem(FileInfo file, String destination, Boolean force, Boolean output) 

It was also empirically observed that if the PackageName is 19 characters or less in length, then no error occurs, and the name GROVETYINC.EasyLyCorp is 21 characters long.


Trying to eliminate the error number 3 with the certificate tried different options:


  1. CN = "GROVETY INC"
  2. CN = "GROVETY INC", O = "GROVETY INC", L = Wilmington, S = Delaware, C = US
  3. CN = 71A49F4D-5C79-40F1-A333-B79F06F50E03 (as indicated in the error message)

But our certificate has exactly this form: CN = “GROVETY, INC”, O = “GROVETY, INC”, L = Wilmington, S = Delaware, C = US, therefore, it is expected that we received an error when signing:


image


Regarding the third error, Microsoft was told that in the Windows Store the signing process is automatic and there is no need to try to sign AppX by ourselves. Thus, the error number 3 is gone.
As for error # 1, we were informed that it is possible that this is a converter bug related to the length of the PackageName parameter and suggested workaround:


 a.  PackageName       , , EasyLyChangeMe. b.  appx . c.   makeappx unpack /p “[appx path and file]” /d “[Unpack folder]” d.   PackageName  GROVETYINC.EasyLyCorp. <Identity Name="xxxx" ProcessorArchitecture="x86" Publisher="CN=pppp" Version="1.0.0.0" />        Name     Name,     Windows Store   APP management -> App Identity e.  appx . makeappx pack /p “[new appx path and file]” /d “[Unpack folder]” 

Following this workaround we solved our problems. Finally, the line with the converter parameters now looks like this:


 DesktopAppConverter.exe -ExpandedBaseImage "C:\ProgramData\Microsoft\Windows\Images\baseImage-14393" -Installer "installer\easyly_v1.61_setup.exe" -Version 1.61.0.0 -InstallerArguments "/verysilent" -Destination "out" -PackageName "GROVETYINC.EasyLy" -PackageDisplayName "EasyLy Corp" -AppDisplayName "EasyLy" -AppExecutable "EasyLy.exe" -AppId "GROVETYINC.EasyLyCorp" -Publisher "CN=71A49F4D-5C79-40F1-A333-B79F06F50E03" -PackagePublisherDisplayName "CN=GROVETY INC" -Verbose 

A happy ending


As a result of all these actions, we received a package that was validated! And - hooray! You could send our EasyLy to the store.


And then everything was simple - fill in the necessary information, upload screenshots and put down the amount we want to receive for the product, and after a few days, it appeared in the store.


')

Source: https://habr.com/ru/post/318072/


All Articles