Page 1 of 1 1
Topic Options
#120340 - 2004-05-28 10:48 AM Need help with JRE deployment via Kixtart
Peak Offline
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 Offline
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
#120342 - 2004-05-28 08:56 PM Re: Need help with JRE deployment via Kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
However writing back to a centralized .ini file can potentially be problematic due to file locks.
Top
#120343 - 2004-05-28 11:10 PM Re: Need help with JRE deployment via Kixtart
Peak Offline
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
#120344 - 2004-05-28 11:16 PM Re: Need help with JRE deployment via Kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The probability of contention is commensurate with the number of clients updating at the same time. You could simply check the return code and go into a try-again loop being carefull to have a timer get you out of the loop, or you could log only failures.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#120345 - 2004-05-29 12:48 AM Re: Need help with JRE deployment via Kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Well it doesn't look like you mean to track it in a log.

It appears that you're mainly only concerned that it get installed on the correct computer, so just using the .ini to read a list should work fine.

1. Check if @WKSTA needs application by checking the registry
2. If it does, read the .INI file to see if the @WKSTA is listed
3. If it is and registry says it is not installed, launch the installer. If @WKSTA is not found in the .INI then do nothing.

If you do want to log it then I'd recommend the user write back to a central location, not a central file the name of the computer the time and any other important information you want. Then I'd copy all of those files into a single file from DOS copy *.log MYREPORT.TXT

Then use Excel to import MYREPORT.TXT for sorting or printing.

Top
#120346 - 2004-05-29 01:13 AM Re: Need help with JRE deployment via Kixtart
Peak Offline
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
#120347 - 2004-05-29 01:31 AM Re: Need help with JRE deployment via Kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
It really depends on how many computers hit the INI at once. DOC is talking about when there are thousands of clients.

You can use the INI to flag done tasks but there is a remote chance of contention. Keep the INI small by limiting what you write and loop thru several tries if the return code shows contention.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#120348 - 2004-06-01 02:24 PM Re: Need help with JRE deployment via Kixtart
Richard H. Administrator Offline
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 Offline
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 Offline
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
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 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.061 seconds in which 0.027 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