21
21
* DESCRIPTION
22
22
* This script is included in the npm bundle of node-oracledb. It
23
23
* is invoked by package.json during npm install. It downloads a
24
- * pre-built node-oracleb binary if one is available, or gives a
25
- * message on how to compile from source code.
24
+ * pre-built node-oracleb binary from GitHub if one is available, or
25
+ * gives a message on how to compile one from source code.
26
26
*
27
+ * MAINTENANCE NOTES
28
+ * - This file should run with Node 4 or later.
29
+ * - This file should only ever 'require' packages included in core Node.js.
30
+ *
27
31
*****************************************************************************/
28
32
29
33
'use strict' ;
30
34
31
- /* Install script for the oracledb add-on.
32
- *
33
- * This script downloads an oracledb.node binary over HTTPS.
34
- *
35
- * Maintenance note:
36
- * - This file should only ever 'require' packages included in core Node.js.
37
- * - This file should run with Node 4 or later.
38
- *
39
- * When a GitHub 'release' is made, binaries can be uploaded to
40
- * GitHub. They will be located in:
41
- * https://github.com/oracle/node-oracledb/releases/download/<tag>/<filename>
42
- */
43
-
44
35
const http = require ( 'http' ) ;
45
36
const https = require ( 'https' ) ;
46
37
const fs = require ( 'fs' ) ;
59
50
return ;
60
51
}
61
52
53
+ // Note: the Makefile uses these hostname and path values for the npm
54
+ // package but will substitute them for the staging package
62
55
const PACKAGE_HOSTNAME = 'github.com' ;
63
56
const PACKAGE_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil . dynamicProps . GITHUB_TAG + '/' + packageUtil . dynamicProps . PACKAGE_FILE_NAME ;
64
57
const SHA_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil . dynamicProps . GITHUB_TAG + '/' + packageUtil . SHA_FILE_NAME ;
@@ -358,16 +351,17 @@ function done(err, alreadyInstalled) {
358
351
arch = '32-bit' ;
359
352
}
360
353
361
- console . log ( '\n********************************************************************************' ) ;
354
+ packageUtil . log ( '' ) ;
355
+ packageUtil . log ( '********************************************************************************' ) ;
362
356
363
357
if ( alreadyInstalled ) {
364
- console . log ( '** Node-oracledb ' + packageUtil . dynamicProps . PACKAGE_JSON_VERSION + ' was already installed for Node.js ' + process . versions . node + ' (' + process . platform + ', ' + process . arch + ')' ) ;
358
+ packageUtil . log ( '** Node-oracledb ' + packageUtil . dynamicProps . PACKAGE_JSON_VERSION + ' was already installed for Node.js ' + process . versions . node + ' (' + process . platform + ', ' + process . arch + ')' ) ;
365
359
} else {
366
- console . log ( '** Node-oracledb ' + packageUtil . dynamicProps . PACKAGE_JSON_VERSION + ' installation complete for Node.js ' + process . versions . node + ' (' + process . platform + ', ' + process . arch + ')' ) ;
360
+ packageUtil . log ( '** Node-oracledb ' + packageUtil . dynamicProps . PACKAGE_JSON_VERSION + ' installation complete for Node.js ' + process . versions . node + ' (' + process . platform + ', ' + process . arch + ')' ) ;
367
361
}
368
362
369
- console . log ( '**' ) ;
370
- console . log ( '** To use the installed node-oracledb:' ) ;
363
+ packageUtil . log ( '**' ) ;
364
+ packageUtil . log ( '** To use the installed node-oracledb:' ) ;
371
365
372
366
if ( process . platform === 'linux' ) {
373
367
if ( process . arch === 'x64' ) {
@@ -376,37 +370,37 @@ function done(err, alreadyInstalled) {
376
370
clientUrl = 'http://www.oracle.com/technetwork/topics/linuxsoft-082809.html' ;
377
371
}
378
372
379
- console . log ( '** - You must have ' + arch + ' Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig' ) ;
380
- console . log ( '** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from ' ) ;
381
- console . log ( '** ' + clientUrl ) ;
373
+ packageUtil . log ( '** - You must have ' + arch + ' Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig' ) ;
374
+ packageUtil . log ( '** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from ' ) ;
375
+ packageUtil . log ( '** ' + clientUrl ) ;
382
376
} else if ( process . platform === 'darwin' ) {
383
377
clientUrl = 'http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html' ;
384
378
385
- console . log ( '** - You need to have the Oracle Instant Client Basic or Basic Light package in ~/lib or /usr/local/lib' ) ;
386
- console . log ( '** Download from ' + clientUrl ) ;
379
+ packageUtil . log ( '** - You need to have the Oracle Instant Client Basic or Basic Light package in ~/lib or /usr/local/lib' ) ;
380
+ packageUtil . log ( '** Download from ' + clientUrl ) ;
387
381
} else if ( process . platform === 'win32' ) {
388
382
if ( process . arch === 'x64' ) {
389
383
clientUrl = 'http://www.oracle.com/technetwork/topics/winx64soft-089540.html' ;
390
384
} else {
391
385
clientUrl = 'http://www.oracle.com/technetwork/topics/winsoft-085727.html' ;
392
386
}
393
387
394
- console . log ( '** - You must have ' + arch + ' Oracle client libraries in your PATH environment variable' ) ;
395
- console . log ( '** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from' ) ;
396
- console . log ( '** ' + clientUrl ) ;
397
- console . log ( '** - A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available' ) ;
398
- console . log ( '** Check ' + installUrl + ' for details' ) ;
388
+ packageUtil . log ( '** - You must have ' + arch + ' Oracle client libraries in your PATH environment variable' ) ;
389
+ packageUtil . log ( '** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from' ) ;
390
+ packageUtil . log ( '** ' + clientUrl ) ;
391
+ packageUtil . log ( '** - A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available' ) ;
392
+ packageUtil . log ( '** Check ' + installUrl + ' for details' ) ;
399
393
} else {
400
394
clientUrl = 'http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html' ;
401
395
402
- console . log ( '** - You must have ' + arch + ' Oracle client libraries in your operating system library search path' ) ;
403
- console . log ( '** - If you do not already have libraries, install an Instant Client Basic or Basic Light package from: ' ) ;
404
- console . log ( '** ' + clientUrl ) ;
396
+ packageUtil . log ( '** - You must have ' + arch + ' Oracle client libraries in your operating system library search path' ) ;
397
+ packageUtil . log ( '** - If you do not already have libraries, install an Instant Client Basic or Basic Light package from: ' ) ;
398
+ packageUtil . log ( '** ' + clientUrl ) ;
405
399
}
406
400
407
- console . log ( '**' ) ;
408
- console . log ( '** Node-oracledb installation instructions: ' + installUrl ) ;
409
- console . log ( '********************************************************************************\n' ) ;
401
+ packageUtil . log ( '**' ) ;
402
+ packageUtil . log ( '** Node-oracledb installation instructions: ' + installUrl ) ;
403
+ packageUtil . log ( '********************************************************************************\n' ) ;
410
404
}
411
405
}
412
406
0 commit comments