1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef HNP_INSTALLER_H 17 #define HNP_INSTALLER_H 18 19 #include "hnp_base.h" 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 typedef struct NativeHnpPathStru { 26 char hnpSoftwareName[MAX_FILE_PATH_LEN]; 27 char hnpBasePath[MAX_FILE_PATH_LEN]; 28 char hnpSoftwarePath[MAX_FILE_PATH_LEN]; 29 char hnpVersionPath[MAX_FILE_PATH_LEN]; 30 } NativeHnpPath; 31 32 // 0x801301 组装安装路径失败 33 #define HNP_ERRNO_INSTALLER_GET_HNP_PATH_FAILED HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x1) 34 35 // 0x801302 获取安装绝对路径失败 36 #define HNP_ERRNO_INSTALLER_GET_REALPATH_FAILED HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x2) 37 38 // 0x801303 获取Hnp安装包名称失败 39 #define HNP_ERRNO_INSTALLER_GET_HNP_NAME_FAILED HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x3) 40 41 // 0x801304 安装的包已存在 42 #define HNP_ERRNO_INSTALLER_PATH_IS_EXIST HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x4) 43 44 // 0x801305 获取卸载路径失败 45 #define HNP_ERRNO_UNINSTALLER_HNP_PATH_NOT_EXIST HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x5) 46 47 // 0x801306 安装命令参数uid错误 48 #define HNP_ERRNO_INSTALLER_ARGV_UID_INVALID HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x6) 49 50 // 0x801307 获取版本目录失败 51 #define HNP_ERRNO_INSTALLER_VERSION_FILE_GET_FAILED HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x7) 52 53 // 0x801308 安装包超过最大值 54 #define HNP_ERRNO_INSTALLER_SOFTWARE_NUM_OVERSIZE HNP_ERRNO_COMMON(HNP_MID_INSTALLER, 0x8) 55 56 #define HNP_DEFAULT_INSTALL_ROOT_PATH "/data/app/el1/bundle" 57 58 int HnpCmdInstall(int argc, char *argv[]); 59 60 int HnpCmdUnInstall(int argc, char *argv[]); 61 62 #ifdef __cplusplus 63 } 64 #endif 65 66 #endif