Author: CARLOS M6766
One of the most interesting new features introduced in RAD Studio 10.1 Berlin Update 2 Anniversary Edition is the support for building Windows 10 APPX application packages.
YouTube reply of EMEA Embarcadero developer webinar “Appx Development for Windows 10 Store” from December 14th, 2016, is available at https://youtu.be/hEOk3Ztm-8g
APPX development in RAD Studio
RAD Studio already provides built-in support for creating apps that can be distributed through Apple AppStore (iOS, Mac) and Google PlayStore (Android). Berlin Update 2 introduces support for the latest version of Windows 10 (Anniversary Update) completing the portfolio of all newest versions of supported operating systems in RAD Studio 10.1 Berlin, including iOS 10, Android 7 Nougat and macOS Sierra.
Windows 10 Store support in RAD Studio opens new possibilities for publishing and delivering Windows applications developed with Delphi or C++Builder. You can take a Win32 or Win64, VCL or FireMonkey, project and using Windows 10 SDK tools converted to appx package that can be deployed to Windows 10 Store.
The first thing for APPX development in RAD Studio is to make sure to you have correct versions of software installed.
- Windows 10 Anniversary Update. It has to be the latest version of Windows 10. Look in “Update History” for Windows Build 1607. That’s the one you need.
- RAD Studio 10.1 Berlin Update 2 Anniversary Edition. It has to be “Update 2”. If you are not sure, you can check the version of RAD Studio in “Help – About”
- Windows 10 SDK. It installs as part of RAD Studio installation. It contains command line tools needs for APPX creation
The next step is to make sure that you have enabled “Developer Mode” on Windows 10. This is required for installing APPX packages signed with test certificates. You can find this option in Windows 10 “Settings” under “Update & Security” and “For Developers”. By default the “Windows Store Mode” is set which only allows installing apps coming from Windows Store. Check “Developer mode” option. This will take a moment to download and install necessary bits.
Now you need to prepare RAD Studio for APPX development. This is just one time operation, similar to preparing RAD Studio for mobile development. You need to configure Windows 10 SDK. In “Tools – Options” select “SDK Manager” and add “Windows SDK”. It should find it automatically. The IDE needs to know the location of “MakeAppx.exe”, “SignTool.exe” and “MakeCert.exe”.
Another one time preparation is creating and installing a local certificate that is needed for digitally signing your APPX packages. Still in the “Options” menu we need to go to “Provisioning” tab. Click on the “Create self-signed certificate…” button to launch the wizard that will walk you through the steps of creating a test certificate. You should see the certificate info after a few seconds. If you see, you know that the IDE sees it as well.
One thing is creating a certificate, but the second thing is to tell Windows that it exists. Now we need to install the certificate. Right-click on newly created certificate in Windows Explorer and select “Install pfx” option from the context menu. That should start the import certificate wizard. Locate your certificate and install it into local machine’s “Trusted People” certificate store.
Now both Windows and RAD Studio are configured and ready for building APPX packages.
APPX “ad-hoc” Local Deployment
Let’s create our first APPX package with RAD Studio. Before publishing to Windows Store, we can create and test it locally. This is why the “ad-hoc” provisioning option is there. Create or open any Windows project with RAD Studio. This could be Delphi or C++Builder. Win32 or Win64. VCL or FireMonkey. Your choice. To keep things simple create a new Delphi VCL Forms application and drop on button on it and write a line of code to display a message in button’s OnClick event. We have now something for testing.
The first thing for APPX development is to change active project’s configuration from “Normal” to “Application Store”. This can be done in “Project Manager”. I’m keeping the default Win32 target and “debug” build configuration. Switching configuration to “Application Store” will show the current version of Windows 10 SDK set for the project.
Before we can generate the appx package we need to go “Project – Options” and set the certificate we want to use to sign our app. In the “Provisioning” enter the location of the certificate in the “Certificate File” edit and enter certificate password that was created in the “Create Certificate” wizard. Click OK.
Now we are good to go. From the “Project” menu select “Deploy” option. Right-click on the name of the project in “Project Manager” and select “Show in Explorer” option. There should be “Win32” subfolder in your project directory. Drill down and you should find the APPX package in “Win32\Debug\AppxTestApp\bin” folder.
Right-click on it and select “Open”. The dialog will pop up asking if you want to install this app. Click on “Install” and in few moments you will see the dialog to “Launch” the app. Click on it and the app should just run.
We have managed to create and deploy appx package locally for testing purposes. All APPX packages installs into hidden “C:\Program Files\WindowsApps” folder.
APPX Windows 10 Store Deployment
We have an app. Let’s deploy it to Windows 10 Store!
The first thing before we can publish our apps in Windows 10 Store is to register as an app developer with Microsoft. Go to https://developer.microsoft.com/en-us/store/register and sign up for an account. You will need to make a one time payment and also choose your “publisher name” that will be used as your “brand” in Windows 10 Store.
Currently you need to additionally apply to Microsoft if you want to publish apps created with “Desktop Bridge” and this is the technology that RAD Studio uses. Here is the link to sign-up for Desktop Bridge publishing: https://developer.microsoft.com/en-us/windows/projects/campaigns/desktop-bridge
In order to be accepted you need to give an URL to the app that you want to convert and publish. Last year I have created “Molecule Hero” proof-of-concept Delphi FireMonkey 3D app that has already been accepted to Google PlayStore so I have decided to publish the same app to Windows 10 Store. The source code of “Molecule Hero” app is available from GitHub.
When you log into your developer account there is “Dashboard” that you can use to manage your applications. Click on the “Create a new app” button.
This will display an option to enter a name of the application that you want to create. You can check if a name is not already taken. If it is not, click on “Reserve product name” button. You have a new app!
In your developer dashboard there could be many apps in different stages of their lifetime. Now you have one year to submit your app, or the name that you have reserved will no longer be available.
In order to prepare your app for submission to Windows Store you need to enter the information from “App Identity” section of the app into “Provisioning” options of your project. Make sure that the “Distribution Type” is set to “Store” and not “Ad hoc”. Build and deploy your application. Now you have APPX package that is ready to be submitted to Windows 10 Store. In the Dashboard select an option to create a “New Submission”. This will take you through a number of options that you need to enter like monetization model, type of an app, age category and similar.
Now you need to wait until your application is accepted and visible in the Windows 10 Store. I’m still waiting for mine to be available. Stay tuned!
RAD Studio 10.1 Berlin Update 2 Anniversary Edition has been released few weeks ago. Probably the most significant new feature that it introduces is the support for building APPX Windows Store packages. This really opens new possibilities in front of Delphi and C++Builder developer that can take existing VCL and FireMonkey project and put them to the Windows 10 Store.
I’m looking forward to see more and more cool apps created with RAD Studio on Windows 10 Store!