Recent Changes - Search:

edit SideBar

Notes about supporting Windows

Cape Code Windows Prerequisites

In theory, it is possible to download the Cape Code Windows installer and use it. In practice, to develop Accessors it is helpful to install the following software

A Java Development Kit (JDK)

To even run the izpack installer, we need to include a JVM. Ideally, we would share this JVM with the one we use at runtime.

In addition, for development using Eclipse, A Java Development Kit (JDK) is required because we need the javac binary. A Java Runtime Environment (JRE) is not sufficient.

The CapeCode Windows installer installs the JRE in $PTII/jre. javac is not present.

Installing JDK1.8.0_131 is a 181Mb gzipped tar file. The JRE is a 81Mb gzipped file

Below are the choices:

  1. Have the user download and install the appropriate JDK
  2. Extend the Izpack installer to invoke and included installer
  3. Redistribute a portion of the JDK

Redistribute The JDK

Actually, it turns out that we can't redistribute all of the JDK. http://www.oracle.com/technetwork/java/javase/jdk-8-readme-2095712.html says that we can ship:

cp jdk1.8.0_131/bin/java.exe jre64/bin
(cd jdk1.8.0_131; tar -cf - `find . -name "*.ttf"`) | (cd jre64; tar -xpf -)
cp jdk1.8.0_131/lib/tools.jar jre64/lib/tools.jar
cp jdk1.8.0_131/jre/bin/attach.dll jre64/bin/
cp jdk1.8.0_131/bin/jarsigner.exe  jre64/bin

I'm trying that now.

TODO:

  • Have the installer add jre64/bin to the path
  • Be sure that the Oracle license is present in the installer.

Apache Ant

Apache Ant is used to compile files.

See http://ant.apache.org/manual/install.html

apache-ant-1.9.9-bin.zip is 8.3Mb, uncompressed it is 39Mb. We could consider checking it in.

http://ant.apache.org/manual/install.html says that only bin and lib are required. The are 2.7Mb on disk. We have checked in ant as $PTII/ant and created $PTII/bin/ant which will use ant from $PTII/ant/bin/ant if it exists. JSAccessor has been modified to attempt to use the version of ant in $PTII/bin/ant.

Node.js

The Node Accessor Host is fairly powerful and interesting. We want to support it

For Windows, maybe we can include a copy of node and npm in vendors.

See https://github.com/nodejs/node/tree/master/tools/msvs/msi for how the Windows installer is built.

We could have the same thing here, where we have node and npm in the path. These might need to be .bat files.

Python

Python2 is needed if you want to use the Node OpenCV camera module.

Symbolic Links

The accessors repo has two symbolic links in it:

bash-3.2$ ls -l accessors/web/node_modules/@accessors-hosts accessors/web/hosts/browser/common
lrwxr-xr-x  1 cxh  staff  10 Jun 15 11:18 accessors/web/hosts/browser/common -> ../common/
lrwxr-xr-x  1 cxh  staff   8 Jun 15 11:18 accessors/web/node_modules/@accessors-hosts -> ../hosts
bash-3.2$

Symbolic links are supported under Windows, but don't work very well. More importantly, installing Node using the Node Windows installer results in a version of Node that does not understand Cygwin symbolic links. This is a problem because we are looking for node modules in @accessors-hosts/hosts, which is now a symbolic link.

Possible Solutions:

  • Have a different tree under Windows, where accessors/web/node_modules/@accessors-hosts is a directory.
    • This means that the documentation is different
    • nodeHosts.js is different because
      var accessorPath = [path.join(__dirname, '..', '..')];
      would need to be changed to
      var accessorPath = [path.join(__dirname, '..', '..', '..')];
  • Have the Windows users run a script that creates a Windows-compatible link. We have code to create the link in FileUtilities.createLink() or in the Windows power shell with: cmd /x mklink @accessors-hosts ..\hosts
  • It is not clear if this will work
    • A Windows link might no longer be compatible with svn under Cygwin
    • We could possibly do this as part of the top level ant build.xml file
  • Move accessors/web/hosts back to accessors/web/node_modules/@accessors-hosts/hosts
    • This is what we had in the past, it makes things harder for developers, but is more node-like.

npm

As part of the test harness, we invoke npm to install modules.

Under Windows, the npm file distributed with the Node installer is a shell script. Ant will not execute this shell script because ant under Windows uses cmd to execute files. The workaround is to check to see if npm.cmd is in the path and use that.

This is solved, but makes the build.xml file more ugly and confusing.

Also, we can't set the npm.executable property at the top of the file with the other properties.

Note that accessors also invoke npm if packages are not installed.

accessors/web/hosts/node/node_modules/@accessors-modules/serial/serial.js contains:

var SerialPort = nodeHost.installIfMissingThenRequire('serialport');

The above needs to be tested.

The node opencv module does not install.

npm install opencv requires that Python2 be installed.

npm install opencv failed under Windows after Python2 is installed.

Under Windows, we are including $PTII/lib/opencv_java320.dll.

Under Mac OS X, the user will need to install OpenCV, see https://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html#install-opencv-3-x-under-macos

Provide a VM

Another idea is to provide a VM that is configured properly.

One issue is that it is not clear if the VM can access the camera of a Windows host.

Edit - History - Print - Recent Changes - Search
Page last modified on August 25, 2017, at 07:19 PM