Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
News

Deploying Windows 10 Apps Through the Microsoft Store

Before 10.3 Rio, creating an app to the Windows Store was only possible by creating an UWP (Universal Windows Platform) app and submitting it to the Windows Store. This was somewhat limiting because you had to know the technology and create a special new app using this platform.

With the introduction of the Windows Desktop Bridge technology, also known as Centennial Bridge, allows you to bring your existing Windows Desktop applications to the Microsoft Windows 10 Store. This is a new technology in the recent Windows 10 Anniversary Update.

Microsoft gave Delphi and C++ Builder developers the opportunity to submit their current Windows apps to the Microsoft store, no matter which language they were programmed. And, besides that, you can also improve your app to use the new features and APIs introduced in Windows 10. That way, you can modernize your applications without having to learn a completely new technology!

Why add your app to the Microsoft store?

There are many advantages of adding your app to the Microsoft Store:

Discoverabilty – your app will be listed in a worldwide directory and can be discovered by people you never would have reached.

Easy install and uninstall – installation and uninstalling Windows apps has always had challenges: you need admin rights, every installation program is different from the other, you need to create install scripts and, uninstalling the app always leave traces behind that will clutter your machine. With the Microsoft Store, installing and uninstalling is very fast and easy!

Security – apps downloaded from the Microsoft Store are guaranteed to be safe: no viruses or harm to your machine. The apps run in a sandbox and will do no harm to you or you computer.

Monetization – You can use several ways to monetize your application; charge a price to download your application, add in-app purchases to your application, add ads to your application, or even use a subscription-based model for your application. You don’t have to concern yourself on how to sell your app on the Micosoft Store. You don’t have to setup a special platform to sell your app. Let the Microsoft Store do all of this for you!

How to deploy Windows Apps to the Microsoft Store?

RAD Studio, Delphi and/or C++ Builder 10.3 Rio offers direct support in the IDE to easily create APPX files for the Microsoft Store with included deployment support, integrated code-signing support and the ability to add your own app store icons and configure other elements of the application.

To add your app to the store you need to do a few special preparations and submit it to the Microsoft store and wait for approval. It’s not as straightforward as posting an executable in the web, but the extra work is worth the benefits. 

Here are the steps on how to package your application and send it to the Windows Store, so it can be installed and downloaded from there.

Packaging the app to the store

For this article, we will use this Delphi Calculator application. The application has all the basic calculator functions:

You can download this sample application from here: http://www.delphipages.com/comp/line_parser__calculator_-1260.html

So how do we go about creating a Windows Store app from this app? This is not new in Delphi 10.3, since you can create a Windows Store app since Delphi Berlin. If you do not already have a Windows 10 SDK installed on your computer, then the first step is to install a Windows 10 SDK, that can be downloaded and installed from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk .

The default install path for your Windows 10 SDK should be folder: C:Program Files (x86)Windows Kits10

Once you have your Windows 10 SDK installed, you must go to the SDK Manager in your RAD Studio, Delphi or C++ Builder 10.3 IDE, in Tools | Options | Deployment | SDK Manager and ADD you new Window 10 SDK: and assure all the paths are set correctly.

1. Select ADD a New SDK.
2. Select a platform = Windows 32
3. Select an SDK version = Windows 10 SDK

4. Click OK.
5. Assure all the paths are set correctly:

6. Click Save.

The next step is to create a certificate.

How to Distribute your application Ad Hoc?

To distribute your application Ad Hoc, you need to create a Certificate file.
Your applications must be signed with this certificate to go to the Windows Store. You don’t need to have a certificate issued by a Certified Issuer, you can use a self-signed certificate.


To create your certificate, go to Tools | Options | Deployment | Provisioning, and select the certificate you want to use. In our case we will use:

Build Type = Windows 32-Bit – Application Store.

Distribution Type = Ad Hoc.

Note: The distribution type indicates how you will distribute your app: Ad Hoc will make an appx file that can be distributed to your users and is used to install the app without going to the Windows Store. The Windows Store will create a package for the store.

If you want to distribute the app Ad Hoc, you need to create a certificate, by clicking the “Create self-signed certificate” button.

On this New Certificate page, enter the information about your new certificate file:

In the File field, click Browse and browse to the path where you want to store your new certificate file.
In the Subject field, enter the subject of the certificate. This can be a user, a program, or virtually any object, computer, or service: CN=MyCompany, O=MyOrganization, C=USA, and so on.
In the Password field, enter a password to protect your new certificate.

Click Finish.
You should get the message:

Click OK.
Click Save, and you should see your Certificate Information, like this:

Click Save.

Note: RAD Studio uses code signing certificates to sign Windows applications so that you can test the .appx on your developer machine or distribute them to other Windows 10 users directly. The .appx package does not need to be signed when uploading to the Windows Store.

Warning: You must store your certificate file in a safe place, and make sure that you do not forget the password of the certificate.
With this certificate, you can use it for creating your apps for the Windows Store!

With your application opened in your IDE, Select your Windows 32 – Windows 10 SDK Configuration for the Application Store configuration, like this:

Using the certificate we created, we can now compile the application, using the certificate file. 
First, verify your Project | Options | Deployment | Provisioning is set to Windows 32-bit Application Store, and you are using your correct Certificate file:

2438-cert_5f00_provisioning-9867541

Click Save.
For distribution without the Microsoft store, select the Ad Hoc distribution, with the certificate you’ve just created.

If your application builds OK, you will then find your Calculator.appx file in your Projects bin folder.

You can go to the location where the appx file is located and double click on it. A dialog like this will be shown:

2772-installcalc-5371327

If you click in the Install button, the app will be installed and launched!  Congratulations!

This application is a Windows 10 application and it has the same features as any other Windows 10 app: you can uninstall it easily, pin it to the Start Menu, and so on. 

But, for this application, the only way to install it is to distribute the appx file and double click on it.

Next, we want to distribute this application to the Windows Store.

Submitting Your App to the Windows Store

This section explains the steps required to submit your applications to the Windows Store.

Prerequisites:
Before you can submit your application to the Windows Store you need to:

1. Have a Microsoft account.

Tip: If you do not have an account, create one here: https://developer.microsoft.com/en-us/store/register

5824-getregistered-7015057

The fees for the individual one-time registration and company accounts differ. You can check the prices here: https://developer.microsoft.com/en-us/store/register  Basically, Individual accounts cost approximately $19 USD, and company accounts cost approximately $99 USD (the exact amounts may vary depending on your country or region). This is a one-time registration fee and no renewal is required.

8686-accounttype-6636009

After you have created your Microsoft Developers Account, you can create your app submission. In your Microsoft Developers Account dashboard, click on the “Create New App” button. This will take you to this “Get started publishing apps and games today” screen where you must create a new app name for your app. This name must be unique, and the availability of the name will be checked.

5808-createnewapp-9453389

Click the Create a New App button.

For my application, I will call it Basic_Calculator. Click the Check Availability link to verify your app name is unique. If you app name is unique, you will get the green check mark for your app name, like this:

6560-reservename-1192438

Click the Reserve product name button.

This gives you this Application Overview Screen:

4061-applicationoverview-7135108

On this screen, you can create your submission, by clicking the “Start your submission” button.  Through a submission you can upload packages, set price and availability details, and describe your app for your customers. Once everything is ready to ship, you can submit your app for certification and publishing to the Microsoft Store:

3630-submission1-6788541

On this screen you must complete all the options. You can set the way you want to distribute your application.
Specifically:
1. Pricing and availability sets the markets, price and visibility for your app (you may make it public, or private). You can also set a free trial and sale price.
2. Properties will set the category of your app and what kind of hardware is required/recommended.
3. Age ratings will set what kind of app you are sending to the store and the age rating for the app.
4. Packages is where you send the package for the app. You must check the Windows Desktop box, as this is a Windows Desktop app and select your correct appx file:

1121-packages-8281831

In the Delphi or C++ Builder IDE, for your Project | Options | Provisioning, you must build your application with the Distribution type to Store, and set the Package Display Name to the one you reserved in the store and set the publisher display name to the one you created in your Microsoft Developers Account:

8666-store_5f00_provisioning-3648196

Click Save.

In the Delphi and/or C++ Builder IDE, set the Target Platform = Windows Application Store:

5700-target_5f00_store-3835109

You can now Build your application in the IDE and it will create your new calculator.appx file:

1300-new_5f00_appx-8907834

Upload your new Windows Store calculator.appx file to the Packages section of the Submission process in your Microsoft Partner Center Developers Account:

0513-package_5f00_upload-9607081

This will validate your calculator.appx file:

4024-validateappx-8897675

You MUST fix any validate errors and rebuild the package in your IDE, and then upload again your corrected calculator.appx file until you get a good Packages validated:

7776-packages_5f00_validated-8637103

And you need to complete all the other sections of your Submission until you get Complete for all sections like this:

8004-submission_5f00_complete-3000400

At this point, you can click the Submit to the Store button. The certification process may take several days. When you app passes the certification process, your app is available in the Microsoft Store and can be downloaded from there!

This means anyone with a Windows 10 machine will be able to search for, and download and install your app from the Microsoft store!

Lastly, the latest versions of C++ Builder 10.3 Rio and Delphi Rio 10.3 adds a new component, TWindowsStore, that will ease the task of managing trial versions and in-app purchases. The TWindowsStore component is used to manage trial versions and In-App purchases, so you can sell and get money from your app. If you are interested now in the TWindowsStore component, see this link on Using the WindowsStore Component:  http://docwiki.embarcadero.com/RADStudio/Rio/en/Using_the_WindowsStore_Component

See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

2 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES