Topic: Request: System,Load - Parameters  (Read 577 times)

0 Members and 1 Guest are viewing this topic.

Request: System,Load - Parameters
« on: December 16, 2017, 04:38:21 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
Hi ied206,


*
It means if a plugin file is modified on-the-fly on build, PEBakery cannot recognize the change.
Is there any plugin uses modify-on-the-fly pattern in SE?
If not, PEBakery can use memory-cached plugins safety with very fast speed.

There are some rare cases......


It is easy to update such plugins for PEBakery following your active development.  :wink:

Remember Reply 2:
http://theoven.org/index.php?topic=2271.msg24579#msg24579

We need a new PEBakery command
I feel
System,Load

ex:
System,Load,%ProjectDir%\Downloads
System,Load,%ProjectDir%\blabla.script

so when a plugin changes other plugin etc. , we can add line:
Code: [Select]
If,ExistVar,%EngineVersion%,System,Load,%ProjectDir%\blabla.script
or when we add a new plugin to project we can add same line
ex:
\Downloads\ComponentsY\PXE Support - Plugin Download
after Line 77 :
Code: [Select]
If,ExistVar,%EngineVersion%,System,Load,%BaseDir%\Projects\Yomi\ComponentsY\0_PXESupport.script
If,ExistVar,%EngineVersion%,System,Load,%ProjectDir%\ComponentsY\0_PXESupport.Link

or when we add a new set of plugins to a folder we can use:
Code: [Select]
System,Load,%ProjectDir%\Downloads


Definition:
System,Load --> load/remove/reload plugin(s) to project tree (+cache)
-->
So shortly, it is a command to load/remove/reload things to database (memory, sql etc.)

===> This way "memory plugin caching" always enabled with PEBakery  :wink:

--->
for all cases, it is faster than wb System,RESCANSCRIPTS which scans all projects folder  :wink:

ps:
Such command is something we miss due to closed source ended development with wb  :wink:

To get download and upload buttons work, we need a command on PEBakery to update a plugin on PEBakery database.
Ex:
Green download button on plugins will fail to work on PEBakery.

Also it will be faster do update \Downloads\ by Refreshing only \Downloads\ folder instead of Refresh ALL Projects.

And it will be faster to update single project
Ex:
Update Win10PESE (Exact and Secure)
Better PEBakery reloads only Win10PESE folder after update.
(currently refresh folders of all projects... including personal plugins \MyPlugins_Direct\ )

:turtle:


edit:
after reply 2 3 4 changed title and post with System,Load
« Last Edit: December 16, 2017, 07:21:37 PM by Lancelot »

Re: Request: System,ReScan - Parameters
« Reply #1 on: December 16, 2017, 09:18:16 AM »

Homes32

  • Code Baker
  • Chef
  • ***
  • Date Registered: Dec 2010
  • Posts: 147
This isn't a bad idea, however instead of adding yet another command I would have RESCANSCRIPTS accept an optional <folder> parameter.
Code: [Select]
System,RESCANSCRIPTS,%ProjectDir%\Downloads

Re: Request: System,ReScan - Parameters
« Reply #2 on: December 16, 2017, 01:43:28 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
PEBakery already has experimental System,Rescan command supporting update of one plugin.

Regarding name, how about just making System,Rescan as an alias of System,RescanScripts?
New behavior can be triggered with optional parameter (like Homes32 proposed).

Re: Request: System,ReScan - Parameters
« Reply #3 on: December 16, 2017, 03:01:15 PM »

Homes32

  • Code Baker
  • Chef
  • ***
  • Date Registered: Dec 2010
  • Posts: 147
Regarding name, how about just making System,Rescan as an alias of System,RescanScripts?

The main reason I don't like the sound of System,Rescan, is that its ambiguous in the fact that when looking at a plugin's code you have no idea what it is actually happening/scanning. At lest with Sytem,RescanScripts you can tell by looking at it what it is doing. I could live with it, I just think we could do better.

Another idea would be to have System,RescanScripts (or whatever we decide to call it) accept a file path  or a directory. That would give you the following options

Code: [Select]
// Rescan everything
System,RescanScripts
// Rescan only scripts under the specified directory
System,RescanScripts,C:\PEBakery\Win10PE\Apps
// Rescan a single script
System,RescanScripts,C:\PEBakery\Win10PE\Apps\BlueScreenView.script
// Rescan only the running script - not that that would be particularly useful to rescan the running script, but Rescan should accept a variable....
System,RescanScripts,%ScriptFile%
« Last Edit: December 16, 2017, 04:07:28 PM by Homes32 »

Re: Request: System,ReScan - Parameters
« Reply #4 on: December 16, 2017, 03:43:17 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
Another idea would be to have System,RescanScripts (or whatever we decide to call it) accept a file path  or a directory. That would give you the following options
It is the all idea of current topic and initial post Lancelot on 2017-11-18, 17:13:24

Anyway, thanks for re writing.

*
well thinking again, no need "Re" prefix.
Since command will also be used to add new plugins.
And no need "script" anymore.

Since there is agreement about syntax, but only discussion left is about name:

What about:
System,Load,
(reminding me my old Commodore 64 days  :lol: )
or
System,Add,
or
??????

*
Thanks ied206,
After syntax updated and time found, I will test experimental "System,Rescan" ....

Low time of the year.....
:turtle:

Re: Request: System,Load - Parameters
« Reply #5 on: December 21, 2017, 03:13:53 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
Hi ied206

From tests,I guess

System,RefreshInterface

also reloads plugin files now ?

I mean :
"System,RefreshInterface" = "Refresh Plugin button"
Is it correct ?

:turtle:

Re: Request: System,ReScan - Parameters
« Reply #6 on: December 21, 2017, 03:22:54 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
PEBakery already has experimental System,Rescan command supporting update of one plugin.

Here is test :
Code: [Select]
[Process]
Call,CreatePlugin,"%BaseDir%\Projects\Win10PESE\Apps\Test Plugin.script"
System,Rescan,"%BaseDir%\Projects\Win10PESE\Apps\Test Plugin.script"

I do not see new plugin on PEBakery GUI.

*
Another idea:
System,LoadFile,

:turtle:

Re: Request: System,Load - Parameters
« Reply #7 on: December 21, 2017, 05:13:16 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
Thinking more:

System,Load,
feels more accurate syntax name.

System,Load,<File>
System,Load,<Folder>
System,Load,ALL

->
3rd parameter ALL is same with Refresh button on PEBakery
I do not have plan put ALL to any plugin for build, but it is still good to have syntax at hand to get "Refresh button" via plugin.


Also:
System,RESCANSCRIPTS
will be deprecated from all plugins after we have System,Load

:turtle:

Re: Request: System,Load - Parameters
« Reply #8 on: December 21, 2017, 09:09:07 AM »

Homes32

  • Code Baker
  • Chef
  • ***
  • Date Registered: Dec 2010
  • Posts: 147
I do not have plan put ALL to any plugin for build, but it is still good to have syntax at hand to get "Refresh button" via plugin.

System,Refresh,<file>
System,Refresh,<folder>
System,Refresh,All

to keep with current/familiar "refresh" terminology could work as well.

Re: Request: System,Load - Parameters
« Reply #9 on: December 21, 2017, 02:12:14 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
I mean :
"System,RefreshInterface" = "Refresh Plugin button"
Is it correct ?

Yes, it does.

Re: Request: System,ReScan - Parameters
« Reply #10 on: December 21, 2017, 02:16:22 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
Here is test :
Code: [Select]
[Process]
Call,CreatePlugin,"%BaseDir%\Projects\Win10PESE\Apps\Test Plugin.script"
System,Rescan,"%BaseDir%\Projects\Win10PESE\Apps\Test Plugin.script"

I do not see new plugin on PEBakery GUI.
Current implementation only works on existing plugin (that is why it is called experimental).

System,Load,
feels more accurate syntax name.

System,Load,<File>
System,Load,<Folder>
System,Load,ALL
System,Refresh,<file>
System,Refresh,<folder>
System,Refresh,All

to keep with current/familiar "refresh" terminology could work as well.
I vote my opinion for System,Load, since new plugin can be added to plugin tree using this command.

Re: Request: System,ReScan - Parameters
« Reply #11 on: December 21, 2017, 02:33:08 PM »

Homes32

  • Code Baker
  • Chef
  • ***
  • Date Registered: Dec 2010
  • Posts: 147
I vote my opinion for System,Load, since new plugin can be added to plugin tree using this command.
:thumbsup:

Re: Request: System,Load - Parameters
« Reply #12 on: December 21, 2017, 04:20:26 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
 :thumbsup:

one more thing I forgot:

System,Load
without 2nd parameter , default current file.  :wink:

Edit:
Reasons behind:
1)
so there will not be accidental System,Load work like System,Load,All around.
1b)
New Plugin authors generally follow easiest path...
2)
and it will be simple syntax for a plugin to reload with System,Load when required.
ex:
Attach new file to plugin via encode or after iniwrite things inside plugin.

:turtle:
« Last Edit: December 21, 2017, 04:45:49 PM by Lancelot »

Re: Request: System,Load - Parameters
« Reply #13 on: December 23, 2017, 12:02:17 AM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
This is my final proposal before implemting.

If PEBakery use 'ALL' flag to refresh whole project, it can cause ambiguity.
Code: [Select]
System,Load,ALL
1) Refresh whole projects
2) Load a directgory named ALL.

Seperating commands can solve this issue.
Code: [Select]
- System,LoadAll
Alias of System,RescanScripts.

- System,Load,<Path>
Refresh/Load a directory or file, wildcard supported.
Without path, just reload current plugin.

Re: Request: System,Load - Parameters
« Reply #14 on: December 23, 2017, 12:19:04 AM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
It seems supporting wildcard can cause another ambiguity.
With wildcard, file/dir should be found recursive or not?

Code: [Select]
- System,LoadAll
Alias of System,RescanScripts.

- System,LoadFile,[Path],[NOREC]
Refresh/Load a file, wildcard supported.
Without path, just reload current plugin.

Ex) System,LoadFile,%BaseDir%\TestPlugin.script
Ex) System,LoadFile,%BaseDir%\Hello\*.script,NOREC

- System,LoadDir,<Path>,[NOREC]
Refresh/Load a directoy, wildcard supported.

Ex) System,LoadDir,%BaseDir%\Test
Ex) System,LoadDir,%BaseDir%\Hello,NOREC

Another question : In case of System,LoadDir, in which condition the file should be considered as plugin?
Traditionally only .script files are treated as plugin, but I had seen some .ini files are used as plugin in Macro Library.
If we are only to accept .script files, can System,LoadDir can be merged into System,LoadFile?

Re: Request: System,Load - Parameters
« Reply #15 on: December 23, 2017, 05:35:53 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
Hi ied206,

Good work  :great:

*
About ALL

This is my final proposal before implemting.

If PEBakery use 'ALL' flag to refresh whole project, it can cause ambiguity.
Code: [Select]
System,Load,ALL
1) Refresh whole projects
2) Load a directgory named ALL.

Separating commands can solve this issue.
[codebox]
- System,LoadAll
Alias of System,RescanScripts.

I guess you mean
System,Load,ALL
can go to a folder
System,Load,%BaseDir%\ALL
or
System,Load,%ScriptDir%\ALL
..
That is the reason I wrote ALL, since Path names can not be only ALL
ex: If,#2,Equal,ALL,......
and one can easily use
System,Load,%BaseDir%\ALL
or
System,Load,%ScriptDir%\ALL

Anyway, Sounds good System,LoadAll  :thumbsup:




*
Yes things missed from my eyes...

so, instead of folder support,
only file support with wildcard can solve syntax adjustments?
System,LoadFile,<Folder>\*.script,[NoRec]
no need hardcode .script . Flexibility good.

So In future we can have
System,LoadFile,%ProjectDir%\Folder\*.script
System,LoadFile,%ProjectDir%\Folder\*.blabla

I feel we will need such things with utf plugins.... (much later)

With wildcard, file/dir should be found recursive or not?
Default Recursive with wildcard looks good to me. It is the most used on such cases.




ps:
Maybe you can use a different name than NoRec on new syntax of PEBakery if it is easy to implement ?
ex: NoRecursive , NoSubFolder
If it sounds better to you following the idea of human-readable syntax. (people mostly complain time to time)




*
This remind me something else:
What about a new project added to Projects folder (after a download or zip exract etc.)

What you think:
System,LoadProject,%BaseDir%\Projects\Win50PESE\script.project

->
This way we have no limitation to ".script extension" and "script.project file name" for future ?
+
Also a project can be out of %BaseDir%\Projects\
ex:
System,LoadProject,D:\Development\script.project
System,LoadProject,D:\Development\script.project,*.script|*.blabla
->
which scans all 3rd parameter files under D:\Development\
( ps: there can not be filename with| on windows )

ps: We have small practice at Utils\Download Other Projects ->
Instead of ReScan plugins button, I can use System,LoadProject,.....

:turtle:

Re: Request: System,Load - Parameters
« Reply #16 on: December 23, 2017, 01:17:11 PM »

Homes32

  • Code Baker
  • Chef
  • ***
  • Date Registered: Dec 2010
  • Posts: 147
Separating commands can solve this issue.
Code: [Select]
- System,LoadAll
Alias of System,RescanScripts.

- System,Load,<Path>
Refresh/Load a directory or file, wildcard supported.
Without path, just reload current plugin.

I think we are overthinking this.

Why do we need a special load command for "LoadALL" when this could be easily done with just a single parameter containing a directory path?

We have the global %ScriptFile% variable that contains the full path of the running plugin, so we don't need to have a separate command for the current plugin. one could simply use System,Load,%ScriptFile%

.project files are really just .script files with some extra directives so nothing special there either. They should be scanned by default.

SystemLoad would then only need 1 parameter containing a directory or a file.

Syntax: System,Load,<path>[,NOREC]

Code: [Select]
// Rescan current plugin
System,Load,%ScriptFile%

// Rescan a single plugin
System,Load,%BaseDir%\Projects\Win7PE_SE\Apps\myPlugin.script
System,Load,%BaseDir%\Projects\Win7PE_SE\script.project

// Rescan the entire Apps directory
System,Load,%BaseDir%\Projects\Win7PE_SE\Apps

// Rescan the entire Apps directory but not subdirectories
System,Load,%BaseDir%\Projects\Win7PE_SE\Apps,NOREC

// Rescan an entire project
System,Load,%BaseDir%\Projects\Win7PE_SE\

// Rescan all projects/scripts (Refresh button)
System,Load,%BaseDir%\Projects\

I never really liked the name of NOREC as it always translated in my head as "No Record". current behavior of all other commands is to recurse unless specifically told not to, so I would stick with that for consistency.
« Last Edit: December 23, 2017, 01:26:42 PM by Homes32 »

Re: Request: System,Load - Parameters
« Reply #17 on: December 23, 2017, 01:26:40 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
I never really liked the name of NOREC as it always translated in my head as "No Record".
Same to me.

current behavior of all other commands is to recurse unless specifically told not to, so I would stick with that for consistency.
I only agree for compatibility. I will be fine with new commands for whatever fits best.

However, There is If,ExistFile,* case that cause issue in the past and so far not used for subfolder on anyplugin.
So better PEBakery continue norecursive If,ExistFile,* as default.

*
Why do we need a special load command for "LoadALL" when this could be easily done with just a single parameter containing a directory path?
I guess idea is flexibility for future expansions.
Current PEBakery follow wb, in future there will no need to without any .script or script.project

:turtle:

edit:
Time to go....
« Last Edit: December 23, 2017, 01:33:18 PM by Lancelot »

Re: Request: System,Load - Parameters
« Reply #18 on: December 23, 2017, 08:01:29 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
I think we are overthinking this.

Why do we need a special load command for "LoadALL" when this could be easily done with just a single parameter containing a directory path?

We have the global %ScriptFile% variable that contains the full path of the running plugin, so we don't need to have a separate command for the current plugin. one could simply use System,Load,%ScriptFile%

.project files are really just .script files with some extra directives so nothing special there either. They should be scanned by default.

SystemLoad would then only need 1 parameter containing a directory or a file.

Syntax: System,Load,<path>[,NOREC]
Oh, I was not thinking about %ScriptFile% directive.
Since Run/Exec commands use similar approach, I like Homes32's idea for consistency.

Yet I think System,LoadAll can be useful.
WB082's System,RescanScripts confuses developers since it refreshs all projects, not scripts.
So to match name with System,Load, I added System,LoadAll as an alias of System,RescanScripts.
Developers can use one of these to achieve update of projects.

Code: [Select]
System,LoadAll
System,Load,%ProjectDir%
// In case of Win10PESE
System,Load,%BaseDir%\Projects\Win10PESE

I never really liked the name of NOREC as it always translated in my head as "No Record". current behavior of all other commands is to recurse unless specifically told not to, so I would stick with that for consistency.
Yes, I agree with recursive behavior.
In case of renaming NOREC flag, then every commands have NOREC should be changed at the same time.

Re: Request: System,Load - Parameters
« Reply #19 on: December 24, 2017, 04:33:11 AM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7758
*
Developers can use one of these to achieve update of projects.

Code: [Select]
System,LoadAll
System,Load,%ProjectDir%
// In case of Win10PESE
System,Load,%BaseDir%\Projects\Win10PESE

Syntax for single file and files ?
ex: Add/Remove/Update new plugin ?




*
In case of renaming NOREC flag, then every commands have NOREC should be changed at the same time.

Too early for now.
The day we depreciate wb with different extension than I am fine to update all relevant plugins.

Only possible for new syntax with current transfer period.
ps:
Maybe you can use a different name than NoRec on new syntax of PEBakery if it is easy to implement ?
ex: NoRecursive , NoSubFolder
If it sounds better to you following the idea of human-readable syntax. (people mostly complain time to time)

Or we can do that after new extension..... (ex: .BakerPlugin .BakerBatch .BakerScript )

:turtle:

 

Powered by EzPortal