From 87b06748933051c5e617bb0b5a8303a558a2c61f Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 14:48:33 +0800 Subject: [PATCH 01/11] doc: add copy node executable guide on windows --- doc/api/single-executable-applications.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 487c43264b424f..648848665e8c73 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -43,9 +43,20 @@ tool, [postject][]: ``` 4. Create a copy of the `node` executable and name it according to your needs: + + * On systems other than Windows: + ```console $ cp $(command -v node) hello ``` + + * On Windows with powershell: + + ```console + $ cp (Get-Command node).source hello.exe + ``` + + Note that `.exe` extension is necessary. 5. Remove the signature of the binary (macOS and Windows only): From ad5bfb976536693ef88f1a90535418515ee5047e Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 15:49:18 +0800 Subject: [PATCH 02/11] doc: fix powershell typo --- doc/api/single-executable-applications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 648848665e8c73..c3ef86fa7cef9d 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -50,7 +50,7 @@ tool, [postject][]: $ cp $(command -v node) hello ``` - * On Windows with powershell: + * On Windows with PowerShell: ```console $ cp (Get-Command node).source hello.exe From 72ca06750cdbe44d24ad5317770f81734fccbb37 Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 15:56:21 +0800 Subject: [PATCH 03/11] doc: fix related hello.exe in commands of sea doc --- doc/api/single-executable-applications.md | 24 +++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index c3ef86fa7cef9d..0d1976e6439fd6 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -72,13 +72,13 @@ tool, [postject][]: skipped, ignore any signature-related warning from postject. ```console - $ signtool remove /s hello + $ signtool remove /s hello.exe ``` 6. Inject the blob into the copied binary by running `postject` with the following options: - * `hello` - The name of the copy of the `node` executable created in step 2. + * `hello` / `hello.exe` - The name of the copy of the `node` executable created in step 2. * `NODE_SEA_BLOB` - The name of the resource / note / section in the binary where the contents of the blob will be stored. * `sea-prep.blob` - The name of the blob created in step 1. @@ -90,12 +90,18 @@ tool, [postject][]: To summarize, here is the required command for each platform: - * On systems other than macOS: + * On Linux: ```console $ npx postject hello NODE_SEA_BLOB sea-prep.blob \ --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 ``` + * On Windows: + ```console + $ npx postject hello.exe NODE_SEA_BLOB sea-prep.blob \ + --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 + ``` + * On macOS: ```console $ npx postject hello NODE_SEA_BLOB sea-prep.blob \ @@ -117,15 +123,25 @@ tool, [postject][]: binary would still be runnable. ```console - $ signtool sign /fd SHA256 hello + $ signtool sign /fd SHA256 hello.exe ``` 8. Run the binary: + + * On systems other than Windows + ```console $ ./hello world Hello, world! ``` + * On Windows + + ```console + $ .\hello.exe world + Hello, world! + ``` + ## Generating single executable preparation blobs Single executable preparation blobs that are injected into the application can From 6c51f8177c3242ad0d8c3d8803bbf20b52663fdb Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 15:57:08 +0800 Subject: [PATCH 04/11] doc: fix copy executable step reference --- doc/api/single-executable-applications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 0d1976e6439fd6..4affa8a358ba29 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -78,7 +78,7 @@ tool, [postject][]: 6. Inject the blob into the copied binary by running `postject` with the following options: - * `hello` / `hello.exe` - The name of the copy of the `node` executable created in step 2. + * `hello` / `hello.exe` - The name of the copy of the `node` executable created in step 4. * `NODE_SEA_BLOB` - The name of the resource / note / section in the binary where the contents of the blob will be stored. * `sea-prep.blob` - The name of the blob created in step 1. From b7fc5bb1b91d9b9c4936710d6d680eb087de2347 Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 15:58:33 +0800 Subject: [PATCH 05/11] doc: remove extra space --- doc/api/single-executable-applications.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 4affa8a358ba29..b5c55342213c0d 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -43,19 +43,19 @@ tool, [postject][]: ``` 4. Create a copy of the `node` executable and name it according to your needs: - + * On systems other than Windows: ```console $ cp $(command -v node) hello ``` - + * On Windows with PowerShell: ```console $ cp (Get-Command node).source hello.exe ``` - + Note that `.exe` extension is necessary. 5. Remove the signature of the binary (macOS and Windows only): From b6ec1c7322d441e2e67dd3fca6963ee7972ae61d Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 16:22:19 +0800 Subject: [PATCH 06/11] doc: splite long lines --- doc/api/single-executable-applications.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index b5c55342213c0d..716896abc30ed0 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -78,7 +78,8 @@ tool, [postject][]: 6. Inject the blob into the copied binary by running `postject` with the following options: - * `hello` / `hello.exe` - The name of the copy of the `node` executable created in step 4. + * `hello` / `hello.exe` - The name of the copy of the `node` executable + created in step 4. * `NODE_SEA_BLOB` - The name of the resource / note / section in the binary where the contents of the blob will be stored. * `sea-prep.blob` - The name of the blob created in step 1. From c4114a058bc2aac6092c7293accda36f61693985 Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 16:24:13 +0800 Subject: [PATCH 07/11] doc: remove note that --- doc/api/single-executable-applications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 716896abc30ed0..38d9403263f736 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -56,7 +56,7 @@ tool, [postject][]: $ cp (Get-Command node).source hello.exe ``` - Note that `.exe` extension is necessary. + The `.exe` extension is necessary. 5. Remove the signature of the binary (macOS and Windows only): From d2795c298e7492395d5820e573692df34698cc7f Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 22 Apr 2023 17:16:51 +0800 Subject: [PATCH 08/11] doc: fix ApplicationInfo.Source property Co-authored-by: Mohammed Keyvanzadeh --- doc/api/single-executable-applications.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 38d9403263f736..9c378fb374470e 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -53,7 +53,7 @@ tool, [postject][]: * On Windows with PowerShell: ```console - $ cp (Get-Command node).source hello.exe + $ cp (Get-Command node).Source hello.exe ``` The `.exe` extension is necessary. From 642312d01e45962013ac0d7dbc0bf98197d798d5 Mon Sep 17 00:00:00 2001 From: XLor Date: Wed, 26 Apr 2023 20:35:17 +0800 Subject: [PATCH 09/11] doc: add copy node windows cmd command --- doc/api/single-executable-applications.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 9c378fb374470e..ac3768de5188db 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -50,11 +50,19 @@ tool, [postject][]: $ cp $(command -v node) hello ``` - * On Windows with PowerShell: + * On Windows: + + Using PowerShell: ```console $ cp (Get-Command node).Source hello.exe ``` + + Using CMD: + + ```console + for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe) + ``` The `.exe` extension is necessary. From 08d03cd7930904808529a4fbc5baa39f3553c434 Mon Sep 17 00:00:00 2001 From: XLor Date: Wed, 26 Apr 2023 23:01:58 +0800 Subject: [PATCH 10/11] doc: fix extra space lint error --- doc/api/single-executable-applications.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index ac3768de5188db..209306569d7e67 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -57,9 +57,9 @@ tool, [postject][]: ```console $ cp (Get-Command node).Source hello.exe ``` - + Using CMD: - + ```console for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe) ``` From 904b818c016a5b544937c83da9cf1b3313b081d0 Mon Sep 17 00:00:00 2001 From: XLor Date: Sat, 29 Apr 2023 22:49:01 +0800 Subject: [PATCH 11/11] doc: rename with command prompt Co-authored-by: Mohammed Keyvanzadeh --- doc/api/single-executable-applications.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index 209306569d7e67..46c3c8e87afe95 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -58,10 +58,10 @@ tool, [postject][]: $ cp (Get-Command node).Source hello.exe ``` - Using CMD: + Using Command Prompt: ```console - for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe) + $ for /F "tokens=*" %n IN ('where.exe node') DO @(copy "%n" hello.exe) ``` The `.exe` extension is necessary.