seabox 0.1.0-beta.2 → 0.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/bin/seabox.js +1 -1
- package/lib/build.js +1 -1
- package/lib/config.js +1 -0
- package/lib/inject.js +35 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -69,6 +69,7 @@ Add a `sea` configuration to your `package.json`:
|
|
|
69
69
|
- **encryptAssets**: Enable encryption for assets (default: false)
|
|
70
70
|
- **encryptExclude**: Patterns to exclude from encryption (e.g., `['*.txt']`)
|
|
71
71
|
- **rebuild**: Automatically rebuild native modules for the target platform before building the SEA (default: false)
|
|
72
|
+
- **rcedit**: (Windows only) Customize executable icon and version information. See [rcedit options](#windows-executable-customization-rcedit)
|
|
72
73
|
- **cacheLocation**: Custom cache directory for extracted binaries (default: `'./.sea-cache'`). Supports environment variable expansion (e.g., `'%LOCALAPPDATA%\\myapp-cache'` on Windows or `'$HOME/.cache/myapp'` on Unix)
|
|
73
74
|
|
|
74
75
|
## Usage
|
|
@@ -188,6 +189,52 @@ The rebuilder will:
|
|
|
188
189
|
|
|
189
190
|
**Note**: Cross-compilation may require additional platform-specific build tools installed.
|
|
190
191
|
|
|
192
|
+
## Windows Executable Customization (rcedit)
|
|
193
|
+
|
|
194
|
+
For Windows executables, you can customize the icon and version information using the `rcedit` configuration option:
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{
|
|
198
|
+
"sea": {
|
|
199
|
+
"output": "myapp.exe",
|
|
200
|
+
"targets": ["node24.11.0-win32-x64"],
|
|
201
|
+
"rcedit": {
|
|
202
|
+
"icon": ".\\assets\\myapp.ico",
|
|
203
|
+
"file-version": "1.2.3.4",
|
|
204
|
+
"product-version": "1.2.3.4",
|
|
205
|
+
"version-string": {
|
|
206
|
+
"CompanyName": "My Company",
|
|
207
|
+
"FileDescription": "My Application",
|
|
208
|
+
"ProductName": "MyApp",
|
|
209
|
+
"InternalName": "myapp.exe",
|
|
210
|
+
"OriginalFilename": "myapp.exe",
|
|
211
|
+
"LegalCopyright": "Copyright (C) 2025 My Company"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### rcedit Options
|
|
219
|
+
|
|
220
|
+
- **icon**: Path to `.ico` file for the executable icon
|
|
221
|
+
- **file-version**: File version in `X.X.X.X` format
|
|
222
|
+
- **product-version**: Product version in `X.X.X.X` format
|
|
223
|
+
- **version-string**: Object containing version string properties:
|
|
224
|
+
- `CompanyName`: Company name
|
|
225
|
+
- `FileDescription`: Description of the file
|
|
226
|
+
- `ProductName`: Product name
|
|
227
|
+
- `InternalName`: Internal name
|
|
228
|
+
- `OriginalFilename`: Original filename
|
|
229
|
+
- `LegalCopyright`: Copyright notice
|
|
230
|
+
- `LegalTrademarks`: Trademark information (optional)
|
|
231
|
+
- `PrivateBuild`: Private build description (optional)
|
|
232
|
+
- `SpecialBuild`: Special build description (optional)
|
|
233
|
+
|
|
234
|
+
The rcedit step runs after signature removal and before the SEA blob injection. This only works for Windows (`win32`) targets.
|
|
235
|
+
|
|
236
|
+
For more details, see the [rcedit documentation](https://github.com/electron/rcedit).
|
|
237
|
+
|
|
191
238
|
## Asset Encryption
|
|
192
239
|
|
|
193
240
|
seabox supports optional AES-256-GCM encryption of embedded assets to protect your application code and data:
|
package/bin/seabox.js
CHANGED
package/lib/build.js
CHANGED
|
@@ -249,7 +249,7 @@ const SEA_ENCRYPTED_ASSETS = new Set(${encryptedKeysJson});
|
|
|
249
249
|
|
|
250
250
|
if (verbose) console.log('\n[8/8] Injecting SEA blob into Node binary');
|
|
251
251
|
const outputExe = path.join(projectRoot, config.outputPath, config.output);
|
|
252
|
-
await injectBlob(nodeBinary, blobOutputPath, outputExe, platform, verbose);
|
|
252
|
+
await injectBlob(nodeBinary, blobOutputPath, outputExe, platform, verbose, config.rcedit);
|
|
253
253
|
|
|
254
254
|
if (!debug) {
|
|
255
255
|
if (verbose) console.log('\nCleaning up temporary files');
|
package/lib/config.js
CHANGED
|
@@ -23,6 +23,7 @@ const path = require('path');
|
|
|
23
23
|
* @property {boolean} [rebuild] - Automatically rebuild native modules for target platform (default: false)
|
|
24
24
|
* @property {boolean} [verbose] - Enable diagnostic logging
|
|
25
25
|
* @property {string} [cacheLocation] - Cache directory for extracted binaries (default: './.sea-cache', supports env vars like '%LOCALAPPDATA%\\path')
|
|
26
|
+
* @property {Object} [rcedit] - Windows executable resource editor options (icon, version info, etc.)
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
/**
|
package/lib/inject.js
CHANGED
|
@@ -17,9 +17,11 @@ const execFileAsync = promisify(execFile);
|
|
|
17
17
|
* @param {string} blobPath - Path to the SEA blob file
|
|
18
18
|
* @param {string} outputPath - Path for the output executable
|
|
19
19
|
* @param {string} platform - Target platform (win32, linux, darwin)
|
|
20
|
+
* @param {boolean} verbose - Enable verbose logging
|
|
21
|
+
* @param {Object} [rceditOptions] - Optional rcedit configuration for Windows executables
|
|
20
22
|
* @returns {Promise<void>}
|
|
21
23
|
*/
|
|
22
|
-
async function injectBlob(nodeBinaryPath, blobPath, outputPath, platform, verbose) {
|
|
24
|
+
async function injectBlob(nodeBinaryPath, blobPath, outputPath, platform, verbose, rceditOptions) {
|
|
23
25
|
// Copy node binary to output location
|
|
24
26
|
fs.copyFileSync(nodeBinaryPath, outputPath);
|
|
25
27
|
|
|
@@ -27,6 +29,11 @@ async function injectBlob(nodeBinaryPath, blobPath, outputPath, platform, verbos
|
|
|
27
29
|
// The downloaded Node.js binary is signed, and postject will corrupt this signature
|
|
28
30
|
await removeSignature(outputPath, platform);
|
|
29
31
|
|
|
32
|
+
// Apply rcedit changes (Windows only, before postject)
|
|
33
|
+
if (platform === 'win32' && rceditOptions && typeof rceditOptions === 'object') {
|
|
34
|
+
await applyRcedit(outputPath, rceditOptions, verbose);
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
// Prepare postject command
|
|
31
38
|
const sentinel = 'NODE_SEA_BLOB';
|
|
32
39
|
const sentinelFuse = 'NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2';
|
|
@@ -66,6 +73,31 @@ async function injectBlob(nodeBinaryPath, blobPath, outputPath, platform, verbos
|
|
|
66
73
|
//console.log('\nNote: Executable is now ready for signing with your certificate');
|
|
67
74
|
}
|
|
68
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Apply rcedit to modify Windows executable resources.
|
|
78
|
+
* @param {string} exePath - Path to the executable
|
|
79
|
+
* @param {Object} options - rcedit options (icon, version-string, file-version, product-version, etc.)
|
|
80
|
+
* @param {boolean} verbose - Enable verbose logging
|
|
81
|
+
* @returns {Promise<void>}
|
|
82
|
+
*/
|
|
83
|
+
async function applyRcedit(exePath, options, verbose) {
|
|
84
|
+
if (verbose) {
|
|
85
|
+
console.log('\nApplying rcedit to modify executable resources...');
|
|
86
|
+
console.log('Options:', JSON.stringify(options, null, 2));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const rcedit = require('rcedit');
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
await rcedit(exePath, options);
|
|
93
|
+
if (verbose) {
|
|
94
|
+
console.log('✓ rcedit applied successfully');
|
|
95
|
+
}
|
|
96
|
+
} catch (error) {
|
|
97
|
+
throw new Error(`rcedit failed: ${error.message}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
69
101
|
/**
|
|
70
102
|
* Resolve the postject executable path.
|
|
71
103
|
* @returns {string}
|
|
@@ -77,5 +109,6 @@ function resolvePostject() {
|
|
|
77
109
|
|
|
78
110
|
module.exports = {
|
|
79
111
|
injectBlob,
|
|
80
|
-
resolvePostject
|
|
112
|
+
resolvePostject,
|
|
113
|
+
applyRcedit
|
|
81
114
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "seabox",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.3",
|
|
4
4
|
"description": "Node.js Single Executable Application (SEA) builder tool with native and library extraction",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"adm-zip": "^0.5.16",
|
|
38
38
|
"glob": "^10.0.0",
|
|
39
39
|
"postject": "^1.0.0-alpha.6",
|
|
40
|
+
"rcedit": "^4.0.1",
|
|
40
41
|
"tar": "^6.2.1"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|