Articles Deploy an application on the Windows Store by Marion Candau

emailx45

Местный
Регистрация
5 Май 2008
Сообщения
3,571
Реакции
2,438
Credits
573
Deploy an application on the Windows Store by Marion Candau
Marion Candau
[SHOWTOGROUPS=4,20]
As of Для просмотра ссылки Войди или Зарегистрируйся , we can create an .appx package of its application in order to submit it to the Windows Store.
To create the package, I advise you to follow the tutorial from Paweł Głowacki: Для просмотра ссылки Войди или Зарегистрируйся . I will translate part of it into French, adding elements related to my own experience of package creation.

To deploy an appx application, you need Windows 10 (minimum version: Anniversary Update), RAD Studio 10.1 Berlin Update 2 Anniversary Edition or a later version, and the Windows 10 SDK.

Then, you have to activate the developer mode under Windows. To do this, open the “Settings” application, click on “Update and security”, then on “For developers”, enter the administrator password if necessary and choose “Developer mode” in “Use the features”. of development". It may take a few minutes to download and install the necessary packages.

Для просмотра ссылки Войди или Зарегистрируйся

The next step takes place on RAD Studio, you must configure a new Windows 10 SDK. Go to "Tools - Options - SDK Manager". Add a new Windows SDK. It should find your SDK automatically. If this is not the case, you must manually enter the paths to MakeAppx.exe, SignTool.exe and MakeCert.exe.

Для просмотра ссылки Войди или Зарегистрируйся

Test deployment on your machine
RAD Studio allows you to locally test your appx on your machine. To do this, you must create a certificate and sign the appx with it. Everything happens in “Projects - Options - Supply”. Choose “Ad-hoc” as the distribution type and click on “create a self-signed certificate…”. Choose the location of your file (be careful, you will need to know where it is next), leave the subject as it is, choose a password (which you will have to remember) and click on "Finish". Normally your new certificate has been successfully created.

Для просмотра ссылки Войди или Зарегистрируйся

Now, you will have to install the certificate on your machine. Find it, right click on it and select “Install PFX”. Then choose “Local computer”, you may have to type your administrator password. Then click on “Next”. Then type the password for your certificate. Then click on “Place all certificates in the following store” and choose “Authorized people” (or Trusted People) in the list of stores. Finally, click on “Finish”. The import was successful.

To prepare your application for local deployment, you must change your project configuration to “Application store”. To do this, look to the right in the “project manager” window and click on the + of Windows 64 bit or Windows 32 bit, depending on your project. Then pull down “Configuration” and choose “Application store”.

Для просмотра ссылки Войди или Зарегистрируйся

Compile your project and click on “Projects - Deployment”. Then click on the icon Для просмотра ссылки Войди или Зарегистрируйсяto deploy. If everything is successful, you can find the APPX file in the folder {Win32 or Win64} \ {Debug or Release} \ {Name of your application} \ bin. Double-click on it and click on “Install” then on “Launch”. Normally, the application will launch.

If that fails, we very often get the error: “paclient” exited with code 1. We have to look if there are no gray lines in the list of files to deploy. If so, you have to look for the correct path for these files. For example, the line corresponding to the file cc64230mt.dll is grayed out. After a search in C: \ Program Files (x86) \ Embarcadero \ Studio I find it in C: \ Program Files (x86) \ Embarcadero \ Studio \ 17.0 \ bin64. Since I cannot delete this line from the file list, I copy the file cc64230mt.dll to C: \ Program Files (x86) \ Embarcadero \ Studio \ 19.0 \ bin64 (because I have version 19.0). My application is now successfully deployed!

So I test it and there, error, problem of rights on the folder in which I wanted to create a configuration file, I try to write in GetHomePath () that is to say in C: \ Users \ Marion \ AppData \ Roaming and it is not allowed. One of the authorized folders is the application installation folder, the path of which is C: \ Users \ Marion \ AppData \ Local \ Packages \ {Application name} _ {chain in base64} \ Settings. Here is a function in C ++ to find the name of this folder:
Код:
String GetFolderPath (String AppName) {
 / * GetHomePath corresponds to C: \ Users \ Marion \ AppData \ Roaming \ * /
    String P = GetHomePath ();
/ * We remove Roaming \ and we add \ Local \ Packages \ * / 
    P = P. SubString (0, P. Length () - 8);
    P = P + "\\ Local \\ Packages \\";
    
    TSearchRec FileRecord;
    int i;

 / * We are looking for a file that starts with AppName * /
    String LocalDir = P + AppName + "*";
    String DirName = "";
    if ( FindFirst (LocalDir, faAnyFile, FileRecord) == 0) {
        do {
            if (((FileRecord.Attr & faDirectory) == faDirectory) &&
                (FileRecord.Name! = ".") && (FileRecord.Name! = ".."))
            { 
                DirName = FileRecord.Name;
                break;
            }
        }
        while ( FindNext (FileRecord) == 0);
    }
    FindClose (FileRecord);

    String res;
    if (DirName! = "") {
        res = P + DirName + "\\ Settings";
    }

    return res;
}

After changing the name of the writing folder of my application, I redeploy it and I retest. I get an error again when I make an http request. Indeed, I have not added the rights to be an internet customer for this application: Для просмотра ссылки Войди или Зарегистрируйся . To add a “capability”, open the AppxManifest.template.xml file. Between the <Capabilities> </Capabilities> tags, you must add
Код:
<Capability Name = "internetClient" />

to be an internet customer for example. Then I redeploy and the http request goes through.

Now imagine that you want to make an https request using Indy and OpenSSL. You must provide the OpenSSL dll to the APPX and tell the application where to look for the dll. In the source code of your application, you must therefore add the line
Код:
Idsslopensslheaders :: IdOpenSSLSetLibPath (".");

Then you need to add the files ssleay32.dll and libeay32.dll to the files deployed with your application.

Deployment on the store
To deploy on the store, you must be registered as a developer at Microsoft. You can do it on this link: Для просмотра ссылки Войди или Зарегистрируйся . In addition, you must tell Microsoft that you want to publish applications created with “Desktop Bridge” because this is the technology that RAD Studio uses. Here is the link to register as a Desktop Bridge developer: Для просмотра ссылки Войди или Зарегистрируйся .

When you're on your developer account, there is a dashboard that you can use to manage your apps. To create a new application, click on "Create a new application". You can then enter the name of your application. If the name is not already taken, you can click on “Reserve product name”.

To prepare your application for the store, you must return to “Project - Options - Supply”. You must choose “Store” and enter the identity information in the fields. For the Publisher field, precede your name or that of your company with CN =. You must rebuild and redeploy your application and you have an appx ready to be submitted to the store. From the Microsoft dashboard, choose "New Submission" and fill in the information for your application. Then you will have to wait a while for your application to be accepted and visible on the Windows Store.

I submitted my application and I have 3 errors. One is related to the fact that my application is in version 3.0.0.1 and the store only accepts versions ending in 0. The other errors seem to be linked to the way the manifest is generated by Embarcadero. A technical support employee contacted us to validate our application manually. We are waiting for his return, hoping that my application will soon be on the store!



[/SHOWTOGROUPS]