How to relaunch a Windows 10 IoT app programmatically
Asked Answered
B

2

6

I have a Windows 10 IoT app developed in C#, and I need to relaunch the app when the configuration has changed. How can the app relaunch itself programmatically?

Benco answered 4/12, 2015 at 18:56 Comment(0)
B
6

Base on the Richard's comments I have resolved as follows:

  1. I set my application as the default application (see picture)
  2. When I need to relaunch the app, simply close it and the operating system opens again.

Setting the default app How to set the default app

The code for close the app is:

private void Exit()
{
   Windows.ApplicationModel.Core.CoreApplication.Exit();
}
Benco answered 10/12, 2015 at 14:46 Comment(0)
C
2

Have you tried using powershell right after a configuration deployment to restart it? https://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm

the command

net start 'program'

should be what you're looking for in powershell

For the Device: Since IoT only allows 1 app at a time, have you considered just issuing the device itself a the restart command and the application to go on startup

Contamination answered 4/12, 2015 at 20:2 Comment(5)
I need the application itself automatically relauch, but your solution is for I relaunch from the pc.Benco
Just to clarify on the question before I edit the answer, you need to restart the app when the configuration has changed due to user input on the device?Contamination
Yes, you are right. The app must to restart when the configuration has changed due to user input on the device.Benco
Since IoT only allows 1 app, have you considered just issuing the device itself a the restart command and the application to just go on startup?Contamination
I've edited this answer to include your specific circumstance (for future readers). Happy coding!Contamination

© 2022 - 2024 — McMap. All rights reserved.