<commit_before>///<reference path="./../../../.d.ts"/>
"use strict";

import path = require("path");
import hostInfo = require("../../host-info");

class Wp8EmulatorServices implements Mobile.IEmulatorPlatformServices {
	constructor(private $logger: ILogger,
		private $emulatorSettingsService: Mobile.IEmulatorSettingsService,
		private $errors: IErrors,
		private $childProcess: IChildProcess,
		private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants) { }

	public checkDependencies(): IFuture<void> {
		return (() => {
		}).future<void>()();
	}

	checkAvailability(): IFuture<void> {
		return (() => {
			if (!hostInfo.isWindows()) {
				this.$errors.fail("Windows Phone Emulator is available only on Windows 8 or later.");
			}

			var platform = this.$devicePlatformsConstants.WP8;
			if (!this.$emulatorSettingsService.canStart(platform).wait()) {
				this.$errors.fail("The current project does not target Windows Phone 8 and cannot be run in the Windows Phone emulator.");
			}
		}).future<void>()();
	}

	startEmulator(app: string, emulatorOptions?: Mobile.IEmulatorOptions) : IFuture<void> {
		return (() => {
			this.$logger.info("Starting Windows Phone Emulator");
			var emulatorStarter = path.join(process.env.ProgramFiles, Wp8EmulatorServices.WP8_LAUNCHER_PATH, Wp8EmulatorServices.WP8_LAUNCHER);
			this.$childProcess.spawn(emulatorStarter, ["/installlaunch", app, "/targetdevice:xd"], { stdio:  ["ignore", "ignore", "ignore"], detached: true }).unref();
		}).future<void>()();
	}

	private static WP8_LAUNCHER = "XapDeployCmd.exe";
	private static WP8_LAUNCHER_PATH = "Microsoft SDKs\\Windows Phone\\v8.0\\Tools\\XAP Deployment";
}
$injector.register("wp8EmulatorServices", Wp8EmulatorServices);<commit_msg>Pick up the correct 32-bit Program Files direcotry regardless node process bitness<commit_after>///<reference path="./../../../.d.ts"/>
"use strict";

import path = require("path");
import hostInfo = require("../../host-info");

class Wp8EmulatorServices implements Mobile.IEmulatorPlatformServices {
	constructor(private $logger: ILogger,
		private $emulatorSettingsService: Mobile.IEmulatorSettingsService,
		private $errors: IErrors,
		private $childProcess: IChildProcess,
		private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants) { }

	public checkDependencies(): IFuture<void> {
		return (() => {
		}).future<void>()();
	}

	checkAvailability(): IFuture<void> {
		return (() => {
			if (!hostInfo.isWindows()) {
				this.$errors.fail("Windows Phone Emulator is available only on Windows 8 or later.");
			}

			var platform = this.$devicePlatformsConstants.WP8;
			if (!this.$emulatorSettingsService.canStart(platform).wait()) {
				this.$errors.fail("The current project does not target Windows Phone 8 and cannot be run in the Windows Phone emulator.");
			}
		}).future<void>()();
	}

	startEmulator(app: string, emulatorOptions?: Mobile.IEmulatorOptions) : IFuture<void> {
		return (() => {
			this.$logger.info("Starting Windows Phone Emulator");
			var emulatorStarter = path.join(Wp8EmulatorServices.programFilesPath, Wp8EmulatorServices.WP8_LAUNCHER_PATH, Wp8EmulatorServices.WP8_LAUNCHER);
			this.$childProcess.spawn(emulatorStarter, ["/installlaunch", app, "/targetdevice:xd"], { stdio:  "ignore", detached: true }).unref();
		}).future<void>()();
	}

	private static get programFilesPath(): string {
		return (process.arch === "x64") ? process.env["PROGRAMFILES(X86)"] : process.env.ProgramFiles;
	}

	private static WP8_LAUNCHER = "XapDeployCmd.exe";
	private static WP8_LAUNCHER_PATH = "Microsoft SDKs\\Windows Phone\\v8.0\\Tools\\XAP Deployment";
}
$injector.register("wp8EmulatorServices", Wp8EmulatorServices);
{'fraction_non_alphanumeric': 0.1512354059190877, 'fraction_numerical': 0.009503122454520771, 'mean_word_length': 5.222972972972973, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7570775', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1121, 'n_words': 248}