Reply to this topic
 Enforcing Dependencies in WinBuilder Scripts
post Nov 20 2009, 07:31 PM
Post #1
WetHat
Member   **
Group: Members

  Joined: 21-December 08 From: Black Forest

Posts: 40
Thank(s): 15


Germany


WinBuilder allows the specification of dependent files and scripts under the script options tab (see screenshot):



However, WinBuilder does not seem to enforce these dependencies. If dependent files are missing the script continues without any warning. If script dependenies need to be enforced a bit of custom code can be used.

Just add the following code sections to your WinBuilder script:

CODE
[process]
Run,%ScriptFile%,CheckDependencies
. . . . .

[CheckDependencies]
Echo,"Checking dependencies ..."
IniRead,%ScriptFile%,main,Depend,%Depend%
StrFormat,SPLIT,"%Depend%",#$c,0,%DependencyCount%
Loop,%ScriptFile%,CheckDependency,1,%DependencyCount%

[CheckDependency]
StrFormat,SPLIT,"%Depend%",#$c,#c,%Dependency%
If,NOTEXISTFILE,"%Dependency%",Begin
  Set,%msg%,"%ScriptTitle% requires %Dependency%"
  Message,"%msg%",Error
  Exit,"%msg%"
End
## ____/If dependency is a script assert that it is selected\____ ##
StrFormat,EXT,"%Dependency%",%DependencyExtension%
If,%DependencyExtension%,EQUAL,".script",Begin
  IniRead,"%Dependency%","Main","Selected",%DependentScriptSelected%
  If,"%DependentScriptSelected%",Equal,False,begin
    IniRead,"%Dependency%","Main","Title",%DependentScriptTitle%
    Set,%msg%,"Script #$q%DependentScriptTitle%#$q must be selected to use %ScriptTitle%"
    Message,"%msg%",Error
    Exit,"%msg%"
  end
End


WetHat


--------------------


+Quote Post
post Nov 20 2009, 09:16 PM
Post #2
Lancelot
Frequent Member   ****
Group: .script developer

  Joined: 8-May 08 From: Turkiye/Izmir

Posts: 937
Thank(s): 709


Turkiye


QUOTE (WetHat @ Nov 20 2009, 09:31 PM) *
However, WinBuilder does not seem to enforce these dependencies. If dependent files are missing the script continues without any warning. If script dependenies need to be enforced a bit of custom code can be used.


Hi WetHat,

WinBuilder does something to enforce,
*
if the dependency script not available and when you try to enable the script, wb warns you that you do not have the dependent script and does not enable the script.
*
if the dependency script available and when you enable the script than you get depedency script enabled too.
*
However,
user can make a mistake and disable dependency script after enableing OR user may have already enabled script which depends on another script OR maybe an advanced user making a test cool.gif

====>
We have a verrry good tool to prevent end users from these kind of mistakes, wbverify.exe (Verify Project , !WBVerify.Script ). (check here )

!WBVerify.Script executed at the very begining of the project to check many things including dependencies wink.gif

If there is a dependency error you would get
"blablabla requires dabalabula"



Getting error/warning at the very early step of the build is better than getting the error/warning after many process, I hope you like wbverify cheers.gif


--------------------
I Galapo's LiveXP and King Amalux's Great LiveXP Package (tutorial and everything)
Lancelot Tips For LiveXP
I hate Medusa problems of WinBuilder, Cryptic codes, syntax rules fakingly mismatching working lines, not having even basic fundemantal syntax rules and mostly 'lies' and 'post games'.
('post games' = includes dishonest, childish posts that have goal to annoy others in community)
+Quote Post
post Nov 20 2009, 10:28 PM
Post #3
WetHat
Member   **
Group: Members

  Joined: 21-December 08 From: Black Forest

Posts: 40
Thank(s): 15


Germany


QUOTE (Lancelot @ Nov 20 2009, 10:16 PM) *
a verrry good tool to prevent end users from these kind of mistakes, wbverify.exe (Verify Project , !WBVerify.Script ). (check here )

!WBVerify.Script executed at the very begining of the project to check many things including dependencies wink.gif

If there is a dependency error you would get
"blablabla requires dabalabula"

Getting error/warning at the very early step of the build is better than getting the error/warning after many process, I hope you like wbverify cheers.gif


Hi Lancelot,

I agree that an early check is much better. I'll give wbverify a try!

Thanks for pointing this out.

WetHat


--------------------
+Quote Post

Reply to this topic
2 User(s) are reading this topic ()



Collapse

  Topic Replies Topic Starter Views Last Action
No new Topic has attachmentsInstall Windows 7/Vista From USB Drive
Very simple
71 Nuno Brito 36,960 1st September 2010 - 02:34 PM
Last post by: ps2_hacker
No New Posts Intel 82577LM not auto detected / HP 8540w
4 spiffywiffy 211 1st September 2010 - 12:29 PM
Last post by: dera
No new WinBuilder.net merged into Boot Land.
16 Nuno Brito 1,596 31st August 2010 - 10:57 PM
Last post by: Nuno Brito
No New Posts internet problems
1 rjp54 165 30th August 2010 - 02:48 PM
Last post by: Wonko the Sane
No New Posts scripts
making a "choosing script"
4 Rah.Levi 519 23rd August 2010 - 02:32 PM
Last post by: Rah.Levi