1# Configuration and Installation of Pre-installed Applications 2 3Pre-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. 4 5## Configuring Pre-installed Applications 6 71. Before the configuration, run the following command to query the directories for pre-installed applications supported by the system: 8 9 ``` 10 hdc shell param get const.cust.config_dir_layer 11 ``` 12 13 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. 14 152. Configure the HAP path on the device in the **install_list.json** file. 16 17``` 18hdc shell mount -o rw,remount / 19hdc file recv /system/etc/app/install_list.json . 20``` 21 223. Configure **install_list**. 23 24``` 25{ 26 "install_list" : [ 27 { 28 "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. 29 "removable":true // Whether the application can be uninstalled. The value true means the application can be uninstalled; the value false means the opposite. 30 } 31 ] 32} 33``` 34 354. Transfer the **install_list.json** file to the device, and restart the device for the modification to take effect. 36 37``` 38 hdc shell mount -o rw,remount / 39 hdc file send install_list.json /system/etc/app/install_list.json 40 hdc shell reboot 41``` 42 43## Updating Pre-installed Applications 44 45After the pre-installed applications are updated, use either of the following methods to reinstall them: 46 47- Method 1: Clear **/data** and restart the device. The applications will be automatically installed. 48 49``` 50 hdc shell mount -o rw,remount / 51 hdc shell rm /data/* -rf 52 hdc shell sync 53 hdc shell /system/bin/udevadm trigger 54 hdc shell reboot 55``` 56- Method 2: Run the following command to restart the device. The applications will be installed. 57 58 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. 59 60``` 61 hdc shell mount -o rw,remount / 62 hdc shell param set persist.bms.test-upgrade true 63 hdc shell reboot 64``` 65 66# Configuring Applications Not Installed 67 68The [**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. 69 70## Example 1 71 72``` 73/system/etc/app/uninstall_list.json 74{ 75 "uninstall_list": ["/system/app/Hiworld"], // Hiworld will not be installed. 76 "recover_list" : [] 77} 78``` 79 80## Example 2 81 82``` 83/system/etc/app/uninstall_list.json 84{ 85 "uninstall_list" : ["/system/app/Hiworld"], 86 "recover_list" : [] 87} 88 89/chipset/etc/app/uninstall_list.json 90{ 91 "uninstall_list" : [], 92 "recover_list": ["/system/app/Hiworld"] // Hiworld will be installed. 93} 94``` 95