Skip to content
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
['OS=="win"', {
'targets': [
{
'target_name': 'conpty',
'target_name': 'conpty_backend',
'sources' : [
'src/win/conpty.cc',
'src/win/path_util.cc'
Expand Down
8 changes: 4 additions & 4 deletions scripts/post-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const path = require('path');

const RELEASE_DIR = path.join(__dirname, '../build/Release');
const BUILD_FILES = [
path.join(RELEASE_DIR, 'conpty.node'),
path.join(RELEASE_DIR, 'conpty.pdb'),
path.join(RELEASE_DIR, 'conpty_backend.node'),
path.join(RELEASE_DIR, 'conpty_backend.pdb'),
path.join(RELEASE_DIR, 'conpty_console_list.node'),
path.join(RELEASE_DIR, 'conpty_console_list.pdb'),
path.join(RELEASE_DIR, 'pty.node'),
Expand Down Expand Up @@ -66,9 +66,9 @@ if (os.platform() !== 'win32') {
const versionFolder = fs.readdirSync(CONPTY_DIR)[0];
console.log(` Found version ${versionFolder}`);
const sourceFolder = path.join(CONPTY_DIR, versionFolder, `win10-${windowsArch}`);
const destFolder = path.join(RELEASE_DIR, 'conpty');
const destFolder = path.join(RELEASE_DIR, 'conpty_backend');
fs.mkdirSync(destFolder, { recursive: true });
for (const file of ['conpty.dll', 'OpenConsole.exe']) {
Comment on lines -69 to -71
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be renamed, they are prebuilt binaries from conpty library.

for (const file of ['conpty_backend.dll', 'OpenConsole.exe']) {
const sourceFile = path.join(sourceFolder, file);
const destFile = path.join(destFolder, file);
console.log(` Copying ${sourceFile} -> ${destFile}`);
Expand Down
4 changes: 2 additions & 2 deletions src/windowsPtyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ export class WindowsPtyAgent {
if (this._useConpty) {
if (!conptyNative) {
try {
conptyNative = require('../build/Release/conpty.node');
conptyNative = require('../build/Release/conpty_backend.node');
} catch (outerError) {
try {
conptyNative = require('../build/Debug/conpty.node');
conptyNative = require('../build/Debug/conpty_backend.node');
} catch (innerError) {
console.error('innerError', innerError);
// Re-throw the exception from the Release require if the Debug require fails as well
Expand Down