• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.bundle.freeInstall (freeInstall) (System API)
2<!--Kit: Ability Kit-->
3<!--Subsystem: BundleManager-->
4<!--Owner: @wanghang904-->
5<!--Designer: @hanfeng6-->
6<!--Tester: @kongjing2-->
7<!--Adviser: @Brilliantry_Rui-->
8
9The module provides APIs for setting and obtaining installation-free information and APIs for obtaining BundlePackInfo and DispatchInfo.
10
11> **NOTE**
12>
13> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
14>
15> The APIs provided by this module are system APIs.
16
17## Modules to Import
18
19```js
20import { freeInstall } from '@kit.AbilityKit';
21```
22
23## Required Permissions
24
25| Permission                                      | APL    | Description              |
26| ------------------------------------------ | ------------ | ------------------ |
27| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to query information about all applications.|
28| ohos.permission.INSTALL_BUNDLE             | system_core  | Permission to install or uninstall other applications except enterprise applications, including enterprise InHouse, mobile device management (MDM), and Normal applications.  |
29
30For details about the APL, see [Basic Concepts in the Permission Mechanism](../../security/AccessToken/app-permission-mgmt-overview.md#basic-concepts-in-the-permission-mechanism).
31## UpgradeFlag
32
33**System API**: This is a system API.
34
35**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
36
37| Name            | Value  | Description            |
38| ---------------- | ---- | ---------------- |
39| NOT_UPGRADE      | 0    | No module needs an upgrade.    |
40| SINGLE_UPGRADE   | 1    | A single module needs an upgrade.|
41| RELATION_UPGRADE | 2    | The module that has a relationship with the current one needs an upgrade.|
42
43## BundlePackFlag
44
45**System API**: This is a system API.
46
47**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
48
49| Name              | Value        | Description                              |
50| ------------------ | ---------- | ---------------------------------- |
51| GET_PACK_INFO_ALL  | 0x00000000 | All information in the **pack.info** file.   |
52| GET_PACKAGES       | 0x00000001 | Package information in the **pack.info** file.|
53| GET_BUNDLE_SUMMARY | 0x00000002 | Bundle summary information in the **pack.info** file. |
54| GET_MODULE_SUMMARY | 0x00000004 | Module summary information in the **pack.info** file. |
55
56## setHapModuleUpgradeFlag
57
58setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback\<void>):void
59
60Sets an upgrade flag for a module. This API uses an asynchronous callback to return the result.
61
62**Required permissions**: ohos.permission.INSTALL_BUNDLE
63
64**System API**: This is a system API.
65
66**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
67
68**Parameters**
69
70| Name    | Type                       | Mandatory| Description                      |
71| ----------- | --------------------------- | ---- | ---------------------------- |
72| bundleName  | string                      | Yes  | Bundle name.    |
73| moduleName  | string                      | Yes  | Module name.          |
74| upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes  | Upgrade flag, which is for internal use only.      |
75| callback    | AsyncCallback\<void>        | Yes  | [Callback](../apis-basic-services-kit/js-apis-base.md#asynccallback) used to return the result. If the operation is successful, **err** is **null**; otherwise, **err** is an error object.|
76
77**Error codes**
78
79For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md).
80
81| ID|    Error Message                           |
82|----------|---------------------------------------- |
83| 201 | Permission denied. |
84| 202 | Permission denied, non-system app called system api. |
85| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.|
86| 801 | Capability not supported. |
87| 17700001 | The specified bundle name is not found. |
88| 17700002 | The specified module name is not found. |
89
90**Example**
91
92```js
93import { freeInstall } from '@kit.AbilityKit';
94let bundleName = 'com.example.myapplication';
95let moduleName = 'entry';
96let upgradeFlag = freeInstall.UpgradeFlag.SINGLE_UPGRADE;
97try {
98    freeInstall.setHapModuleUpgradeFlag(bundleName, moduleName, upgradeFlag, err => {
99        if (err) {
100            console.error('Operation failed:' + JSON.stringify(err));
101        } else {
102            console.info('Operation succeed');
103        }
104    });
105} catch (err) {
106    console.error('Operation failed:' + JSON.stringify(err));
107}
108```
109
110## setHapModuleUpgradeFlag
111
112setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag): Promise\<void>
113
114Sets an upgrade flag for a module. This API uses a promise to return the result.
115
116**System API**: This is a system API.
117
118**Required permissions**: ohos.permission.INSTALL_BUNDLE
119
120**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
121
122**Parameters**
123
124| Name     | Type                       | Mandatory| Description                  |
125| ----------- | --------------------------- | ---- | ---------------------- |
126| bundleName  | string                      | Yes  | Bundle name.|
127| moduleName  | string                      | Yes  | Module name.    |
128| upgradeFlag | [UpgradeFlag](#upgradeflag) | Yes  | Upgrade flag, which is for internal use only.|
129
130**Return value**
131
132| Type         | Description                                |
133| ------------- | ------------------------------------ |
134| Promise\<void> | Promise that returns no value.|
135
136**Error codes**
137
138For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md).
139
140| ID|    Error Message                           |
141|----------|----------------------------------------|
142| 201 | Permission denied. |
143| 202 | Permission denied, non-system app called system api. |
144| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.|
145| 801 | Capability not supported. |
146| 17700001 | The specified bundle name is not found. |
147| 17700002 | The specified module name is not found. |
148
149**Example**
150
151```js
152import { freeInstall } from '@kit.AbilityKit';
153import { BusinessError } from '@ohos.base';
154let bundleName = 'com.example.myapplication';
155let moduleName = 'entry';
156let upgradeFlag = freeInstall.UpgradeFlag.SINGLE_UPGRADE;
157try {
158    freeInstall.setHapModuleUpgradeFlag(bundleName, moduleName, upgradeFlag).then(() => {
159        console.info('Operation succeed')
160    }).catch((err: BusinessError) => {
161        console.error('Operation failed:' + JSON.stringify(err));
162    });
163} catch (err) {
164    console.error('Operation failed:' + JSON.stringify(err));
165}
166```
167
168## isHapModuleRemovable
169
170isHapModuleRemovable(bundleName: string, moduleName: string, callback: AsyncCallback\<boolean>): void
171
172Checks whether a module can be removed. This API uses an asynchronous callback to return the result.
173
174**System API**: This is a system API.
175
176**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
177
178**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
179
180**Parameters**
181
182| Name     | Type                  | Mandatory| Description                                         |
183| ---------- | ---------------------- | ---- | --------------------------------------------- |
184| bundleName | string                 | Yes  | Bundle name.                     |
185| moduleName | string                 | Yes  | Module name.                           |
186| callback   | AsyncCallback\<boolean> | Yes  | [Callback](../apis-basic-services-kit/js-apis-base.md#asynccallback) used to return the result. If the module can be removed, **true** is returned; otherwise, **false** is returned.|
187
188**Error codes**
189
190For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md).
191
192| ID|    Error Message                           |
193|----------|----------------------------------------|
194| 201 | Permission denied. |
195| 202 | Permission denied, non-system app called system api. |
196| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.|
197| 801 | Capability not supported. |
198| 17700001 | The specified bundle name is not found. |
199| 17700002 | The specified module name is not found. |
200
201**Example**
202
203```js
204import { freeInstall } from '@kit.AbilityKit';
205let bundleName = 'com.example.myapplication';
206let moduleName = 'entry';
207try {
208    freeInstall.isHapModuleRemovable(bundleName, moduleName, (err, data) => {
209        if (err) {
210            console.error('Operation failed:' + JSON.stringify(err));
211        } else {
212            console.info('Operation succeed:' + JSON.stringify(data));
213        }
214    });
215} catch (err) {
216    console.error('Operation failed:' + JSON.stringify(err));
217}
218```
219
220## isHapModuleRemovable
221
222isHapModuleRemovable(bundleName: string, moduleName: string): Promise\<boolean>
223
224Checks whether a module can be removed. This API uses a promise to return the result.
225
226**System API**: This is a system API.
227
228**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
229
230**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
231
232**Parameters**
233
234| Name    | Type  | Mandatory| Description              |
235| ---------- | ------ | ---- | ------------------ |
236| bundleName | string | Yes  | Bundle name.  |
237| moduleName | string | Yes  | Module name.|
238
239**Return value**
240
241| Type            | Description                        |
242| ---------------- | ---------------------------- |
243| Promise\<boolean> | Promise used to return the result. If the module can be removed, **true** is returned; otherwise, **false** is returned.|
244
245**Error codes**
246
247For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md).
248
249| ID|    Error Message                           |
250|----------|----------------------------------------|
251| 201 | Permission denied. |
252| 202 | Permission denied, non-system app called system api. |
253| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.|
254| 801 | Capability not supported. |
255| 17700001 | The specified bundle name is not found. |
256| 17700002 | The specified module name is not found. |
257
258**Example**
259
260```js
261import { freeInstall } from '@kit.AbilityKit';
262import { BusinessError } from '@ohos.base';
263let bundleName = 'com.example.myapplication';
264let moduleName = 'entry';
265try {
266    freeInstall.isHapModuleRemovable(bundleName, moduleName).then(data => {
267        console.info('Operation succeed:' + JSON.stringify(data));
268    }).catch((err: BusinessError) => {
269        console.error('Operation failed:' + JSON.stringify(err));
270    });
271} catch (err) {
272    console.error('Operation failed:' + JSON.stringify(err));
273}
274```
275
276## getBundlePackInfo
277
278getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag, callback: AsyncCallback\<BundlePackInfo>): void
279
280Obtains bundlePackInfo based on **bundleName** and **bundlePackFlag**. This API uses an asynchronous callback to return the result.
281
282**System API**: This is a system API.
283
284**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
285
286**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
287
288**Parameters**
289
290| Name        | Type                                                        | Mandatory| Description                                                        |
291| -------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
292| bundleName     | string                                                       | Yes  | Bundle name.                                            |
293| bundlePackFlag | [BundlePackFlag](#bundlepackflag)                            | Yes  | Flag of the bundle package.                                    |
294| callback       | AsyncCallback<[BundlePackInfo](js-apis-bundleManager-BundlePackInfo-sys.md)> | Yes  | [Callback](../apis-basic-services-kit/js-apis-base.md#asynccallback) used to return the result. If the operation is successful, **err** is **null** and **data** is the BundlePackInfo object obtained; otherwise, **err** is an error object.|
295
296**Error codes**
297
298For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md).
299
300| ID|    Error Message                           |
301|----------|----------------------------------------|
302| 201 | Permission denied. |
303| 202 | Permission denied, non-system app called system api. |
304| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.|
305| 801 | Capability not supported. |
306| 17700001 | The specified bundle name is not found. |
307
308**Example**
309
310```js
311import { freeInstall } from '@kit.AbilityKit';
312let bundleName = 'com.example.myapplication';
313let bundlePackFlag = freeInstall.BundlePackFlag.GET_PACK_INFO_ALL;
314try {
315    freeInstall.getBundlePackInfo(bundleName, bundlePackFlag, (err, data) => {
316        if (err) {
317            console.error('Operation failed:' + JSON.stringify(err));
318        } else {
319            console.info('Operation succeed:' + JSON.stringify(data));
320        }
321    });
322} catch (err) {
323    console.error('Operation failed:' + JSON.stringify(err));
324}
325```
326## getBundlePackInfo
327
328getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag): Promise\<BundlePackInfo>
329
330Obtains bundlePackInfo based on **bundleName** and **bundlePackFlag**. This API uses a promise to return the result.
331
332**System API**: This is a system API.
333
334**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
335
336**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
337
338**Parameters**
339
340| Name        | Type                             | Mandatory| Description                  |
341| -------------- | --------------------------------- | ---- | ---------------------- |
342| bundleName     | string                            | Yes  | Bundle name.|
343| bundlePackFlag | [BundlePackFlag](#bundlepackflag) | Yes  | Flag of the bundle package.|
344
345**Return value**
346
347| Type                                                      | Description                               |
348| ---------------------------------------------------------- | ----------------------------------- |
349| Promise<[BundlePackInfo](js-apis-bundleManager-BundlePackInfo-sys.md)> | Promise used to return the BundlePackInfo object obtained.|
350
351**Error codes**
352
353For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Bundle Error Codes](errorcode-bundle.md).
354
355| ID|    Error Message                           |
356|----------|----------------------------------------|
357| 201 | Permission denied. |
358| 202 | Permission denied, non-system app called system api. |
359| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.|
360| 801 | Capability not supported. |
361| 17700001 | The specified bundle name is not found. |
362
363**Example**
364
365```js
366import { freeInstall } from '@kit.AbilityKit';
367import { BusinessError } from '@ohos.base';
368let bundleName = 'com.example.myapplication';
369let bundlePackFlag = freeInstall.BundlePackFlag.GET_PACK_INFO_ALL;
370try {
371    freeInstall.getBundlePackInfo(bundleName, bundlePackFlag).then(data => {
372        console.info('Operation succeed:' + JSON.stringify(data));
373    }).catch((err: BusinessError) => {
374        console.error('Operation failed:' + JSON.stringify(err));
375    });
376} catch (err) {
377    console.error('Operation failed:' + JSON.stringify(err));
378}
379```
380
381## getDispatchInfo
382
383getDispatchInfo(callback: AsyncCallback\<DispatchInfo>): void
384
385Obtains the dispatch information. This API uses an asynchronous callback to return the result.
386
387**System API**: This is a system API.
388
389**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
390
391**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
392
393**Parameters**
394
395| Name  | Type                                                        | Mandatory| Description                                                        |
396| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
397| callback | AsyncCallback<[DispatchInfo](js-apis-bundleManager-dispatchInfo-sys.md)> | Yes  | [Callback](../apis-basic-services-kit/js-apis-base.md#asynccallback) used to return the result. If the operation is successful, **err** is **null**, and **data** is the [DispatchInfo](js-apis-bundleManager-dispatchInfo-sys.md) object obtained. otherwise, **err** is an error object.|
398
399**Error codes**
400
401For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
402
403| ID|    Error Message                           |
404|----------|----------------------------------------|
405| 201 | Permission denied. |
406| 202 | Permission denied, non-system app called system api. |
407| 801 | Capability not supported. |
408
409**Example**
410
411```js
412import { freeInstall } from '@kit.AbilityKit';
413try {
414    freeInstall.getDispatchInfo((err, data) => {
415        if (err) {
416            console.error('Operation failed:' + JSON.stringify(err));
417        } else {
418            console.info('Operation succeed:' + JSON.stringify(data));
419        }
420    });
421} catch (err) {
422    console.error('Operation failed:' + JSON.stringify(err));
423}
424```
425
426## getDispatchInfo
427
428getDispatchInfo(): Promise\<DispatchInfo>
429
430Obtains the dispatch information. This API uses a promise to return the result.
431
432**System API**: This is a system API.
433
434**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
435
436**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
437
438**Return value**
439
440| Type                                            | Description                                                        |
441| ------------------------------------------------ | ------------------------------------------------------------ |
442| Promise<[DispatchInfo](js-apis-bundleManager-dispatchInfo-sys.md)> | Promise used to return the [DispatchInfo](js-apis-bundleManager-dispatchInfo-sys.md) object obtained.|
443
444**Error codes**
445
446For details about the error codes, see [Universal Error Codes](../errorcode-universal.md).
447
448| ID|    Error Message                           |
449|----------|----------------------------------------|
450| 201 | Permission denied. |
451| 202 | Permission denied, non-system app called system api. |
452| 801 | Capability not supported. |
453
454**Example**
455
456```js
457import { freeInstall } from '@kit.AbilityKit';
458import { BusinessError } from '@ohos.base';
459try {
460    freeInstall.getDispatchInfo().then(data => {
461        console.info('Operation succeed:' + JSON.stringify(data));
462    }).catch((err: BusinessError) => {
463        console.error('Operation failed:' + JSON.stringify(err));
464    });
465} catch (err) {
466    console.error('Operation failed:' + JSON.stringify(err));
467}
468```
469
470## DispatchInfo
471
472type DispatchInfo = _DispatchInfo
473
474Defines the installation-free structure and API version information.
475
476**System API**: This is a system API.
477
478**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
479
480| Type                                                        | Description          |
481| ------------------------------------------------------------ | -------------- |
482| [_DispatchInfo](js-apis-bundleManager-dispatchInfo-sys.md#dispatchinfo) |Installation-free structure and API version information.|
483
484## BundlePackInfo
485
486type BundlePackInfo = _PackInfo.BundlePackInfo
487
488Defines the bundle information.
489
490**System API**: This is a system API.
491
492**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
493
494| Type                                                        | Description          |
495| ------------------------------------------------------------ | -------------- |
496| [_PackInfo.BundlePackInfo](js-apis-bundleManager-BundlePackInfo-sys.md#bundlepackinfo) |Bundle information.|
497
498## PackageConfig
499
500type PackageConfig = _PackInfo.PackageConfig
501
502Defines the package configuration information in the **pack.info** file.
503
504**System API**: This is a system API.
505
506**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
507
508| Type                                                        | Description          |
509| ------------------------------------------------------------ | -------------- |
510| [_PackInfo.PackageConfig](js-apis-bundleManager-BundlePackInfo-sys.md#packageconfig) |Package configuration information in the **pack.info** file.|
511
512## PackageSummary
513
514type PackageSummary = _PackInfo.PackageSummary
515
516Defines the package summary information in the **pack.info** file.
517
518**System API**: This is a system API.
519
520**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
521
522| Type                                                        | Description          |
523| ------------------------------------------------------------ | -------------- |
524| [_PackInfo.PackageSummary](js-apis-bundleManager-BundlePackInfo-sys.md#packagesummary) |Package summary information in the **pack.info** file.|
525
526## BundleConfigInfo
527
528type BundleConfigInfo = _PackInfo.BundleConfigInfo
529
530Defines the bundle configuration information.
531
532**System API**: This is a system API.
533
534**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
535
536| Type                                                        | Description          |
537| ------------------------------------------------------------ | -------------- |
538| [_PackInfo.BundleConfigInfo](js-apis-bundleManager-BundlePackInfo-sys.md#bundleconfiginfo) |Bundle configuration information.|
539
540## ExtensionAbility
541
542type ExtensionAbility = _PackInfo.ExtensionAbility
543
544Defines the ExtensionAbility configuration information.
545
546**System API**: This is a system API.
547
548**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
549
550| Type                                                        | Description          |
551| ------------------------------------------------------------ | -------------- |
552| [_PackInfo.ExtensionAbility](js-apis-bundleManager-BundlePackInfo-sys.md#extensionability) |ExtensionAbility configuration information.|
553
554## ModuleConfigInfo
555
556type ModuleConfigInfo = _PackInfo.ModuleConfigInfo
557
558Defines the module configuration information of the bundle.
559
560**System API**: This is a system API.
561
562**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
563
564| Type                                                        | Description          |
565| ------------------------------------------------------------ | -------------- |
566| [_PackInfo.ModuleConfigInfo](js-apis-bundleManager-BundlePackInfo-sys.md#moduleconfiginfo) |Module configuration information of the bundle.|
567
568## ModuleDistroInfo
569
570type ModuleDistroInfo = _PackInfo.ModuleDistroInfo
571
572Defines the distribution information of the module.
573
574**System API**: This is a system API.
575
576**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
577
578| Type                                                        | Description          |
579| ------------------------------------------------------------ | -------------- |
580| [_PackInfo.ModuleDistroInfo](js-apis-bundleManager-BundlePackInfo-sys.md#moduledistroinfo) |Distribution information of the module.|
581
582## ModuleAbilityInfo
583
584type ModuleAbilityInfo = _PackInfo.ModuleAbilityInfo
585
586Defines the ability information of the module.
587
588**System API**: This is a system API.
589
590**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
591
592| Type                                                        | Description          |
593| ------------------------------------------------------------ | -------------- |
594| [_PackInfo.ModuleAbilityInfo](js-apis-bundleManager-BundlePackInfo-sys.md#moduleabilityinfo) |Ability information of the module.|
595
596## AbilityFormInfo
597
598type AbilityFormInfo = _PackInfo.AbilityFormInfo
599
600Defines the widget information.
601
602**System API**: This is a system API.
603
604**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
605
606| Type                                                        | Description          |
607| ------------------------------------------------------------ | -------------- |
608| [_PackInfo.AbilityFormInfo](js-apis-bundleManager-BundlePackInfo-sys.md#abilityforminfo) |Widget information.|
609
610## Version
611
612type Version = _PackInfo.Version
613
614Defines the version in the **pack.info** file.
615
616**System API**: This is a system API.
617
618**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
619
620| Type                                                        | Description          |
621| ------------------------------------------------------------ | -------------- |
622| [_PackInfo.Version](js-apis-bundleManager-BundlePackInfo-sys.md#version) |Version in the **pack.info** file.|
623
624## ApiVersion
625
626type ApiVersion = _PackInfo.ApiVersion
627
628Defines the API version of the module.
629
630**System API**: This is a system API.
631
632**System capability**: SystemCapability.BundleManager.BundleFramework.FreeInstall
633
634| Type                                                        | Description          |
635| ------------------------------------------------------------ | -------------- |
636| [_PackInfo.ApiVersion](js-apis-bundleManager-BundlePackInfo-sys.md#apiversion) |API version of the module.|
637