Browse Source

Cleanup old shfolder.dll backup copy not needed anymore.
Cleanup Windows 2000 fix not needed anymore.

Martijn Laan 5 years ago
parent
commit
8ac11d5aef
6 changed files with 0 additions and 111 deletions
  1. 0 83
      Projects/D2009Win2kFix.pas
  2. 0 16
      Projects/Main.pas
  3. 0 1
      Projects/Setup.dpr
  4. 0 7
      Projects/_shfoldr.rc
  5. BIN
      Projects/_shfoldr.res
  6. 0 4
      README.md

+ 0 - 83
Projects/D2009Win2kFix.pas

@@ -1,83 +0,0 @@
-unit D2009Win2kFix;
-
-{
-  Inno Setup
-  Copyright (C) 1997-2019 Jordan Russell
-  Portions by Martijn Laan
-  For conditions of distribution and use, see LICENSE.TXT.
-
-  When Windows 2000 with SP<4 is detected, this unit reverts the change in
-  Delphi 2009 Update 3 that causes VCL apps (even new, empty projects) to
-  crash on startup when run on Windows 2000 with no SP/SP1/SP2/sometimes SP3.
-
-  This should be at the top of the .dpr's "uses" clause to ensure it runs
-  before any VCL code.
-}
-
-interface
-
-implementation
-
-uses
-  Windows, SysUtils;
-
-{
-  Details:
-  In Delphi 2009 Update 3 (or possibly one of the previous updates),
-  TUTF8Encoding.Create in SysUtils was changed to set the
-  MB_ERR_INVALID_CHARS flag:
-
-         original: inherited Create(CP_UTF8);
-    with Update 3: inherited Create(CP_UTF8, MB_ERR_INVALID_CHARS, 0);
-
-  It appears that when used with CP_UTF8, the MB_ERR_INVALID_CHARS flag is
-  only supported beginning with Windows 2000 SP4 and Windows XP. On Windows
-  2000 with no SP, MultiByteToWideChar() fails with ERROR_INVALID_FLAGS.
-
-  In Delphi 10.3 Rio this change is still present.
-
-  This code changes TEncoding.UTF8's private FMBToWCharFlags field from
-  MB_ERR_INVALID_CHARS back to 0 when Windows 2000 (5.0) with SP<4 is
-  detected.
-
-  Note: This won't fix any other instances of TUTF8Encoding, but there
-  shouldn't be more than just the one. (Inside the Delphi RTL/VCL,
-  TEncoding.GetUTF8 is the only place where TUTF8Encoding.Create is called.)
-}
-
-function NeedWin2kFix: Boolean;
-var
-  Info: TOSVersionInfoEx;
-begin
-  Result := False;
-  Info.dwOSVersionInfoSize := SizeOf(Info);
-  if GetVersionEx(Info) then
-    if (Info.dwMajorVersion = 5) and (Info.dwMinorVersion = 0) and
-       (Info.wServicePackMajor < 4) then
-      Result := True;
-end;
-
-procedure ApplyWin2kFix;
-type
-  PLongWordArray = ^TLongWordArray;
-  TLongWordArray = array[0..6] of LongWord;  { 28 bytes }
-var
-  U: SysUtils.TEncoding;
-begin
-  U := SysUtils.TEncoding.UTF8;
-  if (U.ClassType = SysUtils.TUTF8Encoding) and
-     (U.InstanceSize = 28) and
-     (U is SysUtils.TMBCSEncoding) and
-     (SysUtils.TMBCSEncoding.InstanceSize = 28) then begin
-     if (PLongWordArray(U)[3] = 65001) and  { verify that FCodePage = CP_UTF8 }
-        (PLongWordArray(U)[4] = 8) and      { verify that FMBToWCharFlags = MB_ERR_INVALID_CHARS }
-        (PLongWordArray(U)[5] = 0) then     { verify that FWCharToMBFlags = 0 }
-       PLongWordArray(U)[4] := 0;           { change FMBToWCharFlags to 0 }
-  end;
-end;
-
-initialization
-  if NeedWin2kFix then
-    ApplyWin2kFix;
-
-end.

+ 0 - 16
Projects/Main.pas

@@ -1516,26 +1516,10 @@ end;
 procedure LoadSHFolderDLL;
 procedure LoadSHFolderDLL;
 var
 var
   Filename: String;
   Filename: String;
-  ExistingFileIsOk: Boolean;
-  ExistingFileVersion: TFileVersionNumbers;
 const
 const
   shfolder = 'shfolder.dll';
   shfolder = 'shfolder.dll';
-  _shfoldrMS = $50032;    //must match the version numbers of the DLL image in _shfoldr.res
-  _shfoldrLS = $12C708FC; //
 begin
 begin
   Filename := AddBackslash(GetSystemDir) + shfolder;
   Filename := AddBackslash(GetSystemDir) + shfolder;
-  ExistingFileIsOk :=
-    GetVersionNumbers(Filename, ExistingFileVersion) and
-    (((ExistingFileVersion.MS > _shfoldrMS) or
-      ((ExistingFileVersion.MS = _shfoldrMS) and
-       (ExistingFileVersion.LS > _shfoldrLS)))) or
-     ((ExistingFileVersion.MS = _shfoldrMS) and
-      (ExistingFileVersion.LS = _shfoldrLS));
-  if not ExistingFileIsOk then begin
-    Filename := AddBackslash(TempInstallDir) + '_isetup\_shfoldr.dll';
-    {$R _shfoldr.res}  { Link in the .res file containing the DLL image }
-    SaveResourceToTempFile('SHFOLDERDLL', Filename);
-  end;
   { Ensure shell32.dll is pre-loaded so it isn't loaded/freed for each
   { Ensure shell32.dll is pre-loaded so it isn't loaded/freed for each
     individual SHGetFolderPath call }
     individual SHGetFolderPath call }
   SafeLoadLibrary(AddBackslash(GetSystemDir) + shell32, SEM_NOOPENFILEERRORBOX);
   SafeLoadLibrary(AddBackslash(GetSystemDir) + shell32, SEM_NOOPENFILEERRORBOX);

+ 0 - 1
Projects/Setup.dpr

@@ -17,7 +17,6 @@ program Setup;
 uses
 uses
   SafeDLLPath in 'SafeDLLPath.pas',
   SafeDLLPath in 'SafeDLLPath.pas',
   XPTheme in 'XPTheme.pas',
   XPTheme in 'XPTheme.pas',
-  D2009Win2kFix in 'D2009Win2kFix.pas',
   Forms,
   Forms,
   Windows,
   Windows,
   SysUtils,
   SysUtils,

+ 0 - 7
Projects/_shfoldr.rc

@@ -1,7 +0,0 @@
-// $jrsoftware: issrc/Projects/_shfoldr.rc,v 1.3 2002/11/09 19:45:41 jr Exp $
-// _shfoldr.res contains the shfolder.dll file used by Setup
-//
-// shfolder.dll is from a fresh install of IE 5.5 SP2 on NT 4.0
-// It is version 5.50.4807.2300, dated 2001-07-23 00:00
-
-SHFOLDERDLL RCDATA _shfoldr.dll

BIN
Projects/_shfoldr.res


+ 0 - 4
README.md

@@ -196,10 +196,6 @@ by Visual Studio 2005 from the [Projects\Lzma2\Encoder] directory.
 **Files\isscint.dll** - Compiled by Visual Studio 2005 from Scintilla 2.22 source
 **Files\isscint.dll** - Compiled by Visual Studio 2005 from Scintilla 2.22 source
 code with scintilla-2.22-patch.txt applied.
 code with scintilla-2.22-patch.txt applied.
 
 
-**Projects\\_shfolder.res** - shfolder.dll from a fresh install of IE 5.5 SP2 on
-NT 4.0 stored in a compiled resource file. Note: this file is normally not
-actually used by Setup.
-
 **Projects\Helper\x64\Release\Helper.exe**, **Projects\HelperEXEs.res** -
 **Projects\Helper\x64\Release\Helper.exe**, **Projects\HelperEXEs.res** -
 Compiled by Visual Studio 2005 from the [Projects\Helper] directory and then
 Compiled by Visual Studio 2005 from the [Projects\Helper] directory and then
 stored in a compiled resource file.
 stored in a compiled resource file.