Guys/Shawn,

I'm Alive [Big Grin]

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 [Wink]
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...