Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3befe5d

Browse filesBrowse files
yjl9903targos
authored andcommitted
doc: add copy node executable guide on windows
PR-URL: #47781 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
1 parent 326c3f1 commit 3befe5d
Copy full SHA for 3befe5d

File tree

Expand file treeCollapse file tree

1 file changed

+40
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+40
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/single-executable-applications.md‎

Copy file name to clipboardExpand all lines: doc/api/single-executable-applications.md
+40-4Lines changed: 40 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,29 @@ tool, [postject][]:
4343
```
4444

4545
4. Create a copy of the `node` executable and name it according to your needs:
46+
47+
* On systems other than Windows:
48+
4649
```console
4750
$ cp $(command -v node) hello
4851
```
4952

53+
* On Windows:
54+
55+
Using PowerShell:
56+
57+
```console
58+
$ cp (Get-Command node).Source hello.exe
59+
```
60+
61+
Using Command Prompt:
62+
63+
```console
64+
$ for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe)
65+
```
66+
67+
The `.exe` extension is necessary.
68+
5069
5. Remove the signature of the binary (macOS and Windows only):
5170

5271
* On macOS:
@@ -61,13 +80,14 @@ tool, [postject][]:
6180
skipped, ignore any signature-related warning from postject.
6281

6382
```console
64-
$ signtool remove /s hello
83+
$ signtool remove /s hello.exe
6584
```
6685

6786
6. Inject the blob into the copied binary by running `postject` with
6887
the following options:
6988

70-
* `hello` - The name of the copy of the `node` executable created in step 2.
89+
* `hello` / `hello.exe` - The name of the copy of the `node` executable
90+
created in step 4.
7191
* `NODE_SEA_BLOB` - The name of the resource / note / section in the binary
7292
where the contents of the blob will be stored.
7393
* `sea-prep.blob` - The name of the blob created in step 1.
@@ -79,12 +99,18 @@ tool, [postject][]:
7999

80100
To summarize, here is the required command for each platform:
81101

82-
* On systems other than macOS:
102+
* On Linux:
83103
```console
84104
$ npx postject hello NODE_SEA_BLOB sea-prep.blob \
85105
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
86106
```
87107

108+
* On Windows:
109+
```console
110+
$ npx postject hello.exe NODE_SEA_BLOB sea-prep.blob \
111+
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
112+
```
113+
88114
* On macOS:
89115
```console
90116
$ npx postject hello NODE_SEA_BLOB sea-prep.blob \
@@ -106,15 +132,25 @@ tool, [postject][]:
106132
binary would still be runnable.
107133

108134
```console
109-
$ signtool sign /fd SHA256 hello
135+
$ signtool sign /fd SHA256 hello.exe
110136
```
111137

112138
8. Run the binary:
139+
140+
* On systems other than Windows
141+
113142
```console
114143
$ ./hello world
115144
Hello, world!
116145
```
117146

147+
* On Windows
148+
149+
```console
150+
$ .\hello.exe world
151+
Hello, world!
152+
```
153+
118154
## Generating single executable preparation blobs
119155

120156
Single executable preparation blobs that are injected into the application can

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.