Question: How can we install our UWP app with the required dependencies without an internet connection?
Answer: Per the question, if you are connected to the internet, the app dependencies as defined in manifest will be downloaded and installed from the Store. Typically, the dependencies list in the manifest looks like this: To install the dependencies without a connection to the internet, you must create the packages for sideloading. (In Visual Studio, Publish, Create App Packages) You will see in the AppPackages folder the app’s msix or msixbundle and a Dependencies folder. In the Dependencies folder are the appx files containing the runtime dependencies for each processor type.
There are two ways to install an app with its dependencies:
- Use the Install.ps1 PowerShell script in the root of the AppPackages\App_VersionNumber folder. For example:
\---UwpApp_1.0.0.0_Test
| Install.ps1
This will install the certificate, the app and dependencies.
- Install manually with PowerShell:
CD <Directory containing main msix (msixbundle) and Dependecies sub folders – as create by Visual Studio – Packages Create App Packages)>
# Create array of x86 dependencies
$dependencies = Get-ChildItem (".\Dependencies\x86")
# Create array of x64 dependencies
$dependencies += Get-ChildItem (".\Dependencies\x64")
# Install app with dependencies
Add-AppPackage -Path UwpApp_1.0.0.0_x64.msixbundle -DependencyPath $dependencies.FullName