Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.4 KiB

  1. @echo off
  2. @echo Installing AppFix...
  3. @REM Temporarily change to the AppPatch directory
  4. pushd %1%
  5. @echo Check OS version...
  6. for /F "delims==[. tokens=1,2,3,4" %%A IN ('ver') DO (
  7. Set OS_MAJOR=%%B
  8. Set OS_MINOR=%%C
  9. )
  10. for /F "tokens=1,2" %%A IN ("%OS_MAJOR%") DO (
  11. Set OS_MAJOR=%%B
  12. )
  13. IF %OS_MAJOR% NEQ 5 (
  14. @echo Bad OS version, this package is for Whistler.
  15. goto Cleanup
  16. )
  17. IF %OS_MINOR% EQU 0 (
  18. @echo Windows2000 detected, this package is for Whistler only.
  19. goto Cleanup
  20. )
  21. @echo Whistler detected
  22. set PATH=%PATH%;%windir%\system32
  23. @REM Disable SFP (the brute force way)
  24. del %WinDir%\system32\dllcache\sysmain.sdb
  25. del %WinDir%\system32\dllcache\msimain.sdb
  26. del %WinDir%\system32\dllcache\drvmain.sdb
  27. del %WinDir%\system32\dllcache\Apphelp.sdb
  28. del %WinDir%\system32\dllcache\AcSpecfc.dll
  29. del %WinDir%\system32\dllcache\AcGenral.dll
  30. del %WinDir%\system32\dllcache\AcLayers.dll
  31. del %WinDir%\system32\dllcache\AcXtrnal.dll
  32. del %WinDir%\system32\dllcache\AcLua.dll
  33. del %WinDir%\system32\dllcache\AcVerfyr.dll
  34. @REM Quietly delete all DLLs
  35. del /q *.DLL >nul
  36. @echo Delete systest.sdb...
  37. IF EXIST systest.sdb (
  38. del /f systest.sdb >nul
  39. )
  40. @echo Replace AppHelp messages...
  41. copy apps.chm %windir%\help\apps.chm
  42. @echo Flush the shim cache...
  43. rundll32 apphelp.dll,ShimFlushCache >nul
  44. @echo Install the certificate needed to replace shims...
  45. certmgr.exe -add testroot.cer -r localMachine -s root
  46. @echo Replace the shim databases
  47. chktrust -win2k -acl delta1.cat
  48. chktrust -win2k -acl delta2.cat
  49. chktrust -win2k -acl delta3.cat
  50. fcopy sysmain.sd_ sysmain.sdb
  51. fcopy apphelp.sd_ apphelp.sdb
  52. fcopy msimain.sd_ msimain.sdb
  53. @echo Replace the shim DLLs
  54. fcopy AcLayers.dl_ AcLayers.dll
  55. fcopy AcLua.dl_ AcLua.dll
  56. fcopy AcSpecfc.dl_ AcSpecfc.dll
  57. fcopy AcGenral.dl_ AcGenral.dll
  58. fcopy AcXtrnal.dl_ AcXtrnal.dll
  59. fcopy AcVerfyr.dl_ AcVerfyr.dll
  60. :Cleanup
  61. @echo Cleanup...
  62. del /f apps.chm > nul
  63. del /f certmgr.exe >nul
  64. del /f testroot.cer >nul
  65. del /f fcopy.exe >nul
  66. del /f AcLayers.dl_ >nul
  67. del /f AcLua.dl_ >nul
  68. del /f AcSpecfc.dl_ >nul
  69. del /f AcGenral.dl_ >nul
  70. del /f AcXtrnal.dl_ >nul
  71. del /f AcVerfyr.dl_ >nul
  72. del /f sysmain.sd_ >nul
  73. del /f apphelp.sd_ >nul
  74. del /f msimain.sd_ >nul
  75. del /f chktrust.exe >nul
  76. del /f delta*.* >nul
  77. @REM Back to original directory
  78. popd
  79. pause