Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Fix: Revert prebuild.cmd to previous version
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Molleda committed Oct 10, 2017
1 parent 268510c commit e560be0
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 120 deletions.
9 changes: 5 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ install:
- ps: Install-Product node $env:nodejs_version x86
- ps: Add-AppveyorMessage "node version $((node --version).trim())"
- ps: Add-AppveyorMessage "npm version $((npm --version).trim())"
- ps: Add-AppveyorMessage "Package version $($env:pkg_version)"
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- npm install --ignore-scripts

build_script:
- ps: Add-AppveyorMessage "Starting x86 build"
- ps: Set-AppveyorBuildVariable -Name pkg_version -Value (node -p "require('./package.json').version").trim()
- ps: Set-AppveyorBuildVariable -Name bundle_name -Value (node scripts\bundle.js).trim()
- ps: Add-AppveyorMessage "Package version $($env:pkg_version)"
- ps: Add-AppveyorMessage "Bundle name $($env:bundle_name)"
- npm run build
- dir /s out
- 7z a -ttar %bundle_name%.tar out\lib out\src
- 7z a %bundle_name%.tar.gz %bundle_name%.tar
- appveyor PushArtifact %bundle_name%.tar.gz
Expand All @@ -36,6 +37,7 @@ build_script:
- ps: Set-AppveyorBuildVariable -Name bundle_name -Value (node scripts\bundle.js).trim()
- ps: Add-AppveyorMessage "Bundle name $($env:bundle_name)"
- npm run build
- dir /s out
- 7z a -ttar %bundle_name%.tar out\lib out\src
- 7z a %bundle_name%.tar.gz %bundle_name%.tar
- appveyor PushArtifact %bundle_name%.tar.gz
Expand All @@ -54,6 +56,5 @@ deploy:
draft: false
prerelease: true
on:
branch:
- master
appveyor_repo_tag: true # deploy on tag push only
branch: master
appveyor_repo_tag: true # deploy on tag push only
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ gulp.task('copyproxy', function () {
return gulp.src([
opts.outDir + 'Proxy.dll',
opts.outDir + 'Proxy.pdb'
], { base: opts.outDir })
])
.pipe(gulp.dest('out/lib'));
});

Expand Down
45 changes: 17 additions & 28 deletions native/Addon/EdgeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ NAN_METHOD(closeEdge)
#pragma warning(pop)

HRESULT hr = Helpers::CloseWindow(hwnd);

if (hr == S_OK) // S_FALSE is a valid return code
{
info.GetReturnValue().Set(true);
Expand Down Expand Up @@ -524,28 +524,17 @@ NAN_METHOD(connectTo)

CString path = Helpers::UTF8toUTF16(m_rootPath);
path.Append(L"\\..\\..\\lib\\");
if (is64BitTab)
{
path.Append(L"Proxy64.dll");
}
else
{
path.Append(L"Proxy.dll");
}
path.Append(L"Proxy.dll");

CComPtr<IOleWindow> spSite;
hr = Helpers::StartDiagnosticsMode(spDocument, __uuidof(ProxySite), path, __uuidof(spSite), reinterpret_cast<void**>(&spSite.p));
if (hr == E_ACCESSDENIED && is64BitTab && ::IsWindows8Point1OrGreater())
{
Log("ERROR: Access denied while attempting to connect to a 64 bit tab. The most common solution to this problem is to open an Administrator command prompt, navigate to the folder containing this adapter, and type \"icacls proxy64.dll /grant \"ALL APPLICATION PACKAGES\":(RX)\"");
Log("ERROR: Access denied while attempting to connect to a 64 bit tab. The most common solution to this problem is to open an Administrator command prompt, navigate to the folder containing this adapter, and type \"icacls proxy.dll /grant \"ALL APPLICATION PACKAGES\":(RX)\"");
}
else if (hr == ::HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND) && is64BitTab)
else if (hr == ::HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))
{
Log("ERROR: Module could not be found. Ensure Proxy64.dll exists in the out\\lib\\ folder");
}
else if (hr == ::HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND) && !is64BitTab)
{
Log("ERROR: Module could not be found. Ensure Proxy.dll exists in the out\\lib\\ folder");
Log("ERROR: Module could not be found. Ensure Proxy.dll exists in the out\\lib\\ folder and is for your architecture.");
}
else if (hr != S_OK)
{
Expand Down Expand Up @@ -627,7 +616,7 @@ NAN_METHOD(createNetworkProxyFor)
Nan::ThrowTypeError("Incorrect arguments - createNetworkProxyFor(windowId: string): string");
return;
}

String::Utf8Value id(info[0]->ToString());
#pragma warning(push)
#pragma warning(disable: 4312) // truncation to int
Expand All @@ -636,21 +625,21 @@ NAN_METHOD(createNetworkProxyFor)

info.GetReturnValue().Set(Nan::Null());

if (!IsWindow(hwnd))
if (!IsWindow(hwnd))
{
Log("Argument windowId is not the identifier of a window");
return;
}

// compose the path to the NetworkProxy app
CString path = Helpers::UTF8toUTF16(m_rootPath);
path.Append(L"\\..\\..\\lib\\");
path.Append(L"NetworkProxy.exe");
path.Append(L"\\..\\..\\lib\\");
path.Append(L"NetworkProxy.exe");

LPDWORD processId;
GetWindowThreadProcessId(hwnd, processId);
GetWindowThreadProcessId(hwnd, processId);

CString arguments;
CString arguments;
arguments.Format(L"--process-id=%d", *processId);

// Launch the process
Expand Down Expand Up @@ -693,23 +682,23 @@ NAN_METHOD(createNetworkProxyFor)
{
CStringA newId;
newId.Format("%p", proxyHwnd);
info.GetReturnValue().Set(Nan::New<String>(newId).ToLocalChecked());
info.GetReturnValue().Set(Nan::New<String>(newId).ToLocalChecked());
}
else
{
Log("NetworkProxy hwnd not found.");
}
}
}
else
{
CString msg = L"Could not open NetworkProxy at path: ";
msg.Append(path);
CStringA msgUTF8 = Helpers::UTF16toUTF8(msg);
Log(msgUTF8);
}
Log(msgUTF8);
}
}

NAN_METHOD(closeNetworkProxyInstance)
NAN_METHOD(closeNetworkProxyInstance)
{
EnsureInitialized();
if (info.Length() < 1 || !info[0]->IsString())
Expand All @@ -730,7 +719,7 @@ NAN_METHOD(closeNetworkProxyInstance)
return;
}

::PostMessage(instanceHwnd, WM_DESTROY, 0, 0);
::PostMessage(instanceHwnd, WM_DESTROY, 0, 0);

info.GetReturnValue().Set(true);
}
4 changes: 2 additions & 2 deletions native/Proxy/Proxy.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>$(ProjectName)64</TargetName>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>$(ProjectName)64</TargetName>
<TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup>
<OutDir>..\..\out\native\$(Configuration)\$(Platform)\</OutDir>
Expand Down
140 changes: 70 additions & 70 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
{
"name": "edge-diagnostics-adapter",
"version": "0.6.0-unsigned",
"description": "Microsoft Edge Diagnostics Adapter",
"main": "dist/edgeAdapter.js",
"files": [
"out/src",
"redistributable",
"scripts",
"tsconfig.json"
],
"keywords": [
"edge",
"diagnostics",
"devtools",
"browser"
],
"author": "Microsoft Corporation",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/edge-diagnostics-adapter.git"
},
"dependencies": {
"node-pre-gyp": "^0.6.38",
"regedit": "^2.2.7",
"ws": "3.2.0",
"yargs": "^9.0.1"
},
"devDependencies": {
"@types/node": "^8.0.32",
"@types/ws": "^3.0.2",
"@types/yargs": "^8.0.2",
"cpx": "^1.5.0",
"gulp": "^3.9.1",
"gulp-mocha": "^4.3.1",
"gulp-msbuild": "^0.5.3",
"gulp-sequence": "^0.4.6",
"gulp-util": "^3.0.8",
"nan": "^2.7.0",
"node-gyp": "^3.6.2",
"rimraf": "^2.6.2",
"tslint": "^5.7.0",
"typescript": "2.5.3"
},
"binary": {
"module_name": "edge-diagnostics-adapter",
"module_path": "out/",
"host": "https://github.com/Microsoft/edge-diagnostics-adapter/releases/download/",
"remote_path": "v{version}"
},
"cpu": [
"x64",
"ia32"
],
"os": [
"win32"
],
"scripts": {
"copy:static": "cpx \"./src/**/{!(*.ts),.!(ts)}\" out/src",
"build": "npm run clean && npm run lint && npm run build:ts && npm run copy:static && npm run build:native",
"build:native": "npm config set msvs_version 2015 && gulp buildnative",
"build:ts": "tsc",
"clean": "rimraf out",
"install": "node-pre-gyp install --fallback-to-build",
"lint": "tslint /src/**/*.ts",
"postinstall": "node scripts/postinstall.js",
"watch:ts": "tsc --watch"
}
}
{
"name": "edge-diagnostics-adapter",
"version": "0.6.0-unsigned",
"description": "Microsoft Edge Diagnostics Adapter",
"main": "out/src/edgeAdapter.js",
"files": [
"out/src",
"redistributable",
"scripts",
"tsconfig.json"
],
"keywords": [
"edge",
"diagnostics",
"devtools",
"browser"
],
"author": "Microsoft Corporation",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/edge-diagnostics-adapter.git"
},
"dependencies": {
"node-pre-gyp": "^0.6.38",
"regedit": "^2.2.7",
"ws": "3.2.0",
"yargs": "^9.0.1"
},
"devDependencies": {
"@types/node": "^8.0.32",
"@types/ws": "^3.0.2",
"@types/yargs": "^8.0.2",
"cpx": "^1.5.0",
"gulp": "^3.9.1",
"gulp-mocha": "^4.3.1",
"gulp-msbuild": "^0.5.3",
"gulp-sequence": "^0.4.6",
"gulp-util": "^3.0.8",
"nan": "^2.7.0",
"node-gyp": "^3.6.2",
"rimraf": "^2.6.2",
"tslint": "^5.7.0",
"typescript": "2.5.3"
},
"binary": {
"module_name": "edge-diagnostics-adapter",
"module_path": "out/",
"host": "https://github.com/Microsoft/edge-diagnostics-adapter/releases/download/",
"remote_path": "v{version}"
},
"cpu": [
"x64",
"ia32"
],
"os": [
"win32"
],
"scripts": {
"copy:static": "cpx \"./src/**/{!(*.ts),.!(ts)}\" out/src",
"build": "npm run clean && npm run lint && npm run build:ts && npm run copy:static && npm run build:native",
"build:native": "npm config set msvs_version 2015 && gulp buildnative",
"build:ts": "tsc",
"clean": "rimraf out",
"install": "node-pre-gyp install --fallback-to-build",
"lint": "tslint /src/**/*.ts",
"postinstall": "node scripts/postinstall.js",
"watch:ts": "tsc --watch"
}
}
15 changes: 1 addition & 14 deletions prebuild.cmd
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
@echo off

REM Node-gyp currently does not support vs2017 build tools. We set the C++ build tools v140(vs2015).
REM If you have installed vs2017 enterprise edition:

IF "%VSVERSION%"=="" GOTO :VS2015

IF %VSVERSION%=="2017" (
set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets
GOTO :COMMON
)

:VS2015
REM set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets
set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140

:COMMON
set GYP_MSVS_VERSION=2015
2 changes: 1 addition & 1 deletion src/adapterService/edgeAdapterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export module EdgeAdapter {

this._httpServer = http.createServer((req, res) => this.onServerRequest(req, res));
this._webSocketServer = new WebSocketServer({ server: this._httpServer });
this._webSocketServer.on('connection', (client) => this.onWSSConnection(client));
this._webSocketServer.on('connection', (client, message) => this.onWSSConnection(client, message));

this._httpServer.listen(serverPort, "0.0.0.0");
}
Expand Down
Loading

0 comments on commit e560be0

Please sign in to comment.