#205830 - 2012-09-27 11:26 AM
Opening multiple .kix files in multiple subdirectories
|
LSSJPDude
Just in Town
Registered: 2012-04-19
Posts: 4
Loc: Netherlands
|
Hey there,
We have been trying to call or open multiple .kix files in multiple subdirectories. we got a main file in our netlogon folder. what we'd like to do is open .kix files (which will install the program depending on the directorie, for example, a .kix file in ccleaner) from the netlogon/apps/program folder.
but we can't seem to work it out this the code we are using per program to install them note, this all the code in that file
IF not exist ("C:\Program Files\kixinstall\CCleaner Installed.dum") $NewsTextBox.Text="Bezig met het installeren van Ccleaner." Shell ("\\$srvnaam\NETLOGON\apps\ccleaner\ccsetupSlim.exe /S /D=C:\Program files\CCleaner /L=1031") COPY "\\$srvnaam\NETLOGON\apps\ccleaner\CCleaner Installed.dum" "C:\Program Files\kixinstall\*.*" /r /c Endif
as for the code to call the .kix files we have been experimenting with call and shell in the following code
call ("\\svrnaam\netlogon\apps\*\*.kix")
but all this doesn't want to work unfortunatly so any help is appreciated
edit: maybe a bit of a better explanation of what we are trying to do. we want the main .kix file to look and open other .kix files in the /apps folders
Edited by LSSJPDude (2012-09-27 11:29 AM)
|
|
Top
|
|
|
|
#205833 - 2012-09-27 01:52 PM
Re: Opening multiple .kix files in multiple subdirectories
[Re: Mart]
|
LSSJPDude
Just in Town
Registered: 2012-04-19
Posts: 4
Loc: Netherlands
|
But if i get it right, that's just opening the kix files from 1 folder i want it to look through the folders in the subdirectory to see if there is a .kix file there and then run it
for example a few paths that we use netlogon\apps\ccleaner netlogon\apps\notepad++ netlogon\apps\office2010
so, is that possible with that piece of code then?
|
|
Top
|
|
|
|
#205842 - 2012-09-27 08:21 PM
Re: Opening multiple .kix files in multiple subdirectories
[Re: Mart]
|
LSSJPDude
Just in Town
Registered: 2012-04-19
Posts: 4
Loc: Netherlands
|
well removing the + shouldn't be a problem but i'm still on about 1 thing is it possible to let the main .kix file, find other .kix files (in the subdirectories mind you) by it's own?
for example we don't have skype installed (just naming a program here) and we make a new folder with the program installer, a check file and the .kix to install it. if we place that folder in the "apps" subdirectory, we want the main .kix file pick that new installation up
|
|
Top
|
|
|
|
#205844 - 2012-09-27 09:32 PM
Re: Opening multiple .kix files in multiple subdirectories
[Re: Glenn Barnas]
|
Shanee
Fresh Scripter
Registered: 2006-10-13
Posts: 39
Loc: Tulsa, OK
|
I usually use Jens DirList() UDF to enumerate files into an array. It can be found here...
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Board=7&Number=82581
Below is an example that might work for you.
$installfiles = DirList("\\svrname\netlogon\apps\*.kix",6)
for each $installfile in $installfiles
call ($installfile)
next
Function dirlist($dirname, optional $options)
dim $filename, $counter, $filepath, $mask
dim $list, $sublist, $subcounter
$counter=-1
$dirname=trim($dirname)
if $dirname=''
$dirname=@CURDIR
endif
if right($dirname,1)='\'
$dirname=left($dirname,len($dirname)-1)
endif
if getfileattr($dirname) & 16
$mask='*.*'
else
$mask=substr($dirname,instrrev($dirname,'\')+1)
$dirname=left($dirname,len($dirname)-len($mask)-1)
endif
redim $list[10]
$filename=dir($dirname+'\'+$mask)
while $filename<>'' and @ERROR=0
if $filename<>'.' and $filename<>'..'
select
case (getfileattr($dirname+'\'+$filename) & 16)
if $options & 1
$counter=$counter+1
if $options & 2
$list[$counter]=$dirname+'\'+$filename+'\'
else
$list[$counter]=$filename+'\'
endif
endif
if ($options & 4)
$sublist=dirlist($dirname+'\'+$filename+'\'+$mask,$options)
if ubound($sublist)+1
redim preserve $list[ubound($list)+ubound($sublist)+1]
for $subcounter=0 to ubound($sublist)
$counter=$counter+1
if $options & 2
$list[$counter]=$dirname+'\'+$filename+'\'+$sublist[$subcounter]
else
$list[$counter]=$filename+'\'+$sublist[$subcounter]
endif
next
endif
endif
case ($options & 2)
$counter=$counter+1
$list[$counter]=$dirname+'\'+$filename
case 1
$counter=$counter+1
$list[$counter]=$filename
endselect
if $counter mod 10
redim preserve $list[$counter+10]
endif
endif
$filename = dir('')
loop
if $counter+1
redim preserve $list[$counter]
else
$list=''
endif
if $mask<>'*.*' and ($options & 4)
$filename=dir($dirname+'\*.*')
while $filename<>'' and @ERROR=0
if $filename<>'.' and $filename<>'..'
if (getfileattr($dirname+'\'+$filename) & 16)
$sublist=dirlist($dirname+'\'+$filename+'\'+$mask,4)
if ubound($sublist)+1
redim preserve $list[ubound($list)+ubound($sublist)+1]
for $subcounter=0 to ubound($sublist)
$counter=$counter+1
if $options & 2
$list[$counter]=$dirname+'\'+$filename+'\'+$sublist[$subcounter]
else
$list[$counter]=$filename+'\'+$sublist[$subcounter]
endif
next
endif
endif
endif
$filename = dir('')
loop
endif
if $counter+1
redim preserve $list[$counter]
else
$list=''
endif
$dirlist=$list
endfunction
|
|
Top
|
|
|
|
#205845 - 2012-09-27 10:37 PM
Re: Opening multiple .kix files in multiple subdirectories
[Re: Shanee]
|
LSSJPDude
Just in Town
Registered: 2012-04-19
Posts: 4
Loc: Netherlands
|
Well, we generally use kixtart to install all the programs needed etc. etc. that gets done by us (only 3 of us) so we add the clients to the domain and login (at which point the script will start running) occasionally, not every often though, we just add the client to the domain the script itself gets run every time a user logs in, no matter what user that's done because sometimes we add a program, or give something an update all in all, i think we handle about 40-50 clients per server (1 server each client)
As for the code Shanee posted I can try that code on monday see how it works (to be honest, i'm not that much of a kixtart proffesional)
but i kinda have the feeling that the point i'm trying to make is getting missed i'll explain the current situation and then the situation as we would like to have it.
at the moment, we got 1 .kix file doing everything setting up printers, installing programs etc, etc the .kix file is in the folder Netlogon and all the installers are in Netlogon/Apps/enter program name here
what we like to go for is that we make a seperate .kix file for each program and put that .kix file into the same folder as that program for example in Netlogon/Apps/Notepad and there in would Netlogon/Apps/Notepad/Notepad.kix be
the idea is, is that .kix file in Netlogon will start calling apon all install .kix files also, that the main .kix file is "smart" enough to take a new .kix file (for example, we added another program into the /Apps folder) by itself, without messing with the main .kix file
the purpose for this is so that we can just copy the folder of the new program to the other servers and then be done with it, without further messing with the code
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 793 anonymous users online.
|
|
|