Set the specific app as startup application when your Windows 10 IoT Core boots.
Windows 10 IoT Core is widely popular for Intel Galileo Gen 2, Raspberry Pi 2 and MinnowBoard MAX (when this project was written). Windows 10 IoT Core is essential for embedded projects.
Once Windows IoT Core is deployed on the device, is starts booting and default application starts at startup. If you are new to Windows 10 IoT Core, please click here to know more.
Now the tricky part is after each boot or reboot, default application starts. There is no app to register your application for startup except PowerShell to make Windows IoT Core much lighter as possible. So let’s explore PowerShell.
Update (September 28, 2015): With the latest release of Windows 10 IoT Core, web-management portal is easy to use and provides simple way to register app as startup application without using PowerShell commands.
In Step 4, you need to find out your application’s package family name. It might be confusing sometimes. You can find your application’s package family name by using Step 7 & 8 of the PowserShell method which is explained below.
As per wikipedia PowerShell: “Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework.”
In informal way, it can be said to the more advance command prompt with scripting facility.
PowerShell Commands for IoT
Refer Microsoft’s IoT website to see available commands for the Windows 10 IoT Core.
This project article is going to focus on the commands required to register an application as startup only.
Startup Command : IoTStartup
To view application you have deployed to your device, you can use following commands.
IotStartup list lists all installed headed and headless application.
IotStartup headed list lists all installed headed application.
IotStartup headless list lists all installed headless application.
Headed application are those with user interface. Headless application does not have user interface instead they are background applications only.
IotStartup startup lists headed and headless applications registered for startup.
IotStartup add registers headed and headless applications as startup.
IotStartup add DefaultAppregisters factory default headed application as startup.
IotStartup remove removes headed and headless applications from startup and registers back factory default headed application.
NOTE : Only two startup application can be there. One headed and another must be headless. Two headed or two headless can’t be registered as startup.
In order to register your application as startup application, first you must have to deploy it to the device. If you are not familiar with deployment, see this webpage.
Launch an PS console on your local PC. The easiest way to do this is to type ‘powershell’ in the “Search the web and Windows” textbox near the Windows Start Menu: Windows will find PowerShell on your machine:
To start PS as an administrator, right click on the “Windows PowerShell ISE” entry and select “Run as administrator”.
Turn on WinRM service by typing:
net start WinRM
Service will start and if it is already started you will see following screen:
Note down your device name and IP address by using Windows IoT Core Watcher application:
From the PS console, type the following, substituting
<machine-name or IP Address> with the appropriate value (using your machine-name is the easiest to use, but if your device is not uniquely named on your network, try the IP address):
Set-Item WSMan:\localhost\Client\TrustedHosts -Value <machine-name or IP Address>
When asks for to modify TrustedHosts, click on Yes button.
Now you can start a session with you Windows IoT Core device. From you administrator PS console, type:
Enter-PSSession -ComputerName <machine-name or IP Address> -Credential <machine-name or IP Address or localhost>\Administrator