Closed ahghygy closed 3 years ago
The easiest way is to just copy the js file into the same folder as the exe. When you run the exe, it will try to use the js files from the local path before using the one that is compressed.
After you make the changes you want, to compress it and add it back to the agent, just run the following command, with the updated js in the local path.
MeshAgent -exec "require('clipboard').nativeAddCompressedModule('agent-installer.js');process.exit();"
Then load up ILibDuktape_Polyfills.js in a text editor, and highlight the line to be changed, and paste.... (The previous command generates the whole C command and puts it into the clipboard. If you are doing this from linux, get rid of the process.exit();
from the previous command, because on linux the clipboard can only paste while the process that owns the buffer is alive.
Thank you very much. you really give me a quickly feedback, So a nother questions is when MeshService64.exe is update in mesh central, the previous client machines how to get the latest MeshService64.exe? I have stop mesh central, Then restart mesh central, I find all windows client machines have already get the lastest MeshService64.exe, But this method is not I want. Becasue it is need to stop mesh central,then start mesh central.
I don't want to stop mesh central, I want the mesh central can push the latest version of agent servie to all client machines without stop mesh central. Thansk again.
Hi Krayon007, When I copy the agent-installer.js into MeshService64.exe same folder, that is work for me , my self log is print. But I do not understand your second methond
where to exec the following command? MeshAgent -exec "require('clipboard').nativeAddCompressedModule('agent-installer.js');process.exit();"
becasue I fiand MeshService64.exe only have the following parameter
could you give me a step by step instruction"
The -exec
switch isn't shown in the --help
list, as it's mostly for debugging purposes.
You can run the command like the following:
MeshAgent -exec "require('clipboard').nativeAddCompressedModule('agent-installer');process.exit();"
The file you'll be editing is: MeshAgent/microscript/ILibDuktape_Polyfills.c
You can search for agent-installer
, as you'll be pasting/replacing with what the previous command puts in the clipboard.
When you run the command to compress the module, make sure the updated agent-installer.js file is in the same/current folder as the exe that you are running
Ok, thanks for you help. thanks again. I will have a try.
It is working now. thanks again. I will close it.
After modifying, agent-installer.js
I tried the following.
make linux ARCHID=6 DEBUG=1
chmod +x meshagent_x86-64
cp meshagent_x86-64 modules/
cd modules/
./meshagent_x86-64 -exec "require('clipboard').nativeAddCompressedModule('agent-installer');process.exit();"
Let me fetch the instructions for you. I recently made some changes to make it easier to update these files. I'll verify the instructions on Linux as well.
Yes. Please. That would be great.
I'm linking #167 since it's still open, and appears to be asking the same thing
Hi guys,
I find agent-installer.js is encryption in ILibDuktape_Polyfills.c
// agent-instaler: Refer to modules/agent-installer.js duk_peval_string_noresult(ctx, "addCompressedModule('agent-installer', Buffer.from('eJzdPWtT47iW36niP6ipuzdOd0igZ6q3LmzmFg3............QQbfFwZAwTRp8xYIB+JpV48j/D+W9YTI=', 'base64'));");
When I add a debug code in agent-installer.js in installService function, then rebuild MeshAgent.sln project process.stdout.write('This is test info');
my log is not output. So I want to know how to let agent-installer.js to the following contet 'eJzdPWtT47iW36niP6ipuzdOd0igZ6q3LmzmFg3............QQbfFwZAwTRp8xYIB+JpV48j/D+W9YTI=', 'base64'));