Hi there,
I am a beginner at kix, however I would like to get some help in correcting a
problem with an INF installer I am cobbling together. I have stolen some INF installer function code to install an INF from within the KIX script. The code from within the function code is currently untouched but i get an @error 2 presently. I curently beleive it is because the code wont work with a long path to the INF components on a network drive. i am stumped to whether I need to copy the INF components locally and "chdir" to them like in a batch file or whether I can work around problems with using a long path to a mapped drive. I currently beleive the batch file won't support the long network path location of the INF files, as it returns an "@error 2" from the function part of the code. Can anyone help with a more elegant solution ? Here is the code
Code:
GOSUB WINDIR
? Color b+/n "Lexis Checkout Component manual install"
use o: "\\ajgnt4\software"
If @INWIN = 2
EXIT
Endif
If @PRODUCTTYPE ="Windows 2000 Professional"
SHELL "%comspec% /c chdir /d O:\Utilities\Lexis\CheckoutCtrl_W2K\"
Endif
If @PRODUCTTYPE ="Windows XP Professional"
SHELL "%comspec% /c chdir /d O:\Utilities\Lexis\CheckoutCtrl_WXP\"
Endif
if FileAction("CheckoutCtrl.INF", "Install")
? "error occured:" @error
else
? "Install was Successful"
endif
If @INWIN = 1
$dllregisterPath=$WINDIR+"\system32\"
SHELL "%comspec% /c regsvr32 /s $dllregisterPath"
Endif
;use o: /DELETE /PERSISTENT:YES
sleep 5
:WINDIR ; 98 and NT
;Delimits LanRoot to get the windows directory path equiverlent to %WINDIR% in MSDOS
$lroot = @lanroot
$delimiter = "\"
$slen1 = len($lroot)
$stop1 = instr($lroot,$delimiter)
$part1 = substr($lroot,1,$stop1)
$lroot = substr($lroot,$stop1+1,$slen1-$stop1)
$slen2 = len($lroot)
$stop2 = instr($lroot,$delimiter)
$part2 = substr($lroot,1,$stop2)
$WINDIRTMP = ($part1 + $part2)
$WINDIR=LTRIM(SUBSTR($WINDIRTMP,1,(LEN($WINDIRTMP)-1)))
$ROOT = LTRIM(SUBSTR($Part1,1,(LEN($Part1)-2)))
$ProgramsDir=$ROOT+":\Progra~1"
If @INWIN = 1
$userprofile = "%userprofile%"
$SystemDir=$WINDIR+"\System32"
;$ProgramsDir=ReadValue("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\","ProgramFilesDir")
Endif
If @INWIN = 2
$SystemDir=$WINDIR+"\System"
;$ProgramsDir=ReadValue("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\","ProgramFilesPath")
Endif
RETURN
function FileAction($file,$action)
dim $shell,$
$fileaction=1
$shell=createobject("shell.application")
$file=$Shell.namespace($file).self
if @error $fileaction=2 exit 2 endif
for each $ in $file.verbs
if join(split($,"&"),"")=$action
$file.invokeverb(""+$)
$fileaction=0
endif
next
if $fileaction exit 1 endif
endfunction
Really I am just trying to do emulate this batch file below with a kix script that can check for OS type. IE different components for W2K and XP.
net use o: \\ajgnt4\software
chdir /d O:\Utilities\Lexis\CheckoutCtrl_WXP
rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\CheckoutCtrl.INF
regsvr32 CheckoutCtrl.ocx /s
net use o: /delete
Thankyou for any help you can give.
Bullock: added code tags