#95171 - 2002-11-08 01:21 AM
Re: Did I just hear someone mumble it's a slow night on the board ?
|
MightyR1
MM club member
   
Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
|
Guys/Shawn,
I'm Alive
read some topics on problems installing KiXForms.dll on NT4 and above without adminpowers. So I wrote this UDF. This UDF uses WriteLog2 from Howard Bullock (http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000188)
Check it out:
Note 1 : Not tested yet on a domain, be carefull with it !!! Note 2 : Maybe wrong forum Note 3 : If fully tested, will ask mods to move to UDF
code:
;**************************************************************************** ; ;FUNCTION : KiXForms_install() ; ;AUTHOR : Patrick Rutten (MightyR1@hotmail.com) ; ;CONTRIBUTORS : KiXtart buddies ; ;ACTION : Installs the KiXForms dll on every computer in @domain or on $computer ; ;SYNTAX : KiXForms_install($sourcedll, $destinationdll[, $computer]) ; ;VERSION : 1.0 ; initial release ; ;PARAMETERS : $sourcedll ; location of the KiXForms.dll to be copied ; i.e. @SCRIPTDIR+"\KiXForms.dll" ; $destinationdll ; location where the KiXForms.dll is to be copied ; must begin with c:\ or d:\ or ... ; i.e. "C:\WINNT\system32\KiXForms.dll" ; OPTIONAL $computer ; target computer ; ;REMARKS : In @scriptdir a KiXForms_install.log is created containing the ; installation results per computer ; ;RETURNS : Nothing ; ;DEPENDENCIES : WriteLog2() by Howard A. Bullock () ; - http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000188 ; ADSI ; Administrator rights on the target computer(s) ; Targets are >= winnt40 (W9x can use regsvr32) ; ;KIXTART VER : 4.x ; ;EXAMPLE(S) : $RC=KiXForms_install(@SCRIPTDIR+"\KiXForms.dll","C:\WINNT\system32\KiXForms.dll",@WKSTA) ; ;KNOWN ISSUES : What if OS on domain are installed in c:\winnt, d:\winnt, c:\windows etc.? ; ;**************************************************************************** ; ; Function KiXForms_install($sourcedll, $destinationdll, OPTIONAL $computer)
$file=@SCRIPTDIR+"\KiXForms_install.log" $admindrv=SubStr($destinationdll,1,1) $targetpath=SubStr($destinationdll,3) $destinationpath=SubStr($destinationdll,1,InStrRev($destinationdll,"\")-1)
If Exist("$file") Del "$file" EndIf If Len($computer) = 0 $Domain=@DOMAIN $Computers=GetObject("WinNT://$Domain") $Computers.filter="Computer","" Else Global $Computers[0] $Computers[0]=$computer EndIf
For Each $computer in $Computers $loginfo="***************************************************************************" $RC=WriteLog2($file,$loginfo)
$loginfo=$computer+" - I - Installation of KiXForms started." $RC=WriteLog2($file,$loginfo,1)
$target="\\"+$computer+"\"+$admindrv+"$$"+$targetpath Copy "$sourcedll" "$target" If @ERROR $loginfo=$computer+" - E - Copy of dll failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - Copy of dll was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=1 ;1 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F89DF848-618A-46F9-8A1C-396EA442BDD3}", "","Widget Class",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;2 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F89DF848-618A-46F9-8A1C-396EA442BDD3}\InprocServer32", "",$destinationdll,REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;3 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F89DF848-618A-46F9-8A1C-396EA442BDD3}\InprocServer32", "ThreadingModel","both",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;4 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F89DF848-618A-46F9-8A1C-396EA442BDD3}\ProgID", "","Kixtart.Form.1",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;5 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F89DF848-618A-46F9-8A1C-396EA442BDD3}\VersionIndependentProgID", "","Kixtart.Form",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;6 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{E0422D09-4293-4CB0-A1BB-5BEBDA481004}", "","IWidget",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;7 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{E0422D09-4293-4CB0-A1BB-5BEBDA481004}\ProxyStubClsid", "","{00020424-0000-0000-C000-000000000046}",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;8 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{E0422D09-4293-4CB0-A1BB-5BEBDA481004}\ProxyStubClsid32", "","{00020424-0000-0000-C000-000000000046}",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;9 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{E0422D09-4293-4CB0-A1BB-5BEBDA481004}\TypeLib", "","{C8DCCD39-471D-4AFD-8EA2-89604A9C6252}",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;10 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{E0422D09-4293-4CB0-A1BB-5BEBDA481004}\TypeLib", "Version","1.0",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;11 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Kixtart.Form", "","Widget Class",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;12 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Kixtart.Form\CLSID", "","{F89DF848-618A-46F9-8A1C-396EA442BDD3}",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;13 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Kixtart.Form.1", "","Widget Class",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;14 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Kixtart.Form.1\CLSID", "","{F89DF848-618A-46F9-8A1C-396EA442BDD3}",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;15 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{C8DCCD39-471D-4AFD-8EA2-89604A9C6252}\1.0", "","Kixforms 1.0 Type Library",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;16 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{C8DCCD39-471D-4AFD-8EA2-89604A9C6252}\1.0\0\win32", "",$destinationdll,REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;17 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{C8DCCD39-471D-4AFD-8EA2-89604A9C6252}\1.0\FLAGS", "","0",REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
;18 $RC=WriteValue("\\"+$computer+ "\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{C8DCCD39-471D-4AFD-8EA2-89604A9C6252}\1.0\HELPDIR", "",$destinationpath,REG_SZ) If @ERROR $loginfo=$computer+" - E - RegWrite $cnt Failed --> ErrorCode=@ERROR; @SERROR." Else $loginfo=$computer+" - I - RegWrite $cnt was succesfull." EndIf $RC=WriteLog2($file,$loginfo,1) $cnt=$cnt+1
$loginfo=$computer+" - I - Installation of KiXForms finished." $RC=WriteLog2($file,$loginfo,1)
Next EndFunction
[ 08. November 2002, 15:32: Message edited by: MightyR1 ]
_________________________
Greetz, Patrick Rutten
- We'll either find a way or make one... - Knowledge is power; knowing how to find it is more powerful... - Problems don't exist; they are challenges...
|
|
Top
|
|
|
|
#95176 - 2002-11-08 05:21 AM
Re: Did I just hear someone mumble it's a slow night on the board ?
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Wrong Forum the Long-line Police are powerless
|
|
Top
|
|
|
|
#95179 - 2002-11-08 02:37 PM
Re: Did I just hear someone mumble it's a slow night on the board ?
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
also...
if kixforms is already registerred, then you only need to replace the dll.
|
|
Top
|
|
|
|
#95187 - 2002-11-08 03:24 PM
Re: Did I just hear someone mumble it's a slow night on the board ?
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Les... Doesn't your mouse have a little wheel on top?
If you were to press it, scrolling from side to side wouldn't be too difficult
I't might be a cultural/religous thing however. I heard that Canada almost has a civil war a few years ago...
|
|
Top
|
|
|
|
#95189 - 2002-11-08 03:29 PM
Re: Did I just hear someone mumble it's a slow night on the board ?
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Well, here's some tips...
HKLM = HKEY_LOCAL_MACHINE HKCU = HKEY_CURRENT_USER HKCR = HKEY_CLASSES_ROOT HKCC = HKEY_CURRENT_CONFIG HKU = HKEY_USERS
Regarding the "_", ala VBScript. No need. KiX is a free-format scripting language. Just break your line and continue on the next. If you're using quotes, put an end-quote at the end of the line and following with a "+" then continue your quote on the next line...
code:
"This is a long line....................."+ "........................................"+ "....and I'm spent." ?
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 476 anonymous users online.
|
|
|