JSI Tip 10524. Microsoft cumulative updates are not installed correctly if you change the location of the Program Files folder?


If you modify the ProgramFilesDir data value, Microsoft cumulative updates are not installed correctly.

This behavior affects the MSxx-xxx cumulative updates, like MS06-006.

To workaround this problem, I have scripted CumUpdate.bat to reset the default just before installing a cumulative update, and to set it back to your value after the update is installed.

The syntax for using CumUpdate.bat, both before and after an update, is:

CumUpdate

CumUpdate.bat contains:

@echo off
setlocal
if exist %SystemDrive%\YourProgramFilesDir.reg goto afterUpd
regedit /a "%TEMP%\YourProgramFilesDir.reg" HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion
@echo.REGEDIT4>%SystemDrive%\YourProgramFilesDir.reg
@echo.>>%SystemDrive%\YourProgramFilesDir.reg
@echo.\[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion\]>>%SystemDrive%\YourProgramFilesDir.reg
set f1=find /i "ProgramFilesDir"
set f2=find "="
for /f "Tokens=*" %%i in ('type "%TEMP%\YourProgramFilesDir.reg"^|%f1%^|%f2%') do ( 
 @echo.%%i>>%SystemDrive%\YourProgramFilesDir.reg
 @echo Your %%i
)
@echo.>>%SystemDrive%\YourProgramFilesDir.reg
@echo.>>%SystemDrive%\YourProgramFilesDir.reg
del /q "%TEMP%\YourProgramFilesDir.reg"
@echo.REGEDIT4>%SystemDrive%\DefaultProgramFilesDir.reg
@echo.>>%SystemDrive%\DefaultProgramFilesDir.reg
@echo.\[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion\]>>%SystemDrive%\DefaultProgramFilesDir.reg
@echo."ProgramFilesDir"="%SystemDrive%\\Program Files">>%SystemDrive%\DefaultProgramFilesDir.reg
@echo Default "ProgramFilesDir"="%SystemDrive%\\Program Files"
@echo.>>%SystemDrive%\DefaultProgramFilesDir.reg
@echo.>>%SystemDrive%\DefaultProgramFilesDir.reg
regedit /s %SystemDrive%\DefaultProgramFilesDir.reg
del /q %SystemDrive%\DefaultProgramFilesDir.reg
endlocal
goto :EOF
:afterUpd
type %SystemDrive%\YourProgramFilesDir.reg
regedit /s %SystemDrive%\YourProgramFilesDir.reg
del /q %SystemDrive%\YourProgramFilesDir.reg



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish