Hi Stefan,
in attachment a small project for demonstrating the use of ScriptCommunicator as Runtime for complex multithreading applications.
Kindest Regards,
Pier Andrea.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The idea is to put Scriptcommunicator inside a folder called Runtime (in the example).. Then I've created a small Wrapper application that uses its name (without .exe under Windows) for looking at the right folder and launching all .JS files inside. You can use sub-folders for extra .js include files.
#include<QProcess>#include<QDir>intmain(intargc,char*argv[]){QObject*parent;QStringprogram="./Runtime/ScriptCommunicator.exe";QStringname=QString("%1").arg(argv[0]).section('\\',-1);QStringdirName="./"+name.left(name.lastIndexOf("."))+"/";QDirdir(dirName);if(!dir.exists())return1;QStringListfilters;filters<<"*.js";QStringListarguments;//arguments << "-withScriptWindow"; // for debugging purposesarguments<<dir.entryList(filters,QDir::Files);QProcess*myProcess=newQProcess(parent);myProcess->setWorkingDirectory(dirName);myProcess->start(program,arguments);}
Under Windows 7 it works very well.
Without recompiling the Launcher it is possible to make extra "applications" just renaming it and creating a folder with the right name (the renamed exe name without the extension).
In this manner ScriptCommunicator is also a runtime for portable applications.
I do know if it is useful and how to port to other platforms (MAC, LINUX), but the code is available.
Kindest regards,
Pier Andrea.
If your fileName is "FileName.exe" then the "release" directory is "FileName".
If you change the directory name into "FileNameDebug" (or create another directory with this name) then the scripts will be launched from this directory and the ScriptWindow wll be opened (for debug purpose).
In this way is very simple to launch and debug multiscript applications ready to deploy.
Kindest regards,
Pier Andrea.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
but then you have to copy the scripts or rename the directory. Wouldn't it be better if you create a file with all command-line options for ScriptCommunicator (maybe they will be increase in the future).
Best regards,
Stefan
Last edit: Stefan Zieker 2016-01-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Stefan,
yes this may be an alternative solution.
Kindest regards,
Pier Andrea.
ps: the idea is to have a simple runtime version of SC in the tree of another "app". A lot of distributable system have their own runtime engine that is a simplified (strippen-down) version of the main app.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "User Contributions" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hi Stefan,
in attachment a small project for demonstrating the use of ScriptCommunicator as Runtime for complex multithreading applications.
Kindest Regards,
Pier Andrea.
View and moderate all "User Contributions" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
The idea is to put Scriptcommunicator inside a folder called Runtime (in the example).. Then I've created a small Wrapper application that uses its name (without .exe under Windows) for looking at the right folder and launching all .JS files inside. You can use sub-folders for extra .js include files.
Under Windows 7 it works very well.
Without recompiling the Launcher it is possible to make extra "applications" just renaming it and creating a folder with the right name (the renamed exe name without the extension).
In this manner ScriptCommunicator is also a runtime for portable applications.
I do know if it is useful and how to port to other platforms (MAC, LINUX), but the code is available.
Kindest regards,
Pier Andrea.
Last edit: Anonymous 2016-01-16
Hi Pier,
simple and useful. Thx for sharing this.
PS: I have made a new post here: https://sourceforge.net/p/scriptcommunicator/discussion/usercontributions/thread/44346da9/.
Best regards,
Stefan
Last edit: Stefan Zieker 2016-01-17
View and moderate all "User Contributions" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hi Stefan,
a small improvement in the source code for simple switching between "debug" and "release" with the help of the launcher:
If your fileName is "FileName.exe" then the "release" directory is "FileName".
If you change the directory name into "FileNameDebug" (or create another directory with this name) then the scripts will be launched from this directory and the ScriptWindow wll be opened (for debug purpose).
In this way is very simple to launch and debug multiscript applications ready to deploy.
Kindest regards,
Pier Andrea.
Hi Pier,
but then you have to copy the scripts or rename the directory. Wouldn't it be better if you create a file with all command-line options for ScriptCommunicator (maybe they will be increase in the future).
Best regards,
Stefan
Last edit: Stefan Zieker 2016-01-18
View and moderate all "User Contributions" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hi Stefan,
yes this may be an alternative solution.
Kindest regards,
Pier Andrea.
ps: the idea is to have a simple runtime version of SC in the tree of another "app". A lot of distributable system have their own runtime engine that is a simplified (strippen-down) version of the main app.