Topic: Utils: Script Helper  (Read 1010 times)

0 Members and 1 Guest are viewing this topic.

Utils: Script Helper
« on: February 07, 2016, 07:18:12 PM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
Ready for testing on WinPESE-series:   .\Projects\Win10PESE\Utils\Script_Helper_1.script

ila_rendered

Programmed a textprocessor:
It's not a fullsize converter! - it only can be a helper for new projects on this section:  Convert the  'Hive_Load's & 'Hive_Unoad's & 'Reg_add's in years old WB-Scripts to new Plugin-style. The converted code (ex:  'RegHiveLoad,...' & 'RegWrite,...') can be used as template for a new Plugin. But in many cases, a fully functional conversion is impossible; or: only possible with massive human work, because there are many other old "suspect" instructions whitch need to be "translated". Example: For an old instruction there is no new similary command; to get it nevertheless functionating, needs to translate the whole section with new commands and additional code lines...

The textprocessor recognizes:
Hive_Load,
hive_load,
Hive_load,
hive_Load,
Hive_Unload,
hive_unload,
Hive_unload,
hive_Unload,
reg_add,
Reg_add,

(FreeBasic source code included in attachments of script)

ila_rendered



Not implemented yet: Unnecessary or false quotes. Text processor should determine the whole Script on spaces in path disclosures; regardless of whether declared in variables or advertised scripttext.
Example Win10PESE [2016-02-05] * :
- Set a path without space character(s) in quotes - Builder refuses script execution.
- Set a path with space character(s) NOT in quotes - maybe, you only find warning message in Builder log. This in most cases, if a path consists of more path-variable(s).
-  Example pFileBox(directory): The user is able to change %pFileBox% from a path without spaces to a one with spaces; and in case of: A variable such as %ProjectTemp% is not possible - what to do then?  :confused:

* : Very big thanks to the masters.  :great:

Edit [2016-02-16]: Previous Code snippet Script_Helper_1.script (205.51 kB) - was downloaded 12 times. Updated as mentioned in replies #1+#2, but not published yet.
« Last Edit: February 16, 2016, 06:35:09 AM by Gerhard S. »

Re: Utils: Script Corrector
« Reply #1 on: February 07, 2016, 09:58:12 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Hi Gerhard S.

beter rename your plugin to
"Old Script to Plugin Converter"

"Script Corrector" can be easily misunderstood as a tool to create a new script.

*
+
on your plugin no need Arch,x64|x86 line, it is bulk.
[Process]
Arch,x64|x86

+
delete line, WebX= is special to download plugins from servers, I am pretty sure you missed from eyes.
Web1=http://gena.cwcodes.net/Projects/Gena/Utils/RegCPE.script

+
Code: [Select]
System,FILEREDIRECT,OFF
ShellExecuteEx,Open,%ProgramEXE%,,%ProjectTemp%\%ProgramFolder%
System,FILEREDIRECT,ON
-->
Code: [Select]
Call,Start,,%ProgramEXE%,,%ProjectTemp%\%ProgramFolder%

+
"Tested in Win10PESE" is quite useless on your title.
old scripts were written for some PE1 projects and VistaPE ...  since than Win7PESE Win8PESE Win8.1SE Win10PESE ........
and reminding, some old scripts no convertable at all.
they are mostly useful providing information to create a new plugin.

 That is reason we create some set of rules to create plugins, so plugins always work and continue working.
   So far in 5 years no need to convert plugins around here.  :lol:

 :lol:
If you like, better on HistoryNotes01=Tested in Win10PESE

+
replacing %GlobalTemp% to %ProjectTemp% is no good idea .

*
just for info to public:
+ RegWrite,HKLM,0x1 -> RegWrite,HKLM,0x2 is not a correct way for ALL entries. high ratio to result failure.
+ Delete all lines with RegWrite,HKLM,0x0  ->  is not  a correct way for all entries, low ratio to result failure.


manual replacement always requires human eye check.
http://theoven.org/index.php?topic=1643.msg19253#msg19253

Utils\RegCPE do all stuff that can be automated for available .reg files .
Utils\Reg ReConvert can be used to convert registry after one export old entries to .reg (Utils\RegEdit).

*
human eye check always required, that is the reason I did not wrote a converter for BartPE plugins or old scripts ,
instead provided tools and gave required in on topics, that will always help to convert.

Well Thanks Gerhard S. , I hope this helps to some people  :great:

*
as far as I see on other recent topics, there seems to be only ~50 old scripts useful on PE not available on servers ,
 I wait a pm for the list.
I am pretty sure after a year there will not be anymore left, or only crumb time to time.
http://theoven.org/index.php?topic=1413.msg19293#msg19293

*
as written on other topic,
It is always easier and safer to quickly rewrite plugin, Utils\PC Packed or Utils\PC Packed-> e
 than following old script or old BartPE plugin entries ( mostly registry entries )
  with 3 minutes for replacements with human eyes.
   Rest is testing on an emulator, which only takes some minutes for Apps.

:turtle:
« Last Edit: February 07, 2016, 10:12:59 PM by Lancelot »

Re: Utils: Script Corrector
« Reply #2 on: February 07, 2016, 09:58:40 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Not implemented yet: Unnecessary or false quotes. Text processor should determine the whole Script on spaces in path disclosures; regardless of whether declared in variables or advertised scripttext.
Example Win10PESE [2016-02-05] * :
- Set a path without space character(s) in quotes - Builder refuses script execution.
- Set a path with space character(s) NOT in quotes - maybe, you only find warning message in Builder log. This in most cases, if a path consists of more path-variable(s).
-  Example pFileBox(directory): The user is able to change %pFileBox% from a path without spaces to a one with spaces; and in case of: A variable such as %ProjectTemp% is not possible - what to do then?  :confused:
I do not clearly understand.
You maybe talking about winbuilder textbox/filebox bug of a kind,
or maybe something else..

simplify your question with a simple example, like on CodeBox or a simple plugin example only to demonstrate,
 than I am sure I can feedback.

*
%ProjectTemp% always available, and %ProjectTemp% can be with space, always working fine since >5 years.

:turtle:

Re: Utils: Script Corrector
« Reply #3 on: February 08, 2016, 05:42:15 AM »

Gerhard S.

  • Jr. Chef
  • **
  • Date Registered: Dec 2015
  • Posts: 95
@Lancelot:

ila_rendered
Code: [Select]
[Convert_Old_New]
If,Not,ExistDir,%ProjectTemp%\%ProgramFolder%,DirMake,%ProjectTemp%\%ProgramFolder%
If,Not,ExistFile,"%ProjectTemp%\%ProgramFolder%\%ProgramEXE%",ExtractFile,%ScriptFile%,Folder,"%ProgramEXE%",%ProjectTemp%\%ProgramFolder%
If,Not,ExistFile,"%ProjectTemp%\%ProgramFolder%\%ProgramIniFile%",ExtractFile,%ScriptFile%,Folder,%ProgramIniFile%,%ProjectTemp%\%ProgramFolder%
If,Not,ExistFile,"%ProjectTemp%\%ProgramFolder%\example.Script",ExtractFile,%ScriptFile%,Folder,example.Script,%ProjectTemp%\%ProgramFolder%

=> You see red colored example.Script". The real path is/was:
Code: [Select]
H:\Win10PESE\Temp\Win10PESE\convert_add_reg__Regwrite\example.Script

 :confused: Yesterday, Builder refuses Script execution - today it's functionating; not 1 warning message in Plugin log...  :confused:
Code: [Select]
IF - File exists: [%BaseDir%\Projects\Win10PESE\Build\Macro_Library.script] evaluated string: [If,ExistFile,%API%,AddVariables,%API%,ApiVar,GLOBAL]
AddVariables - Added section [ApiVar] from file [%BaseDir%\Projects\Win10PESE\Build\Macro_Library.script] into the local variable list
System - OnBuildExit [System,ONBUILDEXIT,Exec,%ProjectDir%\script.project,Win10PESE-ONBUILDEXIT]
[//If,Not,ExistFile,%RegSystem%,Run,%ProjectDir%\script.project,Process_DebugNT6x]
IF - Directory exists: [%BaseDir%\Temp\Win10PESE\convert_add_reg__Regwrite] evaluated string: [If,Not,ExistDir,%ProjectTemp%\%ProgramFolder%,DirMake,%ProjectTemp%\%ProgramFolder%]
IF - File exists: [%BaseDir%\Temp\Win10PESE\convert_add_reg__Regwrite\convert_add_reg__Regwrite.exe] evaluated string: [If,Not,ExistFile,"%ProjectTemp%\%ProgramFolder%\%ProgramEXE%",ExtractFile,%ScriptFile%,Folder,"%ProgramEXE%",%ProjectTemp%\%ProgramFolder%]
IF - File exists: [%BaseDir%\Temp\Win10PESE\convert_add_reg__Regwrite\convert_add_reg__Regwrite.ini] evaluated string: [If,Not,ExistFile,"%ProjectTemp%\%ProgramFolder%\%ProgramIniFile%",ExtractFile,%ScriptFile%,Folder,%ProgramIniFile%,%ProjectTemp%\%ProgramFo
IF - File exists: [%BaseDir%\Temp\Win10PESE\convert_add_reg__Regwrite\example.Script] evaluated string: [If,Not,ExistFile,"%ProjectTemp%\%ProgramFolder%\example.Script",ExtractFile,%ScriptFile%,Folder,example.Script,%ProjectTemp%\%ProgramFolder



Edit: Now I remember: Anytime before there was a "Out of System Resources" - and I only clicked "OK"....  :w00t:

(In an earlier project stage, I opend too many pipelines to files in FreeBasic compiler - and forgot didn't close them...)
« Last Edit: February 16, 2016, 06:22:46 AM by Gerhard S. »

Re: Utils: Script Corrector
« Reply #4 on: February 08, 2016, 10:44:27 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7010
Edit: Now I remember: Anytime before there was a "Out of System Resources" - and I only clicked "OK"....  :w00t:

(In a early project stage, I opend too many piplines to files in FreeBasic compiler - and forgot didn't close that...)
Good you figure out  :great:

\Downloads\UtilsY\"Workaround Bugs"

plugin created to avoid such winbuilder bugs, most famous "Out of System Resources" bug... bad programmers  :wink:
 :cool:

 

Powered by EzPortal