#120340 - 2004-05-28 10:48 AM
Need help with JRE deployment via Kixtart
|
Peak
Fresh Scripter
Registered: 2004-05-24
Posts: 7
|
Ok first of all I’m new with Kixtart so bare with me. 
This is my scenario. I have to deploy Java runtime environment to a lot of computers. We are running an old NT domain (no AD) with Kixtart logon scripts.
The computers that I have to deploy the JRE to, all have names looking like this
Department001
I have got a list with all the computer names that need JRE installed.
So I’m thinking of writing a script that works like this:
Sort the department name and number into two variables
If the department variable is equal to the right department call the JRE Deploy script
JRE Deploy script:
Check if JRE is installed, if not installed
Check if number variable is in the list of numbers if it is
Install JRE then remove the number in number variable from the list of numbers
What I need help with is
How will I sort the department name and number into two different variables?
How will I search the list of numbers, and removing a number from the list?
Please fell free to comment on this, any suggestions is appreciated.
|
|
Top
|
|
|
|
#120341 - 2004-05-28 11:11 AM
Re: Need help with JRE deployment via Kixtart
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Use a centralised INI file - look up the ReadProfileString() and WriteProfileString() functions in the manual.
Have a section of the file that looks like this:
Code:
[DEPARTMENTS]
ABCDepartment=1
DEFDepartment=0
GHIDepartment=1
...
department999=1
You can now use:
Code:
$sDepartment=Left(@WKSTA,1,Len(@WKSTA)-1)
$sComputerNo=Right(@WKSTA,3)
If ReadProfileString("Department.ini","DEPARTEMENTS",$sDepartment)
...Check JRE install here...
EndIf
You just need to set the value on the department key in the ini file to "1" to install, and "0" to not install. The default (if the department key does not exist) is to not install.
You should check the registry to see if the JRE exists rather than using a list, which will cater for machines that get it removed for any reason.
It you want to track the installs, then write the machine name back to the ini file with a timestamp as data like this:
Code:
$=WriteProfileString("Department.ini","INSTALLED",@WKSTA,@DATE+" "+@TIME)
|
|
Top
|
|
|
|
#120343 - 2004-05-28 11:10 PM
Re: Need help with JRE deployment via Kixtart
|
Peak
Fresh Scripter
Registered: 2004-05-24
Posts: 7
|
Quote:
However writing back to a centralized .ini file can potentially be problematic due to file locks.
This I have thought of .
So if I dont want this to be too complicated (=database). Would it be a good idéa to first have a script make files (or folders) on an network share from the list of computernames. Then have the install script search the network share for a file to match the computername, install JRE and then delete the file?
|
|
Top
|
|
|
|
#120346 - 2004-05-29 01:13 AM
Re: Need help with JRE deployment via Kixtart
|
Peak
Fresh Scripter
Registered: 2004-05-24
Posts: 7
|
The basic idéa with having the computers removing themself from som kind of list was to know when the install script could be removed from the start script. But NTDOCs way should probably just work fine.
|
|
Top
|
|
|
|
#120348 - 2004-06-01 02:24 PM
Re: Need help with JRE deployment via Kixtart
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
The basic idéa with having the computers removing themself from som kind of list was to know when the install script could be removed from the start script.
Generally you want to leave the install script in permanently, and only call it when needed. This is the purpose of checking the registry to see if the install needs to be done.
The idea is that the JRE will be installed automatically if you install a new computer to the department in future, or if the JRE is accidentally or deliberately removed.
If you use a list then it will quickly become out of date, and will not cater for the situation when JRE has been removed.
|
|
Top
|
|
|
|
#120349 - 2004-06-02 10:39 AM
Re: Need help with JRE deployment via Kixtart
|
Peak
Fresh Scripter
Registered: 2004-05-24
Posts: 7
|
Quote:
Generally you want to leave the install script in permanently, and only call it when needed. This is the purpose of checking the registry to see if the install needs to be done.
The idea is that the JRE will be installed automatically if you install a new computer to the department in future, or if the JRE is accidentally or deliberately removed.
If you use a list then it will quickly become out of date, and will not cater for the situation when JRE has been removed.
This I know. But all computers in that department should not have JRE installed. And all new computers/installations comes with JRE.
|
|
Top
|
|
|
|
#120350 - 2004-06-02 10:54 AM
Re: Need help with JRE deployment via Kixtart
|
Peak
Fresh Scripter
Registered: 2004-05-24
Posts: 7
|
So this is what I got so far.
;from kixtart.kix IF Left(@WKSTA,5)=pcsoc
call jredeploy.kix
ENDIF
;jredeploy.kix IF NOT (registry check here)
$CompNR=Right(@WKSTA,3)
$installed=ReadProfileString("jredeploy.ini",compNR,$CompNR)
IF $installed=0
shell "\\server\jre.exe"
WriteProfileString("jredeploy.ini",compNR,$CompNR,1)
ENDIF
ENDIF
EXIT
jredeploy.ini [compNR] 000=0 001=0 006=0 010=0 011=0 ...
Now I only need some help with the try-again loop sugested by Les
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 764 anonymous users online.
|
|
|