The default startup app supplied with Windows 10 IoT core provides interesting information about your device and basic settings, but does not do anything and does not even provide a launcher for your app.
What we want is for our application to start when we power on the device. This will allow us to specialize the device, and its purpose essentially becomes to run our application and nothing else.
This procedure only deploys debug version applications. Its good for temporary setup AND to demonstrate Setting Default Application. Because the debug certificate is temporary, the application will eventually stop working. I will write a post about deploying release application at some point.
Updating the Manifest
This step is optional, but it makes things easier.
The first step is to identify our application. By default when we create the Universal Windows application, the identity of your application is set as a guid. The identity for our application was:
- 234b35b2-e6d4-471c-8473-5d584ad0ee1a
To make it much easier to find our application in a list, I want to change it to:
- ChristianLavigne-LogicGate
To change the identity you need to change the manifest. Here is how:
- Right Click on your Project (Windows Universal)
- Select ‘Properties’ you will get the following screen. Click on the ‘Package Manifest’ button, you will get the manifest page:
- Select the ‘Packaging’ tab:
- Take note of the Package Name (to uninstall from the device later)
- Replace the Package Name, I used ‘ChristianLavigne-LogicGate’:
Note: The ‘Package family name’ contains the name as displayed on the device - Click the Visual Studio ‘Save’ button to save the manifest.
Deploying the Application
To do this, I will use Visual Studio to deploy a debug version of the application. Building release packages is a bit more complicated and will be the subject of another blog entry.
After updating the manifest, re-build the application (in debug) and start a debugging session by clicking run with remote machine selected. Same as we have done before.
When starting the debug process, Visual Studio will deploy a new version of our application on the device. Once started, you can stop the application from Visual Studio by using the menu Debug | Stop Debugging.
Setting the Device Default App
To update the default app, we start Windows Device Portal web page of our device.
- Navigate to the ‘Apps’ page.
- In the Installed apps drop down lisbeforet, select your app, ChristianLavigne-LogicGate_1.0.0.0_arm_xxx in our case, and click the Set Default.
What this does is interesting. With the Raspberry Pi on, we can see that our app immediately starts. If it shuts down for any reason, our app will re-start. When you reboot your Raspberry Pi, it will start our app again.
In essence it will only run this application, until we set a new default. If we want to go back to the original application supplied with the OS, select IoTCoreDefaultApp and set it as the default.
Removing Old Application
Because we renamed the application in the manifest, we now have a duplicate of the application installed. To remove the old version, we select it in the Installed apps and click the Remove button. I also had another application I created earlier, so I removed it.
Conclusion
Setting the Default App allows you to specialize your device to perform only a single task. You can use you Raspberry Pi to run hardware specific applications, or to run as a media player, or run kiosk software. Any Universal Windows application will work, so capability offers a wide range of possibilities.