Topic: Call  (Read 4699 times)

0 Members and 1 Guest are viewing this topic.

Call
« on: October 15, 2010, 04:37:35 PM »

Lancelot

  • Moderator, Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 7052
All Projects

Call means calling a prepared command (macro)
(for the ones who are familiar with, like in .cmd files ;))

Special thanks to : Cmd.exe , All AutoIT developers, BlueLife, Galapo, ChrisR, JFX

*
Call,FileDelete,<file>
Call,DirDelete,<directory>

Call FileDelete and DirDelete have 2 features:
1) If directory/file not deleted with first trial, it will try ~>10 times quickly to delete directory/file
2) will give warning log only if directory/file not deleted
3) If file/dir not exists, nothing deleted - nothing happens

Do not use this FileDelete+DirDelete commands with wildcards (ex: * ? ), it may seem to work, but not  :wink:

*
Call,FileDeleteX,<file>
Call,DirDeleteX,<directory>

Unlike the previous two functions, Call,FileDeleteX and Call,DirDeleteX accept wildcards, although they do not have to be used with wildcards.
Because they accept wildcards, multiple files/folders can be deleted at once.
The two functions are slightly slower than Call,FileDelete and Call,DirDelete.

*
Call,DirDeleteE,<directory>

This command deletes all Files/Folders inside a Directory,
 It does not delete the Directory.  :smile:

Useful for junctioned folders,
 Also Useful for cases where windows do not let deleting a directory even empty and no application use anything inside... (windows have a bug about that)

A bonus feature:
If Directory is a forgotten junction, it deletes directory and recreate a local directory  :wink:

Forgotten Junction :Target Junction folder not available anymore.  :cool:
                               This results Folder available and naturally nothing can be written inside this folder.  :lol:

*
Call,DirDeleteMake,<directory>

This command is to create an empty folder for sure  ;)
If folder previously exists, it is first deleted, than created  :thumbsup:


*
Call,FileCreateBlank,<file>,[OverWrite]
Call,DirMake,<directory>
Call,HiveCreate,<file>


If file/dir already exists, nothing created - nothing happens

[OverWrite] --> it overwrites ;)

*
Call,DirCopy,<FromDir>,<ToDir>,[OverWrite]


A directory copy function, accepting wildcards, that is compatible between the various WB versions (native WB DirCopy function has some differences between versions).

*
Call,FileCopyMUI,<FromDir>\<File>,<ToDir>,[DistLang],[en-US]

It copies files with its mui ;)
Last parameter is to FallBack to en-US,
It works on both NT5 and later, on NT5 no mui copied for now  :wink:

Examples for Code Box:

Code: [Select]
[Process]
If,ExistFile,%API%,AddVariables,%API%,ApiVar,GLOBAL
Call,HostMuiLang
Call,HostSystemDir
Call,FileCopyMUI,%HostSystemDir%\cmd.exe,%ProjectTemp%\Test,%HostMuiLang%,en-US
Call,OpenDir,%ProjectTemp%\Test

Code: [Select]
[Process]
If,ExistFile,%API%,AddVariables,%API%,ApiVar,GLOBAL
Call,FileCopyMUI,C:\Windows\System32\cmd.exe,D:\1\2,fr-FR,en-US

NT5 Notes:
Call,FileCopyMUI does not support NT5 since installing mui to NT5 not popular,
If you need to copy .mui files at an NT5 HostOS,
Following example will give you ideas:

Code: [Select]
Call,HostMuiLang
Call,HostSystemDir
Call,HostOSVersion,,1
If,%HostOSVersion1%,Equal,5,Begin
If,Not,%HostMuiLang%,Equal,0,Begin
StrFormat,LTRIM,%HostMuiLang%,4,%HostMuiLang4%
Call,HostWindowsDir
If,Not,ExistDir,%ProjectTemp%,DirMake,%ProjectTemp%
System,FILEREDIRECT,OFF
If,ExistFile,%HostWindowsDir%\mui\FALLBACK\%HostMuiLang4%\cmd.exe.mui,FileCopy,%HostWindowsDir%\mui\FALLBACK\%HostMuiLang4%\cmd.exe.mui,%ProjectTemp%
System,FILEREDIRECT,ON
End
End
System,FILEREDIRECT,OFF
FileCopy,%HostSystemDir%\cmd.exe,%ProjectTemp%
System,FILEREDIRECT,ON
//-
Call,OpenDir,%ProjectTemp%

ps:
Call,FileCopyMUI is not compatible to copy files from "XP/2k3 source cd".

ps:
Reminding: wild cards (* ?) NOT supported

**
Call,FileCopyMUI for projects:
You can use this command for project things,
like copy a file from other folder than System32
or copy a file to another folder than System32

here is an example from notepad plugin:

Code: [Select]
If,%OSFamily%,Equal,NT6,Call,FileCopyMUI,%Source_Sys%\notepad.exe,%Target_Win%,%DistLang%,en-US

*
Call,Rename,<CurrentFile/FolderName>,<NewFile/FolderName>

Call,Rename have 2 features:
1) if directory/file not renamed with first trial, it will try rename to ~>10 times
2) will give definative warning log if rename unsuccess

*
Call,VariableToMacro,

A MAcro produced for people who wants to update - fix (fix working plugins to working plugins) some plugins easly and quickly to be used and shared by projects because of some stupid (sabotaging) coding development. We wish (with no hope) such a command will not needed on next release but get prepared from today.
Shortly: For some reason if you decide to use a variable containing macro, than you can use "Call,VariableToMacro," before such variable.

*
Call,ConvertToAnsi,<file>,[<tofile>]

Help to quickly convert a unicode file to basic ansi file,
Useful when you try to iniread (or write) a value of a unicode file.

*
Call,AddInterface,<ScriptFile>,[<Interface>],<prefix>

It is a command which is mostly used with Multible Interface plugins, to got variables from other Interface sections ;)
Call,AddInterface, assures compatibility between any builder version  :thumbsup:


*
Call,ExecCall,<ScriptFile>,<section>
command to execute another plugin

parameter support up to 6 parameters
Call,ExecCall,<ScriptFile>,<section>,par1,par2,par3,par4,par5,par6

Additional Info Advanced Authors:
a plugin having
[Main] NoExecCall=True
behaves different with this command  :wink:
such plugin must have Call,AddInterface,%ScriptFile%,Interface
at very begining
since this plugin meant to be executed from outside ;)

ex:
Code: [Select]
[Process]
//[Main] NoExecCall=True + Call,ExecCall, -> Call,AddInterface here
Call,AddInterface,%ScriptFile%,Interface

*
Call,CompareVersions,<ver1>,<ver2>,var

Compare version numbers

Code: [Select]
Call,CompareVersions,3.3.0.600,3.3.0.380
Echo,%CompareVersions%
var results: Bigger , Smaller , Equal

ps: Bigger -> ver1 is bigger than ver2

*
Call,FileCopyBiggerVersion,<File>,<ToFolder>,[File]


Copy file FromFolder to ToFolder
If
+ FromFolder\File have BIGGER version than ToFolder\File
+ or no such file at ToFolder just copy
+ Supports cab compressed ToFolder\File (ex: From STORPORT.SYS and there is ToFolder STORPORT.SY_ )

This fixes troubles on cases like end user having different version of same application, using old-new .sys , .dll at system32 ;)

Typical example is Acronis, snapapi.dll, snapman.sys may have different versions, and during build we would like to have latest one which will get all Acronis products work

ps: Last [File] parameter is optional, different filename at ToFolder ;)

*
RegMultiSZ="Call,RegMultiSZ,<Append|Prepend|Replace>,<Key>,<Valuename>,<Value>"


Write MultiSZ registry values correctly  :thumbsup:

Mostly used with Acronis Plugins
ex:
Code: [Select]
Call,RegMultiSZ,Append,Tmp_System\ControlSet001\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318},UpperFilters,fltsrv

Also used with DiskCryptor Plugin
Code: [Select]
Call,RegMultiSZ,Prepend,Tmp_System\ControlSet001\Control\Class\{71A27CDD-812A-11D0-BEC7-08002BE2092F},LowerFilters,dcrypt
Call,RegMultiSZ,Prepend,Tmp_System\ControlSet001\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318},UpperFilters,dcrypt
Call,RegMultiSZ,Prepend,Tmp_System\ControlSet001\Control\CrashControl,DumpFilters,dcrypt.sys

*
Call,RegWriteBinaryBit,HexNo,BitNo,NewBit,HKLM,0x3,"Tmp_Default\Control Panel\Desktop",UserPreferencesMask

Command designed to change a bit value of a registry value.
For now You must have a registry value, this syntax reads that value and changes accordingly...
For now only RegBinary (0x3) supported...

HexNo: Count left to right, starting from 1 (this is also byte no)
BitNo: 0123 4567
NewBit: value 1 or 0

ex:
Bit40=1 (Mask Bit40 as 1 - show IME Toolbar. )
Code: [Select]
RegHiveLoad,Tmp_Default,%RegDefault%
Call,RegWriteBinaryBit,6,0,1,HKLM,0x3,"Tmp_Default\Control Panel\Desktop",UserPreferencesMask
RegHiveUnLoad,Tmp_Default

*** Call,Math info http://TheOven.org/index.php?topic=1463
 Reply 4: http://TheOven.org/index.php?topic=1440.msg17015#msg17015

*
Call,Echo,<EchoMessage>,[Warn],[Repeat]

Repeat default value is 10 -> Gives 10 Echos as default

Created to be used with 3rd optional parameter Warn
 which is most used when Plugin-Developer wants to give visually noticable warning to end user

Code: [Select]
Call,Echo,"I Warn You",Warn

*
Call,OpenDir,<Path>

To open a folder with Default hostos folder utility (Explorer)
Automatially creates folder if not exists  :wink:
Generally used for gui buttons that asks end user provide file(s)

Code: [Select]
Call,OpenDir,%ProjectDir%\Test

*
Call,StartDoc,<File>

To open a none-executable file (.pdf, .txt, .htm ...) with its associated utility.
Generally used for gui buttons that asks end user read (launch) a document.

Code: [Select]
Call,DirMake,%ProjectTemp%
Call,FileDelete,%ProjectTemp%\Test.txt
FileCreateBlank,%ProjectTemp%\Test.txt
TxtAddLine,%ProjectTemp%\Test.txt,"Hello",Append
//--
Call,StartDoc,%ProjectTemp%\Test.txt


*
Call,Start[Wait],<Option (Open - Hide)>,<ExecutableName>,[Parameters],[StartInFolder]


Generally used with Launch buttons, avoiding redirections with clean syntax  :thumbsup:


*
Call,StringLength


Code: [Select]
Call,StringLength,"C:\t e st"
Echo,%StringLength%

ps: 3rd Parameter can be used to assign custom variable

*
Call,FileNameNoExt,<FileName>|<File>


Get filename variable without extension :>

Code: [Select]
Call,FileNameNoExt,"C:\Test\My File.txt"
Echo,"C:\Test\My File.txt"
Echo,%FileNameNoExt%

Code: [Select]
Call,FileNameNoExt,"My File.txt"
Echo,"My File.txt"
Echo,%FileNameNoExt%

ps:
2nd Parameter if not provided %ScriptFile%
3rd Parameter can be used to assign custom variable

Code: [Select]
Call,FileNameNoExt
Echo,%FileNameNoExt%

*
Call,CreateLink,[PluginFile],<TargetFolder>,[TargetFileName],[Selected]

.Create Link Files easly between projects etc.
As Default, it creates Link at \AppsMy\1Prepare\ (Refresh Builder to see Links on Gui)

Code: [Select]
Call,CreateLink

ps: you can test command on a single plugin or codebox to see how it works  :wink:
See next Call,CreatePlugin

Add: Par3: PluginFolder -> will create .Link file on same folder plugin.
Call,CreateLink,%ScriptFile%,PluginFolder
useful to create .Link on same folder to copy to another folder like on real windows shortcut creation.  :wink:

*
Call,CreatePlugin,[PluginFile],<Level>

To Create simple plugin easly

Default: creates a simple plugin at Projects\MyPlugins\AppsMy\1Prepare\New Plugin.script

Some examples:
Tip: Test inside codebox

Ex: This is a good example to create your own simple plugin easly from codebox, just change name: My New Simple Plugin

Code: [Select]
Call,CreatePlugin,"%BaseDir%\Projects\MyPlugins\AppsMy\1Prepare\My New Simple Plugin.script"
Call,CreateLink,"%BaseDir%\Projects\MyPlugins\AppsMy\1Prepare\My New Simple Plugin.script",%ProjectDir%\AppsMy\1Prepare
System,ReScanScripts



Ex: Default to test easly
Code: [Select]
Call,CreatePlugin
Call,CreateLink,"%BaseDir%\Projects\MyPlugins\AppsMy\1Prepare\New Plugin.script",%ProjectDir%\AppsMy\1Prepare
System,ReScanScripts


Ex: Exaggerated example  :wink:
Code: [Select]
Call,HostDesktopDir
Call,CreatePlugin,%HostDesktopDir%\Test.script
Call,CreateLink,"%HostDesktopDir%\Test.script",%ProjectDir%\AppsMy\1Prepare
System,ReScanScripts

ps: above examples written for codebox, lines other than Call,CreatePlugin are there to demonstrate the result plugin on interface easly

Remiding: To write simple application plugins, There is "Utils\PC Packed" (Plugin Creator Packed) available. http://TheOven.org/index.php?topic=178

*
Call,CreateCodeBox,,Simple/Plugin/NoOverWrite

This creates a fresh CodeBox with winbuilder bug workaround ;)

just use
Code: [Select]
Call,CreateCodeBox
inside a plugin,

Tip: Macro Library have "New CodeBox" button.

Par2: Default: %ProjectDir%\CodeBox.txt
Par3: Default: Simple
Par3: Plugin: Plugin will create a New Plugin available via CodeBox ;)
Par3: NoOverWrite: If there is previous CodeBox.txt (not empty not old) nothing happens => required at project first run ;)

*
Call,CreateEmptyLink,<File.Link>,<Link>,<Selected>


For Advanced Authors to create an empty .Link easily.
Normal users use: Call,CreateLink

ex:
Code: [Select]
Call,HostDesktopDir
Call,CreateEmptyLink,%HostDesktopDir%\EmptyLink.Link
==> you will get EmptyLink.Link file on desktop (have no use, just to demonstrate ;) )

*
Call,CreateFolderPlugin,<Folder>,<Title>,<Description>

Folder plugins helps give more information to end users about folders,
 Command here to ease creating with a nice icon by Galapo. :)

Ex Test:
Code: [Select]
Call,CreateFolderPlugin

Will create a new folder plugin at
%ProjectDir%\AppsMy\1Prepare
;)

Reminding:
To see result you need at least 1 normal plugin at "%ProjectDir%\AppsMy\1Prepare"
Tip:
 Utils\"PC Packed" --> Right Bottom --> e button will create a New plugin at "%ProjectDir%\AppsMy\1Prepare"

On builder Gui, check "AppsMy\1Prepare"


*
Call,CreateBulletinPlugin,[PluginFile],<Level>,<AuthorName>,<Title>,<WebLink>,<PutLocation(BaseDirSubFolder)>

A special kind of plugin to inform available plugins out of servers
See
\Downloads\UtilsY\PC Bulletin
also
Reply 12 http://theoven.org/index.php?topic=1834.msg21221#msg21221


*
Call,StarterCMD,[Shortcuts]


For applications that needs writable environment, just add above to the end of plugin instead of shortcuts
Call,StarterCMD,Shortcuts
(use default pCheckBox1 pCheckBox2 pCheckBox3 for Desktop, Start Menu , Quicklaunch shortcuts)

To test what it does, write codebox:
Code: [Select]
[Process]
If,ExistFile,%API%,AddVariables,%API%,ApiVar,GLOBAL
Call,StarterCMD
Call,OpenDir,%Target_Prog%\StarterCMD

*
Call,DriveGetFileSystem,<Path>,[var]

To get File System of a Volume

As default, gives File System of BaseDir
Code: [Select]
Call,DriveGetFileSystem
Echo,"BaseDir DriveGetFileSystem =%DriveGetFileSystem%"

Return Values: NoDrive - Unknown - FAT - FAT32 - NTFS - NWFS - CDFS - UDF

*
Call,DriveGetType,<Path>,[var]

To get Type of a Volume

As default, gives Type of BaseDir
Code: [Select]
Call,DriveGetType
Echo,"BaseDir DriveGetType =%DriveGetType%"

Return Values: NoDrive - Unknown - Removable - Fixed - Network - CDROM - RAMDisk

*
Call,Dot83Support

Makes a test at BaseDir to see if current folder structere can be used with applications that requires Dot83 support...

Code: [Select]
Call,Dot83Support
Echo,"ProjectTemp Dot83Support =%Dot83Support%"

Return Values:  1 = Dot83 supported / 0 = Dot83 Not supported

*
Call,Priority,PP,<value>

Sometimes people like to change Priority of mostly Parent Process (=the builder, whatever used),

value: Idle - BelowNormal - Normal - AboveNormal - High - RealTime

ex:
Code: [Select]
Call,Priority,PP,Idle



*
Call,FileArch,var,<File>


Detect Architecture of a file
Return Values:

NotFound
Unknown
I386
IA64
AMD64

ps: var default value = FileArch

Ex:
Code: [Select]
Call,FileArch,,%Tools%\x86\AU3361.exe
Echo,%FileArch%
Call,FileArch,,%Tools%\x64\AU3361.exe
Echo,%FileArch%
Call,FileArch,,%Tools%\x64\Dummy
Echo,%FileArch%

Using and Following JFX  "GetExeArch"
JFX Reply 5 http://TheOven.org/index.php?topic=1499.msg17540#msg17540

*
Call,RetrieveFolderUniqueID,<Folder>,Var


Return Value: 1 Directory not exists
Return Value: 2 Directory exists but empty -> not even empty file or folder exists ;)
Return Value: "UniqueMD5" value -> even with empty file and folders ;)

Tip: if Folder is too big, it would take some time.

Some lines just to demonstrate:
Code: [Select]
If,ExistFile,%api%,AddVariables,%api%,ApiVar,GLOBAL
//-
//Return Value: 1 Directory not exists
Set,%TestFolder%,%ProjectTemp%\TestFolder
Call,DirDelete,%TestFolder%
Call,RetrieveFolderUniqueID,%TestFolder%
Echo,%RetrieveFolderUniqueID%,Warn
//-
//Return Value:2 Directory exists but empty
Set,%TestFolder%,%ProjectTemp%\TestFolder
Call,DirDeleteMake,%TestFolder%
Call,RetrieveFolderUniqueID,%TestFolder%
Echo,%RetrieveFolderUniqueID%,Warn
//-
//Return Value:UniqueMD5 Directory exists but with empty files/folders
Set,%TestFolder%,%ProjectTemp%\TestFolder
Call,DirDeleteMake,%TestFolder%
FileCreateBlank,%TestFolder%\Test.txt
Call,RetrieveFolderUniqueID,%TestFolder%
Echo,%RetrieveFolderUniqueID%,Warn
//-
//Return Value:UniqueMD5 Directory exists with files
Set,%TestFolder%,%ProjectTemp%\TestFolder
Call,DirDeleteMake,%TestFolder%
FileCreateBlank,%TestFolder%\Test.txt
IniWrite,%TestFolder%\Test.txt,Test,Key,Value
Call,RetrieveFolderUniqueID,%TestFolder%
Echo,%RetrieveFolderUniqueID%,Warn




*-------- Some code tips --------- +

*
%ProjectFolderName%


Project names are same with Project folder names,
 sometimes used on some cases,
  following code tip would be useful

Code: [Select]
StrFormat,Split,%ProjectDir%,\,0,%t%
StrFormat,Split,%ProjectDir%,\,%t%,%ProjectFolderName%


*-------- Commands related to HostOS --------- +

*
Call,HostOSArch

To get HostOS Architecture,
popularly used with "Launch" buttons on MultiArchitecture Plugins, to decide which architecture of files to be used when Launching... (ex: to decide to launch blabla.exe 32bit or blabla.exe 64bit)

ex:
Code: [Select]
Call,HostOSArch
Echo,HostOSArch=%HostOSArch%

Current return values: x86 , x64 , IA64 , UNKNOWN

*
Call,HostOSVersion,,[VersionNo|x]

To get major minor versions easily

ex:
Code: [Select]
Call,HostOSVersion,,1
Echo,%HostOSVersion%
Echo,HostOSMajorVersion=%HostOSVersion1%
Code: [Select]
Call,HostOSVersion,,2
Echo,%HostOSVersion%
Echo,HostOSMinorVersion=%HostOSVersion2%

ex:
Code: [Select]
Call,HostOSVersion,,1
Echo,%HostOSVersion%
If,%HostOSVersion1%,Equal,5,Echo,"HostOS is Win2000 or XP or Win2003 - NT5x"
If,%HostOSVersion1%,Equal,6,Echo,"HostOS is Vista or later - NT6x"

ex:
Code: [Select]
Call,HostOSVersion
Call,CompareVersions,%HostOSVersion%,6.3.9600.17736
If,%CompareVersions%,Equal,Bigger,Echo,"Never than Win 8.1"
If,%CompareVersions%,Equal,Equal,Echo,"It is Win 8.1"
If,%CompareVersions%,Equal,Smaller,Echo,"Before Win 8.1"


ex: [VersionNo|x]
--> get sub version numbers before VersionNo
Code: [Select]
Call,HostOSVersion,,4x
Echo,%HostOSVersion%
Echo,%HostOSVersion1%
Echo,%HostOSVersion2%
Echo,%HostOSVersion3%
Echo,%HostOSVersion4%
Echo,HostOSVersion:%HostOSVersion%-----%HostOSVersion1%---%HostOSVersion2%---%HostOSVersion3%---%HostOSVersion4%

[VersionNo] values 1,2,3,4 --> representing 1st (Major) 2nd (Minor) 3rd, 4th version numbers.
                                              When VersionNO used, VersionNO added to variable
  • -> use  with [VersionNo] to get all prior sub versions ex: 3x will give VersionNO 1 2 3


Tip:
https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions
5.0   Win2000
5.1   XP
5.2   Win2003 (+XPx64)
6.0   Vista
6.1   Win7
6.2   Win8
6.3   Win8.1 (6.3.9600.17736)
10.0 Win10


*
Call,TargetVersion,,[VersionNo]


tag: SourceOSVersion

ex:
Code: [Select]
Call,TargetVersion
Echo,%TargetVersion%

Code: [Select]
Call,TargetVersion,,1
Echo,%TargetVersion%
Echo,%TargetVersion1%

Code: [Select]
Call,TargetVersion,,4x
Echo,%TargetVersion%
Echo,%TargetVersion1%
Echo,%TargetVersion2%
Echo,%TargetVersion3%
Echo,%TargetVersion4%
Echo,TargetVersion:%TargetVersion%-----%TargetVersion1%---%TargetVersion2%---%TargetVersion3%---%TargetVersion4%


[VersionNo] values 1,2,3,4 --> representing 1st (Major) 2nd (Minor) 3rd, 4th version numbers.
                                              When VersionNO used, VersionNO added to variable
  • -> use  with [VersionNo] to get all prior sub versions ex: 3x will give VersionNO 1 2 3


If TargetVersion not found, Main variable becomes 0 ( ex: %TargetVersion% becomes 0 )
                                        sub variables with [VersionNo] also 0  ( ex: %TargetVersion1% becomes 0 )


ps: SourceOSVersion not used as syntax :
- Avoid possible bug where one can change source but with still available build with different version
--> It is accurate to use TargetVersion to design plugins.

*
Call,Version,<File>,[Var],[VersionNo|x]

To get version of file easy (and avoid builder bug)

ex:
Code: [Select]
Call,Version,dism.exe
Echo,%dism.exeVersion%


ex:
Code: [Select]
Call,Version,dism.exe,,4x
Echo,%dism.exeVersion%
Echo,%dism.exeVersion1%
Echo,%dism.exeVersion2%
Echo,%dism.exeVersion3%
Echo,%dism.exeVersion4%

ex:
Code: [Select]
Call,HostProgramFilesDir
Call,Version,"%HostProgramFilesDir%\Internet Explorer\iexplore.exe"
Echo,%iexplore.exeVersion%


ex: [VersionNo]
--> get sub version number + main version number
Code: [Select]
Call,HostProgramFilesDir
Call,Version,"%HostProgramFilesDir%\Internet Explorer\iexplore.exe",,1
Echo,%iexplore.exeVersion%
Echo,%iexplore.exeVersion1%


[VersionNo] values 1,2,3,4 --> representing 1st (Major) 2nd (Minor) 3rd, 4th version numbers.
                                              When VersionNO used, VersionNO added to variable
  • -> use  with [VersionNo] to get all prior sub versions ex: 3x will give VersionNO 1 2 3


<File> --> if no path given than First Check HostSystemDir (ex: C:\Windows\System32) than HostWindowsDir

[Var] --> if no variable assigned, than filename used (ex: %dism.exeVersion% )

When File not found, Main Return variable is empty (+ warning on log ) (sub variables with [VersionNo] also empty)


*
Call,SelectCase,[SourceValue],[TargetValues]

Compare a value with possible cases.

par2: source value
par3: list of target values seperated by |

ex:
Code: [Select]
Call,SelectCase,%OS%%OSServicePack%%SourceArch%,"W2003SP1x86|XPSP2x64|W2003SP2x86|W2003SP2x64"
Echo,%Case%
->
If no match ==> %Case%=0
If %OS%%OSServicePack%%SourceArch%=XPSP2x64 ==> %Case%=2

*
par4: assign a value to %Case%

ex:
Code: [Select]
Call,SelectCase,%OS%%SourceArch%,"XPx86|XPx64|W2003x86|W2003x64","-A -C|-A -C -P64|-A -C -W2K3|-A -C -W2K3 -P64"
Echo,%Case%
If %OS%%SourceArch% = XPx64 ==> %Case% A -C -P64

par5 = 1
change seperator from | to , (not tested)

*
Call,Download,[Folder\|DownloadFile],[Web]


to download from internet :)
if you want to download to a folder with default file name on web, use \ at the end of parameter 2 ;)

Currently Call,Download starts with default minimize.  :thumbsup:
More words:
 Starting with normal window becomes ugly ( http://theoven.org/index.php?topic=1375 )
 Hiding would be suspicious and not nice with big downloads,
 End user need to see % of how download progress goes and better not hide any download from end users eyes.  :thumbsup:
  on next builder, better put % to builder interface  :cool:

par3: CheckSize=
Call,Download,[Folder\|DownloadFile],[Web],CheckSize=100

Call,Download as default have a size check (currently 100 bytes)
to lower or increase size check, use 3rd parameter CheckSize

Tip: It is mostly required to download very small files (smaller than 100 bytes) , which are generally small version check .ini files  :wink:

*
Call,DownloadUpdates
Call,DownloadUpdates,<projectdir>,<changelogfile>,<changelogWEB>,<startfrom-OR-checkoldversions>


Code: [Select]
Call,DownloadUpdates
Echo,DownloadUpdatesRefresh=%DownloadUpdatesRefresh%

Updates files of ProjectDir following "ChangeLog from web"
%DownloadUpdatesRefresh% values True or False
ex: If there is new or deleted plugin Value True, else False

Tip:
This command also Call,BackupProject to Backup Project if not backed up before.

Reminder:
For now all updates not available at ChangeLog,
 so if you want a full update, use Utils\Update plugin

Code: [Select]
Call,DownloadUpdates,,,,1479
Echo,DownloadUpdatesRefresh=%DownloadUpdatesRefresh%

Updates files of ProjectDir following "ChangeLog from web" starting after ChangeLog version 1479
Advanced users only

+
Code: [Select]
Call,DownloadUpdates,,,,-1
Echo,DownloadUpdatesRefresh=%DownloadUpdatesRefresh%

Updates files of ProjectDir following "Local ChangeLog" starting after ChangeLog version-X
-1 means only checking last "Local ChangeLog" update
Advanced users only

+
Code: [Select]
Call,DownloadUpdates,%BaseDir%\Projects\Gena
Call,Echo,"Gena DownloadUpdatesRefresh=%DownloadUpdatesRefresh%",Warn
Call,DownloadUpdates,%BaseDir%\Projects\Win7PESE
Call,Echo,"Win7PESE DownloadUpdatesRefresh=%DownloadUpdatesRefresh%",Warn
Call,DownloadUpdates,%BaseDir%\Projects\Win8.1SE
Call,Echo,"Win8.1SE DownloadUpdatesRefresh=%DownloadUpdatesRefresh%",Warn
Call,DownloadUpdates,%BaseDir%\Projects\Win8PESE
Call,Echo,"Win8PESE DownloadUpdatesRefresh=%DownloadUpdatesRefresh%",Warn
Call,DownloadUpdates,%BaseDir%\Projects\Win10PESE
Call,Echo,"Win10PESE DownloadUpdatesRefresh=%DownloadUpdatesRefresh%",Warn

This way you can update different servers following "ChangeLog from web" of them

Call,DownloadUpdates Reminder (Lancelot) :
MD5=0 value means file to be deleted and operational on Call,DownloadUpdates
ex:
Gena ChangeLog
Code: [Select]
20160915 1508 (Lancelot)
1508_Update_Admin=Lancelot
1508_Update_Date=20160915
1508_Web=http://gena.cwcodes.net/Projects/Gena/Utils/UploadPlugin_WebRoots_SE_Gena.script
1508_Date=9999.99.99
1508_MD5=0
1508_Size=0
1508_Version=0

To Do:
Call,DownloadUpdates To Do (Lancelot) :
+
1508_Web=http://gena.cwcodes.net/Projects/Gena/Utils/DeleteFolder/
1508_MD5=DeleteFolder

with md5 value equal to DeleteFolder (and with web address ending with / ;) )
delete folder if empty (if not empty move to backup)

currently not operational on Call,DownloadUpdates
+
During Call,UploadX,
currently check 50 old versions
instead of 50 , faster check up to lastpackage with reading [OptimizeFile] (optimization file to lastpackage)
Tip: codes available at \UtilsY\Change Log editor

+
During Call,UploadX,
change old versions entries
ex:
054_Web=
054_Web_Old=
maybe scan to LastPackage= or if not exists default 100 ;)
This will get Call,DownloadUpdates faster with big versions
==> made on UtilsY\Change Log editor -> optimize button
+
%DownloadUpdatesRefresh% do not check .link for now
+
update ChangeLog via Genvirgin maker !!
+
Add .Link preserve settings (only Main Selected True or False works here )
+
to preserve plugin settings during updates,
 we need another command like
  Call,SettingsSave,<pluginfile>,<settingsfile>
  Call,SettingsLoad,<pluginfile>,<settingsfile>

*
Call,BackupProject
Call,BackupProject,<ProjectFolder>,<BackupFolder>,<OverWrite|Force>


Creates Backup of project to a BackupFolder if there is no backup yet,
 As default all active projects backups to same folder at very begining,
  And As default same BackupFolder (ex: ....\Download_Win10PESE)
    used by all related plugins (ex: \Utils\Update etc.)
    and commands (ex: Call,DownloadX etc. )

Reminder: If you run this command and feel nothing happens, it is because project already backed up  :wink:
 
Not to be used by regular users, Good for Advanced users.

*
Call,LinkType
Call,LinkType,<Var>,<%File%>,<%ProjectDir%>


Return values : PluginFile LinkFolder LinkFile FileMain FolderFile File

It compares File with Directory (default: ProjectDir )
and determines which LinkType required to get this file operational,

Return Value: LinkFile --> means we need Create,Link ;)


*
Call,HostIsAdmin

Check to see if HostOS have Admin priviledges

Code: [Select]
Call,HostIsAdmin
Echo,HostIsAdmin=%HostIsAdmin%

Return values: True False


*
Call,CABCompress,<File>,[TargetFile],[NOUpperCASE],[NODelete],[CustomParameter]


Ex:
Code: [Select]
Call,CABCompress,%Target_Sys%\Drivers\acpiec.sys

As default you will get
ACPIEC.SYS
at
%Target_SYS%\Drivers\

Mostly used by Gena.  :wink:

*
Call,HostUAC,,Enabled

Check to see if HostOS have UAC enabled

Code: [Select]
Call,HostUAC,,Enabled
Echo,HostUACEnabled=%HostUACEnabled%

Return values: 0 = NoUAC or Not Exists / 1 = YesUAC

*
Call,HostUAC

Get UAC value of HostOS

Code: [Select]
Call,HostUAC
Echo,HostUAC=%HostUAC%

Return values: -1 = NoUAC / 0 = UAC Not enabled / 1 = UAC Enabled / And Other Values of UAC

*
Call,HostOSLang

Check HostOS Language "Locale ID" ( LCIDHex , ~ Default Locale)

Code: [Select]
Call,HostOSLang
Echo,HostOSLang=%HostOSLang%

This is a 4 digit Language ID of HostOS (NT5x NT6x ... )
you can get a list here with "LCIDHex" column
http://msdn.microsoft.com/en-us/goglobal/bb895996.aspx

*
Call,HostOSLangDefault

Check HostOS Default Language

Code: [Select]
Call,HostOSLangDefault
Echo,HostOSLangDefault=%HostOSLangDefault%
-->
When HostOS interface changed with installing Mui,
(Or maybe language keyboard etc. changed)
HostOSLang and HostOSLangDefault are different  :wink:
(tested with XP mui ;) )

*
Call,HostMuiLang

Check HostOS Current User MUI language,

Code: [Select]
Call,HostMuiLang
Echo,HostMuiLang=%HostMuiLang%

On nt6x: It returns the value, ex: en-US
On nt5x:
--> If MUI NOT installed (which is most case ;)) returns 0
--> If MUI installed but not selected returns 0
--> If MUI installed, returns Current User MultiUILanguageId value

nt5x Note:
nt5x MultiUILanguageId value is an 8 digit value unlike nt6x, last 4 digit refers Country,
Here is a list
Locale IDs, Input Locales, and Language Collections for Windows XP and Windows Server 2003
http://msdn.microsoft.com/en-us/goglobal/bb895996.aspx

Giving example, when mui TR installed on Enu,
All .mui files are at:
C:\WINDOWS\mui\FALLBACK\041F
( If,Not,%HostMuiLang%,Equal,0,StrFormat,LTRIM,%HostMuiLang%,4,%t% --> will give 041F)


*
Call,HostUserName

Returns Current UserName of hostos
Code: [Select]
Call,HostUserName
Echo,%HostUserName%

*
Call,HostWOW64

Checks if HostOS have WOW64 or not
Returns Values: True or False

Code: [Select]
Call,HostWOW64
Echo,%HostWOW64%

*
Call,Host<Folder>

To get some HostOS folder info, which *rarely required

Here is exagarated test which also summerize all related commands:
Code: [Select]
Call,HostAppDataCommonDir
Call,HostAppDataDir
Call,HostCommonFilesDir
Call,HostCommonFilesDirX86
Call,HostDesktopDir
Call,HostProgramFilesDir
Call,HostProgramFilesDirX86
Call,HostSystemDir
Call,HostSystemDirX86
Call,HostTempDir
Call,HostUserProfileDir
Call,HostWindowsDir
Echo,HostAppDataCommonDir=%HostAppDataCommonDir%
Echo,HostAppDataDir=%HostAppDataDir%
Echo,HostCommonFilesDir=%HostCommonFilesDir%
Echo,HostCommonFilesDirX86=%HostCommonFilesDirX86%
Echo,HostDesktopDir=%HostDesktopDir%
Echo,HostProgramFilesDir=%HostProgramFilesDir%
Echo,HostProgramFilesDirX86=%HostProgramFilesDirX86%
Echo,HostSystemDir=%HostSystemDir%
Echo,HostSystemDirX86=%HostSystemDirX86%
Echo,HostTempDir=%HostTempDir%
Echo,HostUserProfileDir=%HostUserProfileDir%
Echo,HostWindowsDir=%HostWindowsDir%


*
Call,Host<Misc>

Some more miscellaneous variables for HOSTOS

Code: [Select]
Call,HostCOMPUTERNAME
Call,HostComSpec
Call,HostUSERDOMAIN
Call,HostUSERDOMAIN_ROAMINGPROFILE
Call,HostPROMPT
Call,HostPROCESSOR_ARCHITECTURE
Call,HostPROCESSOR_ARCHITEW6432
Call,HostPROCESSOR_ARCHITECTURE,,WOW64
Call,HostPROCESSOR_ARCHITEW6432,,WOW64
Call,HostPROCESSOR_IDENTIFIER
Call,HostPROCESSOR_LEVEL
Call,HostPROCESSOR_REVISION
Call,HostLOGONSERVER
Call,HostNUMBER_OF_PROCESSORS
Call,HostEnvOS
Call,HostEnvPath
Call,HostEnvPATHEXT
Call,HostFP_NO_HOST_CHECK
Call,HostWinDir
Call,HostSessionName
Call,Host__COMPAT_LAYER
Call,HostRANDOM

Echo,COMPUTERNAME=%HostCOMPUTERNAME%
Echo,ComSpec=%HostComSpec%
Echo,USERDOMAIN=%HostUSERDOMAIN%
Echo,USERDOMAIN_ROAMINGPROFILE=%HostUSERDOMAIN_ROAMINGPROFILE%
Echo,PROMPT=%HostPROMPT%
Echo,PROCESSOR_ARCHITECTURE=%HostPROCESSOR_ARCHITECTURE%
Echo,PROCESSOR_ARCHITEW6432=%HostPROCESSOR_ARCHITEW6432%
Echo,PROCESSOR_ARCHITECTUREWOW64=%HostPROCESSOR_ARCHITECTUREWOW64%
Echo,PROCESSOR_ARCHITEW6432WOW64=%HostPROCESSOR_ARCHITEW6432WOW64%
Echo,PROCESSOR_IDENTIFIER=%HostPROCESSOR_IDENTIFIER%
Echo,PROCESSOR_LEVEL=%HostPROCESSOR_LEVEL%
Echo,PROCESSOR_REVISION=%HostPROCESSOR_REVISION%
Echo,LOGONSERVER=%HostLOGONSERVER%
Echo,NUMBER_OF_PROCESSORS=%HostNUMBER_OF_PROCESSORS%
Echo,OS=%HostEnvOS%
Echo,Path=%HostEnvPath%
Echo,PATHEXT=%HostEnvPATHEXT%
Echo,FP_NO_HOST_CHECK=%HostFP_NO_HOST_CHECK%
Echo,WinDir=%HostWinDir%
Echo,SessionName=%HostSessionName%
Echo,__COMPAT_LAYER=%Host__COMPAT_LAYER%
Echo,HostRANDOM=%HostRANDOM%


*
Call,Host<Time>


To time related info from HostOS

Here is exagarated test which also summerize all related commands:
Code: [Select]
Call,HostYear
Call,HostMonth
Call,HostMonthDay
Call,HostWeekDay
Call,HostHour
Call,HostMinute
Call,HostSecond
Call,HostMSecond
Echo,"%HostYear%.%HostMonth%.%HostMonthDay% (%HostWeekDay%/7) - %HostHour%:%HostMinute%:%HostSecond%.%HostMSecond%"

*
Call,Target<Folder>

To copy files to some special folders

Code: [Select]
Call,TargetDesktop
Call,TargetAppdata
Call,TargetAUAppdata
Call,TargetLocalSettingsAppdata
Echo,%TargetDesktop%
Echo,%TargetAppdata%
Echo,%TargetAUAppdata%
Echo,%TargetLocalSettingsAppdata%


SE : result will be something like:
%BaseDir%\Target\Win10PESE\Users\Default\Desktop
%BaseDir%\Target\Win10PESE\Users\Default\AppData\Roaming
%BaseDir%\Target\Win10PESE\ProgramData
%BaseDir%\Target\Win10PESE\Users\Default\AppData\Local

Gena : result will be something like:
%BaseDir%\Workbench\Gena\UserData\TargetProfiles\GenaP\GenaU\Desktop
%BaseDir%\Workbench\Gena\UserData\TargetProfiles\GenaP\GenaU\Application Data
%BaseDir%\Workbench\Gena\UserData\TargetProfiles\GenaP\All Users\Application Data
%BaseDir%\Workbench\Gena\UserData\TargetProfiles\GenaP\GenaU\Local Settings\Application Data

Tag: {commonappdata}

and to write registry etc. values
Code: [Select]
Call,TargetAppdataOS
Call,TargetAUAppdataOS
Echo,%TargetAppdataOS%
Echo,%TargetAUAppdataOS%

SE : result will be something like:
X:\Users\Default\AppData\Roaming
X:\ProgramData

Gena : result will be something like:
B:\GenaP\GenaU\Application Data
B:\GenaP\All Users\Application Data

**--> Some examples with Call,Target... can be found at Plugin Writing Tips : http://TheOven.org/index.php?topic=473.0

"Commands related to HostOS and Target" Notice:
2nd Parameter on all "Commands related to HostOS" can be used to assign custom variable



*-------- Commands related to HostOS --------- +



*-------- Call,Math -------------------------------------- +


Call,Math

Call Math Info: http://TheOven.org/index.php?topic=1463

Call,Math currently designed for only :
Binary ( base 2 ) operations with only 8bit ( 1 Byte )
and
Hexadecimal ( hex ) ( base 16 ) operations with only hex 2 digits maximum ff
and
Decimal ( base 10 ) between 0 - 255


Call,Math,HexAdd,var,HexValue1,HexValue2
Only 2 digit additions and maximum ff
Fallback Variable: MathHexAdd

Code: [Select]
Call,Math,HexAdd,,1,A2
Echo,%MathHexAdd%




Call,MathChangeBit,Binary,BitNO,NewBitValue,var,Value
Value: Change bit of a 8bit number (max 11111111 ) :)
FallBack Variable: MathChangeBitBinary

Example, Bit2 changed to 1
Code: [Select]
Set,%Before%,00001001
Call,MathChangeBit,Binary,2,1,,%Before%
Echo,%Before%
Echo,%MathChangeBitBinary%

Tip: Reminding this is "Math Binary" (digits right to left) not Computer Binary (digits left to right)


Call,MathChangeBit,Hex,BitNO,NewBitValue,var,Value
Value: Change bit of a hexadecimal number (max ff) :)
FallBack Variable: MathChangeBitHex

Code: [Select]
Call,MathChangeBit,Hex,7,1,,9e
Echo,%MathChangeBitHex%
Call,MathChangeBit,Hex,7,1,,0e
Echo,%MathChangeBitHex%
Example Tip: hex 9e already have Bit7=1 so it remains same  :wink:

Info: Bit operations required to change some windows tweaks ( Ex: UserPreferencesMask ) that use hex (RegBinary) values on registry...
Call,RegWriteBinaryBit





Call,MathConvert,HexToDecimal,var,Value
FallBackVariable: MathConvertHexToDecimal
Value: Only 2 digit maximum ff

Code: [Select]
Call,MathConvert,HexToDecimal,,ff
Echo,%MathConvertHexToDecimal%
Call,MathConvert,HexToDecimal,,a1
Echo,%MathConvertHexToDecimal%

Call,MathConvert,DecimalToHex,var,Value
Value: Decimal Only between 0 - 255
FallBack Variable: MathConvertDecimalToHex

Code: [Select]
Call,MathConvert,DecimalToHex,,163
Echo,%MathConvertDecimalToHex%


Call,MathConvert,BinaryToHex,var,Value
Value: 8bits
FallBack Variable: MathConvertBinaryToHex

Code: [Select]
Call,MathConvert,BinaryToHex,,11111010
Echo,%MathConvertBinaryToHex%

Tip: Reminding this is "Math Binary" (digits right to left) not Computer Binary (digits left to right)


Call,MathConvert,HexToBinary,var,Value
Value: hex value maximum ff
FallBack Variable: MathConvertHexToBinary

Code: [Select]
Call,MathConvert,HexToBinary,,ff
Echo,%MathConvertHexToBinary%
Call,MathConvert,HexToBinary,,af
Echo,%MathConvertHexToBinary%

Tip: Reminding this is "Math Binary" (digits right to left) not Computer Binary (digits left to right)


*-------- Call,Math -------------------------------------- -
« Last Edit: January 25, 2017, 11:35:36 PM by Lancelot »

 

Powered by EzPortal