Cristiano Ghersi
Cristiano Ghersi

Reputation: 2122

UWP: how to install side-loaded app when AppX Installer is not installed on the machine

I need to install a UWP app, side-loaded, onto a machine that does not have access to the Microsoft Store.

This machine doesn't even have the AppX installer app, therefore I cannot install any of those files (that come in the installation package of the sideloaded app):

So, two questions:

  1. Is there a place where I can download and install this AppX installer app (obviously not from the MS Store)?
  2. Can I manually recreate the installation procedure, maybe unzipping the content of the .msix? How can I create the correct folder hierarchy for LocalSTate etc.?

Upvotes: 3

Views: 1302

Answers (2)

marv51
marv51

Reputation: 376

You should be able to install via Powershell on all machines that can run packaged applications:

Add-AppxPackage -Path "C:\Users\user1\Desktop\MyApp.msix"

See more parameters here.

Once you have confirmed that this is working, you have a number of different choices on how to run that command in a way that average users understand.

For example, you could create an Inno Setup Installer that runs that command like this:

; Just the relevant snippet:
[Run]
Filename: "powershell.exe"; Parameters: \
  "-ExecutionPolicy Bypass -Command Add-AppxPackage '{tmp}\MyApp.msixbundle'"; \
  StatusMsg: "Installing application...."; \
  WorkingDir: {app}; Flags: runhidden

Edit: Maybe you could also try to restore the built-in applications users might have deleted? In Windows 10 you can do that by running:

Get-AppxPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Upvotes: 1

Bogdan Mitrache
Bogdan Mitrache

Reputation: 11023

  1. The appx/msix installer should be included in the OS now. What version of Windows 10 (I assume) is the PC running?

if it's an old one, can you push an OS update? After a quick web search it seems like you should be able to install an OS update even without internet.

  1. No you cannot. Index, an appx/msix package is basically a smart ZIP which is extracted at install time into a special OS location, but there are some caveats.

You cannot manually put any files in the WindowsApps system folder, only the OS can write in that location.

Even if you hack around somehow the OS and manage to add the files in the WindowsApps folder most likely the OS will not correctly integrate your UWP app because it does not know how to interpret the AppXManifest from the extracted zip (appx/msix package). UWP apps run inside a virtual container, configured based on the information from the AppxManifest from the package. If the OS is too old it will not know how to "read" and process that manifest, therefor your app will most likely fail to run.

Upvotes: 0

Related Questions