1e41f4b71Sopenharmony_ci# Configuration and Installation of Pre-installed Applications
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciPre-installed applications are applications that are natively installed on a device from factory setup. OpenHarmony supports differentiated configuration of pr-installed applications on different devices.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci## Configuring Pre-installed Applications
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci1. Before the configuration, run the following command to query the directories for pre-installed applications supported by the system:
8e41f4b71Sopenharmony_ci   
9e41f4b71Sopenharmony_ci   ```
10e41f4b71Sopenharmony_ci   hdc shell param get const.cust.config_dir_layer
11e41f4b71Sopenharmony_ci   ```
12e41f4b71Sopenharmony_ci   
13e41f4b71Sopenharmony_ci   The query result includes **system**, **chipset**, **sys_prod**, **chip_prod**, and more. The directories are listed in ascending order of priority. For example, **chip_prod** has higher priority than **system**. This document uses **/system/etc/app/** as an example.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci2. Configure the HAP path on the device in the **install_list.json** file.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci```
18e41f4b71Sopenharmony_cihdc shell mount -o rw,remount /
19e41f4b71Sopenharmony_cihdc file recv /system/etc/app/install_list.json .
20e41f4b71Sopenharmony_ci```
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci3. Configure **install_list**.
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci```
25e41f4b71Sopenharmony_ci{
26e41f4b71Sopenharmony_ci    "install_list" : [
27e41f4b71Sopenharmony_ci        {
28e41f4b71Sopenharmony_ci            "app_dir":"system/app/xxxx/yyyy", // HAP path on the device. If the directory does not exist, create it and push HAP to this directory.
29e41f4b71Sopenharmony_ci            "removable":true // Whether the application can be uninstalled. The value true means the application can be uninstalled; the value false means the opposite.
30e41f4b71Sopenharmony_ci        }
31e41f4b71Sopenharmony_ci    ]
32e41f4b71Sopenharmony_ci}
33e41f4b71Sopenharmony_ci```
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_ci4. Transfer the **install_list.json** file to the device, and restart the device for the modification to take effect.
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci```
38e41f4b71Sopenharmony_ci    hdc shell mount -o rw,remount /
39e41f4b71Sopenharmony_ci    hdc file send install_list.json /system/etc/app/install_list.json
40e41f4b71Sopenharmony_ci    hdc shell reboot
41e41f4b71Sopenharmony_ci```
42e41f4b71Sopenharmony_ci
43e41f4b71Sopenharmony_ci## Updating Pre-installed Applications
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ciAfter the pre-installed applications are updated, use either of the following methods to reinstall them:
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci- Method 1: Clear **/data** and restart the device. The applications will be automatically installed.
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci```
50e41f4b71Sopenharmony_ci    hdc shell mount -o rw,remount / 
51e41f4b71Sopenharmony_ci    hdc shell rm /data/* -rf
52e41f4b71Sopenharmony_ci    hdc shell sync
53e41f4b71Sopenharmony_ci    hdc shell /system/bin/udevadm trigger
54e41f4b71Sopenharmony_ci    hdc shell reboot
55e41f4b71Sopenharmony_ci```
56e41f4b71Sopenharmony_ci- Method 2: Run the following command to restart the device. The applications will be installed.
57e41f4b71Sopenharmony_ci
58e41f4b71Sopenharmony_ci    If an application has been installed, the application version No. ([versionCode](../../application-dev/quick-start/app-configuration-file.md) configured in **app.json5** for the stage model or [code](../../application-dev/quick-start/app-structure.md#internal-structure-of-the-version-atttribute) in the configuration file for the FA model) sent to the **/system/app/** directory must be later than the version number of the application installed.
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci```
61e41f4b71Sopenharmony_ci    hdc shell mount -o rw,remount /
62e41f4b71Sopenharmony_ci    hdc shell param set persist.bms.test-upgrade true
63e41f4b71Sopenharmony_ci    hdc shell reboot
64e41f4b71Sopenharmony_ci```
65e41f4b71Sopenharmony_ci
66e41f4b71Sopenharmony_ci# Configuring Applications Not Installed
67e41f4b71Sopenharmony_ci
68e41f4b71Sopenharmony_ciThe [**uninstall_list.json**](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/uninstall_list.json) has higher configuration priority than **install_list.json**. The applications added to **uninstall_list.json** will not be installed.
69e41f4b71Sopenharmony_ci
70e41f4b71Sopenharmony_ci## Example 1
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ci```
73e41f4b71Sopenharmony_ci/system/etc/app/uninstall_list.json
74e41f4b71Sopenharmony_ci{
75e41f4b71Sopenharmony_ci    "uninstall_list": ["/system/app/Hiworld"], // Hiworld will not be installed.
76e41f4b71Sopenharmony_ci    "recover_list" : []
77e41f4b71Sopenharmony_ci}
78e41f4b71Sopenharmony_ci```
79e41f4b71Sopenharmony_ci
80e41f4b71Sopenharmony_ci## Example 2
81e41f4b71Sopenharmony_ci
82e41f4b71Sopenharmony_ci```
83e41f4b71Sopenharmony_ci/system/etc/app/uninstall_list.json
84e41f4b71Sopenharmony_ci{
85e41f4b71Sopenharmony_ci    "uninstall_list" : ["/system/app/Hiworld"],
86e41f4b71Sopenharmony_ci    "recover_list" : []
87e41f4b71Sopenharmony_ci}
88e41f4b71Sopenharmony_ci
89e41f4b71Sopenharmony_ci/chipset/etc/app/uninstall_list.json
90e41f4b71Sopenharmony_ci{
91e41f4b71Sopenharmony_ci    "uninstall_list" : [],
92e41f4b71Sopenharmony_ci    "recover_list": ["/system/app/Hiworld"] // Hiworld will be installed.
93e41f4b71Sopenharmony_ci}
94e41f4b71Sopenharmony_ci```
95