1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Updating Windows build scripts and launch4j config and copying over relevant files (avr tools, drivers, dll's)

This commit is contained in:
David A. Mellis 2009-06-07 16:00:05 +00:00
parent 82c3d1fe16
commit c3c44d8ee1
33 changed files with 1177 additions and 697 deletions

BIN
build/windows/avr_tools.zip Normal file

Binary file not shown.

View File

@ -5,10 +5,10 @@ REVISION=`head -1 ../../todo.txt | awk '{print $1}'`
if [ $1 ]
then
RELEASE=$1
echo Creating Processing release $RELEASE...
echo Creating Arduino release $RELEASE...
else
RELEASE=$REVISION
echo Creating Processing distribution for revision $REVISION...
echo Creating Arduino distribution for revision $REVISION...
fi
# check to see if the version number in the app is correct
@ -23,79 +23,80 @@ fi
./make.sh
# remove any old boogers
rm -rf processing
rm -rf processing-*
rm -rf arduino
rm -rf arduino-*
mkdir arduino
cp -r ../shared/lib arduino/
cp -r ../shared/tools arduino/
cp dist/*.dll arduino/
cp -r dist/drivers arduino/
cp -r ../../hardware arduino/
mkdir processing
cp -r ../shared/lib processing/
cp -r ../shared/libraries processing/
cp -r ../shared/tools processing/
if [ $1 ]
then
# write the release version number into the output directory
echo $1 > processing/lib/version.txt
echo $1 > arduino/lib/version.txt
fi
cp ../../app/lib/antlr.jar processing/lib/
cp ../../app/lib/ecj.jar processing/lib/
cp ../../app/lib/jna.jar processing/lib/
cp ../../app/lib/antlr.jar arduino/lib/
cp ../../app/lib/ecj.jar arduino/lib/
cp ../../app/lib/jna.jar arduino/lib/
cp ../../app/lib/oro.jar arduino/lib/
cp ../../app/lib/RXTXcomm.jar arduino/lib/
cp ../shared/revisions.txt processing/
cp ../../readme.txt arduino/
echo Extracting examples...
unzip -q -d processing/ ../shared/examples.zip
echo Copying examples...
cp -r ../shared/examples arduino/
echo Extracting reference...
unzip -q -d processing/ ../shared/reference.zip
unzip -q -d arduino/ ../shared/reference.zip
# add the libraries folder with source
cp -r ../../net processing/libraries/
cp -r ../../opengl processing/libraries/
cp -r ../../serial processing/libraries/
cp -r ../../video processing/libraries/
cp -r ../../pdf processing/libraries/
cp -r ../../dxf processing/libraries/
unzip -q -d arduino/hardware avr_tools.zip
# add java (jre) files
unzip -q -d processing jre.zip
unzip -q -d arduino jre.zip
# get platform-specific goodies from the dist dir
cp launcher/processing.exe processing/
cp launcher/arduino.exe arduino/
# grab pde.jar and export from the working dir
cp work/lib/pde.jar processing/lib/
cp work/lib/core.jar processing/lib/
cp work/lib/pde.jar arduino/lib/
cp work/lib/core.jar arduino/lib/
# convert revisions.txt to windows LFs
# the 2> is because the app is a little chatty
unix2dos processing/revisions.txt 2> /dev/null
unix2dos processing/lib/preferences.txt 2> /dev/null
unix2dos processing/lib/keywords.txt 2> /dev/null
unix2dos arduino/readme.txt 2> /dev/null
unix2dos arduino/lib/preferences.txt 2> /dev/null
unix2dos arduino/lib/keywords.txt 2> /dev/null
# remove boogers
find processing -name "*.bak" -exec rm -f {} ';'
find processing -name "*~" -exec rm -f {} ';'
find processing -name ".DS_Store" -exec rm -f {} ';'
find processing -name "._*" -exec rm -f {} ';'
find processing -name "Thumbs.db" -exec rm -f {} ';'
find arduino -name "*.bak" -exec rm -f {} ';'
find arduino -name "*~" -exec rm -f {} ';'
find arduino -name ".DS_Store" -exec rm -f {} ';'
find arduino -name "._*" -exec rm -f {} ';'
find arduino -name "Thumbs.db" -exec rm -f {} ';'
# chmod +x the crew
find processing -name "*.html" -exec chmod +x {} ';'
find processing -name "*.dll" -exec chmod +x {} ';'
find processing -name "*.exe" -exec chmod +x {} ';'
find processing -name "*.html" -exec chmod +x {} ';'
find arduino -name "*.html" -exec chmod +x {} ';'
find arduino -name "*.dll" -exec chmod +x {} ';'
find arduino -name "*.exe" -exec chmod +x {} ';'
find arduino -name "*.html" -exec chmod +x {} ';'
# clean out the cvs entries
find processing -name "CVS" -exec rm -rf {} ';' 2> /dev/null
find processing -name ".cvsignore" -exec rm -rf {} ';'
find processing -name ".svn" -exec rm -rf {} ';' 2> /dev/null
find arduino -name "CVS" -exec rm -rf {} ';' 2> /dev/null
find arduino -name ".cvsignore" -exec rm -rf {} ';'
find arduino -name ".svn" -exec rm -rf {} ';' 2> /dev/null
# zip it all up for release
echo Packaging standard release...
echo
P5=processing-$RELEASE
mv processing $P5
P5=arduino-$RELEASE
mv arduino $P5
zip -rq $P5.zip $P5
# nah, keep the new directory around
#rm -rf $P5

BIN
build/windows/dist/cygiconv-2.dll vendored Executable file

Binary file not shown.

BIN
build/windows/dist/cygwin1.dll vendored Executable file

Binary file not shown.

View File

@ -0,0 +1,7 @@
[DEFAULT]
BASEURL=http://www.ftdichip.com/Documents/AppNotes.htm
[InternetShortcut]
URL=http://www.ftdichip.com/Documents/AppNotes.htm
Modified=C055946F4AF7C5011F
IconFile=C:\WINNT\system32\url.dll
IconIndex=0

Binary file not shown.

View File

@ -0,0 +1,875 @@
/*++
Copyright (c) 2001-2005 Future Technology Devices International Ltd.
Module Name:
ftd2xx.h
Abstract:
Native USB device driver for FTDI FT8U232/245
FTD2XX library definitions
Environment:
kernel & user mode
Revision History:
13/03/01 awm Created.
13/01/03 awm Added device information support.
19/03/03 awm Added FT_W32_CancelIo.
12/06/03 awm Added FT_StopInTask and FT_RestartInTask.
18/09/03 awm Added FT_SetResetPipeRetryCount.
10/10/03 awm Added FT_ResetPort.
23/01/04 awm Added support for open-by-location.
16/03/04 awm Added support for FT2232C.
23/09/04 awm Added support for FT232R.
20/10/04 awm Added FT_CyclePort.
18/01/05 awm Added FT_DEVICE_LIST_INFO_NODE type.
11/02/05 awm Added LocId to FT_DEVICE_LIST_INFO_NODE.
25/08/05 awm Added FT_SetDeadmanTimeout.
02/12/05 awm Removed obsolete references.
05/12/05 awm Added FT_GetVersion, FT_GetVersionEx.
--*/
#ifndef FTD2XX_H
#define FTD2XX_H
// The following ifdef block is the standard way of creating macros
// which make exporting from a DLL simpler. All files within this DLL
// are compiled with the FTD2XX_EXPORTS symbol defined on the command line.
// This symbol should not be defined on any project that uses this DLL.
// This way any other project whose source files include this file see
// FTD2XX_API functions as being imported from a DLL, whereas this DLL
// sees symbols defined with this macro as being exported.
#ifdef FTD2XX_EXPORTS
#define FTD2XX_API __declspec(dllexport)
#else
#define FTD2XX_API __declspec(dllimport)
#endif
typedef PVOID FT_HANDLE;
typedef ULONG FT_STATUS;
//
// Device status
//
enum {
FT_OK,
FT_INVALID_HANDLE,
FT_DEVICE_NOT_FOUND,
FT_DEVICE_NOT_OPENED,
FT_IO_ERROR,
FT_INSUFFICIENT_RESOURCES,
FT_INVALID_PARAMETER,
FT_INVALID_BAUD_RATE,
FT_DEVICE_NOT_OPENED_FOR_ERASE,
FT_DEVICE_NOT_OPENED_FOR_WRITE,
FT_FAILED_TO_WRITE_DEVICE,
FT_EEPROM_READ_FAILED,
FT_EEPROM_WRITE_FAILED,
FT_EEPROM_ERASE_FAILED,
FT_EEPROM_NOT_PRESENT,
FT_EEPROM_NOT_PROGRAMMED,
FT_INVALID_ARGS,
FT_NOT_SUPPORTED,
FT_OTHER_ERROR
};
#define FT_SUCCESS(status) ((status) == FT_OK)
//
// FT_OpenEx Flags
//
#define FT_OPEN_BY_SERIAL_NUMBER 1
#define FT_OPEN_BY_DESCRIPTION 2
#define FT_OPEN_BY_LOCATION 4
//
// FT_ListDevices Flags (used in conjunction with FT_OpenEx Flags
//
#define FT_LIST_NUMBER_ONLY 0x80000000
#define FT_LIST_BY_INDEX 0x40000000
#define FT_LIST_ALL 0x20000000
#define FT_LIST_MASK (FT_LIST_NUMBER_ONLY|FT_LIST_BY_INDEX|FT_LIST_ALL)
//
// Baud Rates
//
#define FT_BAUD_300 300
#define FT_BAUD_600 600
#define FT_BAUD_1200 1200
#define FT_BAUD_2400 2400
#define FT_BAUD_4800 4800
#define FT_BAUD_9600 9600
#define FT_BAUD_14400 14400
#define FT_BAUD_19200 19200
#define FT_BAUD_38400 38400
#define FT_BAUD_57600 57600
#define FT_BAUD_115200 115200
#define FT_BAUD_230400 230400
#define FT_BAUD_460800 460800
#define FT_BAUD_921600 921600
//
// Word Lengths
//
#define FT_BITS_8 (UCHAR) 8
#define FT_BITS_7 (UCHAR) 7
#define FT_BITS_6 (UCHAR) 6
#define FT_BITS_5 (UCHAR) 5
//
// Stop Bits
//
#define FT_STOP_BITS_1 (UCHAR) 0
#define FT_STOP_BITS_1_5 (UCHAR) 1
#define FT_STOP_BITS_2 (UCHAR) 2
//
// Parity
//
#define FT_PARITY_NONE (UCHAR) 0
#define FT_PARITY_ODD (UCHAR) 1
#define FT_PARITY_EVEN (UCHAR) 2
#define FT_PARITY_MARK (UCHAR) 3
#define FT_PARITY_SPACE (UCHAR) 4
//
// Flow Control
//
#define FT_FLOW_NONE 0x0000
#define FT_FLOW_RTS_CTS 0x0100
#define FT_FLOW_DTR_DSR 0x0200
#define FT_FLOW_XON_XOFF 0x0400
//
// Purge rx and tx buffers
//
#define FT_PURGE_RX 1
#define FT_PURGE_TX 2
//
// Events
//
typedef void (*PFT_EVENT_HANDLER)(DWORD,DWORD);
#define FT_EVENT_RXCHAR 1
#define FT_EVENT_MODEM_STATUS 2
//
// Timeouts
//
#define FT_DEFAULT_RX_TIMEOUT 300
#define FT_DEFAULT_TX_TIMEOUT 300
//
// Device types
//
typedef ULONG FT_DEVICE;
enum {
FT_DEVICE_BM,
FT_DEVICE_AM,
FT_DEVICE_100AX,
FT_DEVICE_UNKNOWN,
FT_DEVICE_2232C,
FT_DEVICE_232R
};
#ifdef __cplusplus
extern "C" {
#endif
FTD2XX_API
FT_STATUS WINAPI FT_Open(
int deviceNumber,
FT_HANDLE *pHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_OpenEx(
PVOID pArg1,
DWORD Flags,
FT_HANDLE *pHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_ListDevices(
PVOID pArg1,
PVOID pArg2,
DWORD Flags
);
FTD2XX_API
FT_STATUS WINAPI FT_Close(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_Read(
FT_HANDLE ftHandle,
LPVOID lpBuffer,
DWORD nBufferSize,
LPDWORD lpBytesReturned
);
FTD2XX_API
FT_STATUS WINAPI FT_Write(
FT_HANDLE ftHandle,
LPVOID lpBuffer,
DWORD nBufferSize,
LPDWORD lpBytesWritten
);
FTD2XX_API
FT_STATUS WINAPI FT_IoCtl(
FT_HANDLE ftHandle,
DWORD dwIoControlCode,
LPVOID lpInBuf,
DWORD nInBufSize,
LPVOID lpOutBuf,
DWORD nOutBufSize,
LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped
);
FTD2XX_API
FT_STATUS WINAPI FT_SetBaudRate(
FT_HANDLE ftHandle,
ULONG BaudRate
);
FTD2XX_API
FT_STATUS WINAPI FT_SetDivisor(
FT_HANDLE ftHandle,
USHORT Divisor
);
FTD2XX_API
FT_STATUS WINAPI FT_SetDataCharacteristics(
FT_HANDLE ftHandle,
UCHAR WordLength,
UCHAR StopBits,
UCHAR Parity
);
FTD2XX_API
FT_STATUS WINAPI FT_SetFlowControl(
FT_HANDLE ftHandle,
USHORT FlowControl,
UCHAR XonChar,
UCHAR XoffChar
);
FTD2XX_API
FT_STATUS WINAPI FT_ResetDevice(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_SetDtr(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_ClrDtr(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_SetRts(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_ClrRts(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_GetModemStatus(
FT_HANDLE ftHandle,
ULONG *pModemStatus
);
FTD2XX_API
FT_STATUS WINAPI FT_SetChars(
FT_HANDLE ftHandle,
UCHAR EventChar,
UCHAR EventCharEnabled,
UCHAR ErrorChar,
UCHAR ErrorCharEnabled
);
FTD2XX_API
FT_STATUS WINAPI FT_Purge(
FT_HANDLE ftHandle,
ULONG Mask
);
FTD2XX_API
FT_STATUS WINAPI FT_SetTimeouts(
FT_HANDLE ftHandle,
ULONG ReadTimeout,
ULONG WriteTimeout
);
FTD2XX_API
FT_STATUS WINAPI FT_GetQueueStatus(
FT_HANDLE ftHandle,
DWORD *dwRxBytes
);
FTD2XX_API
FT_STATUS WINAPI FT_SetEventNotification(
FT_HANDLE ftHandle,
DWORD Mask,
PVOID Param
);
FTD2XX_API
FT_STATUS WINAPI FT_GetStatus(
FT_HANDLE ftHandle,
DWORD *dwRxBytes,
DWORD *dwTxBytes,
DWORD *dwEventDWord
);
FTD2XX_API
FT_STATUS WINAPI FT_SetBreakOn(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_SetBreakOff(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_SetWaitMask(
FT_HANDLE ftHandle,
DWORD Mask
);
FTD2XX_API
FT_STATUS WINAPI FT_WaitOnMask(
FT_HANDLE ftHandle,
DWORD *Mask
);
FTD2XX_API
FT_STATUS WINAPI FT_GetEventStatus(
FT_HANDLE ftHandle,
DWORD *dwEventDWord
);
FTD2XX_API
FT_STATUS WINAPI FT_ReadEE(
FT_HANDLE ftHandle,
DWORD dwWordOffset,
LPWORD lpwValue
);
FTD2XX_API
FT_STATUS WINAPI FT_WriteEE(
FT_HANDLE ftHandle,
DWORD dwWordOffset,
WORD wValue
);
FTD2XX_API
FT_STATUS WINAPI FT_EraseEE(
FT_HANDLE ftHandle
);
//
// structure to hold program data for FT_Program function
//
typedef struct ft_program_data {
DWORD Signature1; // Header - must be 0x00000000
DWORD Signature2; // Header - must be 0xffffffff
DWORD Version; // Header - FT_PROGRAM_DATA version
// 0 = original
// 1 = FT2232C extensions
// 2 = FT232R extensions
WORD VendorId; // 0x0403
WORD ProductId; // 0x6001
char *Manufacturer; // "FTDI"
char *ManufacturerId; // "FT"
char *Description; // "USB HS Serial Converter"
char *SerialNumber; // "FT000001" if fixed, or NULL
WORD MaxPower; // 0 < MaxPower <= 500
WORD PnP; // 0 = disabled, 1 = enabled
WORD SelfPowered; // 0 = bus powered, 1 = self powered
WORD RemoteWakeup; // 0 = not capable, 1 = capable
//
// Rev4 extensions
//
UCHAR Rev4; // non-zero if Rev4 chip, zero otherwise
UCHAR IsoIn; // non-zero if in endpoint is isochronous
UCHAR IsoOut; // non-zero if out endpoint is isochronous
UCHAR PullDownEnable; // non-zero if pull down enabled
UCHAR SerNumEnable; // non-zero if serial number to be used
UCHAR USBVersionEnable; // non-zero if chip uses USBVersion
WORD USBVersion; // BCD (0x0200 => USB2)
//
// FT2232C extensions
//
UCHAR Rev5; // non-zero if Rev5 chip, zero otherwise
UCHAR IsoInA; // non-zero if in endpoint is isochronous
UCHAR IsoInB; // non-zero if in endpoint is isochronous
UCHAR IsoOutA; // non-zero if out endpoint is isochronous
UCHAR IsoOutB; // non-zero if out endpoint is isochronous
UCHAR PullDownEnable5; // non-zero if pull down enabled
UCHAR SerNumEnable5; // non-zero if serial number to be used
UCHAR USBVersionEnable5; // non-zero if chip uses USBVersion
WORD USBVersion5; // BCD (0x0200 => USB2)
UCHAR AIsHighCurrent; // non-zero if interface is high current
UCHAR BIsHighCurrent; // non-zero if interface is high current
UCHAR IFAIsFifo; // non-zero if interface is 245 FIFO
UCHAR IFAIsFifoTar; // non-zero if interface is 245 FIFO CPU target
UCHAR IFAIsFastSer; // non-zero if interface is Fast serial
UCHAR AIsVCP; // non-zero if interface is to use VCP drivers
UCHAR IFBIsFifo; // non-zero if interface is 245 FIFO
UCHAR IFBIsFifoTar; // non-zero if interface is 245 FIFO CPU target
UCHAR IFBIsFastSer; // non-zero if interface is Fast serial
UCHAR BIsVCP; // non-zero if interface is to use VCP drivers
//
// FT232R extensions
//
UCHAR UseExtOsc; // Use External Oscillator
UCHAR HighDriveIOs; // High Drive I/Os
UCHAR EndpointSize; // Endpoint size
UCHAR PullDownEnableR; // non-zero if pull down enabled
UCHAR SerNumEnableR; // non-zero if serial number to be used
UCHAR InvertTXD; // non-zero if invert TXD
UCHAR InvertRXD; // non-zero if invert RXD
UCHAR InvertRTS; // non-zero if invert RTS
UCHAR InvertCTS; // non-zero if invert CTS
UCHAR InvertDTR; // non-zero if invert DTR
UCHAR InvertDSR; // non-zero if invert DSR
UCHAR InvertDCD; // non-zero if invert DCD
UCHAR InvertRI; // non-zero if invert RI
UCHAR Cbus0; // Cbus Mux control
UCHAR Cbus1; // Cbus Mux control
UCHAR Cbus2; // Cbus Mux control
UCHAR Cbus3; // Cbus Mux control
UCHAR Cbus4; // Cbus Mux control
UCHAR RIsVCP; // non-zero if using VCP drivers
} FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;
FTD2XX_API
FT_STATUS WINAPI FT_EE_Program(
FT_HANDLE ftHandle,
PFT_PROGRAM_DATA pData
);
FTD2XX_API
FT_STATUS WINAPI FT_EE_ProgramEx(
FT_HANDLE ftHandle,
PFT_PROGRAM_DATA pData,
char *Manufacturer,
char *ManufacturerId,
char *Description,
char *SerialNumber
);
FTD2XX_API
FT_STATUS WINAPI FT_EE_Read(
FT_HANDLE ftHandle,
PFT_PROGRAM_DATA pData
);
FTD2XX_API
FT_STATUS WINAPI FT_EE_ReadEx(
FT_HANDLE ftHandle,
PFT_PROGRAM_DATA pData,
char *Manufacturer,
char *ManufacturerId,
char *Description,
char *SerialNumber
);
FTD2XX_API
FT_STATUS WINAPI FT_EE_UASize(
FT_HANDLE ftHandle,
LPDWORD lpdwSize
);
FTD2XX_API
FT_STATUS WINAPI FT_EE_UAWrite(
FT_HANDLE ftHandle,
PUCHAR pucData,
DWORD dwDataLen
);
FTD2XX_API
FT_STATUS WINAPI FT_EE_UARead(
FT_HANDLE ftHandle,
PUCHAR pucData,
DWORD dwDataLen,
LPDWORD lpdwBytesRead
);
FTD2XX_API
FT_STATUS WINAPI FT_SetLatencyTimer(
FT_HANDLE ftHandle,
UCHAR ucLatency
);
FTD2XX_API
FT_STATUS WINAPI FT_GetLatencyTimer(
FT_HANDLE ftHandle,
PUCHAR pucLatency
);
FTD2XX_API
FT_STATUS WINAPI FT_SetBitMode(
FT_HANDLE ftHandle,
UCHAR ucMask,
UCHAR ucEnable
);
FTD2XX_API
FT_STATUS WINAPI FT_GetBitMode(
FT_HANDLE ftHandle,
PUCHAR pucMode
);
FTD2XX_API
FT_STATUS WINAPI FT_SetUSBParameters(
FT_HANDLE ftHandle,
ULONG ulInTransferSize,
ULONG ulOutTransferSize
);
FTD2XX_API
FT_STATUS WINAPI FT_SetDeadmanTimeout(
FT_HANDLE ftHandle,
ULONG ulDeadmanTimeout
);
FTD2XX_API
FT_STATUS WINAPI FT_GetDeviceInfo(
FT_HANDLE ftHandle,
FT_DEVICE *lpftDevice,
LPDWORD lpdwID,
PCHAR SerialNumber,
PCHAR Description,
LPVOID Dummy
);
FTD2XX_API
FT_STATUS WINAPI FT_StopInTask(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_RestartInTask(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_SetResetPipeRetryCount(
FT_HANDLE ftHandle,
DWORD dwCount
);
FTD2XX_API
FT_STATUS WINAPI FT_ResetPort(
FT_HANDLE ftHandle
);
FTD2XX_API
FT_STATUS WINAPI FT_CyclePort(
FT_HANDLE ftHandle
);
//
// Win32-type functions
//
FTD2XX_API
FT_HANDLE WINAPI FT_W32_CreateFile(
LPCSTR lpszName,
DWORD dwAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreate,
DWORD dwAttrsAndFlags,
HANDLE hTemplate
);
FTD2XX_API
BOOL WINAPI FT_W32_CloseHandle(
FT_HANDLE ftHandle
);
FTD2XX_API
BOOL WINAPI FT_W32_ReadFile(
FT_HANDLE ftHandle,
LPVOID lpBuffer,
DWORD nBufferSize,
LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped
);
FTD2XX_API
BOOL WINAPI FT_W32_WriteFile(
FT_HANDLE ftHandle,
LPVOID lpBuffer,
DWORD nBufferSize,
LPDWORD lpBytesWritten,
LPOVERLAPPED lpOverlapped
);
FTD2XX_API
DWORD WINAPI FT_W32_GetLastError(
FT_HANDLE ftHandle
);
FTD2XX_API
BOOL WINAPI FT_W32_GetOverlappedResult(
FT_HANDLE ftHandle,
LPOVERLAPPED lpOverlapped,
LPDWORD lpdwBytesTransferred,
BOOL bWait
);
FTD2XX_API
BOOL WINAPI FT_W32_CancelIo(
FT_HANDLE ftHandle
);
//
// Win32 COMM API type functions
//
typedef struct _FTCOMSTAT {
DWORD fCtsHold : 1;
DWORD fDsrHold : 1;
DWORD fRlsdHold : 1;
DWORD fXoffHold : 1;
DWORD fXoffSent : 1;
DWORD fEof : 1;
DWORD fTxim : 1;
DWORD fReserved : 25;
DWORD cbInQue;
DWORD cbOutQue;
} FTCOMSTAT, *LPFTCOMSTAT;
typedef struct _FTDCB {
DWORD DCBlength; /* sizeof(FTDCB) */
DWORD BaudRate; /* Baudrate at which running */
DWORD fBinary: 1; /* Binary Mode (skip EOF check) */
DWORD fParity: 1; /* Enable parity checking */
DWORD fOutxCtsFlow:1; /* CTS handshaking on output */
DWORD fOutxDsrFlow:1; /* DSR handshaking on output */
DWORD fDtrControl:2; /* DTR Flow control */
DWORD fDsrSensitivity:1; /* DSR Sensitivity */
DWORD fTXContinueOnXoff: 1; /* Continue TX when Xoff sent */
DWORD fOutX: 1; /* Enable output X-ON/X-OFF */
DWORD fInX: 1; /* Enable input X-ON/X-OFF */
DWORD fErrorChar: 1; /* Enable Err Replacement */
DWORD fNull: 1; /* Enable Null stripping */
DWORD fRtsControl:2; /* Rts Flow control */
DWORD fAbortOnError:1; /* Abort all reads and writes on Error */
DWORD fDummy2:17; /* Reserved */
WORD wReserved; /* Not currently used */
WORD XonLim; /* Transmit X-ON threshold */
WORD XoffLim; /* Transmit X-OFF threshold */
BYTE ByteSize; /* Number of bits/byte, 4-8 */
BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
char XonChar; /* Tx and Rx X-ON character */
char XoffChar; /* Tx and Rx X-OFF character */
char ErrorChar; /* Error replacement char */
char EofChar; /* End of Input character */
char EvtChar; /* Received Event character */
WORD wReserved1; /* Fill for now. */
} FTDCB, *LPFTDCB;
typedef struct _FTTIMEOUTS {
DWORD ReadIntervalTimeout; /* Maximum time between read chars. */
DWORD ReadTotalTimeoutMultiplier; /* Multiplier of characters. */
DWORD ReadTotalTimeoutConstant; /* Constant in milliseconds. */
DWORD WriteTotalTimeoutMultiplier; /* Multiplier of characters. */
DWORD WriteTotalTimeoutConstant; /* Constant in milliseconds. */
} FTTIMEOUTS,*LPFTTIMEOUTS;
FTD2XX_API
BOOL WINAPI FT_W32_ClearCommBreak(
FT_HANDLE ftHandle
);
FTD2XX_API
BOOL WINAPI FT_W32_ClearCommError(
FT_HANDLE ftHandle,
LPDWORD lpdwErrors,
LPFTCOMSTAT lpftComstat
);
FTD2XX_API
BOOL WINAPI FT_W32_EscapeCommFunction(
FT_HANDLE ftHandle,
DWORD dwFunc
);
FTD2XX_API
BOOL WINAPI FT_W32_GetCommModemStatus(
FT_HANDLE ftHandle,
LPDWORD lpdwModemStatus
);
FTD2XX_API
BOOL WINAPI FT_W32_GetCommState(
FT_HANDLE ftHandle,
LPFTDCB lpftDcb
);
FTD2XX_API
BOOL WINAPI FT_W32_GetCommTimeouts(
FT_HANDLE ftHandle,
FTTIMEOUTS *pTimeouts
);
FTD2XX_API
BOOL WINAPI FT_W32_PurgeComm(
FT_HANDLE ftHandle,
DWORD dwMask
);
FTD2XX_API
BOOL WINAPI FT_W32_SetCommBreak(
FT_HANDLE ftHandle
);
FTD2XX_API
BOOL WINAPI FT_W32_SetCommMask(
FT_HANDLE ftHandle,
ULONG ulEventMask
);
FTD2XX_API
BOOL WINAPI FT_W32_SetCommState(
FT_HANDLE ftHandle,
LPFTDCB lpftDcb
);
FTD2XX_API
BOOL WINAPI FT_W32_SetCommTimeouts(
FT_HANDLE ftHandle,
FTTIMEOUTS *pTimeouts
);
FTD2XX_API
BOOL WINAPI FT_W32_SetupComm(
FT_HANDLE ftHandle,
DWORD dwReadBufferSize,
DWORD dwWriteBufferSize
);
FTD2XX_API
BOOL WINAPI FT_W32_WaitCommEvent(
FT_HANDLE ftHandle,
PULONG pulEvent,
LPOVERLAPPED lpOverlapped
);
//
// Device information
//
typedef struct _ft_device_list_info_node {
ULONG Flags;
ULONG Type;
ULONG ID;
DWORD LocId;
char SerialNumber[16];
char Description[64];
FT_HANDLE ftHandle;
} FT_DEVICE_LIST_INFO_NODE;
FTD2XX_API
FT_STATUS WINAPI FT_CreateDeviceInfoList(
LPDWORD lpdwNumDevs
);
FTD2XX_API
FT_STATUS WINAPI FT_GetDeviceInfoList(
FT_DEVICE_LIST_INFO_NODE *pDest,
LPDWORD lpdwNumDevs
);
FTD2XX_API
FT_STATUS WINAPI FT_GetDeviceInfoDetail(
DWORD dwIndex,
LPDWORD lpdwFlags,
LPDWORD lpdwType,
LPDWORD lpdwID,
LPDWORD lpdwLocId,
LPVOID lpSerialNumber,
LPVOID lpDescription,
FT_HANDLE *pftHandle
);
//
// Version information
//
FTD2XX_API
FT_STATUS WINAPI FT_GetDriverVersion(
FT_HANDLE ftHandle,
LPDWORD lpdwVersion
);
FTD2XX_API
FT_STATUS WINAPI FT_GetLibraryVersion(
LPDWORD lpdwVersion
);
#ifdef __cplusplus
}
#endif
#endif /* FTD2XX_H */

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,88 @@
; FTDIBUS.INF
; Copyright (c) 2000-2006 FTDI Ltd.
;
; USB serial converter driver installation for Windows 2000 and XP.
;
[Version]
Signature="$Windows NT$"
DriverPackageType=PlugAndPlay
DriverPackageDisplayName=%DESC%
Class=USB
ClassGUID={36fc9e60-c465-11cf-8056-444553540000}
Provider=%FTDI%
CatalogFile=ftdibus.cat
DriverVer=05/19/2006,2.00.00
[SourceDisksNames]
1=%DriversDisk%,,,
[SourceDisksFiles]
ftdibus.sys = 1
ftdiunin.exe = 1
ftdiun2k.ini = 1
ftbusui.dll = 1
ftd2xx.dll = 1
[DestinationDirs]
FtdiBus.NT.Copy = 10,system32\drivers
FtdiBus.NT.Copy2 = 10,system32
[Manufacturer]
%Ftdi%=FtdiHw
[FtdiHw]
%USB\VID_0403&PID_6001.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6001
%USB\VID_0403&PID_6010&MI_00.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6010&MI_00
%USB\VID_0403&PID_6010&MI_01.DeviceDesc%=FtdiBus,USB\VID_0403&PID_6010&MI_01
[ControlFlags]
ExcludeFromSelect=*
[FtdiBus.NT]
CopyFiles=FtdiBus.NT.Copy,FtdiBus.NT.Copy2
AddReg=FtdiBus.NT.AddReg,FtdiBusUnInst.NT.Reg
[FtdiBus.NT.Services]
AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
[FtdiBus.NT.AddService]
DisplayName = %SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\system32\drivers\ftdibus.sys
LoadOrderGroup = Base
[FtdiBus.NT.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,ftdibus.sys
HKR,,EnumPropPages32,,"ftbusui.dll,FTBUSUIPropPageProvider"
[FtdiBus.NT.Copy]
ftdibus.sys
[FtdiBus.NT.Copy2]
ftdiunin.exe
ftdiun2k.ini
ftbusui.dll
ftd2xx.dll
[FtdiBusUnInst.NT.Reg]
HKLM,%WINUN%,"FTDICOMM"
HKLM,%WINUN%\FTDICOMM , "UninstallString",,"%11%\ftdiunin.exe %11%\ftdiun2k.ini"
HKLM,%WINUN%\FTDICOMM , "DisplayName",,"FTDI USB Serial Converter Drivers"
HKLM,%WINUN%\FTDICOMM , "URLInfoAbout",,"http://www.ftdichip.com"
HKLM,%WINUN%\FTDICOMM , "Publisher",,"FTDI Ltd"
HKLM,%WINUN%\FTDICOMM , "DisplayVersion",,"2.00.00"
[Strings]
Ftdi="FTDI"
DESC="CDM Driver Package"
DriversDisk="FTDI USB Drivers Disk"
USB\VID_0403&PID_6001.DeviceDesc="USB Serial Converter"
USB\VID_0403&PID_6010&MI_00.DeviceDesc="USB Serial Converter A"
USB\VID_0403&PID_6010&MI_01.DeviceDesc="USB Serial Converter B"
WINUN="Software\Microsoft\Windows\CurrentVersion\Uninstall"
SvcDesc="USB Serial Converter Driver"
ClassName="USB"

Binary file not shown.

View File

@ -0,0 +1,127 @@
; FTDIPORT.INF
; Copyright (c) 2000-2006 FTDI Ltd.
;
; USB serial port driver installation for Windows 2000 and XP.
;
[Version]
Signature="$Windows NT$"
DriverPackageType=PlugAndPlay
DriverPackageDisplayName=%DESC%
Class=Ports
ClassGUID={4d36e978-e325-11ce-bfc1-08002be10318}
Provider=%FTDI%
CatalogFile=ftdiport.cat
DriverVer=05/19/2006,2.00.00
[SourceDisksNames]
1=%DriversDisk%,,,
[SourceDisksFiles]
ftser2k.sys=1
ftserui2.dll=1
FTLang.Dll = 1
ftcserco.dll = 1
[DestinationDirs]
FtdiPort.NT.Copy=10,system32\drivers
FtdiPort.NT.CopyUI=10,system32
FtdiPort2232.NT.CopyCoInst=10,system32
[ControlFlags]
ExcludeFromSelect=*
[Manufacturer]
%FTDI%=FtdiHw
[FtdiHw]
%VID_0403&PID_6001.DeviceDesc%=FtdiPort232,FTDIBUS\COMPORT&VID_0403&PID_6001
%VID_0403&PID_6010.DeviceDesc%=FtdiPort2232,FTDIBUS\COMPORT&VID_0403&PID_6010
[FtdiPort.NT.AddService]
DisplayName = %SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\system32\drivers\ftser2k.sys
LoadOrderGroup = Base
; -------------- Serenum Driver install section
[SerEnum_AddService]
DisplayName = %SerEnum.SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\serenum.sys
LoadOrderGroup = PNP Filter
[FtdiPort.NT.AddReg]
HKR,,EnumPropPages32,,"ftserui2.dll,SerialPortPropPageProvider"
[FtdiPort.NT.Copy]
ftser2k.sys
;serenum.sys
[FtdiPort.NT.CopyUI]
ftserui2.dll
FTLang.dll
[FtdiPort232.NT]
CopyFiles=FtdiPort.NT.Copy,FtdiPort.NT.CopyUI
AddReg=FtdiPort.NT.AddReg
[FtdiPort232.NT.HW]
AddReg=FtdiPort232.NT.HW.AddReg
[FtdiPort232.NT.Services]
AddService = FTSER2K, 0x00000002, FtdiPort.NT.AddService
AddService = Serenum,,SerEnum_AddService
DelService = FTSERIAL
[FtdiPort232.NT.HW.AddReg]
HKR,,"UpperFilters",0x00010000,"serenum"
;HKR,,"ConfigData",1,01,00,3F,3F,10,27,88,13,C4,09,E2,04,71,02,38,41,9c,80,4E,C0,34,00,1A,00,0D,00,06,40,03,80,00,00,d0,80
HKR,,"ConfigData",1,11,00,3F,3F,10,27,00,00,88,13,00,00,C4,09,00,00,E2,04,00,00,71,02,00,00,38,41,00,00,9C,80,00,00,4E,C0,00,00,34,00,00,00,1A,00,00,00,0D,00,00,00,06,40,00,00,03,80,00,00,00,00,00,00,D0,80,00,00
HKR,,"MinReadTimeout",0x00010001,0
HKR,,"MinWriteTimeout",0x00010001,0
HKR,,"LatencyTimer",0x00010001,16
; -------
; FT2232C
; -------
[FtdiPort2232.NT]
CopyFiles=FtdiPort.NT.Copy,FtdiPort.NT.CopyUI
AddReg=FtdiPort.NT.AddReg
[FtdiPort2232.NT.HW]
AddReg=FtdiPort232.NT.HW.AddReg
[FtdiPort2232.NT.CoInstallers]
AddReg=FtdiPort2232.NT.CoInstallers.AddReg
CopyFiles=FtdiPort2232.NT.CopyCoInst
[FtdiPort2232.NT.Services]
AddService = FTSER2K, 0x00000002, FtdiPort.NT.AddService
AddService = Serenum,,SerEnum_AddService
DelService = FTSERIAL
[FtdiPort2232.NT.CoInstallers.AddReg]
HKR,,CoInstallers32,0x00010000,"ftcserco.Dll,FTCSERCoInstaller"
[FtdiPort2232.NT.CopyCoInst]
ftcserco.dll
;---------------------------------------------------------------;
[Strings]
FTDI="FTDI"
DESC="CDM Driver Package"
DriversDisk="FTDI USB Drivers Disk"
PortsClassName = "Ports (COM & LPT)"
VID_0403&PID_6001.DeviceDesc="USB Serial Port"
VID_0403&PID_6010.DeviceDesc="USB Serial Port"
SvcDesc="USB Serial Port Driver"
SerEnum.SvcDesc="Serenum Filter Driver"

View File

@ -0,0 +1,6 @@
[Uninstall]
Device=VID_0403&PID_6001,VID_0403&PID_6010
Converter=FTDIBUS
Serial=FTSER2K
InfFiles=FTDIBUS,FTDIPORT
Key=FTDICOMM

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,7 @@
[DEFAULT]
BASEURL=http://www.ftdichip.com/Documents/InstallGuides.htm
[InternetShortcut]
URL=http://www.ftdichip.com/Documents/InstallGuides.htm
Modified=606147754AF7C50184
IconFile=C:\WINNT\system32\url.dll
IconIndex=0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
build/windows/dist/libusb0.dll vendored Executable file

Binary file not shown.

BIN
build/windows/dist/rxtxSerial.dll vendored Normal file

Binary file not shown.

View File

@ -1,22 +0,0 @@
CXXFLAGS = -mwindows -mno-cygwin -O2 -Wall
#POBJS = launcher.o launcher-rc.o
# don't want to include the p5 icons for the exported feller
AOBJS = launcher.o
#processing.exe: $(POBJS)
# $(LINK.cc) $(CXXFLAGS) -o $@ $(POBJS)
# cp processing.exe ../work/
application.exe: $(AOBJS)
$(LINK.cc) $(CXXFLAGS) -DEXPORT -o $@ $(AOBJS)
cp application.exe ../work/lib/export/
cp application.exe ../../shared/lib/export/
$(POBJS): Makefile
#launcher-rc.o: launcher.rc
# windres -i $< -o $@
clean:
$(RM) $(OBJS) application.exe
# $(RM) $(OBJS) processing.exe application.exe

Binary file not shown.

View File

@ -1,451 +0,0 @@
// -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// if this code looks shitty, that's because it is. people are likely to have
// the durndest things in their CLASSPATH and QTJAVA environment variables.
// mostly because installers often mangle them without the user knowing.
// so who knows where and when the quotes will show up. the code below is
// based on a couple years of trial and error with processing releases.
// For revision 0102, a lot of changes were made to deal with stripping
// the quotes from the PATH, CLASSPATH, and QTJAVA environment variables.
// Any elements of the PATH and CLASSPATH that don't exist (whether files
// or directories) are also stripped out before being set.
// (<A HREF="http://dev.processing.org/bugs/show_bug.cgi?id=112">Bug 112</A>)
// The size of all of the strings was made sort of ambiguously large, since
// 1) nothing is hurt by allocating an extra few bytes temporarily and
// 2) if the user has a long path, and it gets copied five times over for the
// CLASSPATH, the program runs the risk of crashing. Bad bad.
// TODO this code leaks memory all over the place because nothing has been
// done to properly handle creation/deletion of new strings.
// TODO switch to unicode versions of all methods in order to better support
// running on non-English (non-Roman especially) versions of Windows.
#define ARGS_FILE_PATH "\\lib\\args.txt"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
void removeLineEndings(char *what);
char *scrubPath(char *incoming);
char *mallocChars(int count);
void removeQuotes(char *quoted);
void removeTrailingSlash(char *slashed);
int STDCALL
WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
{
// command line that was passed to this application
char *incoming_cmd_line = (char *)malloc(strlen(lpCmd + 1) * sizeof(char));
strcpy(incoming_cmd_line, lpCmd);
// get the full path to the application that was launched,
// drop the app name but keep the path
char *exe_directory = (char *)malloc(MAX_PATH * sizeof(char));
//*exe_directory = 0;
GetModuleFileName(NULL, exe_directory, MAX_PATH);
// remove the application name
*(strrchr(exe_directory, '\\')) = '\0';
// open the file that contains the main class name and java args
char *args_file_path = (char*)
malloc(strlen(exe_directory) * sizeof(char) +
strlen(ARGS_FILE_PATH) * sizeof(char) + 1);
strcpy(args_file_path, exe_directory);
strcat(args_file_path, ARGS_FILE_PATH);
char java_args[512];
char java_main_class[512];
char jar_list[512];
char *app_classpath = (char *)malloc(10 * strlen(exe_directory) + 4096);
FILE *argsfile = fopen(args_file_path, "r");
if (argsfile == NULL) {
sprintf(app_classpath,
"This program is missing the \"lib\" folder, "
"which should be located at\n%s",
exe_directory);
MessageBox(NULL, app_classpath, "Folder Missing", MB_OK);
return 0;
/*
sprintf(app_classpath,
"%s\\lib;"
"%s\\lib\\pde.jar;"
"%s\\lib\\core.jar;"
"%s\\lib\\jna.jar;"
"%s\\lib\\ecj.jar;"
"%s\\lib\\antlr.jar;",
exe_directory,
exe_directory, exe_directory,
exe_directory, exe_directory, exe_directory);
*/
} else {
fgets(java_args, 511, argsfile);
removeLineEndings(java_args);
fgets(java_main_class, 511, argsfile);
removeLineEndings(java_main_class);
fgets(jar_list, 511, argsfile);
removeLineEndings(jar_list);
//MessageBox(NULL, java_args, "args", MB_OK);
//MessageBox(NULL, java_main_class, "class", MB_OK);
//MessageBox(NULL, jar_list, "jarlist", MB_OK);
app_classpath[0] = 0;
char *jar = (char*) strtok(jar_list, ",");
while (jar != NULL) {
char entry[1024];
sprintf(entry, "%s\\lib\\%s;", exe_directory, jar);
strcat(app_classpath, entry);
jar = (char*) strtok(NULL, ",");
}
fclose(argsfile);
}
//
char *cp = (char *)malloc(10 * strlen(exe_directory) + 4096);
// test to see if running with a java runtime nearby or not
char *testpath = (char *)malloc(MAX_PATH * sizeof(char));
*testpath = 0;
strcpy(testpath, exe_directory);
strcat(testpath, "\\java\\bin\\java.exe");
FILE *fp = fopen(testpath, "rb");
int local_jre_installed = (fp != NULL);
//char *rt_jar = (fp == NULL) ? "" : "java\\lib\\rt.jar;";
if (fp != NULL) fclose(fp); // argh! this was probably causing trouble
//const char *envClasspath = getenv("CLASSPATH");
//char *env_classpath = (char *)malloc(16384 * sizeof(char));
// ignoring CLASSPATH for now, because it's not needed
// and causes more trouble than it's worth [0060]
//env_classpath[0] = 0;
/*
// keep this code around since may be re-enabled later
if (getenv("CLASSPATH") != NULL) {
strcpy(env_classpath, getenv("CLASSPATH"));
if (env_classpath[0] == '\"') {
// starting quote in classpath.. yech
env_classpath++; // shitty.. i know..
int len = strlen(env_classpath);
if (env_classpath[len-1] == '\"') {
env_classpath[len-1] = 0;
} else {
// a starting quote but no ending quote.. ugh
// maybe throw an error
}
}
int last = strlen(env_classpath);
env_classpath[last++] = ';';
env_classpath[last] = 0;
} else {
env_classpath[0] = 0;
}
*/
char *qtjava_path = (char *)malloc(16384 * sizeof(char));
qtjava_path[0] = 0;
if (getenv("QTJAVA") != NULL) {
//char *qtjava_temp = (char *)malloc(16384 * sizeof(char));
strcpy(qtjava_path, getenv("QTJAVA"));
removeQuotes(qtjava_path);
/*
//MessageBox(NULL, qtjava_temp, "QTJAVA", MB_OK);
if (qtjava_temp[0] == '\"') { // has quotes
// remove quotes by subsetting string by two
int qtjava_repaired_length = strlen(qtjava_temp) - 2;
strncpy(qtjava_path, &qtjava_temp[1], qtjava_repaired_length);
// terminate the string since strncpy ain't gonna do it
qtjava_path[qtjava_repaired_length] = 0;
//MessageBox(NULL, qtjava_path, "QTJAVA", MB_OK);
} else {
strcpy(qtjava_path, getenv("QTJAVA"));
}
*/
FILE *fp = fopen(qtjava_path, "rb");
if (fp != NULL) {
fclose(fp); // found it, all set
strcat(qtjava_path, ";"); // add path separator
//MessageBox(NULL, "found 1", "msg", MB_OK);
//MessageBox(NULL, qtjava_path, "QTJAVA after strcat", MB_OK);
} else {
qtjava_path[0] = 0; // not a valid path
}
//} else {
//MessageBox(NULL, "no qtjava set", "mess", MB_OK);
}
if (qtjava_path[0] == 0) { // not set yet
//if (getenv("WINDIR") == NULL) {
// uh-oh.. serious problem.. gonna have to report this
// but hopefully WINDIR is set on win98 too
//} else {
strcpy(qtjava_path, getenv("WINDIR"));
strcat(qtjava_path, "\\SYSTEM32\\QTJava.zip");
FILE *fp = fopen(qtjava_path, "rb");
if (fp != NULL) {
fclose(fp); // found it, all set
strcat(qtjava_path, ";"); // add path separator
//MessageBox(NULL, "found 2", "msg", MB_OK);
} else {
qtjava_path[0] = 0; // not a valid path
}
}
if (qtjava_path[0] == 0) {
strcpy(qtjava_path, getenv("WINDIR"));
strcat(qtjava_path, "\\SYSTEM\\QTJava.zip");
fp = fopen(qtjava_path, "rb");
if (fp != NULL) {
fclose(fp); // found it, all set
strcat(qtjava_path, ";"); // add path separator
//MessageBox(NULL, "found 3", "msg", MB_OK);
} else {
// doesn't seem to be installed, which is a problem.
// but the error will be reported by the pde
qtjava_path[0] = 0;
}
}
// don't put quotes around contents of cp, even though %s might have
// spaces in it. don't put quotes in it, because it's setting the
// environment variable for CLASSPATH, not being included on the
// command line. so setting the env var it's ok to have spaces,
// and the quotes prevent javax.comm.properties from being found.
strcpy(cp, app_classpath);
if (local_jre_installed) {
char *local_jre = mallocChars(64 + strlen(exe_directory) * 2);
sprintf(local_jre, "%s\\java\\lib\\rt.jar;%s\\java\\lib\\tools.jar;", exe_directory, exe_directory);
strcat(cp, local_jre);
}
strcat(cp, qtjava_path);
char *clean_cp = scrubPath(cp);
//if (!SetEnvironmentVariable("CLASSPATH", cp)) {
if (!SetEnvironmentVariable("CLASSPATH", clean_cp)) {
MessageBox(NULL, "Could not set CLASSPATH environment variable",
"Processing Error", MB_OK);
return 0;
}
//MessageBox(NULL, "2", "checking", MB_OK);
//char *env_path = (char *)malloc(strlen(getenv("PATH")) * sizeof(char));
int env_path_length = strlen(getenv("PATH"));
char *env_path = mallocChars(env_path_length);
strcpy(env_path, getenv("PATH"));
char *clean_path;
// need to add the local jre to the path for 'java mode' in the env
if (local_jre_installed) {
char *path_to_clean =
mallocChars(env_path_length + strlen(exe_directory) + 30);
sprintf(path_to_clean, "%s\\java\\bin;%s", exe_directory, env_path);
clean_path = scrubPath(path_to_clean);
} else {
clean_path = scrubPath(getenv("PATH"));
}
//MessageBox(NULL, clean_path, "after scrubbing PATH", MB_OK);
//MessageBox(NULL, "3", "checking", MB_OK);
if (!SetEnvironmentVariable("PATH", clean_path)) {
MessageBox(NULL, "Could not set PATH environment variable",
"Processing Error", MB_OK);
return 0;
}
// what gets put together to pass to jre
char *outgoing_cmd_line = (char *)malloc(16384 * sizeof(char));
// prepend the args for -mx and -ms
strcpy(outgoing_cmd_line, java_args);
strcat(outgoing_cmd_line, " ");
// add the name of the class to execute and a space before the next arg
strcat(outgoing_cmd_line, java_main_class);
strcat(outgoing_cmd_line, " ");
// append additional incoming stuff (document names), if any
strcat(outgoing_cmd_line, incoming_cmd_line);
//MessageBox(NULL, outgoing_cmd_line, "cmd_line", MB_OK);
char *executable =
(char *)malloc((strlen(exe_directory) + 256) * sizeof(char));
// exe_directory is the name path to the current application
if (local_jre_installed) {
strcpy(executable, exe_directory);
// copy in the path for javaw, relative to launcher.exe
strcat(executable, "\\java\\bin\\javaw.exe");
} else {
strcpy(executable, "javaw.exe");
}
SHELLEXECUTEINFO ShExecInfo;
// set up the execution info
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = 0;
ShExecInfo.hwnd = 0;
ShExecInfo.lpVerb = "open";
ShExecInfo.lpFile = executable;
ShExecInfo.lpParameters = outgoing_cmd_line;
ShExecInfo.lpDirectory = exe_directory;
ShExecInfo.nShow = SW_SHOWNORMAL;
ShExecInfo.hInstApp = NULL;
if (!ShellExecuteEx(&ShExecInfo)) {
MessageBox(NULL, "Error calling ShellExecuteEx()",
"Processing Error", MB_OK);
return 0;
}
if (reinterpret_cast<int>(ShExecInfo.hInstApp) <= 32) {
// some type of error occurred
switch (reinterpret_cast<int>(ShExecInfo.hInstApp)) {
case ERROR_FILE_NOT_FOUND:
case ERROR_PATH_NOT_FOUND:
MessageBox(NULL, "A required file could not be found. \n"
"You may need to install a Java runtime\n"
"or re-install Processing.",
"Processing Error", MB_OK);
break;
case 0:
case SE_ERR_OOM:
MessageBox(NULL, "Not enough memory or resources to run at"
" this time.", "Processing Error", MB_OK);
break;
default:
MessageBox(NULL, "There is a problem with your installation.\n"
"If the problem persists, re-install the program.",
"Processing Error", MB_OK);
break;
}
}
return 0;
}
void removeLineEndings(char *what) {
int index = strlen(what) - 1;
while (index >= 0) {
if ((what[index] == 10) || (what[index] == 13)) {
what[index] = 0;
--index;
} else {
return;
}
}
}
// take a PATH environment variable, split on semicolons,
// remove extraneous quotes, perhaps even make 8.3 syntax if necessary
char *scrubPath(char *incoming) {
char *cleaned = mallocChars(strlen(incoming) * 2);
int found_so_far = 0;
char *p = (char*) strtok(incoming, ";");
while (p != NULL) {
char entry[1024];
/*
if (*p == '\"') {
// if this segment of the path contains quotes, remove them
int fixed_length = strlen(p) - 2;
strncpy(entry, &p[1], fixed_length);
entry[fixed_length] = 0;
//MessageBox(NULL, entry, "clipped", MB_OK);
// if it doesn't actually end with a quote, then the person
// is screwed anyway.. they can deal with that themselves
} else {
strcpy(entry, p);
}
*/
strcpy(entry, p);
removeQuotes(entry);
// a trailing slash will cause FindFirstFile to fail.. grr [0109]
removeTrailingSlash(entry);
//MessageBox(NULL, entry, "entry", MB_OK);
// if this path doesn't exist, don't add it
WIN32_FIND_DATA find_file_data;
HANDLE hfind = FindFirstFile(entry, &find_file_data);
if (hfind != INVALID_HANDLE_VALUE) {
if (found_so_far) strcat(cleaned, ";");
strcat(cleaned, entry);
//MessageBox(NULL, cleaned, "cleaned so far", MB_OK);
FindClose(hfind);
found_so_far = 1;
//} else {
//MessageBox(NULL, entry, "removing", MB_OK);
}
// grab the next entry
p = (char*) strtok(NULL, ";");
}
//MessageBox(NULL, cleaned, "scrubPath", MB_OK);
return cleaned;
}
// eventually make this handle unicode
char *mallocChars(int count) {
// add one for the terminator
char *outgoing = (char*) malloc(count * sizeof(char) + 1);
outgoing[0] = 0; // for safety
return outgoing;
}
void removeQuotes(char *quoted) {
int len = strlen(quoted);
// remove quote at the front
if (quoted[0] == '\"') {
for (int i = 0; i < len - 1; i++) {
quoted[i] = quoted[i+1];
}
len--;
quoted[len] = 0;
}
// remove quote at the end
if (len > 1) {
if (quoted[len - 1] == '\"') {
len--;
quoted[len] = 0;
}
}
}
void removeTrailingSlash(char *slashed) {
int len = strlen(slashed);
if (len > 1) {
if (slashed[len - 1] == '\\') {
len--;
slashed[len] = 0;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 KiB

After

Width:  |  Height:  |  Size: 374 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -2,7 +2,7 @@
<dontWrapJar>true</dontWrapJar>
<headerType>gui</headerType>
<jar>lib</jar>
<outfile>processing.exe</outfile>
<outfile>arduino.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
@ -19,13 +19,14 @@
<cp>lib/core.jar</cp>
<cp>lib/jna.jar</cp>
<cp>lib/ecj.jar</cp>
<cp>lib/antlr.jar</cp>
<cp>lib/oro.jar</cp>
<cp>lib/RXTXcomm.jar</cp>
</classPath>
<jre>
<path>java</path>
<minVersion>1.5.0</minVersion>
<maxVersion></maxVersion>
<jdkPreference>jdkOnly</jdkPreference>
<jdkPreference>preferJre</jdkPreference>
<opt>-Xms128m -Xmx128m</opt>
</jre>
<splash>

Binary file not shown.

View File

@ -12,33 +12,30 @@ else
mkdir work
cp -r ../shared/lib work/
cp -r ../shared/libraries work/
cp -r ../shared/tools work/
cp dist/*.dll work/
cp -r dist/drivers work/
cp -r ../../hardware work/
cp ../../app/lib/antlr.jar work/lib/
cp ../../app/lib/ecj.jar work/lib/
cp ../../app/lib/jna.jar work/lib/
cp ../../app/lib/oro.jar work/lib/
cp ../../app/lib/RXTXcomm.jar work/lib/
echo Extracting examples...
unzip -q -d work/ ../shared/examples.zip
echo Copying examples...
cp -r ../shared/examples work/
echo Extracting reference...
unzip -q -d work/ ../shared/reference.zip
cp -r ../../net work/libraries/
cp -r ../../opengl work/libraries/
cp -r ../../serial work/libraries/
cp -r ../../video work/libraries/
cp -r ../../pdf work/libraries/
cp -r ../../dxf work/libraries/
echo Extracting avr tools...
unzip -q -d work/hardware/ avr_tools.zip
echo Extracting enormous JRE...
unzip -q -d work jre.zip
# build the export launcher
cd export
make
cd ..
unzip -q -d work/ jre.zip
# build the processing.exe bundle
# there are a few hacks in the source to launch4j-3.0.1
@ -46,7 +43,7 @@ else
# cd head_src/gui_head && make -f Makefile.win
cd launcher
./launch4j/launch4jc.exe config.xml
cp processing.exe ../work/
cp arduino.exe ../work/
cd ..
# chmod +x the crew
@ -91,53 +88,12 @@ cd bin && zip -rq ../../build/windows/work/lib/core.jar \
# back to base processing dir
cd ..
### -- BUILD PREPROC ---------------------------------------------
if $BUILD_PREPROC
then
echo Building PDE for JDK 1.5
cd app
# first build the default java goop
../build/windows/work/java/bin/java \
-cp "..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool \
-o src/antlr/java \
src/antlr/java/java.g
# now build the pde stuff that extends the java classes
#../../build/windows/work/java/bin/java \
# -cp "..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool \
# -o src/processing/app/preproc \
# -glib antlr/java/java.g processing/app/preproc/pde.g
# this is totally ugly and needs to be fixed
# the problem is that -glib doesn't set the main path properly,
# so it's necessary to cd into the antlr/java folder, otherwise
# the JavaTokenTypes.txt file won't be found
# this is the eventual hack to make things work
# why this is required on windows and not the others is beyond me
cp src/antlr/java/JavaTokenTypes.txt src/processing/app/preproc/
# this is a total disaster...fix me soon!
cd src/processing/app/preproc
../../../../../build/windows/work/java/bin/java \
-cp "..\\..\\..\\..\\..\\build\\windows\\work\\lib\\antlr.jar" antlr.Tool \
-glib ../../../antlr/java/java.g \
pde.g
cd ../../../..
# back to base processing dir
cd ..
fi
### -- BUILD PDE ------------------------------------------------
echo Building the PDE...
cd app
# has to be present, otherwise javac will complain of file writing errors
@ -148,16 +104,14 @@ mkdir ../build/windows/work/classes
-classpath "..\\build\\windows\\work\\java\\lib\\tools.jar" \
com.sun.tools.javac.Main \
-source 1.5 -target 1.5 \
-classpath "..\\build\\windows\\work\\lib\\core.jar;..\\build\\windows\\work\\lib\antlr.jar;..\\build\\windows\\work\\lib\\ecj.jar;..\\build\\windows\\work\\lib\\jna.jar;..\\build\\windows\\work\\java\\lib\\tools.jar" \
-classpath "..\\build\\windows\\work\\lib\\core.jar;..\\build\\windows\\work\\lib\antlr.jar;..\\build\\windows\\work\\lib\\ecj.jar;..\\build\\windows\\work\\lib\\jna.jar;..\\build\\windows\\work\\lib\\oro.jar;..\\build\\windows\\work\\lib\\RXTXcomm.jar;..\\build\\windows\\work\\java\\lib\\tools.jar" \
-d ..\\build\\windows\\work\\classes \
src/processing/app/*.java \
src/processing/app/debug/*.java \
src/processing/app/syntax/*.java \
src/processing/app/preproc/*.java \
src/processing/app/tools/*.java \
src/processing/app/windows/*.java \
src/antlr/*.java \
src/antlr/java/*.java
src/processing/app/windows/*.java
cd ../build/windows/work/classes
rm -f ../lib/pde.jar
@ -165,119 +119,6 @@ zip -rq ../lib/pde.jar .
cd ../..
### -- BUILD LIBRARIES ------------------------------------------------
PLATFORM=windows
#CLASSPATH="..\\build\\$PLATFORM\\work\\lib\\core.jar;..\\build\\$PLATFORM\\work\\java\\lib\\rt.jar"
#CLASSPATH="..\\build\\$PLATFORM\\work\\lib\\core.jar"
JAVAC="../build/windows/work/java/bin/java -classpath ..\\build\\windows\\work\\java\\lib\\tools.jar com.sun.tools.javac.Main -source 1.5 -target 1.5"
CORE="..\\build\\$PLATFORM\\work\\lib\\core.jar"
LIBRARIES="..\\build\\$PLATFORM\\work\\libraries"
# move to processing/build
cd ..
# SERIAL LIBRARY
echo Building serial library...
cd ../serial
mkdir -p bin
$JAVAC \
-classpath "library\\RXTXcomm.jar;$CORE" \
-d bin src/processing/serial/*.java
rm -f library/serial.jar
find bin -name "*~" -exec rm -f {} ';'
cd bin && zip -rq ../library/serial.jar processing/serial/*.class && cd ..
mkdir -p $LIBRARIES/serial/library/
cp library/serial.jar $LIBRARIES/serial/library/
# NET LIBRARY
echo Building net library...
cd ../net
mkdir -p bin
$JAVAC \
-classpath "$CORE" \
-d bin src/processing/net/*.java
rm -f library/net.jar
find bin -name "*~" -exec rm -f {} ';'
cd bin && zip -rq ../library/net.jar processing/net/*.class && cd ..
mkdir -p $LIBRARIES/net/library/
cp library/net.jar $LIBRARIES/net/library/
# VIDEO LIBRARY
echo Building video library...
if test -f "${QTJAVA}"
then
echo "Found Quicktime 7 installation"
else
QTJAVA="$WINDIR\\system32\\QTJava.zip"
if test -f "${QTJAVA}"
then
echo "Found Quicktime 6 at $QTJAVA"
else
echo "Could not find QuickTime for Java,"
echo "you'll need to install it before building."
exit 1;
fi
fi
cd ../video
mkdir -p bin
$JAVAC \
-classpath "$QTJAVA;$CORE" \
-d bin src/processing/video/*.java
rm -f library/video.jar
find bin -name "*~" -exec rm -f {} ';'
cd bin && zip -rq ../library/video.jar processing/video/*.class && cd ..
mkdir -p $LIBRARIES/video/library/
cp library/video.jar $LIBRARIES/video/library/
# OPENGL LIBRARY
echo Building OpenGL library...
cd ../opengl
mkdir -p bin
$JAVAC \
-classpath "library\\jogl.jar;$CORE" \
-d bin src/processing/opengl/*.java
rm -f library/opengl.jar
find bin -name "*~" -exec rm -f {} ';'
cd bin && zip -rq ../library/opengl.jar processing/opengl/*.class && cd ..
mkdir -p $LIBRARIES/opengl/library/
cp library/opengl.jar $LIBRARIES/opengl/library/
# PDF LIBRARY
echo Building PDF library...
cd ../pdf
mkdir -p bin
$JAVAC \
-classpath "library\\itext.jar;$CORE" \
-d bin src/processing/pdf/*.java
rm -f library/pdf.jar
find bin -name "*~" -exec rm -f {} ';'
cd bin && zip -rq ../library/pdf.jar processing/pdf/*.class && cd ..
mkdir -p $LIBRARIES/pdf/library/
cp library/pdf.jar $LIBRARIES/pdf/library/
# DXF LIBRARY
echo Building DXF library...
cd ../dxf
mkdir -p bin
$JAVAC \
-classpath "$CORE" \
-d bin src/processing/dxf/*.java
rm -f library/dxf.jar
find bin -name "*~" -exec rm -f {} ';'
cd bin && zip -rq ../library/dxf.jar processing/dxf/*.class && cd ..
mkdir -p $LIBRARIES/dxf/library/
cp library/dxf.jar $LIBRARIES/dxf/library/
echo
echo Done.

View File

@ -1,6 +1,6 @@
#!/bin/sh
CLASSPATH=lib\\pde.jar\;lib\\core.jar\;lib\\jna.jar\;lib\\ecj.jar\;lib\\antlr.jar\;java\\lib\\tools.jar
CLASSPATH=lib\\pde.jar\;lib\\core.jar\;lib\\jna.jar\;lib\\ecj.jar\;lib\\antlr.jar\;lib\\oro.jar\;lib\\RXTXcomm.jar\;java\\lib\\tools.jar
export CLASSPATH
cd work && ./java/bin/java processing.app.Base