Il est plus simple pour l'utilisateur de disposer d'un programme d'installation qui s'occupera de toutes les opérations à réaliser pour installer correctement votre programme.

MSDN .CAB

Projets smart device

Fichiers CAB personnalisés pour les périphériques

Vous pouvez déterminer l'emplacement où sont installés vos fichiers d'application et les modalités de l'installation en fournissant votre propre fichier d'informations (.inf) et, facultativement, un fichier Setup.dll, puis en exécutant Cabwiz.exe pour générer des fichiers CAB personnalisés destinés à vos clients. Le fichier texte .inf spécifie les répertoires, les fichiers, les paramètres et les configurations qu'utilise Cabwiz.exe pour installer votre application. Le fichier facultatif Setup.dll fournit des fonctions permettant d'effectuer certaines opérations lors de l'installation et de la suppression de l'application.

Dans cette section

Fichiers .inf pour les périphériques

Décrit les informations requises pour générer des fichiers CAB destinés à des smart devices et en fournit des exemples.

Fichiers Setup.dll pour les périphériques

Explique comment ajouter des opérations qui s'exécuteront avant et après l'installation et la suppression de l'application smart device.

Fichier Cabwiz.exe pour les périphériques

Fournit des paramètres à utiliser avec Cabwiz.exe pour générer des fichiers CAB destinés à des projets smart device.

Rubrique connexe

Procédure pas à pas : génération de fichiers CAB personnalisés pour les projets smart device

Explique, étape par étape, comment créer un fichier CAB personnalisé.

Voyez aussi :

Application Security, Deployment, and Management

Pour appeler un ficher .cab sur le périphérique, vous devez appeler wceload.exe avec le chemin complet du .cab en tant que paramètre de ligne de commande, ce qui est facile à faire avec CeCreateProcess. Cependant, puisque nous ne voulons pas d'invoquer plus d'un .cab à un moment, nous avons besoin d'attendre la fin de wceload, et nous sommes incapables d'utiliser WaitForSingleObject sur le processus de poignée comme avec CreateProcess.

C'est un autre cas où nos SetupHelper.dll devient pratique. Il pourrait être fait pour faire la waitfor ... call sur le périphérique et tout simplement bloc, mais cela rend votre installation dépendante du comportement de l'appareil. Au lieu de cela, nous interroge le dispositif une fois par seconde pour savoir si le processus est terminé. Cela nous permet d'invoquer dans l'ordre tous les fichiers .cab nécessaires, d'abord. NET Compact Framework, puis les deux SQL CE .cabs, et enfin notre application.

Il convient de noter que wceload n'est pas garanti de se taire. Particulièrement dans le cas d'un réaménagement d'une ROM d'installation du. NET Compact Framework, les dialogues mai apparaîtront sur l'appareil qui requièrent une interaction utilisateur. Pour cette raison, il est préférable que votre MSI diriger l'attention de l'utilisateur de l'appareil, ou alternativement votre SetupHelper.dll pourraient être utilisés pour surveiller le processus de wceload pour les popups, et l'utilisation des API Win32 pour appuyer sur le bouton approprié.

Annexes :

J'ai développé sous Windows Mobile 6 application professionnelle à l'aide ciblée cadre comme. NET CF 3.5 et professionnelle 6 SDK. A également créé sa SmartDeviceCab fichier. Quand je l'ai installer sur le dispositif de ne pas avoir CF 3.5 ne parvient pas à faire fonctionner mon demande (car l'appareil a fait. NET CF 2.0). Maintenant, je sais que je dois avoir NET CF 3.5 sur le dispositif sur lequel je veux courir mon app. Comment puis-je détecter la version actuelle de la mucoviscidose et l'installer (si nécessaire) CF 3.5 depuis mon installation cabine. J'ai exploré, et traversé autant sur Setup.dll Mais sa manière trop vieux et je n'ai pas trouver une façon de diriger cab de mon Setup.dll. S'il vous plaît aidez-moi à trouver la solution. Serait reconnaissante si / code de lien échantillon fourni. Plus frustrant, c'est que je n'ai jamais touché VC ++.

Il s'agit d'un article MSDN Creating an MSI Package that Detects and Updates the .NET Compact Framework sur la création d'un package MSI qui détecte et met à jour le. NET Compact Framework, si cela est nécessaire. Il est assez vieux, mais les principes s'appliquent toujours. Vous devez écrire une DLL qui se déroulera dans le téléphone. Vous recherchez d'abord les fichiers dll compact framework et alors vous pouvez obtenir la version à partir d'une clé de registre. Vous pouvez également détecter le type d'appareil et installer les fichiers appropriés compacte CAB-cadre.

Si vous voulez le faire avec un fichier CAB, le processus est toujours le même. Voir Optional Setup.dll Files for Installation sur la façon dont vous pouvez exécuter un set-up dll à partir d'un fichier CAB.

.CAB avec Windows Phone 7 ? Non : .XAP

Les nouveaux fichiers sont appelés .xap et remplacent les .cab, quelles sont les modifications exactes entre les deux fichiers?

Tout d'abord, les fichiers .xap ne sont rien de plus que des des fichiers .zip renommés. Il ya un certain nombre de fichiers .xml qui peuvent être inclus dans le .xap. Ils déterminent certaines choses comme le niveau de sécurité d'accès requis, pour indiquer au système quel .dll contient la fonction main() pour l'application, et autres options de configuration. Initialement, les fichiers .xap ne seront disponibles que pour le déploiement à travers le Marketplace.

Les problème de sécurité lors de l'installation d'exe et .cab

Sur windows mobile 5, lors de la mise à jour automatique, mon programme lance l'installeur (un .cab) et se quitte.

Le problème c'est qu'il faudrait confirmer le message de sécurité suivant :

Le programme provient d'un éditeur inconnu.
Ne l'installez que si vous faites confiance à cet éditeur. Voulez-vous continuer?

ou sa variante :

Le programme provient d'un éditeur inconnu.
Si vous l'exécutez, vous risquez d'endommager votre appareil. Voulez-vous continuer?

Nom: MonProg.CAB
Editeur: Inconnu
Emplacement: \Application Data\Volatile

Mais comme on pas le temps de cliquer, c'est l'installeur du .CAB qui retourne l'erreur avec le message :

L'installation a échoué. Impossible d'installer le programme ou de définir le paramètre en l'absence de signature numérique provenant d'un certificat digne de confiance.

En peut outre passer ce problème via la modification de la base de registre (HKLM\Security\Policies\Policies\) :

  • HKLM\Security\Policies\Policies\00001005 = 16 Unsigned .cabs Policy. Smartphone only.
  • HKLM\Security\Policies\Policies\00001006 = 1 Unsigned Applications Policy. Smartphone only.
  • HKLM\Security\Policies\Policies\0000101A = 1 UnsignedPrompt Policy. Smartphone only.
  • HKLM\Security\Policies\Policies\0000101B = 1 PrivilegedApps Policy. Smartphone only.

Ensuite pour l'application lancée automatiquement au démarrage la nouvelle erreur est :

Impossible d'ouvrir le fichier 'MonProg'. Il n'est pas signé avec un certificat de confiance ou l'un de ses composants est introuvable. Vous devrez peut-être réinstaller ou restaurer ce fichier.

Explication sur les certificats : Installation des certificats Freephone sous Windows Mobile 6.0

Et pour mettre le certificat dans le PDA (un SPV M650) :

Vous êtes sur le point d'installer \leCertificat.cer, un certificat émis par TEST CA. Voulez vous continuer ?

Résulte avec l'erreur :

Les autorisations de sécurité étaient insuffisantes pour mettre à jour l'appareil.

Windows Mobile 5.0 Application Security

Table 1. Important security policies

SECPOLICY_* constant Security policy
4102 (0x1006) Can unsigned apps run?
4122 (0x101A) Should the user be prompted when an unsigned application attempts to run?
4123 (0x101B) Is the device one-tier or two-tier?
4097 (0x1001) What rights does a desktop computer application have when making RAPI calls?

DISABLED (0) means the desktop computer application has no rights.

ALLOWED (1) means the desktop computer application has full rights.

RESTRICTED (2) means the desktop computer application has the Authenticated User role (SECROLE_USER_AUTH), which means it can do what an end-user could do.

Note   In previous versions of Windows Mobile, RAPI was always allowed on Pocket PC, so earlier applications that use RAPI may no longer work. For more details, see the SDK documentation about CeRapiInvoke().

Security Configuration

Together, the values of the four security policies in Table 1 define a security configuration. Windows Mobile has five standard security configurations, as shown in Table 2.

Table 2. Standard security configurations

Security configuration 4102
(Can unsigned apps run?)
4122
(Prompt User?)
4123
(One-tier?)
4097

(RAPI)

Notes
Locked No (0) No (1) Two-tier (0) or one-tier (1) Disabled (0) Does not include the Mobile2Market certificate. Not recommended.
Third-Party-Signed No (0) No (1) Two-tier (0) or one-tier (1) Disabled (0) Includes the Mobile2Market certificate.
Two-Tier-Prompt Yes (1) Yes (0) Two-tier (0) Restricted (2) May or may not include Mobile2Market privileged certificate. Smartphone emulator has this configuration
One-Tier-Prompt Yes (1) Yes (0) One-tier (1) Restricted (2) Pocket PC emulator has this configuration
Security-Off Yes (1) No (1) One-tier (1) Allowed (1) Not recommended.

For more information, see the "Selecting Security Configuration" topic in the SDK documentation.

Windows Mobile Device Security Model

Windows Mobile devices employ a combination of security policies, roles, and certificates to address configuration, remote access, and application execution.

Sécurité dans les projets Smart Device

Windows Mobile-based Smartphone Applications Deployment Demystified

Table 3. Windows CE® Strings for Smartphone*

Identifier Smartphone Directory
%CE1% \Program Files
%CE2% \Windows
%CE11% \Windows\Start Menu\Programs
%CE14% \Windows\Start Menu\Programs\Games
%CE17% \Windows\Start Menu
%CE18% <default volume, dependent on device configuration>
%CE19% \Application Data

* Taken from Smartphone 2003 SDK Help

Les appareils Windows Mobile sont fournis par l'opérateur mobile ou le fabricant de matériel préconfigurés avec les paramètres de sécurité restreignant l'exécution d'applications non signées et l'installation de fichiers CAB non signés. Pour permettre le fonctionnement de votre application, vous devez la signer avec un certificat installé sur l'appareil de vos utilisateurs finaux.

Pour signer une application, vous devez signer tous les fichiers EXE, assemblys managés, DLL, CAB et MUI (Interface utilisateur Multilingue) qui constituent l'application.

  • Signature d'application (Smart Devices)
    • Comment : signer une application Visual Basic ou Visual C# (smart devices)
    • Comment : signer un assembly Visual Basic ou Visual C# (smart devices)
    • Comment : signer la sortie de projet dans un projet Visual C++ (smart devices)
    • Comment : signer un fichier CAB (smart devices)

policies smartphone policies are stored in the registry in HKLM\Security\Policies\Policies

HKLM\Security\Policies\Policies\0000101a Unsigned Prompt Policy

The Unsigned Prompt policy determines whether a user is prompted to accept or reject an unsigned .cab file or theme with unsigned .dll files for a Windows Mobile-based Smartphone.

  • 0 Enable user prompt. Any value other than 1 is treated as 0. ( default )
  • 1 Disable user prompt.
HKLM\Security\Policies\Policies\0000101b PrivilegedApps Policy

The PrivilegedApps policy setting specifies which security model is implemented on the device.

  • 0 Two-tier security model is enabled. Any value other than 1 is treated as 0. ( default )
  • 1 One-tier security model is enabled.
HKLM\Security\Policies\Policies\00001001 RAPI Policy

The Remote API (RAPI) policy restricts the access of remote applications that are using RAPI to implement ActiveSync operations on mobile devices.

  • 0 ActiveSync service is shut down. RAPI calls are rejected.
  • 1 Full access to ActiveSync is provided. RAPI calls are allowed to process without restrictions.
  • 2 Access to ActiveSync is restricted to the SECROLE_USER_AUTH (User Authenticated) role. RAPI calls are checked against this role mask before they are granted. ( default )
HKLM\Security\Policies\Policies\00001005 Unsigned CABS Policy

The Unsigned CABS policy determines whether unsigned .cab files can be installed on the device. On the Windows Mobile-based Smartphone, this policy also determines whether applications stored on a MultiMedia Card (MMC) are allowed to auto-run when inserted into the device. Accepted unsigned .cab files are installed with the role mask specified by the policy value. If a signed .cab file does not have a matching root certificate in the Software Publisher Certificate(SPC) store, the file is unsigned. For information about certificate stores, see Application Security on Mobile Devices.

Specified as a role mask Accepted unsigned .cab files are installed with the role mask specified by this policy. SECROLE_USER_AUTH Unsigned .cab files cannot be installed. (default)

HKLM\Security\Policies\Policies\00001006 Unsigned Applications Policy

The Unsigned Applications policy determines whether unsigned applications are allowed to run on a Windows Mobile-based Smartphone. If a signed application does not have a matching root certificate in the Privileged Execution Trust Authorities or the Unprivileged Execution Trust Authoritiescertificate store, the application is unsigned. For information about certificate stores, see Application Security on Mobile Devices.

  • 0 Unsigned applications are not allowed to run on the device. Any value other than 1 is treated as 0.
  • 1 Unsigned applications are allowed to run on the device. ( default )
HKLM\Security\Policies\Policies\00001007 Unsigned Themes Policy

The Unsigned Themes policy determines whether unsigned theme files (.cab files that update the Home screen) can be installed on the device and with which role mask they are installed. Specified as a role mask Default value SECROLE_USER_UNAUTH

Et les sous pages des outils et l'utilisation des certificats :

How are certificates imported ? certificates can be entered into a phone in several ways:

  • using rapiconfig.exe /p AddCert.xml
  • using spdps.exe or sp2002dps.exe
  • using prapi.exe -c certificatefile.cer


HKLM\Security\Policies\Policies\00001017
codeppc.com

Policy Value Description Hex --Dec

  • 00000002 0002 AutoRun Policy.
  • 00001001 4097 RAPI Policy.
  • 00001005 4101 Unsigned .cabs Policy. Smartphone only.
  • 00001006 4102 Unsigned Applications Policy. Smartphone only.
  • 00001007 4103 Unsigned Themes Policy. Smartphone only.
  • 00001008 4104 TPS Policy.
  • 00001009 4105 Message Authentication Policy.
  • 0000100B 4107 WAP Signed Message Policy.
  • 0000100C 4108 Service Loading Policy. Smartphone only.
  • 0000100D 4109 Service Indication Policy. Smartphone only.
  • 0000100E 4110 Unauthenticated Messages Policy.
  • 0000100F 4111 OTA Management Policy.
  • 00001010 4112 WDP Push Policy. Smartphone only.
  • 00001011 4113 WSP Push Policy.
  • 00001017 4119 Grant Manager Policy.
  • 00001018 4120 Grant User Authenticated Policy.
  • 0000101A 4122 UnsignedPrompt Policy. Smartphone only.
  • 0000101B 4123 PrivilegedApps Policy. Smartphone only.

REMOTE API (RAPI) Policies : 1 permet l'écriture par ActiveSync dans les zones sensibles de la base de registre, 2 l'interdit.

CAB file installation failed on windows

CAB file installation failed on windows ce 5.0

Voici les paramètres de Registre pour les politiques de sécurité :

; Security Policies 
; ------------------------------------------------------------------- 
; * The absence of any policy in the following section is equivalent to setting 
; that policy to a default value of 0 
; * The default values can be changed by sending security policy CSP XML using 
; the DMProcessConfigXML API 
; * DWORD values are in hex. 
 
; AutoRun Policy 
; Value: 0 - Applications on a CF card are allowed to auto-run 
;[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
; "00000002"=dword:0 
 
; Device Wipe Policy 
; Value: 8 - Manager 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001000"=dword:8 
 
; RAPI Policy 
; Value: 2 - RAPI calls in restricted mode 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001001"=dword:1 
 
; Unsigned cabs role 
; (default: SECROLE_USERAUTH) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001005"=dword:10 
 
; 
; Unsigned Applications Policy 
; 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001006"=dword:1 
 
; UNAUTHENTICATED role is used for processing Homescreens 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001007"=dword:40 
 
; TPS Policy 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001008"=dword:1 
 
; Message Authentication Retry Number Policy 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001009"=dword:3 
 
; WAP Signed Message Policy 
; (default: SECROLE_PPG_AUTH | SECROLE_PPG_TRUSTED | 
SECROLE_CARRIER_TPS) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000100b"=dword:c80 
 
; SL Message Policy 
; (default: SECROLE_PPG_TRUSTED) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000100c"=dword:800 
 
; SI Message Policy 
; (default: SECROLE_PPG_AUTH | SECROLE_PPG_TRUSTED) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000100d"=dword:c00 
 
; Unauthenticated Message Policy 
; Value: 64 - USER_UNAUTH 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000100e"=dword:40 
 
; OTA Provisioning Policy 
; (default: CARRIER_TPS | SECROLE_PPG_TRUSTED | SECROLE_PPG_AUTH | 
SECROLE_TRUSTED_PPG | USER_AUTH) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000100f"=dword:e90 
 
; WSP Push Policy 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001011"=dword:1 
 
; Grant Manager Policy 
; (default: CARRIER_TPS for phone skus; USER_AUTH for non-phone skus) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001017"=dword:80 
 
; Grant User Auth Policy 
; (default: USER_AUTH) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001018"=dword:10 
 
; Trust WAP Proxy Policy 
; (default: CARRIER | CARRIER_TPS | MANAGER) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001019"=dword:8c 
 
; Unsigned Prompt Policy 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000101a"=dword:1 
 
; Privileged Apps Policy 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000101b"=dword:1 
 
; Signed Mail(USESIGN) Policy 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000101d"=dword:1 
 
; Encrypted Mail(USEENCRYPT) Policy 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000101e"=dword:1 
 
 
;Storage Card Encryption 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"0000101f"=dword:1 
 
;Local Persist Encryption 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001020"=dword:1 
 
; DRM Security Policy 
; (default SECROLE_PPG_AUTH | SECROLE_PPG_TRUSTED) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001021"=dword:c00 
 
; NetwPin Prompt Security Policy 
; (default 1 - no prompt) 
[HKEY_LOCAL_MACHINE\Security\Policies\Policies] 
"00001024"=dword:1 
 
; END Security Policies 
; -------------------------------------------------------------------
forum.xda-developers.com

Policy enable sdconfig HKLM \ Security \ Policies \ Policies\0000101a = 1 Enable Registry edit HKLM \ Security \ Policies \ Policies\00000101b = 1

Per and I just received our new Qtek 8310 mobile devices today and got into trouble when we tried to ad

A utility called SDA_ApplicationUnlock.exe can also be found on the Internet but our testing shows us that it does the same as the Grant Manager Policy registry key. The problem with this application is that it only has a "Remove Lock" feature and no "Enable Lock" feature. Different posts/websites show the solution for other phones that include the use of SDA_ApplicationUnlock.exe utility; so if you run into problems you might want to try it.

Grant Manager Policy registry key
HKLM\Security\Policies\Policies\00001017 = 144
Edition de la base de registre

Pour éditer la base de registre du mobile device vous pouvez utiliser Total Commander