# wx.miniapp.installApp

Install the application (only available for Android), to install the Apk The package name must be the same as the current application, the certificate that generated the signature must be the same, and the application version number must not be smaller than the current application.

Android >= 1.0.13

Added: The interface may be combined with [wx.getAppBaseInfo ](https://dev.weixin.qq.com/docs/framework/dev/jsapi/diffapi/getAppBaseInfo .html) Gets the currently applied appVersion A new version can be used. wx.miniapp.installApp Prompts the user to download and install within the app Apk To update.

Note: Required inproject.miniapp.jsonTick install SDK

# parameter

attribute type Default value Required Introductions
filePath string yes Application's user directory

# JSAPI Examples of code

// Login
wx.downloadFile({
    url: 'http://xxxx/Package name.apk ',
    success(res) {
        console.log('download Apk  success', res)
        wx.miniapp.installApp ({
            filePath:  res.tempFilePath, 
            success(res) {
                console.log('install app success', res)
            },
            fail(res) {
                console.log('install app fail', res)
            }
        })
    },
    fail(res) {
        console.log('download Apk  fail', res)
    }
})