This is a work in progress. The objective is to be able to directly load a Universal Windows App from an Appx package on a Windows 10 IoT RPI2, The blocking issue is a PIN requirement. I can package up the app and deploy it to my development machine and a Win 10 phone but not to my RPI2. Updated for Web Portal IoT Package installation.

 

ToDo: Remote deployment with a pin. <Watch this space>

  • Can’t get it to work with a phone
  • Want to do it with a Win 10 IoT RPI2 device

 

PS: Click on images to see in expanded size.

 

The simplest way to deploy is to do so directly from Visual Studio. This applies to the desktop, the phone and IoT. You must though be in developer mode on the target. For general use you would deploy a retail  build. 

 

Universal Apps and Universal Windows Apps: Terminology

Firstly, lets get the terminology straight. Universal Apps refers to Windows 8.1 apps that can be built for x86/64 desktops as well as Windows 8.1 ARM Surface devices and Windows 8.1 Phones..Windows 8 (??) . With this software architecture, a Universal App project had a desktop and an phone subproject as well as a common “subproject”. When you built, say, the desktop version (whether ARM or Intel CPU) it used the desktop subproject plus the common part. When you built the phone version, you used the phone subproject and the same common part. The phone UI (XAML) plus phone specific code was in the phone subproject. Common code such as data structures, remote server access, event handlers where in the common code.

 

With Windows 10 and its One Windows mantra, there is only needs to be only one project in the solution, although you can have platform specific extensions, and hence platform specific versions of the project. The Windows 10 platform (One Windows) is called Universal Windows Platform and its apps are called Universal Windows Apps. The Universal Apps terminology is also used for Windows 10 Universal Windows apps which can confuse things.

 

Lets stick to calling Windows 10 Universal apps Universal Windows Apps (UW App) not Universal Apps (leave that for Windows 8.1 apps..

 

Visual Studio UW App deployment.

When you create a UW App in Visual Studio (2015) you build it either for x86/x64 or ARM targets. If x86/x64 you can deploy it locally to the development machine or remotely to another Windows 10 desktop. If built as ARM you can deploy it to a tethered (via USB cable)  Windows 10 phone or remotely to a Raspberry PI 2 using its IPAddress. The target device needs to be in developer mode. When so deployed you can debug the app or just run and exit it. On the desktop or phone you can then subsequently run the app without Visual Studio. Can you subsequently run an app so deployed to a RPI2?

 

Packaging

For general deployment you need to create a package called an AppX package.
There is a Channel9 video on this: App Packaging and Deployment for Universal Windows Apps

Whilst this is in-depth, it is pre RTM and so has some missing information, such as using a Pin, which is my current issue.

But lets look at Appx packaging:

MSDN Link: Packaging Universal Windows apps for Windows 10

 

You create an Appx package when you upload an app to the Windows Store. With Windows 10 you create a common package that contains all versions (x86/x64/ARM). When it gets uploaded it gets deconstructed and reconstructed with signing by The Store. It then can be downloaded and installed by end users once published there. When so downloaded, the required version is what is downloaded, not the whole package. This process has been simplified and unified (no separate phone and desktop Stores) for windows 10.

 

Sideloading

It is possible though to create packages for installation without using The Store. This is called Sideloading. It is of particular use for Enterprise applications where an enterprise will install and use its custom in-house apps, in-house. That way it keeps control of its IP and IT. It is also possible to configure a non enterprise Windows 10 system for sideloading for testing purposes.

 

There is a different approach for development for Windows 10 devices. A developer license is no longer required for each device that you want to use to develop, install or test your app. You just enable a device once for these tasks from the settings for the device. That's it. No more renewing your developer licenses every 30 or 90 days! Ref: https://msdn.microsoft.com/library/windows/apps/xaml/dn706236.aspx

If you start to develop on a system that isn’t in Developer mode you get the following message:

image

 

Enabling sideloading is done from the System Settings:

Action Center (bottom right of taskbar)

Select All Setttings

Select Update & Security

Select For developers

Select Developer mode

image

Note: Having installed Visual Studio 2015 on your Windows 10 system and done some UW app development, you probably have already enabled Developer mode.

 

What is the difference between selecting Sideloading and Developer modes? Sideloading per se  allows an app to be installed directly to system without getting it from The Store but the app must be appropriately Code Signed and the related certificate must be installed on the system. Developer mode is free and easy; doesn’t require any of that vetting but is subject to end user trust.

For our purposes we want Developer mode

 

Creating Packages

Having developed your UW App in Visual Studio 2015 on a Windiows 10 system with the Universal Apps SDK you can action the creation of AppX packages from within VS:

Right click on the project in VS

Select Store

Select Create App Packages

For the “Create Your Packages” dialog select No. We want to separately install packages to different devices.

For the next dialog select Never  (take the link to understand this)and set to Release builds for all versions if just sharing the app Debug if you wish to test.

Press [Create]

image

 

image

 

image

 

In your project folder you will have a new folder called AppPackages. Open that.

You will have a subfolder for each package version

Local Deployment

Open the X86 version. Lets install it.

Examine the files. You will see the AppX and the Certificate files.

Note also that there is a PowerShell script to install the app (.ps1)

image

 

image

 

image

 

Right-click on the .ps1file and run it in PowerShell.

image

 

image

Running the PS AppX install script.

 

Also try running it not in Developer mode. It should fail:

image

 

 

On the Start Menu you should now see the app under “Recently Added”.

Test that the app runs OK.

image

 

Remote Deployment

Winappdeploycmd is used for remote deployment of a package.
On MSDN: Install Universal Windows Apps with the WinAppDeployCmd tool

 

First lets deploy to a (USB) tethered phone:

When tethered, the IPAdress is 127.0.1 so the command is

Winappdeploycmd install –file <filepath/filename> -ip <ipaddress>

eg.

Open the Visual Studio 2015 Developer Prompt

Run Winappdeploycmd /? just to check its there

Get the path of the ARM package from FileExplorer

cd <That Path> so we are local to it.

Winappdeploycmd install -file SysInfo_1.0.0.0_ARM.appx -ip 127.0.0.1

C:\Users\david\Documents\Visual Studio 2015\Projects\SysInfo\SysInfo\AppPackages\SysInfo_1.0.0.0_ARM
_Test>Winappdeploycmd install -file SysInfo_1.0.0.0_ARM.appx -ip 127.0.0.1
Windows App Deployment Tool
Version 10.0.0.0
Copyright (c) Microsoft Corporation. All rights reserved.

Opening connection to device at '127.0.0.1'.
Checking remote system architecture...
Installing remote target components for ARM architecture.

Checking for dependencies...
Scanning given package for all necessary dependencies...
Attempting to match dependency: 'Microsoft.VCLibs.140.00'
Dependency found at 'C:\Users\david\Documents\Visual Studio 2015\Projects\SysInfo\SysInfo\AppPackage
s\SysInfo_1.0.0.0_ARM_Test\Dependencies\ARM\Microsoft.VCLibs.ARM.14.00.appx'.
Attempting to match dependency: 'Microsoft.NET.Native.Runtime.1.1'
Dependency found at 'C:\Users\david\Documents\Visual Studio 2015\Projects\SysInfo\SysInfo\AppPackage
s\SysInfo_1.0.0.0_ARM_Test\Dependencies\ARM\Microsoft.NET.Native.Runtime.1.1.appx'.
Sending 'SysInfo_1.0.0.0_ARM.appx' to the remote device.
Sending dependency 'Microsoft.VCLibs.ARM.14.00.appx' to the remote device.
Sending dependency 'Microsoft.NET.Native.Runtime.1.1.appx' to the remote device.

Installing app...
Remote action succeeded.

Cleaning up dependencies.
Cleaning up app package.

Cleaning up remote target components.
Disconnecting.
Done.

 

The app will be on the phones Start Menu (not tiles) at top as Recently Added. Test it.

Remote Deployment

This involves the remote devices IpAddress and a pin

Link: Deploy Universal remote Windows Apps  Thanks that IE can directly translate.

The command will in this case be:

Winappdeploycmd install –file <filepath/filename> -ip <ipaddress> –pin <remote device’s pin>

You set the phone in Developer mode and enable pairing. This gives you a pin.

Select Settings—> Update & Security

Select For developers

image   image

The article at the link above says to first run the command:

WinAppDeployCmd devices

to get the IPAddress. eg:

deploy_de_universal_windows_apps_por_linha_de_comando_8

 

For my phone this doesn’t work ??

Sad smile

 

Windows 10-IoT UW App Remote Deployment

Want to use this methodology to deploy to a RPI2 running Win 10 IoT.

  • This process is blocked on two issues:
  • This WinAppDeployCmd devices pairing command problem as above.
  • Getting a pin for a RPI2

 

Note that you can of course deploy directly from Visual Studio to a Win 10 IoT device.

 

Web Portal Interface: Update (works now)

Alternatively one could use the Web Interface. If the app has already been deployed  (eg from Visual Studio) you will need to uninstall it first via the Web Portal (or the  SysInfo app), Previously I had a problem with this but was because the app was already installed (direct from VS).

In a web browser go to http://<device’s IPaddress>:8080

Select the Apps tab. Select the package (browse to it), Select the certificate, in same folder and select the dependencies (2 folders below that target specific)..usually 2 or more dependencies.

Install app
 AppX
SysInfo_1.0.0.0_ARM.appx
 Certificate
 Dependencies
 Add dependency 
 Actions
 Install  Reset 
 Deployment log
Upload AppX   (OK)
Upload certificate (OK)
Upload dependencies  (OK)
Winking smile

image

 

If you uninstall and reinstall you may only need the Package next time.. No need for certificate and dependencies again.

Update:

Was able to pair phone with desktop using the list command: eg:

Winappdeploycmd list -ip 192.168.0.10 -pin E9C2Y6

The phone config now show 1 device paired.

 

ToDo: Remote deployment with a pin. <Watch this space>

  • Can’t get it to work with a phone
  • Want to do it with a Win 10 IoT RPI2 device
  • Also want to get the web interface deployment working.