Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows Metro
It was asked here if a metro app in windows 8 can launch a desktop program and the answer was "no" because metro apps are "sandboxed".
 
However, I found an interesting answer in this page:
 
---
 
I found a solution which is suitable for me. I just made an empty textfile in my app and called it launcher.yourappyouwanttostart and then executed it with
 
Windows.System.Launcher.LaunchFileAsync("launcher.yourappyouwanttostart");
 
On the first startup it asks you for the assocation for this file and then you choose the exe file you want to run and from now on every time you execute this file, your app will be started.

 
---
 
I'm new and don't really understand what he means :/ make an empty textfile? Where, how?
 
Help is much appreciated Smile | :)
Posted 12-Feb-13 14:16pm
Mossmyr304

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Microsoft is really moving away from allowing 1 app to launch another app, there are many security vulnerabilities associated with such a technology, the biggest one being the command injection vulnerability. Microsoft's solution to this problem was to use what is known as the launcher, the launcher doesn't directly launch another application itself, as you would in the days of C++ where you would just call system("Your command") or pre metro where you would fire up a diagnostic process. Rather the launcher, which is, a Microsoft technology that's been around for a while directly calls the OS, to launch the application associated with such a file.
 
Microsoft allows you to associate file extensions with applications, see the context menu & the "open with" option by right clicking on a file. So Microsoft allows you to make that association and it's through that association that Windows, and more specifically windows 8 will determine the best possible application to open that file extension with.
 
Rather then you calling note pad, to open a text document through the diagnostic processes, you will now call the launcher, with the file you want to open, and the Launcher/OS will determine which application and the safest way to open the application.
  Permalink  
Comments
Mossmyr at 13-Feb-13 10:46am
   
...and I suppose the .exe file extension can't be "best opened" by another application?

All I've been trying to do is make large tiles and artwork for shortcuts to desktop applications, but I guess this work-around isn't gonna work. I'll do some more research, thank you for your extensive answer.
CdnSecurityEngineer at 13-Feb-13 10:49am
   
Unfortunately not.
 
That would break the "sandboxing" that Microsoft had put in place, if that were possible all you'd have to do is write a vulnerable desktop app and get the user to click it via Metro. Which would then defeat the "security" they've put in place.
CdnSecurityEngineer at 13-Feb-13 12:36pm
   
Hey If you wouldn't mind accepting my answer if you found it helpful!
Mossmyr at 13-Feb-13 14:08pm
   
Yeah it was rather helpful :) much appreciated!
Something called OblyTile (google it) does exactly what I'm trying to achieve with one flaw: no wide tiles (or live tiles for that matter). I'll be using that until microsoft either fixes this nuisance or someone finds a work-around (I'm much too noob to try it myself). I recommend giving it a look.

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

  Print Answers RSS
0 OriginalGriff 299
1 Maciej Los 295
2 Sergey Alexandrovich Kryukov 205
3 Aajmot Sk 202
4 Sinisa Hajnal 166
0 OriginalGriff 7,760
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,785


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100