Skip to content

Instantly share code, notes, and snippets.

@mjfusa
Last active January 28, 2022 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjfusa/b98b604c6acd08da4ce259aa6f4255ad to your computer and use it in GitHub Desktop.
Save mjfusa/b98b604c6acd08da4ce259aa6f4255ad to your computer and use it in GitHub Desktop.

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:

  1. 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.

  1. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment