Skip to content

Commit

Permalink
[TIMOB-17411] Fixed PowerShell permission checks on Windows 7 and dis…
Browse files Browse the repository at this point in the history
…abled Winstore apps on Windows 7.
  • Loading branch information
cb1kenobi committed Aug 21, 2014
1 parent dde2bbc commit 688a659
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 23 deletions.
43 changes: 25 additions & 18 deletions mobileweb/cli/commands/_build.js
Expand Up @@ -71,22 +71,24 @@ MobileWebBuilder.prototype.config = function config(logger, config, cli) {
return function (finished) {
var targets = ['web'];

if (process.platform == 'win32') {
windows.detect(config, null, function (windowsInfo) {
_t.windowsInfo = windowsInfo;
if (windowsInfo.visualstudio) {
if (windowsInfo.windowsphone) {
targets.push('wp8');
appc.environ.getOSInfo(function (osInfo) {
if (process.platform == 'win32') {
windows.detect(config, null, function (windowsInfo) {
_t.windowsInfo = windowsInfo;
if (windowsInfo.visualstudio) {
if (windowsInfo.windowsphone) {
targets.push('wp8');
}
targets.push('winstore');
}
targets.push('winstore');
}
configure();
});
} else {
configure();
}
configure(osInfo);
});
} else {
configure(osInfo);
}
});

function configure() {
function configure(osInfo) {
cli.createHook('build.mobileweb.config', function (callback) {
function assertIssue(logger, issues, name, exit) {
var i = 0,
Expand Down Expand Up @@ -119,15 +121,15 @@ MobileWebBuilder.prototype.config = function config(logger, config, cli) {
'target': {
abbr: 'T',
callback: function (value) {
if (process.platform == 'win32' && targets.indexOf(value) != -1) {
if (value == 'wp8' || value == 'winstore') {
if (process.platform == 'win32' && targets.indexOf(value) !== -1) {
if (value === 'wp8' || value === 'winstore') {
assertIssue(logger, _t.windowsInfo.issues, 'WINDOWS_VISUAL_STUDIO_NOT_INSTALLED', true);
assertIssue(logger, _t.windowsInfo.issues, 'WINDOWS_MSBUILD_ERROR', true);
assertIssue(logger, _t.windowsInfo.issues, 'WINDOWS_MSBUILD_TOO_OLD', true);
}

// if this is a Windows Phone 8 target, validate the wp8 specific parameters
if (value == 'wp8') {
if (value === 'wp8') {
assertIssue(logger, _t.windowsInfo.issues, 'WINDOWS_PHONE_SDK_NOT_INSTALLED', true);
assertIssue(logger, _t.windowsInfo.issues, 'WINDOWS_PHONE_SDK_MISSING_DEPLOY_CMD', true);
assertIssue(logger, _t.windowsInfo.issues, 'WINDOWS_PHONE_ENUMERATE_DEVICES_FAILED', true);
Expand All @@ -136,7 +138,12 @@ MobileWebBuilder.prototype.config = function config(logger, config, cli) {
conf.options['device-id'].required = true;
}

if (value == 'winstore') {
if (value === 'winstore') {
if (appc.version.lt(osInfo.osver, '6.2.0')) {
logger.banner();
logger.error(__('Winstore apps are only supported on Windows 8 and newer.') + '\n');
process.exit(1);
}
assertIssue(logger, _t.windowsInfo.issues, 'WINDOWS_PHONE_POWERSHELL_SCRIPTS_DISABLED', true);
}
}
Expand Down
1 change: 1 addition & 0 deletions node_modules/titanium-sdk/bin/test_permissions.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 25 additions & 5 deletions node_modules/titanium-sdk/lib/windows.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 688a659

Please sign in to comment.