Index  | Recent Threads  | Unanswered Threads  | Who's Active  | Guidelines  | Search
 

Quick Go »
No member browsing this thread
Thread Status: Active
Total posts in this thread: 14
Posts: 14   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1777 times and has 13 replies Next Thread
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: Autoinstaller for multiple machines

Morning rutgers-nieer-cgilbert

I posted it a couple of days ago here .

I will be modifying the note in a couple of hours as the xml file that has to be used can be modified if you want the devices to use a particular Device Profile or should be clean if you just want it to use the default.

Regards Slug

EDIT: The post has been updated
----------------------------------------
[Edit 2 times, last edit by Former Member at Feb 2, 2006 10:49:06 AM]
[Feb 2, 2006 6:33:58 AM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: Autoinstaller for multiple machines

Hello rutgers-nieer-cgilbert,
One 'service hack' is described on the Unofficial WCG: http://www.unofficialworldcommunitygrid.com/service.shtml
[Feb 2, 2006 10:45:01 AM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
biggrin Re: Autoinstaller for multiple machines

So after a couple days of testing, I was able to come up with a script that works! laughing

What this script does is it assumes the following:
    idea The program has been installed and is stopped at the regestering point.
    idea The two files "INSTSRV.EXE" and "SRVANY.EXE" have been installed int he "C:\WINDOWS\SYSTEM32" directory. You can download these resource kit files from M$ bygoing here.

I added some comments along the way for those who want to understand what variables and such are. By default, this script will auto register with the member name and password you provide in the variables "strUser" and "strPassword". When it registers, it just simply pulls the current computername as the Grid Agent name. You can change this action to register for the first time, although I think this script would be kinda pointless, but it is there! Just change "boolRegistered" to FALSE to register a new member name.

Again, by default, it assumes during the second half that you want to install the client as a service. This will run anytime whether the user is logged into the computer or not. You can disable this from running by changing "boolInstallSrv" to FALSE.

I decided to have this run locally rather than remotely although someone, if you wanted to, could tweak the script to do just that.

Here's the code (I wrote it in Notepad, but it looks like some of the formating went away, I'm not this sloppy as it look): biggrin

'==========================================================================
'Macro for World Community Grid Registration
'
'Created by: Raymond McCarthy Bergeron
'Updated: 2/3/2006
'Notes: Developed for a Windows XP Pro environment, not tested for
' other rollout environments.
'
'Description: This macro assumes that the registration process has not
' been finished yet and automates the registration with the
' perameters below. It will also setup the agent as a
' service if you switch the perameter from FALSE to TRUE.
' This also assumes by default that the two files:
' "SRVANY.EXE" and "INSTSRV.EXE" is placed in the
' "C:\WINDOWS\SYSTEM32" Directory. The service will also be
' nameded simply "WCG Agent" and will automatically start
' after the script has been run. This script is assumed to
' run on the local machine.
'==========================================================================
Dim objShell, objWMIService, objProcess, objService
Dim colProcess, colListOfServices
Dim strUser, strPassword, strDeviceID, strEMail, strCommand
Dim boolRegistered, boolInstallSrv

Set objShell = Wscript.CreateObject("Wscript.Shell")

'--------------------------------------------------------------------------
'strUser - The member name to register with
'strPassword - The password associated with the member name
'strDeviceID - If filled out, it will use this as your Grid Agent name,
' If left "", it assumes you will use the default
'strEMail - The E-Mail address you wish to register with
'strUDPath - The Path to the WCG UD.EXE agent file
'strInstsrvPath - The Path to the INSTSRV.EXE file
'strSrvanyPath - The Path to the SRVANY.EXE file
'--------------------------------------------------------------------------
strUser = "membername"
strPassword = "memberpassword"
strDeviceID = ""
strEMail = ""
strUDPath = "C:\Program Files\WorldCommunityGrid\UD.EXE"
strInstsrvPath = "C:\WINDOWS\SYSTEM32\INSTSRV.EXE"
strSrvanyPath = "C:\WINDOWS\SYSTEM32\SRVANY.EXE"

'--------------------------------------------------------------------------
'boolRegistered (TRUE or FALSE)
' - TRUE assumes you are a registered member (Default)
' - FALSE assumes you would like to register for the first time
'--------------------------------------------------------------------------
boolRegistered = TRUE

'--------------------------------------------------------------------------
'boolInstallSrv (TRUE or FALSE)
' - TRUE will install the agent as a service (Default)
' - FALSE will disregard this part
'--------------------------------------------------------------------------
boolInstallSrv = TRUE

objShell.Exec(strUDPath)
While objShell.AppActivate("World Community Grid Registration") = FALSE
Wscript.Sleep(3000)
Wend
objShell.SendKeys "{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}"
If boolRegistered = TRUE Then
objShell.SendKeys " "
End If
objShell.SendKeys "{TAB}"

'--------------------------------------------------------------------------
'Deletes the current Member Name in the input box. Feel free to increase
'the number if your logged in username is longer than 30 characters.
'--------------------------------------------------------------------------
For x = 0 to 30
objShell.SendKeys "{DEL}"
Next

objShell.SendKeys strUser
objShell.SendKeys "{TAB}"
objShell.SendKeys strPassword
objShell.SendKeys "{TAB}"
If boolRegistered = FALSE Then
objShell.SendKeys strPassword
objShell.SendKeys "{TAB}"
End If
If strDeviceID <> "" Then
objShell.SendKeys strDeviceID
End If
objShell.SendKeys "{TAB}"
If boolRegistered = FALSE Then
objShell.SendKeys strEMail
End If

'--------------------------------------------------------------------------
'Assumes all information is correct and sends the registration info.
'--------------------------------------------------------------------------
objShell.SendKeys "{ENTER}"

'--------------------------------------------------------------------------
'Starts the Service Install.
'--------------------------------------------------------------------------
If boolInstallSrv = TRUE Then
Wscript.Sleep(5000)
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'UD.EXE'")
For Each objProcess in colProcess
objProcess.Terminate()
Next

strCommand = """" & strInstsrvPath & """ ""WCG Agent"" """ & strSrvanyPath & """"
objShell.Run strCommand, 0, True

objShell.RegWrite "HKLM\System\CurrentControlSet\Services\WCG Agent\","Parameters"
objShell.RegWrite "HKLM\System\CurrentControlSet\Services\WCG Agent\Parameters\Application",strUDPath,"REG_SZ"
objShell.RegWrite "HKLM\System\CurrentControlSet\Services\WCG Agent\Description","World Community Grid Agent used to crunch and tackle projects that benefit humanity.","REG_SZ"

Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name = 'WCG Agent'")
For Each objService in colListOfServices
objService.StartService()
Wscript.Sleep(5000)
Next
End If


I use Symantec AI Snapshot to take a look at the install process when i click on the downloaded agent up until I close the registration window. Then I copy the "INSTSRV.EXE" and "SRVANY.EXE" to the "C:\WINDOWS\SYSTEM32" directory. Afterwards, I put into the install directory "C:\PROGRAM FILES\WORLDCOMMUNITYGRID" a small batch file called "REG.BAT" and in the file, I add this line:

cscript.exe "C:\PROGRAM FILES\WORLDCOMMUNITYGRID\WCG_REG.VBS"

"WCG_REG.VBS" is the script above. Once this is done, I captured the snapshot into an EXE and set the EXE to execute the REG.BAT file once the installation is complete. The batch file sets off the "WCG_REG.VBS" script to run through the command line setting up the program as illustrated above.

You could follow this process with any type of snapshot program (msiinstaller, etc). I was thinking of doing a complete macro to do the full process from start to finish, but in my environment, it would be easier to create the AI package. I may, when I have more time on my hands, develop a full macro! wink
[Feb 3, 2006 7:05:42 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Former Member
Cruncher
Joined: May 22, 2018
Post Count: 0
Status: Offline
Reply to this Post  Reply with Quote 
Re: Autoinstaller for multiple machines

Nice piece of work bergeron.

It's a shame really, that a number of us have had to spend a great deal of time finding a way to deploy the UD agent AND get it to automatically register, when a bit of info from the tech guys might have made it a bit easier.

You might want ot have a look at this post from a year ago http://www.worldcommunitygrid.org/forums/wcg/viewthread?thread=1346#6716

(If I am doing you tech guys a disservice, I apologise, but it did seem that wilsondr was close to a simple installation method.)
[Feb 5, 2006 9:13:01 AM]   Link   Report threatening or abusive post: please login first  Go to top 
Posts: 14   Pages: 2   [ Previous Page | 1 2 ]
[ Jump to Last Post ]
Post new Thread