Page 1 of 1 1
Topic Options
#152910 - 2005-12-06 10:45 AM Automatic installation
Bobbes Offline
Fresh Scripter

Registered: 2005-12-02
Posts: 7
Hi,

For a school project, i'm working on a script that needs to install files from a fileserver after a certain date. I was thinking about something like a .INI file on the client which compares the date in it with all the files in the folder on the fileserver. But now my question:

What commands can i use so the script will install multiple files from the folder on the fileserver without knowing what the filename is? Because it needs to be variable so you don't need to edit the script everytime there is an update for the client.

Hope you can help me,
Bobbes

Top
#152911 - 2005-12-06 02:25 PM Re: Automatic installation
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Can you be more specific with what you are attempting to accomplish?
Quote:

i'm working on a script that needs to install files from a fileserver after a certain date.



What does install mean? Do you want to copy? If so, there is a copy command or even Xcopy or Robocopy. Are you saying that you want to have a script run but take no action until a certain time/date passes? Or are you only wanting to install file that meet a certain date requirement?


Edited by Howard Bullock (2005-12-06 02:25 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#152912 - 2005-12-06 08:06 PM Re: Automatic installation
Bobbes Offline
Fresh Scripter

Registered: 2005-12-02
Posts: 7
Well, they asked me to build a system with InstallRite and Kixtart.
InstallRite records an installation on one Client and builds a .EXE file.
The .Exe file is going to be placed on the File server in a folder so All client computers can access the files.

When a client computer starts, Kixtart needs to check if there is a new .EXE file for him and if there is, he needs to run the file. But it is possible that there are more updates for him, so the also needs to wait before an other installation is done. Something like Old files First. (Maybe an other solution for a date in a .INI file is to check witch files the client allready have and compare that with the folder on the fileserver and download the ones he doesn't have. But i don't know what is easier to make)

Hope this explains a little more,
Bobbes


Edited by Bobbes (2005-12-06 08:08 PM)

Top
#152913 - 2005-12-08 05:11 AM Re: Automatic installation
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Check out the COMPAREFILETIMES() function and the DirPlus() and DirList() UDFs.
_________________________
There are two types of vessels, submarines and targets.

Top
#152914 - 2005-12-08 10:19 AM Re: Automatic installation
Bobbes Offline
Fresh Scripter

Registered: 2005-12-02
Posts: 7
Yes I noticed that UDF command, but it can't compare the data IN two .INI files right? It is used to compare the date OF 2 different files which won't make the system variable.

What about the solution with the directory list? Compare the files in the folder of the filserver with a .INI file on the client what says which files he already have and install the ones he is missing and after that rebuild the .INI file with the files he installed?

I think this is a rather difficult situation, but not impossible

Top
#152915 - 2005-12-08 10:31 AM Re: Automatic installation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
why you need the ini?
why don't you just compare the files directly?
_________________________
!

download KiXnet

Top
#152916 - 2005-12-08 10:43 AM Re: Automatic installation
Bobbes Offline
Fresh Scripter

Registered: 2005-12-02
Posts: 7
Because he doesn't need to compare files on the cliënt with the ones on the server. The files that are on the server are .EXE files the clients need to run.
The clients just need to know what files are installed before (by writing them into a ini file) and install the files on the fileserver he never installed before. (Which won't be in the ini file)

Maybe this makes sense:
Code:

If Open( 3 , "C:\TEMP\LOG.ini" , 5 ) = 0
$FileName = Dir("\\server\data\*.exe")
While $FileName <> "" And @ERROR = 0
$x = WriteLine( 3 , $FileName + @CRLF )
$FileName = Dir() ; retrieve next file
Loop



Edited by Bobbes (2005-12-08 10:47 AM)

Top
#152917 - 2005-12-08 10:50 AM Re: Automatic installation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh.
k, think I understand.

so, what about something like:
Code:

$FileName = Dir("\\server\data\*.exe")
While $FileName <> "" And @ERROR = 0
if not len(readprofilestring("c:\temp\log_installs.ini",$FileName,"",""))
;not run. running and writing to ini.
shell "\\server\data\"+$FileName
$=writeprofilestring("c:\temp\log_installs.ini",$FileName,@userID,"@Date @Time")
endif
$FileName = Dir() ; retrieve next file
Loop

_________________________
!

download KiXnet

Top
#152918 - 2005-12-08 11:10 AM Re: Automatic installation
Bobbes Offline
Fresh Scripter

Registered: 2005-12-02
Posts: 7
Yeah, this seems to be something that does the job.
But there is a error in the line of the profile string. (Too many parameters)
Code:
 If Not Len(ReadProfileString("c:\temp\log_installs.ini",$FileName,"",""))



Edited by Bobbes (2005-12-08 11:11 AM)

Top
#152919 - 2005-12-08 11:11 AM Re: Automatic installation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what that error might possibly be?
_________________________
!

download KiXnet

Top
#152920 - 2005-12-08 11:14 AM Re: Automatic installation
Bobbes Offline
Fresh Scripter

Registered: 2005-12-02
Posts: 7
Yes, if i remove that line, it writes perfectly to the ini file.
Else I retrieve a too many parameters error

Top
#152921 - 2005-12-08 11:21 AM Re: Automatic installation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
so, the error was too many parameters.

so, remove the last ,"" from the line.
_________________________
!

download KiXnet

Top
#152922 - 2005-12-08 11:24 AM Re: Automatic installation
Bobbes Offline
Fresh Scripter

Registered: 2005-12-02
Posts: 7
Ohh, thank you so much! you really helped us in the right direction.
Thanks!

Top
#152923 - 2005-12-08 11:26 AM Re: Automatic installation
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
good.
that was my intention.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 242 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.069 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org