API functions inside WB's Magic Wand
#1
Posted 14 January 2009 - 07:49 PM
I think it is time to include the command require_file, in the new api.
#2
Posted 14 January 2009 - 07:54 PM
Seeee me confuuuused!I think it is time to include the command require_file, in the new api.
I think that we have it since Ice-Age!
Peter
@fxscrpt:
Maybe I misunderstood the last posts, including your intention.
If yes, can you explain again for a fool?
#3
Posted 14 January 2009 - 09:40 PM
wrong phrases in a rush. I misunderstood myself. Freudic confusion.Maybe I misunderstood the last posts, including your intention.
If yes, can you explain again for a fool?
I was to mean that I wanted to say that.... require_file be included in magic wand ... and you are right it is found in api from the times of old testament. I Shake my brain to turn it on...
#4
Posted 14 January 2009 - 09:56 PM
Hope you don't mind that I split this from the original topic to it's own topic.
-----------
Regarding your idea, I also agree that the most common api commands should be available to the developer with the same ease as the "raw" commands.
Please suggest all the API commands that should be listed, thank you!
#5
Posted 14 January 2009 - 10:26 PM
It is difficult to implement.Hmm.. this a feature discussion that probably deserved a topic of it's own to allow exploring all possibilities.
Hope you don't mind that I split this from the original topic to it's own topic.
-----------
Regarding your idea, I also agree that the most common api commands should be available to the developer with the same ease as the "raw" commands.
Please suggest all the API commands that should be listed, thank you!
Either there can be a hardcoded list inside WB. But whenever something changes, that demands a new WinBuilder.exe
Or WB could look into project.script. But that demands the API shortcut to be 'findable'. They cannot be find if they are anywhere inside the [Variables] section. Therefore they should be in a specific [API] or [?????] section.
This would demand a bigger rebuild in WB [exe] internals.
Peter
#6
Posted 14 January 2009 - 11:53 PM
Peter,It is difficult to implement.
Either there can be a hardcoded list inside WB. But whenever something changes, that demands a new WinBuilder.exe
Or WB could look into project.script. But that demands the API shortcut to be 'findable'. They cannot be find if they are anywhere inside the [Variables] section. Therefore they should be in a specific [API] or [?????] section.
This would demand a bigger rebuild in WB [exe] internals.
Peter
Make the command AddVariables the possibility to set variable Global (like the Set command)
In Api I add a section [ApiVar] which contain all api command
In Script.project delete all api command from section [Variables]
and add in section [Process] in Script.project
[Process] AddVariables,%API%,ApiVar,GLOBALIn api.script
[ApiVar] Add_Shortcut=Run,%API%,AddShortcut Require_File=run,%API%,Expand_file Unpack=Run,%API%,Depack _Calculate=run,%API%,CalculateThen all api command can be found directly in the api
When updating api no need to update script.project
I don't know if this can be possible and if help you
Pedro
#7
Posted 15 January 2009 - 07:45 AM
A very good idea!Peter,
Make the command AddVariables the possibility to set variable Global (like the Set command)
In Api I add a section [ApiVar] which contain all api command
In Script.project delete all api command from section [Variables]
and add in section [Process] in Script.project[Process] AddVariables,%API%,ApiVar,GLOBALIn api.script[ApiVar] Add_Shortcut=Run,%API%,AddShortcut Require_File=run,%API%,Expand_file Unpack=Run,%API%,Depack _Calculate=run,%API%,CalculateThen all api command can be found directly in the api
When updating api no need to update script.project
I don't know if this can be possible and if help you
Pedro
Peter
#8
Posted 15 January 2009 - 12:22 PM
I realized it.Peter,
Make the command AddVariables the possibility to set variable Global (like the Set command)
In Api I add a section [ApiVar] which contain all api command
In Script.project delete all api command from section [Variables]
and add in section [Process] in Script.project[Process] AddVariables,%API%,ApiVar,GLOBALIn api.script[ApiVar] Add_Shortcut=Run,%API%,AddShortcut Require_File=run,%API%,Expand_file Unpack=Run,%API%,Depack _Calculate=run,%API%,CalculateThen all api command can be found directly in the api
When updating api no need to update script.project
I don't know if this can be possible and if help you
Pedro
Will be available next beta (or inofficially beta 6 a)
Please be sure to use PERMANENT rather than GLOBAL.
from release notes:
****************
added - GLOBAL and PERMANENT options to AddVariables command
AddVariables,%ScriptFile%,section,GLOBAL: Additional new variables list will be defined in all subsequent scripts of the current build.
AddVariables,%ScriptFile%,section,PERMANENT: Additional new variables list will be defined in all subsequent scripts of the current build.
- Additionally all added variables are written into script.project and therefore valid for all subsequent builds.
With GLOBAL the definitions are valid for a complete build, but not when running a single script.
Peter
#9
Posted 15 January 2009 - 04:47 PM
I will test but my idea is not to use the PERMANENT definition or why changing as it is now
I search a simply way for having a quick find of all api function and syntax
[Api_Command] Add_Shortcut=Run,%API%,AddShortcut Require_File=run,%API%,Expand_file Unpack=Run,%API%,Depack _Calculate=run,%API%,Calculate [Api_Syntax] Add_Shortcut,<Type>,<Folder>,<FullFileName>,<Title>,<Work Folder>,<Parameters>,<IconFile>,<StartMode>,<ToolTip> Require_File , <Folder\> filename , <Source> , <Target> Unpack,<Folder>,<Archive>,<Option>,<%Target_Prog%>,<%ProgramFolder%>,<%programExe%>,<Target_Temp> _Calculate,expression,VariableSo with api formatted like this you can make WB easy to list all api function (without knowing them and only for the current project) and their respective Syntax in Api_Syntax section
Hope you understand what I mean
Pedro
#10
Posted 15 January 2009 - 04:55 PM
Great Peter
I will test but my idea is not to use the PERMANENT definition or why changing as it is now
I search a simply way for having a quick find of all api function and syntax[Api_Command] Add_Shortcut=Run,%API%,AddShortcut Require_File=run,%API%,Expand_file Unpack=Run,%API%,Depack _Calculate=run,%API%,Calculate [Api_Syntax] Add_Shortcut,<Type>,<Folder>,<FullFileName>,<Title>,<Work Folder>,<Parameters>,<IconFile>,<StartMode>,<ToolTip> Require_File , <Folder\> filename , <Source> , <Target> Unpack,<Folder>,<Archive>,<Option>,<%Target_Prog%>,<%ProgramFolder%>,<%programExe%>,<Target_Temp> _Calculate,expression,VariableSo with api formatted like this you can make WB easy to list all api function (without knowing them and only for the current project) and their respective Syntax in Api_Syntax section
Hope you understand what I mean
Pedro
API is your playground
And you mean that WB is mine and I can now add to the magic wand !?
I'll see what I can do
Peter
#11
Posted 15 January 2009 - 05:01 PM
YesAPI is your playground
And you mean that WB is mine and I can now add to the magic wand !?
I'll see what I can do
Peter
Simply tell me how to format the section Api_Syntax
Pedro
#12
Posted 15 January 2009 - 05:07 PM
Tomorrow.Yes
Simply tell me how to format the section Api_Syntax
Pedro
I have to go now for 'Nuhr die Wahrheit' (you know the famous German artist?)
Peter
#13
Posted 15 January 2009 - 07:15 PM
#14
Posted 15 January 2009 - 07:45 PM
@Peter
I have tested and it work with GLOBAL even when running a single script.With GLOBAL the definitions are valid for a complete build, but not when running a single script.
Pedro
#15
Posted 16 January 2009 - 09:27 AM
Not for a test in CodeBox!Thank you Nuno
@Peter
I have tested and it work with GLOBAL even when running a single script.
Pedro
In CodeBox as first line there is necessary:
AddVariables,%API%,ApiVar,GLOBAL
Peter
#16
Posted 16 January 2009 - 09:33 AM
Is it possible that on individual script run, script.project will also be run prior, so thatWith GLOBAL the definitions are valid for a complete build, but not when running a single script.
[Process] AddVariables,%API%,ApiVar,GLOBALis run to initiate the api commands?
Regards,
Galapo.
#17
Posted 16 January 2009 - 09:48 AM
I recommend caution when trying to add such functionality...
#18
Posted 16 January 2009 - 09:50 AM
Yes, I had the same thought just after I posted.I have the feeling that this (running script.project when individual script runs) might cause new trouble with the onbuildexit stuff and some other vodoo tricks i implemented...
#19
Posted 16 January 2009 - 10:12 AM
I agree to ctmag!I have the feeling that this (running script.project when individual script runs) might cause new trouble with the onbuildexit stuff and some other vodoo tricks i implemented...
I recommend caution when trying to add such functionality...
Peter
#20
Posted 16 January 2009 - 10:31 AM
[Process] If,System,INDIVIDUAL,Equal,True,AddVariables,%API%,ApiVar,GLOBAL If,System,PROJECT,Equal,True,Begin System,ONBUILDEXIT,Exec,%api%,LiveXP-ONBUILDEXIT EndThen we could have script.project run before an individual script run without consequence.
Regards,
Galapo.
#21
Posted 16 January 2009 - 11:54 AM
The idea is good, but if used like in your example it would me every single script needs to be changed...or am i getting something wrong here?
#22
Posted 16 January 2009 - 11:57 AM
No, that would be in script.project only!???
The idea is good, but if used like in your example it would me every single script needs to be changed...or am i getting something wrong here?
But I emotionally do not like the idea, I cannot yet explain clearly why.
Peter
#23
Posted 16 January 2009 - 01:16 PM
But what i would like is a function (for use in scripts) to do some things when run by green triangle.
On the other hand i think a lot of this could also be done by improving the script code with already existing commands...
#24
Posted 16 January 2009 - 02:20 PM
don't like an idea emotionally?!?But I emotionally do not like the idea, I cannot yet explain clearly why.
Peter is getting latin!
#25
Posted 16 January 2009 - 03:21 PM
Maybe I have had the feeling that this is hurting your 'Fundamental Intentions'don't like an idea emotionally?!?
Peter is getting latin!
..Hold things easy and straight on
But nevertheless:
I have finished a working concept where the magic wand:
- Everytimes presents the actual project's API functions (or none if there is no API in the actual project)
- Works also if a project is not yet built.
To bring to work, in Script.project in the variables section I added
%APIDEF%=API
And in Api.Script I included:
[API] _Calculate="_Calculate,[expression],[Variable (whithout %)]" _FileCopy="_FileCopy,[Source],[Target]" Add_Asso="Add_Asso,[Ext],[Type],[Title],[Filename],[Option],[True for RegAddBoot]" Ask_License="Ask_License,Filename,ID,Section" Associate_file="Associate_file,[Ext],[Type],[Filename],[Option],[True for RegAddBoot]" CopyProgram="CopyProgram,[%FileBox_Source%],[%Target_Prog%\%ProgramFolder%],[%ProgramExe%],[Archive to delete]" QuickScript="QuickScript,RunFromRam,Section_or_7z_file,Add_Shortcut" RegAddBoot="RegAddBoot,RootKey,ValueType,Key,ValueName,Value" Require_File="Require_File,[Folder\]filename,[Source (if source is different of %Source_Sys%)],[Target ( If target is different of %Target_Sys%)]" Require_Version="Require_Version,Filename,Version,Section" Unpack="Unpack,[Folder],[Archive],[Option],[%Target_Prog%],[%ProgramFolder%],[%programExe%],[Target_Temp]"And of course -not visible here- it inserts the code into the CodeBox or current script resp.
This new API section is a 'quick and dirty write down' and only something for test.
It does not claim to be complete, 'nice' or logically correct.
Pedrole#15 and the forum should correct it.
For all the crazy people who want to have it just before it becomes public:
You can get it here
But be careful: The version shows an 'API'. Do it really use ONLY FOR API tests.
The internal variable structure has been significantly changed. And I did not test for standards.
Peter
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users