With Delphi (and C++Builder) Berlin Update 2, you have the ability to create and deploy on the local machine an Appx package, leveraging the Microsoft Desktop Bridge (aka Centennial Bridge). The IDE also support deployment for Windows Store, using slightly different steps.
However some of the steps are far from obvious, particularly including generating and registering a self-signed certificate. This blog post highlights some of the steps need, and the related video (extracted from one of my CodeRage sessions) show all of the steps in details, going from a vanilla version of Update 2 to the APPX deployment.
Detailed Content
The video covers:
- Configuring the Windows SDK in the IDE to enable the execution of the required SDK utilities
- Creating a self-signed certificate from the IDE
- Creating a project and build it for store deployment, configuring the provisioning page
- Looking into the list of deployed file and in particular into the Appx manifest file
- Installing the self-signed certificate among the trusted certificates on the local machine (for this step, there is a detailed description below)
- Installing the Appx package on a machine, uninstalling it, looking at the file system location where it is stored and the versioning model
The Video
The video in itself is slightly over 10 minutes, and you can see it on YouTube at https://youtu.be/_GNPT9Cvyag.
Further Instructions for Certificate Registration
To import the certificate having the .pfx file generated by the RAD Studio IDE:In File Explorer, select the certificate file and use the Install PFX local menu item:
- In the Store Location group, select Local Machine
- Click Next and OK to confirm the UAC dialog
- Confirm the certificate file selection
- Enter your certificate password
- In the next screen of the Certificate Import Wizard, change the selected option to "Place all certificates in the following store"
- Click Browse. In the Select Certificate Store window, scroll down and select Trusted People and click OK
- Click Next. A "Completing... " screen appears
- Click Finish
As an alternative, you can import the certificate from the Appx package (like a customer would) and in this case the password won't be requested:
- In File Explorer, right click an Appx that you've signed with the certificate (most likely the Appx package you want to install) and choose Properties from the context menu.
- Click the Digital Signatures tab
- Click on the certificate and choose Details
- Click on View Certificate
- Click Install Certificate
- In the Store Location group, select Local Machine
- Click Next and OK to confirm the UAC dialog
- In the next screen of the Certificate Import Wizard, change the selected option to "Place all certificates in the following store"
- Click Browse. In the Select Certificate Store window, scroll down and select Trusted People and click OK
- Click Next. A "Completing... " screen appears
- Click Finish (agreeing to the following confirmation dialog if displayed)
These are steps I borrowed from Microsoft, of course, but worth sharing, as they are critical to be able to do local debugging or your applications once deployed into an Appx package. Remember that file access rules and even WinRT API call rules are different for applications executed via an Appx package and the Windows Desktop Bridge, so you need to do adequate testing in this scenario.