IPB

 
 
> Script writing help
 
 Lancelot
post Aug 27 2008, 09:34 PM
Post #1


Bug Catcher
*****

Group: .script developer
Posts: 1,796
Joined: 8-May 08
Member No.: 15,072


Turkiye


Answer found, look end of the message.


Question:
I am writing a script that will look for source in 4 locations automatically, if it cant find in 4 ot them, than it will give a warning message in the end.

1) source uncompressed
2) source compressed
3) internet
4) script file

1-2 okey, for 3 i will use download.exe to avoid warning message with webget, but with 4 i have a question to ask.

for 4, if file exists in script file, i want to extract so no warning message in script file
if not exist, it wont try to extract so again no warning message.

Here is what i wrote that didnt work, i guess you will understand what i am tryin to do.

If,ExistFile,"%ScriptFile%","Folder","%sevenzippedpac%",Run,%ScriptFile%,Profromscriptb
[Profromscriptb]
If,NotExistFile,%sourcefilezloc%\%ProgramEXE%,ExtractFile,"%ScriptFile%","Folder","%sevenzippedpac%","%sourcefilezloc%"


Thanks for any help.


ps: first 2 messages of this topic is here: post 17 & post 18


Edit:

Answer:
attach a small file to script, than use this code


[Profromscripta]
If,NotExistDir,"%sourcefilezloc%TEMP",DirMake,"%sourcefilezloc%TEMP"
ExtractAllFiles,"%ScriptFile%","Folder","%sourcefilezloc%TEMP"
If,ExistFile,%sourcefilezloc%TEMP\%sevenzippedpac%,FileCopy,%sourcefilezloc%TEMP\%sevenzippedpac%,%sourcefilezloc%
FileDelete,%sourcefilezloc%TEMP
Go to the top of the page
 
 
 psc
post Aug 28 2008, 08:58 AM
Post #2


Guru
******

Group: .script developer
Posts: 6,558
Joined: 14-July 06
From: Korschenbroich
Member No.: 3


Germany


QUOTE (Lancelot @ Aug 27 2008, 11:34 PM) *
[Profromscripta]
If,NotExistDir,"%sourcefilezloc%TEMP",DirMake,"%sourcefilezloc%TEMP"
ExtractAllFiles,"%ScriptFile%","Folder","%sourcefilezloc%TEMP"
If,ExistFile,%sourcefilezloc%TEMP\%sevenzippedpac%,FileCopy,%sourcefilezloc%TEMP\%sevenzippedpac%,%sourcefilezloc%
FileDeleteDirDelete,%sourcefilezloc%TEMP

That will work, but some concerns:
Imagine you are looking for a small file with only some bytes.
And the script has many attached files with several megabyte.
Extract them all?

Better would be
CODE
If,EXISTSECTION,%ScriptFile%,EncodedFile-Folder-%sevenzippedpac%,IniRead, \ %ScriptFile%,EncodedFile-Folder-%sevenzippedpac%,lines,%var%
If,EXISTVAR,%var%,ExtractFile,%ScriptFile%,Folder,%sevenzippedpac%,%sourcefilezloc%


Another item you have to think about:
The file can be attached at a place different from 'Folder'. Therefore this algorithm cannot be applied to every script written by anybody.
You must be sure that it is in 'Folder'

Peter
Go to the top of the page
 
 
 Lancelot
post Aug 28 2008, 01:41 PM
Post #3


Bug Catcher
*****

Group: .script developer
Posts: 1,796
Joined: 8-May 08
Member No.: 15,072


Turkiye


QUOTE
Imagine you are looking for a small file with only some bytes.
And the script has many attached files with several megabyte.
Extract them all


Yep, that was my concern, and now with your help it is okey
i used this

If,EXISTSECTION,%ScriptFile%,EncodedFile-Folder-%sevenzippedpac%,ExtractFile,"%ScriptFile%","Folder","%sevenzippedpac%","%sourcefilezloc%"

QUOTE
You must be sure that it is in 'Folder'


I thought that before too, so I made a tutorial section to be sure.

here is the script http://www.boot-land.net/forums/?showtopic=5549
Go to the top of the page
 
 
 Lancelot
post Sep 19 2008, 03:25 PM
Post #4


Bug Catcher
*****

Group: .script developer
Posts: 1,796
Joined: 8-May 08
Member No.: 15,072


Turkiye


i am working on a script that i put these to startup using runonce and a .cmd

%SystemRoot%\system32\regsvr32.exe /s %SystemRoot%\system32\mshtmled.dll
%SystemRoot%\system32\regsvr32.exe /s /i %SystemRoot%\system32\mshtml.dll

to make these in buildtime, which should i use?
Run,%OLESupportScript%,Install-DLL,mshtmled.dll,mshtml.dll

Run,%OLESupportScript%,Register-DLL,mshtmled.dll,mshtml.dll

or sth else?

i tried some set of combinations which failed, i guess i am missing sth.
Go to the top of the page
 
 
 psc
post Sep 19 2008, 04:40 PM
Post #5


Guru
******

Group: .script developer
Posts: 6,558
Joined: 14-July 06
From: Korschenbroich
Member No.: 3


Germany


QUOTE (Lancelot @ Sep 19 2008, 05:25 PM) *
Run,%OLESupportScript%,Install-DLL,mshtmled.dll,mshtml.dll
Run,%OLESupportScript%,Register-DLL,mshtmled.dll,mshtml.dll


Peter
Go to the top of the page
 
 
 Lancelot
post Sep 19 2008, 06:04 PM
Post #6


Bug Catcher
*****

Group: .script developer
Posts: 1,796
Joined: 8-May 08
Member No.: 15,072


Turkiye


Thanks Peter
Go to the top of the page
 
 
 Lancelot
post Dec 23 2008, 12:43 AM
Post #7


Bug Catcher
*****

Group: .script developer
Posts: 1,796
Joined: 8-May 08
Member No.: 15,072


Turkiye


I need 2 help

-
i want to delete folder IF folder is empty

-
how can i get a random number, or milisecond of current time with winbuilder


ps: peter thank you for StrFormat,DATE (IMG:http://img.donanimhaber.com/image.aspx/upfiles/smiley/s20.gif) (IMG:../forums/style_emoticons/default/frusty.gif) (IMG:http://img.donanimhaber.com/image.aspx/upfiles/smiley/s20.gif)
Go to the top of the page
 
 
 psc
post Dec 23 2008, 08:55 AM
Post #8


Guru
******

Group: .script developer
Posts: 6,558
Joined: 14-July 06
From: Korschenbroich
Member No.: 3


Germany


QUOTE (Lancelot @ Dec 23 2008, 01:43 AM) *
i want to delete folder IF folder is empty

CODE
Retrieve,FOLDERSIZE,Dir,%var%
If,%var%,EQUAL,0,DirDelete,Dir


Peter
Go to the top of the page
 
 
 Lancelot
post Dec 23 2008, 03:15 PM
Post #9


Bug Catcher
*****

Group: .script developer
Posts: 1,796
Joined: 8-May 08
Member No.: 15,072


Turkiye


Thank you Peter,

Forget my second question, i already found the answer and NO need for milisecond. Thank you a looooot for everything.
Go to the top of the page
 
 
 
 

 
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

Collapse

>

  Topic Replies Topic Starter Views Last Action
No New Posts Help! Please :) How to add a linux iso to the grub menu
0 lew247 9 Today, 10:35 AM
Last post by: lew247
No New Posts help please script
2 OutCast2 102 24th February 2009 - 01:09 AM
Last post by: Nuno Brito
No New Posts Help changing registry setting in HKU
Need to change a setting in HKEY_USERS in Default User
3 thasan 145 17th February 2009 - 01:41 PM
Last post by: thasan
No new Posts Topic has attachments Script: Vista Driver Packs
25 DaveXP 2,269 16th February 2009 - 11:54 AM
Last post by: thelegendarypig666
No new Posts Topic has attachments Help solving a feud between psc and myself
18 MedEvil 351 11th February 2009 - 03:25 PM
Last post by: MedEvil


 
menu_build_menu( "topicreferrals", new Array( img_item + " %olesupportscript%,register-dll   2 clicks", img_item + " http://www.boot-land.net/   1 clicks", img_item + " http://boot-land.net/news...Newsletter.html   1 clicks" ) );

RSS "Boot-Land.net", "WinBuilder" Lo-Fi Version Time is now: 26th February 2009 - 04:12 PM