Emulate CMD in Metro Style App For Win 8 on ARM - windows-8

As we know , we are not going to have a command line prompt as we in traditional Windows system for Windows on ARM.
I am trying to emulate command line prompt. The Question i have is it possible for us to spawn new process/app from a given app (as a background task could also do) with parent app having all information about child app?

You CAN dynamically load and execute assemblies.
Assembly.Load() works fine - as long as the target is a System assembly or in your app's package graph (i.e. in your app's package, or a declared 's package).
You're right, Metro/Desktop are very different. A 'MetroCMD.exe' would by definition be restricted; given the isolated nature of Metro apps, would a Metro CMD.EXE be useful?

Related

How can I run an embedded binary in my OSX application?

I have an application which needs to run an external program.
I have included this program as an Embedded Framework. When archived, it appears at the location %AppRoot%/Contents/Frameworks/MyExternalApplication.
How can I run this program from my app's code without using an absolute path? I'd like to run in both release and debug.
Thank You!
You can run the executable by using an NSTask object or the posix_spawn() function.
You can use the NSBundle class to find the absolute path of the executable. See this article for details.
Notes:
That is not the correct place within the app bundle to place the executable; I believe it should be in Contents/MacOS, as documented here.
If the main app is sandboxed (a requirement if you want to put the app on the Mac App Store) then an entitlement is required that will be embedded into the external executable so that it inherits the app's sandbox. See this question for details.
Once you've done 2. you will notice that the executable will no longer run from the command line, but that's nothing to worry about, as it will run from within your app.

LUA windows: How do I launch windows metro app with Unified Remote script

I'm trying to make a custom remote for unified remote server in windows 8.1
The sample scripts have os.start(command). It works for something like calc, but I'm trying to launch a metro app 'netflix://' and Lua doesn't seem to want to accept it - I think it's not taking the front slashes.
Is there a way to get Lua to launch a metro app in windows? Thanks
Assuming you mean os.execute() command, to run commands that open files and run based on protocol association, you need to use start command:
os.execute("start http://google.com")
If you need to put the parameter in quotes, then make sure to include a pair of empty quotes as the first parameter:
os.execute([[start "" "netflix://..."]])
For os.start(), it seems that you have to pass the whole path to a command. The Unified Remote API states that it should match installed applications, but I believe it might only be applicable to applications with binaries in the PATH, which is why their example of calc works.
With this in mind, and knowing that start works well directly from PoweShell, this command does what we need:
os.start("C:\\WINDOWS\\system32\\cmd.exe", "/c", "start", "netflix:");
Answering this old question since it's the top google hit when looking for launching windows10 apps with Lua for Unified Remote
As a side note, due to limitations on the Netflix Win10 app, I ended up simply opening Firefox and giving it the Netflix URL. Assuming default installation:
os.start("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe", "https://www.netflix.com");

Limit 3D application for Windows RT device

I am developing a 3D game for Windows Store (Metro application) using Visual Studio 2012 Express and Blender for creating 3D objects (fbx). I have used Visual Studio 3D Starter Kit for importing fbx file in the game. Currently I have tested my application on Windows 8 machine only and now, I want to test it on Windows RT device too. On Microsoft forums I read that if I want to deploy the build on Windows RT device, I need to limit my application to Feature Level 9_1.
I need to know the following two things:
• How to run the application on hardware graphics card on Windows RT machine?
• How to limit the application to DirectX Feature Level 9_1?
Any help will be appreciated.
How to run the application on hardware graphics card on Windows RT machine?
The Direct3D code provided in the various Windows 8 samples and templates should always run on the hardware graphics card. Assuming you're interested in the specifics of how to actually get the app there in the first place (i.e. deployment), there are two main ways to do this. The first is remote deployment and debugging: In Visual Studio, go to your project's properties page and go to the Debugging view. Under "Debugger to launch" select "Remote Machine" and set "Machine Name" to the IP address or NetBIOS name of the target Windows RT machine. The remote machine will need to be running the remote debugging tools and connected to the same network as the development machine. For more info about remote debugging, check out this page.
The second way is to manually create and deploy a local test package. To do this, right click the project and go to Store -> Create App Packages. When prompted about whether this package will be submitted to the store, select "no" and follow the remaining prompts to create an appropriate app package. Copy the contents of the created package folder to the target machine, then run the "Add-*" powershell script. This will install the package on the target machine.
How to limit the application to DirectX Feature Level 9_1?
The best way to do this is to use the DirectX Control Panel. Run "dxcpl.exe" and click "Edit List" under the scope menu. Add the name of your app's executable (typically [app name].exe) to the list. Then, under Device Settings, set "Feature level limit" to 9.1 and check the "Disable Feature Level Upgrade" checkbox. The next time you launch your app, the system will automatically restrict functionality to what is available on 9.1 hardware.
Note that the Windows App Certification Kit automatically performs a feature level test to ensure your app does not crash on 9.1, however its scope is relatively limited.
In additional to alanw, if you have any shaders in your solution, for each, bring up the property page in VS, expand "HLSL Compiler" and select "General". Under "Shader Model" select 4_0_level_9_1.
You should pass in the D3D_FEATURE_LEVEL_9_1 feature level on creation of your d3d11 device.
D3D_FEATURE_LEVEL pFeatureLevels[] =
{
D3D_FEATURE_LEVEL_9_1
};
ID3D11Device* pDevice;
ID3D11DeviceContext* pDeviceContext;
D3D_FEATURE_LEVEL eFeatureLevel;
D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, pFeatureLevels, 1,
D3D11_SDK_VERSION, &pDevice, &eFeatureLevel, &pDeviceContext);

Turning a command line app into a Cocoa GUI app on Mac OS X?

Is there any tutorials or references, if such thing is possible, to make GUI applications out of command line apps?
What I mean is, having a command line app, wrap it into an app bundle and create a Cocoa GUI app that would have a simple interface to execute the command line app with its flags and parameters.
As a matter of fact there are. Here is the first hit for a Google search:
Cocoa Dev Central: Wrapping UNIX Commands
What you're looking for is the NSTask class. Check out the documentation for all the information you need.
For very simple scripts, I recommend Platypus. For more complicated scenarios, you could try something like Pashua.

LSOpenURLSpec error

I have created a minimal OS X boot stick (basically the Snow Leopard DVD with all the packages and installer stripped out). I've written a basic Cocoa app launcher to launch other apps that I put in the Applications folder (the minimal install lacks Dock and Finder).
When I try to launch an app I get this error:
LSOpenFromURLSpec() returned -10810 for application (null) path /Applications/MyApp.app
Where "MyApp.app" is the app I tried to launch. I've tried this with both NSWorkspace's openFile method and the UNIX "open" utility and I get more or less the same error. One way that launching an app works is if I just execute the main executable of the app itself. (e.g. /Applications/MyApp.app/Contents/MacOS/MyApp). However this method is kind of inconvenient as it stalls the launcher until the app I launched exits. Any alternate ways to launch an app (or fix the LSOpenFromURL error)?
Thanks
Found a workaround:
/Applications/MyApp.app/Contents/MacOS/MyApp >/dev/null 2>/dev/null &
Using that command starts apps without stalling the launcher.
open relies on Launch Services, which relies on the Finder. Your script workaround starts a new background process executing the application's code with its standard out and standard error open to /dev/null. That should work fine.
The C equivalent under Mac OS X would be to either posix_spawn or fork/vfork then exec the executable file.