@@ -26,42 +26,42 @@ Here are the steps for creating a single executable application using one such
26
26
tool, [ postject] [ ] :
27
27
28
28
1 . Create a JavaScript file:
29
- ``` console
30
- $ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js
29
+ ``` bash
30
+ echo ' console.log(`Hello, ${process.argv[2]}!`);' > hello.js
31
31
```
32
32
33
33
2 . Create a configuration file building a blob that can be injected into the
34
34
single executable application (see
35
35
[ Generating single executable preparation blobs] [ ] for details):
36
- ``` console
37
- $ echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json
36
+ ``` bash
37
+ echo ' { "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json
38
38
```
39
39
40
40
3 . Generate the blob to be injected:
41
- ``` console
42
- $ node --experimental-sea-config sea-config.json
41
+ ``` bash
42
+ node --experimental-sea-config sea-config.json
43
43
```
44
44
45
45
4 . Create a copy of the ` node ` executable and name it according to your needs:
46
46
47
47
* On systems other than Windows:
48
48
49
- ``` console
50
- $ cp $(command -v node) hello
49
+ ``` bash
50
+ cp $( command -v node) hello
51
51
```
52
52
53
53
* On Windows:
54
54
55
55
Using PowerShell:
56
56
57
- ``` console
58
- $ cp (Get-Command node).Source hello.exe
57
+ ``` bash
58
+ cp (Get-Command node).Source hello.exe
59
59
```
60
60
61
61
Using Command Prompt:
62
62
63
- ``` console
64
- $ for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe)
63
+ ``` bash
64
+ for /F " tokens=*" %n IN (' where.exe node' ) DO @ (copy " %n" hello.exe)
65
65
```
66
66
67
67
The ` .exe ` extension is necessary.
@@ -70,17 +70,17 @@ tool, [postject][]:
70
70
71
71
* On macOS:
72
72
73
- ``` console
74
- $ codesign --remove-signature hello
73
+ ``` bash
74
+ codesign --remove-signature hello
75
75
```
76
76
77
77
* On Windows (optional):
78
78
79
79
[ signtool] [ ] can be used from the installed [ Windows SDK] [ ] . If this step is
80
80
skipped, ignore any signature-related warning from postject.
81
81
82
- ``` console
83
- $ signtool remove /s hello.exe
82
+ ``` bash
83
+ signtool remove /s hello.exe
84
84
```
85
85
86
86
6 . Inject the blob into the copied binary by running ` postject ` with
@@ -100,20 +100,20 @@ tool, [postject][]:
100
100
To summarize, here is the required command for each platform:
101
101
102
102
* On Linux:
103
- ``` console
104
- $ npx postject hello NODE_SEA_BLOB sea-prep.blob \
103
+ ``` bash
104
+ npx postject hello NODE_SEA_BLOB sea-prep.blob \
105
105
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
106
106
```
107
107
108
108
* On Windows:
109
- ```console
110
- $ npx postject hello.exe NODE_SEA_BLOB sea-prep.blob \
109
+ ` ` ` bash
110
+ npx postject hello.exe NODE_SEA_BLOB sea-prep.blob \
111
111
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
112
112
` ` `
113
113
114
114
* On macOS:
115
- ```console
116
- $ npx postject hello NODE_SEA_BLOB sea-prep.blob \
115
+ ` ` ` bash
116
+ npx postject hello NODE_SEA_BLOB sea-prep.blob \
117
117
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
118
118
--macho-segment-name NODE_SEA
119
119
` ` `
@@ -122,17 +122,17 @@ tool, [postject][]:
122
122
123
123
* On macOS:
124
124
125
- ```console
126
- $ codesign --sign - hello
125
+ ` ` ` bash
126
+ codesign --sign - hello
127
127
` ` `
128
128
129
129
* On Windows (optional):
130
130
131
131
A certificate needs to be present for this to work. However, the unsigned
132
132
binary would still be runnable.
133
133
134
- ``` console
135
- $ signtool sign /fd SHA256 hello.exe
134
+ ` ` ` bash
135
+ signtool sign /fd SHA256 hello.exe
136
136
` ` `
137
137
138
138
8. Run the binary:
0 commit comments