Click here to Skip to main content
13,146,742 members (79,966 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

2.9K views
Posted 17 May 2016

Windows 10 IoT Core – Setting Default App

, 17 May 2016
Rate this:
Please Sign up or sign in to vote.
Windows 10 IoT Core – Setting Default App

Editorial Note

This article is an entry in our Microsoft Azure IoT Contest. Articles in this section are not required to be full articles so care should be taken when voting.

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. It's 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:

  1. Right click on your Project (Windows Universal)
  2. Select ‘Properties’. You will get the following screen. Click on the ‘Package Manifest’ button, you will get the manifest page:

    Default-ProjectProperties

  3. Select the ‘Packaging’ tab:

    Default-PackageManifest

  4. Take note of the Package Name (to uninstall from the device later).

    Default-PackagePackaging

  5. Replace the Package Name, I used ‘ChristianLavigne-LogicGate’:

    Default-PackagePackaging_updated

    Note: The ‘Package family name’ contains the name as displayed on the device.

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

  1. Navigate to the ‘Apps’ page.

    Default-SelectApp1

  2. In the Installed apps drop down list before, select your app, ChristianLavigne-LogicGate_1.0.0.0_arm_xxx in our case, and click the Set Default.

    Default-SelectApp2

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.

Default-RemoveApp

Conclusion

Setting the Default App allows you to specialize your device to perform only a single task. You can use your 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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

ChristianLavigne
Software Developer (Senior)
Canada Canada
I have been programming computers since the mid 1980’s and have been doing so professionally for the past 22 years. I worked on a variety of applications from large consumer oriented commercial applications to enterprise level web applications.

I have been working with the .NET framework since the first version came out around 2000 and got my MCSD (Microsoft Certified Solution Developer) in 2006. Although .NET is my specialty, I do spend time to learn new things and new languages outside of it.

See my blog at: https://christianlavigne.com.

You may also be interested in...

Pro
Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170915.1 | Last Updated 17 May 2016
Article Copyright 2016 by ChristianLavigne
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid