Skip to content

Commit 4a33f1b

Browse files
committed
Implemented processor architecture check based on http://blog.differentpla.net/blog/2013/03/10/processor-architew6432
1 parent 350448f commit 4a33f1b

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

src/features/OpenInISE.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import vscode = require('vscode');
22
import Window = vscode.window;
3-
import os = require('os');
43

54
export function registerOpenInISECommand(): void {
65
var disposable = vscode.commands.registerCommand('PowerShell.OpenInISE', () => {
@@ -10,27 +9,17 @@ export function registerOpenInISECommand(): void {
109

1110
var uri = document.uri
1211

13-
// For testing, to be removed
14-
Window.showInformationMessage(uri.fsPath);
15-
Window.showInformationMessage(uri.path);
16-
17-
if (os.arch()== 'x64') {
12+
if (process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432')) {
1813

1914
var ISEPath = 'C:\\Windows\\Sysnative\\WindowsPowerShell\\v1.0\\powershell_ise.exe';
2015

2116
} else
2217
{
2318

24-
// Need to figure out how to check OS architecture os.arch returns process architecture
25-
//var ISEPath = process.env.windir + '\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe';
26-
var ISEPath = 'C:\\Windows\\Sysnative\\WindowsPowerShell\\v1.0\\powershell_ise.exe';
19+
var ISEPath = process.env.windir + '\\System32\\WindowsPowerShell\\v1.0\\powershell_ise.exe';
2720

2821
}
29-
30-
// For testing, to be removed
31-
Window.showInformationMessage(os.arch());
32-
Window.showInformationMessage(ISEPath);
33-
22+
3423
require("child_process").exec(ISEPath + ' -NoProfile -File ' + uri.fsPath).unref();
3524

3625

0 commit comments

Comments
 (0)