MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear Kent,
Your question: how iexpress packages are working?
- install a files in temporary directory in the %tmp% directory.
- run installation script by command: kix32.exe install.kix
the environment variable kix-debug influences which version will be running: - kix32 start1.kix (= without kix-debug specification) - kix32 start2.kix (= with kix-debug specification)
install.kix
code:
CLS IF setconsole("hide") ENDIF ; ; NT/95 install kixtart - Kixtart 3.62, 3.63, 4.00, 4.01, 4.02, 4.10 ; ; (c) scripting@wanadoo.nl - 2000, 2001, 2002 ; ; vs 1.00 - program ; ; 1.00 (20010605) original version. created for IExpress package. ; - split script for with/without debugging. ; - activate $debug_mode when variable %kix-debug% is declared. ; - shows also @curdir value. ; $prgrm_version="1.00" ; $debug_mode="no" IF (len(ExpandEnvironmentVars(CHR(37)+"kix-debug"+CHR(37))) <> 0) $debug_mode="yes" ENDIF ; IF ($debug_mode = "yes") $message="Installation of Kixtart "+@kix+" started from '"+LCASE(@curdir)+"'." $title="Kixtart "+@kix IF (MessageBox($message, $title, 340, 300) <> 0) ENDIF ? $message ENDIF IF ($debug_mode <> "yes") call "start1.kix" ELSE call "start2.kix" ENDIF :end IF (RedirectOutput("CON") = 0) ENDIF $debug_mode="no" IF (len(ExpandEnvironmentVars(CHR(37)+"kix-debug"+CHR(37))) <> 0) $debug_mode="yes" ENDIF ; IF ($debug_mode <> "yes") ? "Informative INSTALL: no creation of debug list 'c:\kixtart.log'" ELSE ? "Informative INSTALL: create debug list 'c:\kixtart.log'" IF (Exist("c:\kix"+substr(@kix,1,1)+substr(@kix,3,2)+".ok") = 1) $message="Installation of Kixtart "+@kix+" completed from '"+LCASE(@curdir)+"'." $message=$message+" File '"+UCASE("kix"+substr(@kix,1,1)+substr(@kix,3,2)+".ok")+"' created." ELSE $message="Installation of Kixtart "+@kix+" incompleted from '"+LCASE(@curdir)+"'." $message=$message+" No file '"+UCASE("kix"+substr(@kix,1,1)+substr(@kix,3,2)+".ok")+"' created." ENDIF $title="Kixtart "+@kix IF (MessageBox($message, $title, 340, 300) <> 0) ENDIF ? $message ENDIF break on flushkb
start1.kix
code:
cls break on IF setconsole("hide") ENDIF ; ; NT/95 install kixtart - Kixtart 3.62, 3.63, 4.00, 4.01, 4.02, 4.10 ; ; (c) scripting@wanadoo.nl - 2000, 2001, 2002 ; ; vs 3.03 - program ; ; 1.00 (20000715) original version. created for IExpress package. ; 1.01 (20000715) - additional information written to check-file. ; 1.02 (20000715) - additional information about starting script. ; system tries to find "c:\temp\kixtart.dbg" file, which will ; create a info file "c:\temp\kixtart.txt". ; automatic remove of "c:\temp\kixtart.dbg" + "c:\temp\kixtart.txt" by next run. ; - change "source_directory" to "c:\temp\ixp000.tmp\", ; because "@curdir" is "@homeshr" directory. ; - CHANGE iexpress package changed. calling command ; "kix32.exe install.kix" ; to ; "c:\temp\ixp000.tmp\kix32.exe c:\temp\ixp000.tmp\install.kix". ; sometime actual drive isn't correct. ; 1.03 (20000730) - add HKCR registry entries to 'edit', 'run', 'run debug' + 'print' kixtart scripts. ; first it will removing existing HKCR registry entries. ; 1.04 (20001025) - update to kixtart 3.63 ; 2.00 (20010320) - use %tmp% variable as temporary path. ; - use @curdir as location of "%temp%\ixp00?.tmp" directory. ; - use flexible "kix36?.ok" file. ; 2.01 (20010401) - kixtart 2001 beta1 compliancy ; - kix32.exe (= console-less version) ; - kix32c.exe (= console version) ; - introduction of "$debug_file" ; - introduction of "$update_ok". all kixtart files ; must be available at "$destination_directory". ; - check files ; - kix400.kix <= kix32.exe ; - kix400c.kix <= kix32c.exe (with "kix.console" file) ; - introduction of "$kix_console_mode". ; - additional information written to eventlog. ; 2.02 (20010605) - split script for with/without debugging. ; - activate $debug_mode when variable %kix-debug% is declared. ; - shows also @curdir value. ; - fix: for too late flushing write-buffers on windows95 ; 2.03 (20011120) - add "windows XP" ; 2.04 (20011120) - additional information written to check-file about update/registry mode. ; 3.00 (20020110) - remove also .k2k & .udf registry keys by an update. ; 3.01 (20020410) - activate $show_mode when variable %kix-show% is declared. ; - remove other check-files (del "c:\kix*.ok"). ; 3.02 (20020530) - convert "kixedit.reg" to internal code. ; - move "kedit.ico" to "%systemroot% directory. mostly "c:\windows" or ; "c:\winnt" directory. ; - change "c:\kix???.ok" location to "%systemroot\kix???.ok". prevent ; permission problems. ; for compatibility reasons we create both control files. ; 3.03 (20020530) - restyle check-file. ; - change "kixedit.reg" to "kedit.ico" as check. ; ; external variables kix-debug ; kix-show ; $prgrm_version="3.03" ; $tmp_directory=ExpandEnvironmentVars("%tmp%") IF (Substr($tmp_directory,len($tmp_directory),1) <> "\") $tmp_directory=$tmp_directory+"\" ENDIF ; $debug_mode="no" IF (len(ExpandEnvironmentVars(CHR(37)+"kix-debug"+CHR(37))) <> 0) $debug_mode="yes" ENDIF $show_mode="no" IF (len(ExpandEnvironmentVars(CHR(37)+"kix-show"+CHR(37))) <> 0) $show_mode="yes" ENDIF
; --------------------------------------------------------------------------- ; - site defined settings - ; ---------------------------------------------------------------------------
$debug_file=$tmp_directory+"kixtart.txt"
; --------------------------------------------------------------------------- ; - - ; ---------------------------------------------------------------------------
IF (@inwin = 1) $NT_mode="yes" ELSE $NT_mode="no" ENDIF ; $os="" $os_dos=@dos SELECT CASE ($NT_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP - $os="XP" CASE ($NT_mode = "yes") AND ($os_dos = "5.0") ; - Windows 2000 - $os="W2K" CASE ($NT_mode = "yes") ; - Windows NT - $os="NT4" CASE ($NT_mode <> "yes") AND ($os_dos = "4.90") ; - Windows ME - $os="ME" CASE ($NT_mode <> "yes") AND ($os_dos = "4.10") ; - Windows 98 - $os="W98" CASE ($NT_mode <> "yes") AND ($os_dos = "4.0") ; - Windows 95 - $os="W95" CASE 1 $os="???" ; - undetermined - ENDSELECT $time_start=@time ; IF ($debug_mode = "yes") break on del $debug_file IF (RedirectOutput($debug_file,1) = 0) ENDIF $log_info="Kixtart-UPDATE "+$prgrm_version+" script started." IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix") ENDIF ELSE break off del $debug_file IF (RedirectOutput("nul",1) = 0) ENDIF ENDIF
IF ($debug_mode = "yes") ? "Kixtart "+@kix+" - "+$os+" debug mode (vs "+$prgrm_version+")"+" "+$time_start ? ENDIF
; -------------------------------------------------------------------------- ; - install kixtart at local workstation - ; - - ; - 1. calculates source/destination directory - ; - 2. check for update - ; - - GetFileSize - ; - - GetFileTime - ; - - GetFileVersion - ; - 3. update any kixtart file, when installed version isn't the same. - ; - first it removes unwanted fileattributes - ; - (hidden, readonly, system) - ; - 4a. create information file, which can be checked by batch - ; - procedure. it eliminates a unwanted download + installation. - ; - 4b. log update information to eventvwr log. - ; - - ; - call by installation procedure - ; - fe. "if not exist c:\kix362.ok %0\..\kix362update.exe /q" - ; - "if not exist c:\kix363.ok %0\..\kix363update.exe /q" - ; - "if not exist c:\kix400.ok %0\..\kix400update.exe /q" - ; - "if not exist c:\kix400w.ok %0\..\kix400update.exe /q" - ; --------------------------------------------------------------------------
$source_directory=@curdir IF (Substr($source_directory,len($source_directory),1) <> "\") $source_directory=$source_directory+"\" ENDIF IF ($NT_mode = "yes") $destination_directory=ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows NT\currentversion", "SystemRoot") ELSE $destination_directory=ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion", "SystemRoot") ENDIF IF (len($destination_directory) = 0) $destination_directory=@lanroot ENDIF IF (Substr($destination_directory,len($destination_directory),1) <> "\") $destination_directory=$destination_directory+"\" ENDIF ; $kix_console_mode="no" ; - kix32.exe - ; $max_kix_files=4 DIM $kix_files[$max_kix_files+1] $kix_files[0]="kix"+Substr(@kix,1,1)+Substr(@kix,3,2)+".ok" ; - check file - $kix_files[1]="kix32.exe" $kix_files[2]="kx16.dll" $kix_files[3]="kx32.dll" $kix_files[4]="kx95.dll" ; $first_installation="yes" IF (Exist("c:\"+$kix_files[0]) = 1) $first_installation="no" ELSE del "c:\kix*.ok" ; - other installed kixtart versions - ENDIF IF (Exist($destination_directory+$kix_files[0]) = 1) $first_installation="no" ELSE del $destination_directory+"kix*.ok" ; - other installed kixtart versions - ENDIF ; $update="no" $update_info="" $i=1 WHILE ($i <= $max_kix_files) $source_file=$source_directory+$kix_files[$i] $destination_file=$destination_directory+$kix_files[$i] IF (Exist($destination_file) = 1) IF (setfileattr($destination_file, 128) <> 0) ENDIF IF ($debug_mode = "yes") del $destination_file ; - activates an automatic update for debugging script - ENDIF ENDIF $update="yes" IF (Exist($source_file) = 1) $update="no" IF (GetFileSize($source_file) <> GetFileSize($destination_file)) $update="yes" ENDIF IF (GetFileTime($source_file) <> GetFileTime($destination_file)) $update="yes" ENDIF IF (GetFileVersion($source_file,"filedescription") <> GetFileVersion($destination_file,"filedescription")) $update="yes" ENDIF IF (GetFileVersion($source_file,"fileversion") <> GetFileVersion($destination_file,"fileversion")) $update="yes" ENDIF IF (GetFileVersion($source_file,"internalname") <> GetFileVersion($destination_file,"internalname")) $update="yes" ENDIF IF (GetFileVersion($source_file,"language") <> GetFileVersion($destination_file,"language")) $update="yes" ENDIF IF (GetFileVersion($source_file,"originalfilename") <> GetFileVersion($destination_file,"originalfilename")) $update="yes" ENDIF IF (GetFileVersion($source_file,"productname") <> GetFileVersion($destination_file,"productname")) $update="yes" ENDIF ENDIF ; IF ($update = "yes") OR ($debug_mode = "yes") copy $source_file $destination_file /H $update_info=$update_info+" +"+LCASE($kix_files[$i]) ELSE $update_info=$update_info+" ="+LCASE($kix_files[$i]) ENDIF IF (@error <> 0) ? "Warning INSTALL "+@error+": "+@serror ENDIF IF ($debug_mode = "yes") ? "Informative INSTALL: copy "+LCASE($source_file)+" "+LCASE($destination_file) ? ? " size.old = "+GetFileSize($source_file) ? " size.new = "+GetFileSize($destination_file) ? " time.old = "+GetFileTime($source_file) ? " time.new = "+GetFileTime($destination_file) ? ? " company name "+GetFileVersion($source_file,"company name") ? " filedescription "+GetFileVersion($source_file,"filedescription") ? " fileversion "+GetFileVersion($source_file,"fileversion") ? " internalname "+GetFileVersion($source_file,"internalname") ? " language "+GetFileVersion($source_file,"language") ? " legalcopyright "+GetFileVersion($source_file,"legalcopyright") ? " legaltrademarks "+GetFileVersion($source_file,"legaltrademarks") ? " originalfilename "+GetFileVersion($source_file,"originalfilename") ? " privatebuild "+GetFileVersion($source_file,"privatebuild") ? " productname "+GetFileVersion($source_file,"productname") ? " productversion "+GetFileVersion($source_file,"productversion") ? " specialbuild "+GetFileVersion($source_file,"specialbuild") ? ENDIF $i=$i+1 LOOP ; IF ($debug_mode = "yes") del "c:\"+$kix_files[0] ; - activates an automatic update for debugging script - ENDIF ; $update_ok="yes" ; - all kixtart files must be available at $destination_directory - $i=1 WHILE ($i <= $max_kix_files) $destination_file=$destination_directory+$kix_files[$i] IF (Exist($destination_file) <> 1) $update_ok="no" $update_info=$update_info+" unknown_file."+LCASE($kix_files[$i]) IF WriteProfileString("c:\"+$kix_files[0], "KiXtart", LCASE($kix_files[$i]), @date+" "+@time+" -> unknown file") ENDIF IF WriteProfileString($destination_directory+$kix_files[0], "KiXtart", LCASE($kix_files[$i]), @date+" "+@time+" -> unknown file") ENDIF ELSE $build_info=GetFileVersion($destination_file,"specialbuild") IF (len($build_info) <> 0) $build_info=" ("+LCASE($build_info)+")" ELSE $build_info="" ENDIF IF WriteProfileString("c:\"+$kix_files[0], "KiXtart", LCASE($kix_files[$i]), @date+" "+@time+" -> "+GetFileTime($destination_file)+" "+GetFileSize($destination_file)+$build_info) ENDIF IF WriteProfileString($destination_directory+$kix_files[0], "KiXtart", LCASE($kix_files[$i]), @date+" "+@time+" -> "+GetFileTime($destination_file)+" "+GetFileSize($destination_file)+$build_info) ENDIF ENDIF $i=$i+1 LOOP IF ($update_ok = "yes") $update_info="("+LTRIM(RTRIM(LCASE($update_info)))+") to "+'"'+LTRIM(RTRIM(LCASE($destination_directory)))+'"' IF WriteProfileString("c:\"+$kix_files[0], "KiXtart", "KiXtart", "installation completed at "+@date+" "+@time+" "+$update_info) ENDIF IF WriteProfileString($destination_directory+$kix_files[0], "KiXtart", "KiXtart", "installation completed at "+@date+" "+@time+" "+$update_info) ENDIF ELSE $update_info="("+LTRIM(RTRIM(LCASE($update_info)))+") to "+'"'+LTRIM(RTRIM(LCASE($destination_directory)))+'"' IF WriteProfileString("c:\"+$kix_files[0], "KiXtart", "KiXtart", "installation incompleted at "+@date+" "+@time+" "+$update_info) ENDIF IF WriteProfileString($destination_directory+$kix_files[0], "KiXtart", "KiXtart", "installation incompleted at "+@date+" "+@time+" "+$update_info) ENDIF ENDIF IF ($update_ok <> "yes") IF (Exist("c:\"+$kix_files[0]) = 1) IF ($debug_mode <> "yes") del "c:\"+$kix_files[0] ; - kixtart version is incompleted - ENDIF ENDIF ENDIF
; -------------------------------------------------------------------------- ; - HKCR registry update - ; --------------------------------------------------------------------------
$ikey="HKEY_CLASSES_ROOT\.kix" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\.k2k" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\.scr" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\.udf" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\kix32 document" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF ; IF (Exist($source_directory+"kedit.ico") = 1) copy $source_directory+"kedit.ico" $destination_directory+"kedit.ico" /H ; ? "Informative INSTALL.KIX: creation of KIX file associations." ; ; - create Kixtart 3.6x/4.x registry entries ; - .kix, .k2k, .scr, .udf ; - ; - requirements: kix32.exe is available ; - options: %systemroot%\kedit.ico ; - editor of your choose f.e. notepad.exe ; $nul=AddKey("HKEY_CLASSES_ROOT\.kix") $nul=WriteValue("HKEY_CLASSES_ROOT\.kix","","kix32 document","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\.k2k") $nul=WriteValue("HKEY_CLASSES_ROOT\.k2k","","kix32 document","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\.scr") $nul=WriteValue("HKEY_CLASSES_ROOT\.scr","","kix32 document","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\.udf") $nul=WriteValue("HKEY_CLASSES_ROOT\.udf","","kix32 document","REG_SZ")
$nul=AddKey("HKEY_CLASSES_ROOT\kix32 document") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document","","KiXtart","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\DefaultIcon") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\DefaultIcon","",LCASE($destination_directory+"kedit.ico"),"REG_SZ")
$nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell","","Edit","REG_SZ") ; - open: Kix32 Run - $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\open") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\open","","Kix32 &run","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\open\command") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\open\command","","kix32.exe %1","REG_SZ") ; - debug: Kix32 run with Debug - $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\debug") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\debug","","Kix32 run with &debug","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\debug\command") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\debug\command","","kix32.exe %1 /d","REG_SZ") ; - edit: Edit - $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\edit") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\edit","","&Edit","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\edit\command") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\edit\command","","notepad.exe %1","REG_SZ") ; - print: Print - $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\print") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\print","","&Print","REG_SZ") $nul=AddKey("HKEY_CLASSES_ROOT\kix32 document\Shell\print\command") $nul=WriteValue("HKEY_CLASSES_ROOT\kix32 document\Shell\print\command","","notepad.exe /p %1","REG_SZ") ENDIF ; IF WriteProfileString("c:\"+$kix_files[0], "KiXtart", "KiXtart release", $os+" -> kix "+@kix) ENDIF IF WriteProfileString($destination_directory+$kix_files[0], "KiXtart", "KiXtart release", $os+" -> kix "+@kix) ENDIF IF (Exist($source_directory+"kedit.ico") = 1) IF WriteProfileString("c:\"+$kix_files[0], "KiXtart", "KiXtart mode", "registry") ENDIF IF WriteProfileString($destination_directory+$kix_files[0], "KiXtart", "KiXtart mode", "registry") ENDIF ELSE IF WriteProfileString("c:\"+$kix_files[0], "KiXtart", "KiXtart mode", "update") ENDIF IF WriteProfileString($destination_directory+$kix_files[0], "KiXtart", "KiXtart mode", "update") ENDIF ENDIF
; -------------------------------------------------------------------------- ; - end - ; --------------------------------------------------------------------------
:end_script $time_stop=@time IF ($update = "yes") $log_info="Kixtart-UPDATE "+$prgrm_version+" script completed successfully" $log_info=$log_info+" ("+$time_start+" - "+$time_stop+") "+LTRIM(RTRIM($update_info)) IF ($kix_console_mode = "yes") $log_info=$log_info+" (CONSOLE-LESS)" ENDIF IF ($debug_mode = "yes") ? ? " logevent = "+$log_info ? ENDIF IF ($update_ok = "yes") IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix"+"c") ENDIF ELSE IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix"+"e") ENDIF ENDIF ENDIF IF ($update_ok = "yes") $update_ok="" ELSE $update_ok="in" ENDIF IF ($kix_console_mode = "yes") ? "Kixtart "+@kix+" (console-less) update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ELSE ? "Kixtart "+@kix+" update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ENDIF IF (RedirectOutput("CON") = 0) ENDIF IF ($kix_console_mode = "yes") ? "Kixtart "+@kix+" (console-less) update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ELSE ? "Kixtart "+@kix+" update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ENDIF ? IF ($debug_mode = "yes") ? "Informative INSTALL: create debug list '"+$debug_file+"'" ELSE ? "Informative INSTALL: no creation of debug list '"+$debug_file+"'" ENDIF :end IF ($show_mode = "yes") $title="KiXtart "+@kix $message="" IF ($first_installation = "yes") IF (Exist("c:\kix"+Substr(@kix,1,1)+Substr(@kix,3,2)+".ok") = 1) OR (Exist($destination_directory+"kix"+Substr(@kix,1,1)+Substr(@kix,3,2)+".ok") = 1) $message="Installation of KiXtart "+@kix+" completed" ELSE $message="Installation of KiXtart "+@kix+" incompleted" ENDIF ELSE IF (Exist("c:\kix"+Substr(@kix,1,1)+Substr(@kix,3,2)+".ok") = 0) OR (Exist($destination_directory+"kix"+Substr(@kix,1,1)+Substr(@kix,3,2)+".ok") = 0) $message="Installation of KiXtart "+@kix+" incompleted" ENDIF ENDIF ? $message IF (len($message) <> 0) IF (Exist($source_directory+"kedit.ico") = 1) $message=$message+" (registry mode)." ELSE $message=$message+" (update mode)." ENDIF IF (MessageBox($message, $title, 340, 15) <> 0) ENDIF ENDIF ENDIF break on flushkb
greetings.
btw: with the environment kix-debug specified you can see what above temporary directory actually will contain.
|