1# @system.package (Bundle Management)
2
3
4> **NOTE**
5>
6> - This module is deprecated since API version 9. You are advised to use [@ohos.bundle.bundleManager](js-apis-bundleManager.md) instead.
7>
8> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
9
10
11## Modules to Import
12
13
14```
15import package from '@system.package';
16```
17
18
19## package.hasInstalled<sup>(deprecated)</sup>
20> This API is deprecated since API version 9. You are advised to use [@ohos.bundle.bundleManager](js-apis-bundleManager.md) instead.
21
22hasInstalled(options: CheckPackageHasInstalledOptions): void
23
24Checks whether an application exists, or whether a native application has been installed.
25
26**System capability**: SystemCapability.BundleManager.BundleFramework
27
28**Parameters**
29
30| Name| Type| Mandatory| Description|
31| -------- | -------- | -------- | -------- |
32|options | [CheckPackageHasInstalledOptions](#checkpackagehasinstalledoptions) | Yes| Options.|
33
34**Example**
35
36``` ts
37export default {
38  hasInstalled() {
39    package.hasInstalled({
40      bundleName: 'com.example.bundlename',
41      success: function(data) {
42        console.log('package has installed: ' + data);
43      },
44      fail: function(data, code) {
45        console.log('query package fail, code: ' + code + ', data: ' + data);
46      },
47    });
48  },
49}
50```
51
52## CheckPackageHasInstalledResponse
53
54> This API is deprecated since API version 9.
55
56Checks whether a bundle has been installed.
57
58**System capability**: SystemCapability.BundleManager.BundleFramework
59
60| Name| Type| Mandatory| Description|
61| -------- | -------- | -------- | -------- |
62|result | boolean | Yes| The value **true** means that the bundle has been installed, and **false** means the opposite.|
63
64## CheckPackageHasInstalledOptions
65
66> This API is deprecated since API version 9.
67
68Defines the options used for checking whether a bundle has been installed.
69
70**System capability**: SystemCapability.BundleManager.BundleFramework
71
72| Name| Type| Mandatory| Description|
73| -------- | -------- | -------- | -------- |
74| bundleName | string | Yes| Bundle name.|
75| success | Function | No| Called when API call is successful.|
76| fail | Function | No| Called when API call has failed.|
77| complete | Function | No| Called when API call is complete.|
78