Hi allI've read alot of messages suggesting methods for updating system files in use by the OS, for example the good old "MSNET32.DLL".
Many of them includes the use of tools for shutting down Windows, copying and replacing autoexec.bat, making a wininit.ini file that doesn't seem to work, "spaghetti code" etc etc. There are also a tool called MOVEEX, that only work for WinNT, or sd-sys.exe, that requires VB runtimes installed on the OS. Some suggest using the MS installer with a /q switch, but the right file to use (when it comes to MSNET32.DLL anyway) is the Win98 version (v4.10.1998).
How do the experts solve this situation? I'm sure there is a good "overall" solution for this, perhaps i've missed it? Many of the BB threads just die with "finally got it working", without any "final solutions" specified.
Perhaps using a thirdparty tool together with KiX is the best solution, or maybe to call a batch file from RUNONCE in the registry?
This is a copy of a script that actually works, but isn't there any better way that this (the downside of this script is that the users autoexec.bat i skipped once).
code:
IF @INWIN = 2
$Key = ExistKey("HKEY_LOCAL_MACHINE\SOFTWARE\KiXfix\MSNETupd")
IF $Key <> 0
$nul=AddKey("HKEY_LOCAL_MACHINE\SOFTWARE\KiXfix\MSNETupd")
ENDIF
IF ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\KiXfix\MSNETupd","MSNET32") = "Step2"
Exit
ELSE
IF ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\KiXfix\MSNETupd","MSNET32") = "Step1"
GOTO "Step2"
ELSE
?"********** Updating your system..."
? ""
SHELL "%COMSPEC% /C Copy C:\Autoexec.bat C:\Autoexec.m32 /Y"
Sleep 1
SHELL "%COMSPEC% /C Del C:\Autoexec.bat"
Sleep 1
SHELL "%COMSPEC% /C MD C:\Temp"
Sleep 1
SHELL "%COMSPEC% /C Copy \\[server]\Bin$\Autoexec.bat C:\Autoexec.bat /Y"
Sleep 3
SHELL "%COMSPEC% /C Copy \\[server]\Bin$\MSNET32.dll C:\Temp\MSNET32.dll /Y"
Sleep 10
$nul=WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\KiXfix\MSNETupd","MSNET32","Step1","REG_SZ")
MessageBox("Your computer has been updated, and will now reboot.", "Systemupdate", 48, 10)
RUN "\\[server]\Bin$\SD-SYS.exe /F /R"
ENDIF
ENDIF
ENDIF
EXIT:Step2
SHELL "%COMSPEC% /C Del C:\Autoexec.bat"
Sleep 1
SHELL "%COMSPEC% /C Copy C:\Autoexec.m32 C:\Autoexec.bat /Y"
Sleep 1
SHELL "%COMSPEC% /C Del C:\Autoexec.m32"
Sleep 1
SHELL "%COMSPEC% /C Del C:\Temp\MSNET32.dll"
Sleep 1
$nul=WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\KiXfix\MSNETupd","MSNET32","Step2","REG_SZ")
EXIT
The autoexec.bat copies the updated MSNET32.DLL to the right place.In hope of a maximum of ten rows, and no autoexec replacement 