IPB

Welcome Guest ( Log In | Register )

Recommended
BootDisk.com

Active Users

 
Reply to this topicStart new topic
Script writing help
Lancelot
post Aug 27 2008, 09:34 PM
Post #1


Bug Catcher
***

Group: Advanced user
Posts: 675
Thank(s): 48
Joined: 8-May 08
Member No.: 15,072


Turkey


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
 
+Quote Post
psc
post Aug 28 2008, 08:58 AM
Post #2


Guru
***

Group: .script developer
Posts: 5,404
Thank(s): 83
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
 
+Quote Post
The Following 1 Users Say Thank You to psc For This Useful Post:
Lancelot
Lancelot
post Aug 28 2008, 01:41 PM
Post #3


Bug Catcher
***

Group: Advanced user
Posts: 675
Thank(s): 48
Joined: 8-May 08
Member No.: 15,072


Turkey


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
 
+Quote Post
Lancelot
post Sep 19 2008, 03:25 PM
Post #4


Bug Catcher
***

Group: Advanced user
Posts: 675
Thank(s): 48
Joined: 8-May 08
Member No.: 15,072


Turkey


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
 
+Quote Post
psc
post Sep 19 2008, 04:40 PM
Post #5


Guru
***

Group: .script developer
Posts: 5,404
Thank(s): 83
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
 
+Quote Post
Lancelot
post Sep 19 2008, 06:04 PM
Post #6


Bug Catcher
***

Group: Advanced user
Posts: 675
Thank(s): 48
Joined: 8-May 08
Member No.: 15,072


Turkey


Thanks Peter
Go to the top of the page
 
+Quote Post
« Next Oldest · WinBuilder · Next Newest »
 

Fast ReplyReply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 

Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

RSS Lo-Fi Version Time is now: 12th October 2008 - 08:52 AM

W3C XHTML • © 2008 Boot Land • All rights reserved • W3C CSS