Skip to content

Commit 06e54e5

Browse files
committed
update
1 parent 157ef18 commit 06e54e5

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/extension.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ async function checkAndInstallRuntime() {
724724
//
725725
if (os.platform() == 'win32') {
726726
try {
727-
ChildProcess.execSync(`dotnet --version`);
727+
ChildProcess.execSync(`dotnet --info`);
728728
} catch (error) {
729729
platform.appendToSysEnv(process.env, ['C:\\Program Files\\dotnet']);
730730
}
@@ -734,13 +734,16 @@ async function checkAndInstallRuntime() {
734734
// check or install .NET
735735
//
736736
try {
737-
const dotnetVer = ChildProcess.execSync(`dotnet --version`).toString().trim();
738-
if (!/^\s*6\.\d+\.\d+/.test(dotnetVer)) {
739-
throw new Error(`We need .NET6 runtime, but your dotnet version is '${dotnetVer}' !`);
740-
}
737+
GlobalEvent.emit('globalLog', newMessage('Info', 'Checking .NET6 Runtime ...'));
738+
const dotnetInfo = ChildProcess.execSync(`dotnet --info`).toString().trim();
739+
GlobalEvent.emit('globalLog', newMessage('Info', dotnetInfo));
740+
if (!/Version: (?:6|7)\./.test(dotnetInfo)) { throw new Error(`Not found .NET6 Runtime`); }
741+
GlobalEvent.emit('globalLog', newMessage('Info', '.NET6 Runtime Found !'));
741742
} catch (error) {
742743

743-
const msg = `Not found [.NET6 runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0), please install it !`;
744+
GlobalEvent.emit('globalLog', newMessage('Info', 'Not found [.NET6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) !'));
745+
746+
const msg = `Not found [.NET6 Runtime](https://dotnet.microsoft.com/en-us/download/dotnet/6.0), please install it !`;
744747
const sel = await vscode.window.showWarningMessage(msg, `Install Now`);
745748
if (!sel) { return } // user canceled
746749

@@ -826,10 +829,19 @@ async function InitComponents(context: vscode.ExtensionContext): Promise<boolean
826829
if (os.platform() != 'win32') {
827830

828831
const exeLi: string[] = [
829-
`${[resManager.GetBinDir().path, 'scripts', 'qjs'].join(File.sep)}`,
830-
`${[resManager.getBuilderDir().path, 'utils', 'hex2bin'].join(File.sep)}`
832+
`${[resManager.GetBinDir().path, 'scripts', 'qjs'].join(File.sep)}`
831833
];
832834

835+
// get exe file list from 'utils' folder
836+
File.fromArray([resManager.getBuilderDir().path, 'utils'])
837+
.GetList(undefined, File.EMPTY_FILTER)
838+
.forEach((f) => {
839+
if (!f.suffix) { // nosuffix file is an exe file
840+
exeLi.push(f.path);
841+
}
842+
});
843+
844+
// get exe file list from 'bin' folder
833845
File.fromArray([resManager.getBuilderDir().path, 'bin'])
834846
.GetList(undefined, File.EMPTY_FILTER)
835847
.forEach((f) => {

0 commit comments

Comments
 (0)