-
Notifications
You must be signed in to change notification settings - Fork 970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Support. #2
Comments
So my original question was actually resolved once I manually downloaded some nodejs.org packages (don't think it had anything to do with robotjs). And it appears from your source code at least that the library is designed to support windows machines. However, now I have a different problem :(, the "node-gyp build" task breaks when run and I get a whole string of errors. Are our Windows build environment must be different? I'm running node v.0.10.30 on Windows 7 using Python 2.78 and the latest visual studio 2013. I could post the complete error log if you would find that helpful, but to give you a sense, I'm getting errors such as the following:
Note, I'm also using node v0.10.30. Based on the feature enhancement you recently added to use the nan package in order to support newer versions, it seems likely this could be the case. Is this correct? It seems to be a possible combination of missing libraries and syntax errors. Also, note that these errors occur whether building from npm or building directly from the repo. |
Hey Scott! My apologies for the delay. I've honestly never tried to build RobotJS on Windows and it's probably just missing a few libraries. I had a similar issue on Mac until I added that conditional. I'll try to take a look today (need to set up a VM), and I may need your help testing a few things! |
That would be awesome. Let me know how I could be useful with testing or something. As far as c++ goes, I'm sadly a complete n00b :( |
I haven't forgot about this! I just really need a windows build environment. |
Spent a few hours on this just now, didn't have much luck. Here's the errors I'm getting on Windows XP using Visual Studio 2010:
This isn't too terrible, and at least it's a start! |
@plasmashadow was working on this today, hopefully he had better luck. |
@octalmage Getting the same error when I tried to build robotjs in windows
|
Still having issues here. I fixed a bunch of the errors in 581cbdc, but now there's more. I'm probably going to reach out to someone more familiar with gyp for help. |
+1 |
I really need to get this working. As more projects start to rely on RobotJS, I'm letting them and their users down by not supporting Windows. I've been doing a lot of research and I have some new ideas, I'm going to hit this hard tomorrow. At the end of Thursday if I can't get it building I'll post to the gyp mailing list. The code is cross platform, I just need to set the right flags for MSVC. My goal is to publish a Windows compatible build by the end of the month. Wish me luck! |
+1 |
+1 |
Going to need another week, it's going to happen this month! |
So I'm getting close with this as my bindings.gyp:
I know it's a mess, but it's getting me close. |
The errors I'm getting seem to be related to using C:
|
Unfortunately I wasn't able to get the project to build. This is very disheartening but I posted to the Node.js mailing list. Hopefully I'll get some help there. I just want a Windows build so bad, If anyone is familiar with Visual Studio, we could use your help! |
I've tried to run it on Windows, some stuff I found while trying to get it working. The file https://github.com/octalmage/robotjs/blob/master/src/ms_stdint.h is already included by libuv, which results in duplicated definition errors. https://github.com/octalmage/robotjs/blob/master/src/robotjs.cc#L286 There is no nanosleep or timespec types on Windows, so this function is doomed. The nan include in the binding.gyp file is not working because it's using single quotes. I'm using Visual Studio 12, and I can include stdint.h just fine, idk about other versions. After fixing those errors I was able to get it compiled. Also, the only thing I've modified in the binding file was what I said above, about the nan include. |
No way!!! You are my hero @JCMais. |
+1 |
Sorry got octalmage branch, ran node-gyp configure, works, but build has the issues pointed out earlier: (I am building with VS12 on Windows 8) |
Just published the https://github.com/octalmage/robotjs/tree/windows-2 Currently only |
The getPixelColor is broken. Im only getting #000000. The script mentioned above (mouseclick) works good. |
@Deltatiger thanks a ton for confirming! I'll dig into getPixelColor when I have time. After that we're pretty much ready to merge! |
@octalmage Np. I will also look into it and see if I can fix it. I am pretty new to node.js (started yesterday) so let me give see what I can do. |
@Deltatiger Awesome have at it! Just a heads up, RobotJS is actually written in C/C++. If I had to guess, id say the issue is the snprintf call in src/robotjs.cc. I don't trust the portable version of that function. |
I also wrote this code the other day just in case we needed to replace that snprintf call: https://gist.github.com/octalmage/2b873e2b50695cda56d8 |
Seems I may have found the problem. The BitBlt function in the screengrab.c seems to have the arguments mixed up. BOOL BitBlt(
_In_ HDC hdcDest,
_In_ int nXDest,
_In_ int nYDest,
_In_ int nWidth,
_In_ int nHeight,
_In_ HDC hdcSrc,
_In_ int nXSrc,
_In_ int nYSrc,
_In_ DWORD dwRop
); The code now is BitBlt(screenMem,
(int)rect.origin.x,
(int)rect.origin.y,
(int)rect.size.width,
(int)rect.size.height, screen, 0, 0, SRCCOPY) The code should be BitBlt(screenMem,
(int)0,
(int)0,
(int)rect.size.width,
(int)rect.size.height, screen, rect.origin.x, rect.origin.y, SRCCOPY) I cant test right now. But I can check it out in around 10 Hours from now. |
Yup that fixed the issue. getPixelColor is now working. |
Thanks to pr #43 from @Deltatiger and 8730e94 we now have full Windows support. I'll get ready to merge into the master branch. If anyone wants to test the |
RobotJS v0.2.0 has been published to npm with Windows support. |
Awesome work @octalmage! |
The link for the Windows build, at the top of this page, goes to a 404. |
Sorry that branch was merged. Just install from npm! |
You rocks, thanks guys! |
@achenwei-chwy its exactly what is says.. you don't have ANY |
Edit by octalmage:
Windows is completely supported! Just install from npm.
Known issues:
All known issues resolved!
Fixed in getPixelColor bug fix. #43.getPixelColor
returns "000000" no matter what in my VM, not sure if it's broken.The sqrt functions in rgb.h cause errors, currently commented out in the windows-2 branch.Fixed in 8730e94.TheReplaced with microsleep.mssleep
function needs to be cross platform.This is working!moveMouse
andmoveMouseSmooth
wouldn't work in my virtual machine. I'm guessing this is because it's a VM, but it would be cool if someone could confirm.Original comment:
Hey Octa, I'm trying to use your add on for a node webkit project I'm working on but wasn't able to get very far since the package gets stuck on my windows machine while running the "node-gyp configure" command, just sitting there endlessly. I thought possible your NPM might not be up to date with this github repo, but still the same behavior when I cloned the repo and built it from scratch.
I notice in binding.gyp that your only condition is 'OS' == "mac". I'm not intimately familiar with building native node modules, so does this mean the package simply does not support window builds right now?
The text was updated successfully, but these errors were encountered: