|
@@ -62,13 +62,11 @@ type
|
|
FileLineNumber: Integer;
|
|
FileLineNumber: Integer;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
TPreLangData = class
|
|
TPreLangData = class
|
|
public
|
|
public
|
|
Name: String;
|
|
Name: String;
|
|
LanguageCodePage: Integer;
|
|
LanguageCodePage: Integer;
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
TLangData = class
|
|
TLangData = class
|
|
public
|
|
public
|
|
@@ -193,7 +191,7 @@ type
|
|
PreprocOutput: String;
|
|
PreprocOutput: String;
|
|
|
|
|
|
DefaultLangData: TLangData;
|
|
DefaultLangData: TLangData;
|
|
- {$IFDEF UNICODE} PreLangDataList, {$ENDIF} LangDataList: TList;
|
|
|
|
|
|
+ PreLangDataList, LangDataList: TList;
|
|
SignToolList: TList;
|
|
SignToolList: TList;
|
|
SignTools, SignToolsParams: TStringList;
|
|
SignTools, SignToolsParams: TStringList;
|
|
SignToolRetryCount, SignToolRetryDelay, SignToolMinimumTimeBetween: Integer;
|
|
SignToolRetryCount, SignToolRetryDelay, SignToolMinimumTimeBetween: Integer;
|
|
@@ -283,13 +281,9 @@ type
|
|
procedure EnumDirsProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumDirsProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumIconsProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumIconsProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumINIProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumINIProc(const Line: PChar; const Ext: Integer);
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure EnumLangOptionsPreProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumLangOptionsPreProc(const Line: PChar; const Ext: Integer);
|
|
-{$ENDIF}
|
|
|
|
procedure EnumLangOptionsProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumLangOptionsProc(const Line: PChar; const Ext: Integer);
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure EnumLanguagesPreProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumLanguagesPreProc(const Line: PChar; const Ext: Integer);
|
|
-{$ENDIF}
|
|
|
|
procedure EnumLanguagesProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumLanguagesProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumRegistryProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumRegistryProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumDeleteProc(const Line: PChar; const Ext: Integer);
|
|
procedure EnumDeleteProc(const Line: PChar; const Ext: Integer);
|
|
@@ -305,9 +299,7 @@ type
|
|
function GetLZMAExeFilename(const Allow64Bit: Boolean): String;
|
|
function GetLZMAExeFilename(const Allow64Bit: Boolean): String;
|
|
procedure InitBzipDLL;
|
|
procedure InitBzipDLL;
|
|
procedure InitCryptDLL;
|
|
procedure InitCryptDLL;
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure InitPreLangData(const APreLangData: TPreLangData);
|
|
procedure InitPreLangData(const APreLangData: TPreLangData);
|
|
-{$ENDIF}
|
|
|
|
procedure InitLanguageEntry(var ALanguageEntry: TSetupLanguageEntry);
|
|
procedure InitLanguageEntry(var ALanguageEntry: TSetupLanguageEntry);
|
|
procedure InitLZMADLL;
|
|
procedure InitLZMADLL;
|
|
procedure InitPreprocessor;
|
|
procedure InitPreprocessor;
|
|
@@ -331,13 +323,9 @@ type
|
|
procedure ProcessWildcardsParameter(const ParamData: String;
|
|
procedure ProcessWildcardsParameter(const ParamData: String;
|
|
const AWildcards: TStringList; const TooLongMsg: String);
|
|
const AWildcards: TStringList; const TooLongMsg: String);
|
|
procedure ReadDefaultMessages;
|
|
procedure ReadDefaultMessages;
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure ReadMessagesFromFilesPre(const AFiles: String; const ALangIndex: Integer);
|
|
procedure ReadMessagesFromFilesPre(const AFiles: String; const ALangIndex: Integer);
|
|
-{$ENDIF}
|
|
|
|
procedure ReadMessagesFromFiles(const AFiles: String; const ALangIndex: Integer);
|
|
procedure ReadMessagesFromFiles(const AFiles: String; const ALangIndex: Integer);
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure ReadMessagesFromScriptPre;
|
|
procedure ReadMessagesFromScriptPre;
|
|
-{$ENDIF}
|
|
|
|
procedure ReadMessagesFromScript;
|
|
procedure ReadMessagesFromScript;
|
|
function ReadScriptFile(const Filename: String; const UseCache: Boolean;
|
|
function ReadScriptFile(const Filename: String; const UseCache: Boolean;
|
|
const AnsiConvertCodePage: Cardinal): TScriptFileLines;
|
|
const AnsiConvertCodePage: Cardinal): TScriptFileLines;
|
|
@@ -372,9 +360,6 @@ type
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- CompilerLeadBytes: TLeadByteSet;
|
|
|
|
-{$ENDIF}
|
|
|
|
ZipInitialized, BzipInitialized, LZMAInitialized, CryptInitialized: Boolean;
|
|
ZipInitialized, BzipInitialized, LZMAInitialized, CryptInitialized: Boolean;
|
|
PreprocessorInitialized: Boolean;
|
|
PreprocessorInitialized: Boolean;
|
|
PreprocessScriptProc: TPreprocessScriptProc;
|
|
PreprocessScriptProc: TPreprocessScriptProc;
|
|
@@ -714,41 +699,6 @@ begin
|
|
F.Seek(0);
|
|
F.Seek(0);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function Is64BitPEImage(const Filename: String): Boolean;
|
|
|
|
-{ Returns True if the specified file is a non-32-bit PE image, False
|
|
|
|
- otherwise. }
|
|
|
|
-var
|
|
|
|
- F: TFile;
|
|
|
|
- DosHeader: packed record
|
|
|
|
- Sig: array[0..1] of AnsiChar;
|
|
|
|
- Other: array[0..57] of Byte;
|
|
|
|
- PEHeaderOffset: LongWord;
|
|
|
|
- end;
|
|
|
|
- PESigAndHeader: packed record
|
|
|
|
- Sig: DWORD;
|
|
|
|
- Header: TImageFileHeader;
|
|
|
|
- OptHeaderMagic: Word;
|
|
|
|
- end;
|
|
|
|
-begin
|
|
|
|
- Result := False;
|
|
|
|
- F := TFile.Create(Filename, fdOpenExisting, faRead, fsRead);
|
|
|
|
- try
|
|
|
|
- if F.Read(DosHeader, SizeOf(DosHeader)) = SizeOf(DosHeader) then begin
|
|
|
|
- if (DosHeader.Sig[0] = 'M') and (DosHeader.Sig[1] = 'Z') and
|
|
|
|
- (DosHeader.PEHeaderOffset <> 0) then begin
|
|
|
|
- F.Seek(DosHeader.PEHeaderOffset);
|
|
|
|
- if F.Read(PESigAndHeader, SizeOf(PESigAndHeader)) = SizeOf(PESigAndHeader) then begin
|
|
|
|
- if (PESigAndHeader.Sig = IMAGE_NT_SIGNATURE) and
|
|
|
|
- (PESigAndHeader.OptHeaderMagic <> IMAGE_NT_OPTIONAL_HDR32_MAGIC) then
|
|
|
|
- Result := True;
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
- finally
|
|
|
|
- F.Free;
|
|
|
|
- end;
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
function CountChars(const S: String; C: Char): Integer;
|
|
function CountChars(const S: String; C: Char): Integer;
|
|
var
|
|
var
|
|
I: Integer;
|
|
I: Integer;
|
|
@@ -817,13 +767,8 @@ begin
|
|
if Result[I] = '{' then
|
|
if Result[I] = '{' then
|
|
Delete(Result, I, 1);
|
|
Delete(Result, I, 1);
|
|
end
|
|
end
|
|
- else begin
|
|
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- if Result[I] in CompilerLeadBytes then
|
|
|
|
- Inc(I);
|
|
|
|
-{$ENDIF}
|
|
|
|
|
|
+ else
|
|
Inc(I);
|
|
Inc(I);
|
|
- end;
|
|
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -1556,9 +1501,7 @@ begin
|
|
UsedUserAreas.Duplicates := dupIgnore;
|
|
UsedUserAreas.Duplicates := dupIgnore;
|
|
PreprocIncludedFilenames := TStringList.Create;
|
|
PreprocIncludedFilenames := TStringList.Create;
|
|
DefaultLangData := TLangData.Create;
|
|
DefaultLangData := TLangData.Create;
|
|
-{$IFDEF UNICODE}
|
|
|
|
PreLangDataList := TLowFragList.Create;
|
|
PreLangDataList := TLowFragList.Create;
|
|
-{$ENDIF}
|
|
|
|
LangDataList := TLowFragList.Create;
|
|
LangDataList := TLowFragList.Create;
|
|
SignToolList := TLowFragList.Create;
|
|
SignToolList := TLowFragList.Create;
|
|
SignTools := TStringList.Create;
|
|
SignTools := TStringList.Create;
|
|
@@ -1591,9 +1534,7 @@ begin
|
|
SignToolList.Free;
|
|
SignToolList.Free;
|
|
end;
|
|
end;
|
|
LangDataList.Free;
|
|
LangDataList.Free;
|
|
-{$IFDEF UNICODE}
|
|
|
|
PreLangDataList.Free;
|
|
PreLangDataList.Free;
|
|
-{$ENDIF}
|
|
|
|
DefaultLangData.Free;
|
|
DefaultLangData.Free;
|
|
PreprocIncludedFilenames.Free;
|
|
PreprocIncludedFilenames.Free;
|
|
UsedUserAreas.Free;
|
|
UsedUserAreas.Free;
|
|
@@ -1622,8 +1563,6 @@ end;
|
|
|
|
|
|
procedure TSetupCompiler.InitPreprocessor;
|
|
procedure TSetupCompiler.InitPreprocessor;
|
|
{$IFNDEF STATICPREPROC}
|
|
{$IFNDEF STATICPREPROC}
|
|
-const
|
|
|
|
- FuncNameSuffix = {$IFDEF UNICODE} 'W' {$ELSE} 'A' {$ENDIF};
|
|
|
|
var
|
|
var
|
|
Filename: String;
|
|
Filename: String;
|
|
Attr: DWORD;
|
|
Attr: DWORD;
|
|
@@ -1643,8 +1582,7 @@ begin
|
|
if M = 0 then
|
|
if M = 0 then
|
|
AbortCompileFmt('Failed to load preprocessor DLL "%s" (%d)',
|
|
AbortCompileFmt('Failed to load preprocessor DLL "%s" (%d)',
|
|
[Filename, GetLastError]);
|
|
[Filename, GetLastError]);
|
|
- PreprocessScriptProc := GetProcAddress(M,
|
|
|
|
- PAnsiChar('ISPreprocessScript' + FuncNameSuffix));
|
|
|
|
|
|
+ PreprocessScriptProc := GetProcAddress(M, 'ISPreprocessScriptW');
|
|
if not Assigned(PreprocessScriptProc) then
|
|
if not Assigned(PreprocessScriptProc) then
|
|
AbortCompileFmt('Failed to get address of functions in "%s"', [Filename]);
|
|
AbortCompileFmt('Failed to get address of functions in "%s"', [Filename]);
|
|
end;
|
|
end;
|
|
@@ -2203,7 +2141,6 @@ var
|
|
|
|
|
|
UseCache := not (LangSection and LangSectionPre);
|
|
UseCache := not (LangSection and LangSectionPre);
|
|
AnsiConvertCodePage := 0;
|
|
AnsiConvertCodePage := 0;
|
|
-{$IFDEF UNICODE}
|
|
|
|
if LangSection then begin
|
|
if LangSection then begin
|
|
{ During a Pre pass on an .isl file, use code page 1252 for translation.
|
|
{ During a Pre pass on an .isl file, use code page 1252 for translation.
|
|
Previously, the system code page was used, but on DBCS that resulted in
|
|
Previously, the system code page was used, but on DBCS that resulted in
|
|
@@ -2219,7 +2156,6 @@ var
|
|
AnsiConvertCodePage := TPreLangData(PreLangDataList[Ext]).LanguageCodePage;
|
|
AnsiConvertCodePage := TPreLangData(PreLangDataList[Ext]).LanguageCodePage;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
Lines := ReadScriptFile(Filename, UseCache, AnsiConvertCodePage);
|
|
Lines := ReadScriptFile(Filename, UseCache, AnsiConvertCodePage);
|
|
try
|
|
try
|
|
@@ -2822,13 +2758,7 @@ begin
|
|
|
|
|
|
1:{ Constant is OK }
|
|
1:{ Constant is OK }
|
|
end;
|
|
end;
|
|
-{$IFDEF UNICODE}
|
|
|
|
end;
|
|
end;
|
|
-{$ELSE}
|
|
|
|
- end
|
|
|
|
- else if S[I] in CompilerLeadBytes then
|
|
|
|
- Inc(I);
|
|
|
|
-{$ENDIF}
|
|
|
|
Inc(I);
|
|
Inc(I);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -2848,7 +2778,7 @@ begin
|
|
Decl := '0';
|
|
Decl := '0';
|
|
|
|
|
|
for I := Low(Parameters) to High(Parameters) do begin
|
|
for I := Low(Parameters) to High(Parameters) do begin
|
|
- if Parameters[I].VType = {$IFDEF UNICODE} vtUnicodeString {$ELSE} vtAnsiString {$ENDIF} then
|
|
|
|
|
|
+ if Parameters[I].VType = vtUnicodeString then
|
|
Decl := Decl + ' @String'
|
|
Decl := Decl + ' @String'
|
|
else if Parameters[I].VType = vtInteger then
|
|
else if Parameters[I].VType = vtInteger then
|
|
Decl := Decl + ' @LongInt'
|
|
Decl := Decl + ' @LongInt'
|
|
@@ -3251,18 +3181,15 @@ procedure TSetupCompiler.ReadTextFile(const Filename: String; const LangIndex: I
|
|
var
|
|
var
|
|
F: TFile;
|
|
F: TFile;
|
|
Size: Cardinal;
|
|
Size: Cardinal;
|
|
-{$IFDEF UNICODE}
|
|
|
|
UnicodeFile, RTFFile: Boolean;
|
|
UnicodeFile, RTFFile: Boolean;
|
|
AnsiConvertCodePage: Integer;
|
|
AnsiConvertCodePage: Integer;
|
|
S: RawByteString;
|
|
S: RawByteString;
|
|
U: String;
|
|
U: String;
|
|
-{$ENDIF}
|
|
|
|
begin
|
|
begin
|
|
try
|
|
try
|
|
F := TFile.Create(Filename, fdOpenExisting, faRead, fsRead);
|
|
F := TFile.Create(Filename, fdOpenExisting, faRead, fsRead);
|
|
try
|
|
try
|
|
Size := F.Size.Lo;
|
|
Size := F.Size.Lo;
|
|
-{$IFDEF UNICODE}
|
|
|
|
SetLength(S, Size);
|
|
SetLength(S, Size);
|
|
F.ReadBuffer(S[1], Size);
|
|
F.ReadBuffer(S[1], Size);
|
|
|
|
|
|
@@ -3291,10 +3218,6 @@ begin
|
|
Text := S;
|
|
Text := S;
|
|
end else
|
|
end else
|
|
Text := S;
|
|
Text := S;
|
|
-{$ELSE}
|
|
|
|
- SetLength(Text, Size);
|
|
|
|
- F.ReadBuffer(Text[1], Size);
|
|
|
|
-{$ENDIF}
|
|
|
|
finally
|
|
finally
|
|
F.Free;
|
|
F.Free;
|
|
end;
|
|
end;
|
|
@@ -3926,10 +3849,6 @@ begin
|
|
CompressProps.WorkerProcessFilename := GetLZMAExeFilename(True)
|
|
CompressProps.WorkerProcessFilename := GetLZMAExeFilename(True)
|
|
else
|
|
else
|
|
CompressProps.WorkerProcessFilename := '';
|
|
CompressProps.WorkerProcessFilename := '';
|
|
- if (CompressProps.WorkerProcessFilename <> '') and
|
|
|
|
- (Byte(GetVersion()) < 5) then
|
|
|
|
- AbortCompileOnLineFmt(SCompilerDirectiveRequiresWindows2000,
|
|
|
|
- ['Setup', KeyName]);
|
|
|
|
end;
|
|
end;
|
|
ssMergeDuplicateFiles: begin
|
|
ssMergeDuplicateFiles: begin
|
|
DontMergeDuplicateFiles := not StrToBool(Value);
|
|
DontMergeDuplicateFiles := not StrToBool(Value);
|
|
@@ -3942,8 +3861,8 @@ begin
|
|
Invalid;
|
|
Invalid;
|
|
if SetupHeader.MinVersion.WinVersion <> 0 then
|
|
if SetupHeader.MinVersion.WinVersion <> 0 then
|
|
AbortCompileOnLine(SCompilerMinVersionWinMustBeZero);
|
|
AbortCompileOnLine(SCompilerMinVersionWinMustBeZero);
|
|
- if SetupHeader.MinVersion.NTVersion < $06000000 then
|
|
|
|
- AbortCompileOnLineFmt(SCompilerMinVersionNTTooLow, ['6.0']);
|
|
|
|
|
|
+ if SetupHeader.MinVersion.NTVersion < $06010000 then
|
|
|
|
+ AbortCompileOnLineFmt(SCompilerMinVersionNTTooLow, ['6.1']);
|
|
end;
|
|
end;
|
|
ssMissingMessagesWarning: begin
|
|
ssMissingMessagesWarning: begin
|
|
MissingMessagesWarning := StrToBool(Value);
|
|
MissingMessagesWarning := StrToBool(Value);
|
|
@@ -4005,8 +3924,6 @@ begin
|
|
SetSetupHeaderOption(shRestartIfNeededByRun);
|
|
SetSetupHeaderOption(shRestartIfNeededByRun);
|
|
end;
|
|
end;
|
|
ssSetupIconFile: begin
|
|
ssSetupIconFile: begin
|
|
- if (Value <> '') and (Win32Platform <> VER_PLATFORM_WIN32_NT) then
|
|
|
|
- AbortCompileOnLineFmt(SCompilerDirectiveIsNTOnly, ['Setup', KeyName]);
|
|
|
|
SetupIconFilename := Value;
|
|
SetupIconFilename := Value;
|
|
end;
|
|
end;
|
|
ssSetupLogging: begin
|
|
ssSetupLogging: begin
|
|
@@ -4030,11 +3947,7 @@ begin
|
|
SetSetupHeaderOption(shShowTasksTreeLines);
|
|
SetSetupHeaderOption(shShowTasksTreeLines);
|
|
end;
|
|
end;
|
|
ssShowUndisplayableLanguages: begin
|
|
ssShowUndisplayableLanguages: begin
|
|
-{$IFDEF UNICODE}
|
|
|
|
WarningsList.Add(Format(SCompilerEntryObsolete, ['Setup', KeyName]));
|
|
WarningsList.Add(Format(SCompilerEntryObsolete, ['Setup', KeyName]));
|
|
-{$ELSE}
|
|
|
|
- SetSetupHeaderOption(shShowUndisplayableLanguages);
|
|
|
|
-{$ENDIF}
|
|
|
|
end;
|
|
end;
|
|
ssSignedUninstaller: begin
|
|
ssSignedUninstaller: begin
|
|
SetSetupHeaderOption(shSignedUninstaller);
|
|
SetSetupHeaderOption(shSignedUninstaller);
|
|
@@ -4278,7 +4191,6 @@ function TSetupCompiler.FindLangEntryIndexByName(const AName: String;
|
|
var
|
|
var
|
|
I: Integer;
|
|
I: Integer;
|
|
begin
|
|
begin
|
|
-{$IFDEF UNICODE}
|
|
|
|
if Pre then begin
|
|
if Pre then begin
|
|
for I := 0 to PreLangDataList.Count-1 do begin
|
|
for I := 0 to PreLangDataList.Count-1 do begin
|
|
if TPreLangData(PreLangDataList[I]).Name = AName then begin
|
|
if TPreLangData(PreLangDataList[I]).Name = AName then begin
|
|
@@ -4288,7 +4200,6 @@ begin
|
|
end;
|
|
end;
|
|
AbortCompileOnLineFmt(SCompilerUnknownLanguage, [AName]);
|
|
AbortCompileOnLineFmt(SCompilerUnknownLanguage, [AName]);
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
for I := 0 to LanguageEntries.Count-1 do begin
|
|
for I := 0 to LanguageEntries.Count-1 do begin
|
|
if PSetupLanguageEntry(LanguageEntries[I]).Name = AName then begin
|
|
if PSetupLanguageEntry(LanguageEntries[I]).Name = AName then begin
|
|
@@ -4313,7 +4224,6 @@ begin
|
|
Result := -1;
|
|
Result := -1;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure TSetupCompiler.EnumLangOptionsPreProc(const Line: PChar; const Ext: Integer);
|
|
procedure TSetupCompiler.EnumLangOptionsPreProc(const Line: PChar; const Ext: Integer);
|
|
|
|
|
|
procedure ApplyToLangEntryPre(const KeyName, Value: String;
|
|
procedure ApplyToLangEntryPre(const KeyName, Value: String;
|
|
@@ -4366,7 +4276,6 @@ begin
|
|
end else
|
|
end else
|
|
ApplyToLangEntryPre(KeyName, Value, TPreLangData(PreLangDataList[LangIndex]), False);
|
|
ApplyToLangEntryPre(KeyName, Value, TPreLangData(PreLangDataList[LangIndex]), False);
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
procedure TSetupCompiler.EnumLangOptionsProc(const Line: PChar; const Ext: Integer);
|
|
procedure TSetupCompiler.EnumLangOptionsProc(const Line: PChar; const Ext: Integer);
|
|
|
|
|
|
@@ -4445,7 +4354,7 @@ procedure TSetupCompiler.EnumLangOptionsProc(const Line: PChar; const Ext: Integ
|
|
lsLanguageCodePage: begin
|
|
lsLanguageCodePage: begin
|
|
if AffectsMultipleLangs then
|
|
if AffectsMultipleLangs then
|
|
AbortCompileOnLineFmt(SCompilerCantSpecifyLangOption, [KeyName]);
|
|
AbortCompileOnLineFmt(SCompilerCantSpecifyLangOption, [KeyName]);
|
|
- {$IFNDEF UNICODE}LangOptions.LanguageCodePage := {$ENDIF}StrToIntCheck(Value);
|
|
|
|
|
|
+ StrToIntCheck(Value);
|
|
end;
|
|
end;
|
|
lsLanguageID: begin
|
|
lsLanguageID: begin
|
|
if AffectsMultipleLangs then
|
|
if AffectsMultipleLangs then
|
|
@@ -4881,35 +4790,14 @@ type
|
|
mkcPgDn, mkcEnd, mkcHome, mkcLeft, mkcUp, mkcRight, mkcDown, mkcIns,
|
|
mkcPgDn, mkcEnd, mkcHome, mkcLeft, mkcUp, mkcRight, mkcDown, mkcIns,
|
|
mkcDel, mkcShift, mkcCtrl, mkcAlt);
|
|
mkcDel, mkcShift, mkcCtrl, mkcAlt);
|
|
|
|
|
|
-{$IFDEF Delphi3OrHigher}
|
|
|
|
var
|
|
var
|
|
MenuKeyCaps: array[TMenuKeyCap] of string = (
|
|
MenuKeyCaps: array[TMenuKeyCap] of string = (
|
|
SmkcBkSp, SmkcTab, SmkcEsc, SmkcEnter, SmkcSpace, SmkcPgUp,
|
|
SmkcBkSp, SmkcTab, SmkcEsc, SmkcEnter, SmkcSpace, SmkcPgUp,
|
|
SmkcPgDn, SmkcEnd, SmkcHome, SmkcLeft, SmkcUp, SmkcRight,
|
|
SmkcPgDn, SmkcEnd, SmkcHome, SmkcLeft, SmkcUp, SmkcRight,
|
|
SmkcDown, SmkcIns, SmkcDel, SmkcShift, SmkcCtrl, SmkcAlt);
|
|
SmkcDown, SmkcIns, SmkcDel, SmkcShift, SmkcCtrl, SmkcAlt);
|
|
-{$ELSE}
|
|
|
|
-var
|
|
|
|
- MenuKeyCaps: array[TMenuKeyCap] of string;
|
|
|
|
-
|
|
|
|
-const
|
|
|
|
- MenuKeyCapIDs: array[TMenuKeyCap] of Word = (
|
|
|
|
- SmkcBkSp, SmkcTab, SmkcEsc, SmkcEnter, SmkcSpace, SmkcPgUp,
|
|
|
|
- SmkcPgDn, SmkcEnd, SmkcHome, SmkcLeft, SmkcUp, SmkcRight,
|
|
|
|
- SmkcDown, SmkcIns, SmkcDel, SmkcShift, SmkcCtrl, SmkcAlt);
|
|
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
procedure TSetupCompiler.EnumIconsProc(const Line: PChar; const Ext: Integer);
|
|
procedure TSetupCompiler.EnumIconsProc(const Line: PChar; const Ext: Integer);
|
|
|
|
|
|
- {$IFNDEF Delphi3OrHigher}
|
|
|
|
- procedure LoadStrings;
|
|
|
|
- var
|
|
|
|
- I: TMenuKeyCap;
|
|
|
|
- begin
|
|
|
|
- for I := Low(TMenuKeyCap) to High(TMenuKeyCap) do
|
|
|
|
- MenuKeyCaps[I] := LoadStr(MenuKeyCapIDs[I]);
|
|
|
|
- end;
|
|
|
|
- {$ENDIF}
|
|
|
|
-
|
|
|
|
function HotKeyToText(HotKey: Word): string;
|
|
function HotKeyToText(HotKey: Word): string;
|
|
|
|
|
|
function GetSpecialName(HotKey: Word): string;
|
|
function GetSpecialName(HotKey: Word): string;
|
|
@@ -5028,19 +4916,15 @@ const
|
|
(Name: ParamCommonAfterInstall; Flags: []),
|
|
(Name: ParamCommonAfterInstall; Flags: []),
|
|
(Name: ParamCommonMinVersion; Flags: []),
|
|
(Name: ParamCommonMinVersion; Flags: []),
|
|
(Name: ParamCommonOnlyBelowVersion; Flags: []));
|
|
(Name: ParamCommonOnlyBelowVersion; Flags: []));
|
|
- Flags: array[0..9] of PChar = (
|
|
|
|
|
|
+ Flags: array[0..8] of PChar = (
|
|
'uninsneveruninstall', 'runminimized', 'createonlyiffileexists',
|
|
'uninsneveruninstall', 'runminimized', 'createonlyiffileexists',
|
|
'useapppaths', 'closeonexit', 'dontcloseonexit', 'runmaximized',
|
|
'useapppaths', 'closeonexit', 'dontcloseonexit', 'runmaximized',
|
|
- 'foldershortcut', 'excludefromshowinnewinstall', 'preventpinning');
|
|
|
|
|
|
+ 'excludefromshowinnewinstall', 'preventpinning');
|
|
var
|
|
var
|
|
Values: array[TParam] of TParamValue;
|
|
Values: array[TParam] of TParamValue;
|
|
NewIconEntry: PSetupIconEntry;
|
|
NewIconEntry: PSetupIconEntry;
|
|
S: String;
|
|
S: String;
|
|
begin
|
|
begin
|
|
- {$IFNDEF Delphi3OrHigher}
|
|
|
|
- LoadStrings;
|
|
|
|
- {$ENDIF}
|
|
|
|
-
|
|
|
|
ExtractParameters(Line, ParamInfo, Values);
|
|
ExtractParameters(Line, ParamInfo, Values);
|
|
|
|
|
|
NewIconEntry := AllocMem(SizeOf(TSetupIconEntry));
|
|
NewIconEntry := AllocMem(SizeOf(TSetupIconEntry));
|
|
@@ -5061,9 +4945,8 @@ begin
|
|
4: CloseOnExit := icYes;
|
|
4: CloseOnExit := icYes;
|
|
5: CloseOnExit := icNo;
|
|
5: CloseOnExit := icNo;
|
|
6: ShowCmd := SW_SHOWMAXIMIZED;
|
|
6: ShowCmd := SW_SHOWMAXIMIZED;
|
|
- 7: Include(Options, ioFolderShortcut);
|
|
|
|
- 8: Include(Options, ioExcludeFromShowInNewInstall);
|
|
|
|
- 9: Include(Options, ioPreventPinning);
|
|
|
|
|
|
+ 7: Include(Options, ioExcludeFromShowInNewInstall);
|
|
|
|
+ 8: Include(Options, ioPreventPinning);
|
|
end;
|
|
end;
|
|
|
|
|
|
{ Name }
|
|
{ Name }
|
|
@@ -5613,13 +5496,7 @@ procedure TSetupCompiler.EnumFilesProc(const Line: PChar; const Ext: Integer);
|
|
if Result[I] = '{' then begin
|
|
if Result[I] = '{' then begin
|
|
Insert('{', Result, I);
|
|
Insert('{', Result, I);
|
|
Inc(I);
|
|
Inc(I);
|
|
-{$IFDEF UNICODE}
|
|
|
|
end;
|
|
end;
|
|
-{$ELSE}
|
|
|
|
- end
|
|
|
|
- else if Result[I] in CompilerLeadBytes then
|
|
|
|
- Inc(I);
|
|
|
|
-{$ENDIF}
|
|
|
|
Inc(I);
|
|
Inc(I);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -6009,12 +5886,6 @@ type
|
|
if not ExternalFile and not(foIgnoreVersion in NewFileEntry^.Options) and
|
|
if not ExternalFile and not(foIgnoreVersion in NewFileEntry^.Options) and
|
|
(NewFileLocationEntry^.Flags * [foVersionInfoValid, foVersionInfoNotValid] = []) then begin
|
|
(NewFileLocationEntry^.Flags * [foVersionInfoValid, foVersionInfoNotValid] = []) then begin
|
|
AddStatus(Format(SCompilerStatusFilesVerInfo, [SourceFile]));
|
|
AddStatus(Format(SCompilerStatusFilesVerInfo, [SourceFile]));
|
|
- { Windows versions prior to 2000 cannot read version info on 64-bit
|
|
|
|
- images. Throw an error rather than silently failing to read the
|
|
|
|
- version info (which could be dangerous). }
|
|
|
|
- if (Win32Platform <> VER_PLATFORM_WIN32_NT) or (Byte(GetVersion) < 5) then
|
|
|
|
- if Is64BitPEImage(SourceFile) then
|
|
|
|
- AbortCompileOnLine(SCompilerFilesCantReadVersionInfoOn64BitImage);
|
|
|
|
if GetVersionNumbers(SourceFile, VersionNumbers) then begin
|
|
if GetVersionNumbers(SourceFile, VersionNumbers) then begin
|
|
NewFileLocationEntry^.FileVersionMS := VersionNumbers.MS;
|
|
NewFileLocationEntry^.FileVersionMS := VersionNumbers.MS;
|
|
NewFileLocationEntry^.FileVersionLS := VersionNumbers.LS;
|
|
NewFileLocationEntry^.FileVersionLS := VersionNumbers.LS;
|
|
@@ -6078,32 +5949,20 @@ type
|
|
function ComparePathStr(P1, P2: PChar): Integer;
|
|
function ComparePathStr(P1, P2: PChar): Integer;
|
|
{ Like CompareStr, but sorts backslashes correctly ('A\B' < 'AB\B') }
|
|
{ Like CompareStr, but sorts backslashes correctly ('A\B' < 'AB\B') }
|
|
var
|
|
var
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- LastWasLeadByte: BOOL;
|
|
|
|
-{$ENDIF}
|
|
|
|
C1, C2: Char;
|
|
C1, C2: Char;
|
|
begin
|
|
begin
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- LastWasLeadByte := False;
|
|
|
|
-{$ENDIF}
|
|
|
|
repeat
|
|
repeat
|
|
C1 := P1^;
|
|
C1 := P1^;
|
|
- if (C1 = '\') {$IFNDEF UNICODE} and not LastWasLeadByte {$ENDIF} then
|
|
|
|
|
|
+ if C1 = '\' then
|
|
C1 := #1;
|
|
C1 := #1;
|
|
C2 := P2^;
|
|
C2 := P2^;
|
|
- if (C2 = '\') {$IFNDEF UNICODE} and not LastWasLeadByte {$ENDIF} then
|
|
|
|
|
|
+ if C2 = '\' then
|
|
C2 := #1;
|
|
C2 := #1;
|
|
Result := Ord(C1) - Ord(C2);
|
|
Result := Ord(C1) - Ord(C2);
|
|
if Result <> 0 then
|
|
if Result <> 0 then
|
|
Break;
|
|
Break;
|
|
if C1 = #0 then
|
|
if C1 = #0 then
|
|
Break;
|
|
Break;
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- if LastWasLeadByte then
|
|
|
|
- LastWasLeadByte := False
|
|
|
|
- else
|
|
|
|
- LastWasLeadByte := IsDBCSLeadByte(Ord(C1));
|
|
|
|
-{$ENDIF}
|
|
|
|
Inc(P1);
|
|
Inc(P1);
|
|
Inc(P2);
|
|
Inc(P2);
|
|
until False;
|
|
until False;
|
|
@@ -6755,7 +6614,6 @@ const
|
|
(Name: ParamLanguagesInfoBeforeFile; Flags: [piNoEmpty]),
|
|
(Name: ParamLanguagesInfoBeforeFile; Flags: [piNoEmpty]),
|
|
(Name: ParamLanguagesInfoAfterFile; Flags: [piNoEmpty]));
|
|
(Name: ParamLanguagesInfoAfterFile; Flags: [piNoEmpty]));
|
|
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure TSetupCompiler.EnumLanguagesPreProc(const Line: PChar; const Ext: Integer);
|
|
procedure TSetupCompiler.EnumLanguagesPreProc(const Line: PChar; const Ext: Integer);
|
|
var
|
|
var
|
|
Values: array[TLanguagesParam] of TParamValue;
|
|
Values: array[TLanguagesParam] of TParamValue;
|
|
@@ -6786,7 +6644,6 @@ begin
|
|
|
|
|
|
ReadMessagesFromFilesPre(Filename, PreLangDataList.Count-1);
|
|
ReadMessagesFromFilesPre(Filename, PreLangDataList.Count-1);
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
procedure TSetupCompiler.EnumLanguagesProc(const Line: PChar; const Ext: Integer);
|
|
procedure TSetupCompiler.EnumLanguagesProc(const Line: PChar; const Ext: Integer);
|
|
var
|
|
var
|
|
@@ -7032,7 +6889,6 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure TSetupCompiler.InitPreLangData(const APreLangData: TPreLangData);
|
|
procedure TSetupCompiler.InitPreLangData(const APreLangData: TPreLangData);
|
|
{ Initializes a TPreLangData object with the default settings }
|
|
{ Initializes a TPreLangData object with the default settings }
|
|
begin
|
|
begin
|
|
@@ -7041,7 +6897,6 @@ begin
|
|
LanguageCodePage := 0;
|
|
LanguageCodePage := 0;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
procedure TSetupCompiler.InitLanguageEntry(var ALanguageEntry: TSetupLanguageEntry);
|
|
procedure TSetupCompiler.InitLanguageEntry(var ALanguageEntry: TSetupLanguageEntry);
|
|
{ Initializes a TSetupLanguageEntry record with the default settings }
|
|
{ Initializes a TSetupLanguageEntry record with the default settings }
|
|
@@ -7050,9 +6905,6 @@ begin
|
|
Name := 'default';
|
|
Name := 'default';
|
|
LanguageName := 'English';
|
|
LanguageName := 'English';
|
|
LanguageID := $0409; { U.S. English }
|
|
LanguageID := $0409; { U.S. English }
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- LanguageCodePage := 0;
|
|
|
|
-{$ENDIF}
|
|
|
|
DialogFontName := DefaultDialogFontName;
|
|
DialogFontName := DefaultDialogFontName;
|
|
DialogFontSize := 8;
|
|
DialogFontSize := 8;
|
|
TitleFontName := 'Arial';
|
|
TitleFontName := 'Arial';
|
|
@@ -7067,7 +6919,6 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure TSetupCompiler.ReadMessagesFromFilesPre(const AFiles: String;
|
|
procedure TSetupCompiler.ReadMessagesFromFilesPre(const AFiles: String;
|
|
const ALangIndex: Integer);
|
|
const ALangIndex: Integer);
|
|
var
|
|
var
|
|
@@ -7084,7 +6935,6 @@ begin
|
|
CallIdleProc;
|
|
CallIdleProc;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
procedure TSetupCompiler.ReadMessagesFromFiles(const AFiles: String;
|
|
procedure TSetupCompiler.ReadMessagesFromFiles(const AFiles: String;
|
|
const ALangIndex: Integer);
|
|
const ALangIndex: Integer);
|
|
@@ -7123,7 +6973,6 @@ begin
|
|
{ ^ Copy(..., 4, Maxint) is to skip past "msg" }
|
|
{ ^ Copy(..., 4, Maxint) is to skip past "msg" }
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure TSetupCompiler.ReadMessagesFromScriptPre;
|
|
procedure TSetupCompiler.ReadMessagesFromScriptPre;
|
|
|
|
|
|
procedure CreateDefaultLanguageEntryPre;
|
|
procedure CreateDefaultLanguageEntryPre;
|
|
@@ -7157,7 +7006,6 @@ begin
|
|
EnumIniSection(EnumLangOptionsPreProc, 'LangOptions', -1, False, True, '', True, False);
|
|
EnumIniSection(EnumLangOptionsPreProc, 'LangOptions', -1, False, True, '', True, False);
|
|
CallIdleProc;
|
|
CallIdleProc;
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
procedure TSetupCompiler.ReadMessagesFromScript;
|
|
procedure TSetupCompiler.ReadMessagesFromScript;
|
|
|
|
|
|
@@ -7645,7 +7493,6 @@ procedure TSetupCompiler.Compile;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
procedure FreePreLangData;
|
|
procedure FreePreLangData;
|
|
var
|
|
var
|
|
I: Integer;
|
|
I: Integer;
|
|
@@ -7655,7 +7502,6 @@ procedure TSetupCompiler.Compile;
|
|
PreLangDataList.Delete(I);
|
|
PreLangDataList.Delete(I);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
procedure FreeLangData;
|
|
procedure FreeLangData;
|
|
var
|
|
var
|
|
@@ -7724,9 +7570,6 @@ var
|
|
|
|
|
|
F.WriteBuffer(SetupID, SizeOf(SetupID));
|
|
F.WriteBuffer(SetupID, SizeOf(SetupID));
|
|
|
|
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- SetupHeader.LeadBytes := CompilerLeadBytes;
|
|
|
|
-{$ENDIF}
|
|
|
|
SetupHeader.NumLanguageEntries := LanguageEntries.Count;
|
|
SetupHeader.NumLanguageEntries := LanguageEntries.Count;
|
|
SetupHeader.NumCustomMessageEntries := CustomMessageEntries.Count;
|
|
SetupHeader.NumCustomMessageEntries := CustomMessageEntries.Count;
|
|
SetupHeader.NumPermissionEntries := PermissionEntries.Count;
|
|
SetupHeader.NumPermissionEntries := PermissionEntries.Count;
|
|
@@ -8232,7 +8075,7 @@ var
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
- procedure PrepareSetupE32(var M: TMemoryFile; const RemoveManifestDllHijackProtection: Boolean);
|
|
|
|
|
|
+ procedure PrepareSetupE32(var M: TMemoryFile);
|
|
var
|
|
var
|
|
TempFilename, E32Filename, ConvertFilename: String;
|
|
TempFilename, E32Filename, ConvertFilename: String;
|
|
ConvertFile: TFile;
|
|
ConvertFile: TFile;
|
|
@@ -8258,21 +8101,11 @@ var
|
|
UpdateVersionInfo(ConvertFile, TFileVersionNumbers(nil^), VersionInfoProductVersion, VersionInfoCompany,
|
|
UpdateVersionInfo(ConvertFile, TFileVersionNumbers(nil^), VersionInfoProductVersion, VersionInfoCompany,
|
|
'', '', VersionInfoCopyright, VersionInfoProductName, VersionInfoProductTextVersion, VersionInfoOriginalFileName,
|
|
'', '', VersionInfoCopyright, VersionInfoProductName, VersionInfoProductTextVersion, VersionInfoOriginalFileName,
|
|
False);
|
|
False);
|
|
- if RemoveManifestDllHijackProtection then begin
|
|
|
|
- AddStatus(Format(SCompilerStatusUpdatingManifest, ['SETUP.E32']));
|
|
|
|
- CompExeUpdate.RemoveManifestDllHijackProtection(ConvertFile, False);
|
|
|
|
- end else begin
|
|
|
|
- { Use the opportunity to check that the manifest is correctly prepared for removing the
|
|
|
|
- protection, without actually removing it. Doing this only once per compile since there's
|
|
|
|
- only one source manifest. }
|
|
|
|
- CompExeUpdate.RemoveManifestDllHijackProtection(ConvertFile, True);
|
|
|
|
- end;
|
|
|
|
finally
|
|
finally
|
|
ConvertFile.Free;
|
|
ConvertFile.Free;
|
|
end;
|
|
end;
|
|
M := TMemoryFile.Create(ConvertFilename);
|
|
M := TMemoryFile.Create(ConvertFilename);
|
|
- UpdateSetupPEHeaderFields(M, RemoveManifestDllHijackProtection, TerminalServicesAware,
|
|
|
|
- DEPCompatible, ASLRCompatible);
|
|
|
|
|
|
+ UpdateSetupPEHeaderFields(M, TerminalServicesAware, DEPCompatible, ASLRCompatible);
|
|
if shSignedUninstaller in SetupHeader.Options then
|
|
if shSignedUninstaller in SetupHeader.Options then
|
|
SignSetupE32(M);
|
|
SignSetupE32(M);
|
|
finally
|
|
finally
|
|
@@ -8408,10 +8241,8 @@ var
|
|
SetupE32: TMemoryFile;
|
|
SetupE32: TMemoryFile;
|
|
I: Integer;
|
|
I: Integer;
|
|
AppNameHasConsts, AppVersionHasConsts, AppPublisherHasConsts,
|
|
AppNameHasConsts, AppVersionHasConsts, AppPublisherHasConsts,
|
|
- AppCopyrightHasConsts, AppIdHasConsts, Uninstallable, RemoveManifestDllHijackProtection: Boolean;
|
|
|
|
|
|
+ AppCopyrightHasConsts, AppIdHasConsts, Uninstallable: Boolean;
|
|
PrivilegesRequiredValue: String;
|
|
PrivilegesRequiredValue: String;
|
|
- OSVersionInfo: TOSVersionInfo;
|
|
|
|
- WindowsVersion: Cardinal;
|
|
|
|
begin
|
|
begin
|
|
{ Sanity check: A single TSetupCompiler instance cannot be used to do
|
|
{ Sanity check: A single TSetupCompiler instance cannot be used to do
|
|
multiple compiles. A separate instance must be used for each compile,
|
|
multiple compiles. A separate instance must be used for each compile,
|
|
@@ -8758,28 +8589,28 @@ begin
|
|
{ Prepare Setup executable & signed uninstaller data }
|
|
{ Prepare Setup executable & signed uninstaller data }
|
|
if Output then begin
|
|
if Output then begin
|
|
AddStatus(SCompilerStatusPreparingSetupExe);
|
|
AddStatus(SCompilerStatusPreparingSetupExe);
|
|
- { The manifest block protecting special DLLs breaks Vista compatibility }
|
|
|
|
- RemoveManifestDllHijackProtection := SetupHeader.MinVersion.NTVersion < $06010000;
|
|
|
|
- if RemoveManifestDllHijackProtection then
|
|
|
|
- WarningsList.Add(Format(SCompilerRemoveManifestDllHijackProtection, ['6.1']))
|
|
|
|
- else begin
|
|
|
|
- OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
|
|
|
|
- if GetVersionEx(OSVersionInfo) then begin
|
|
|
|
- WindowsVersion := (Byte(OSVersionInfo.dwMajorVersion) shl 24) or
|
|
|
|
- (Byte(OSVersionInfo.dwMinorVersion) shl 16) or Word(OSVersionInfo.dwBuildNumber);
|
|
|
|
- if WindowsVersion < Cardinal($06010000) then
|
|
|
|
- WarningsList.Add(Format(SCompilerDidntRemoveManifestDllHijackProtection, ['6.1']))
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
- PrepareSetupE32(SetupE32, RemoveManifestDllHijackProtection);
|
|
|
|
- end else begin
|
|
|
|
|
|
+ PrepareSetupE32(SetupE32);
|
|
|
|
+ end else
|
|
AddStatus(SCompilerStatusSkippingPreparingSetupExe);
|
|
AddStatus(SCompilerStatusSkippingPreparingSetupExe);
|
|
- RemoveManifestDllHijackProtection := False; { silence compiler }
|
|
|
|
- end;
|
|
|
|
|
|
|
|
{ Read languages:
|
|
{ Read languages:
|
|
|
|
|
|
- Non Unicode:
|
|
|
|
|
|
+ 0. Determine final code pages:
|
|
|
|
+ Unicode Setup uses Unicode text and does not depend on the system code page. To
|
|
|
|
+ provide Setup with Unicode text without requiring Unicode .isl files (but still
|
|
|
|
+ supporting Unicode .iss, license and info files), the compiler converts the .isl
|
|
|
|
+ files to Unicode during compilation. It also does this if it finds ANSI plain text
|
|
|
|
+ license and info files. To be able to do this it needs to know the language's code
|
|
|
|
+ page but as seen above it can't simply take this from the current .isl. And license
|
|
|
|
+ and info files do not even have a language code page setting.
|
|
|
|
+
|
|
|
|
+ This means the Unicode compiler has to do an extra phase: following the logic above
|
|
|
|
+ it first determines the final language code page for each language, storing these
|
|
|
|
+ into an extra list called PreDataList, and then it continues as normal while using
|
|
|
|
+ the final language code page for any conversions needed.
|
|
|
|
+
|
|
|
|
+ Note: it must avoid caching the .isl files while determining the code pages, since
|
|
|
|
+ the conversion is done *before* the caching.
|
|
|
|
|
|
1. Read Default.isl messages:
|
|
1. Read Default.isl messages:
|
|
|
|
|
|
@@ -8835,35 +8666,8 @@ begin
|
|
4. Check 'language completeness' of custom message constants:
|
|
4. Check 'language completeness' of custom message constants:
|
|
CheckCustomMessageDefinitions is used to check for missing custom messages and
|
|
CheckCustomMessageDefinitions is used to check for missing custom messages and
|
|
where necessary it 'promotes' a custom message by resetting its LangIndex property
|
|
where necessary it 'promotes' a custom message by resetting its LangIndex property
|
|
- to -1.
|
|
|
|
-
|
|
|
|
- 5. Display the language at run time:
|
|
|
|
- Setup checks if the system code page matches the language code page, and only shows
|
|
|
|
- the language if it does. The system code page is then used to display all text, this
|
|
|
|
- does not only include messages and custom messages, but also any readme and info files.
|
|
|
|
-
|
|
|
|
- Unicode:
|
|
|
|
-
|
|
|
|
- Unicode works exactly like above with one exception:
|
|
|
|
-
|
|
|
|
- 0. Determine final code pages:
|
|
|
|
- Unicode Setup uses Unicode text and does not depend on the system code page. To
|
|
|
|
- provide Setup with Unicode text without requiring Unicode .isl files (but still
|
|
|
|
- supporting Unicode .iss, license and info files), the compiler converts the .isl
|
|
|
|
- files to Unicode during compilation. It also does this if it finds ANSI plain text
|
|
|
|
- license and info files. To be able to do this it needs to know the language's code
|
|
|
|
- page but as seen above it can't simply take this from the current .isl. And license
|
|
|
|
- and info files do not even have a language code page setting.
|
|
|
|
|
|
+ to -1. }
|
|
|
|
|
|
- This means the Unicode compiler has to do an extra phase: following the logic above
|
|
|
|
- it first determines the final language code page for each language, storing these
|
|
|
|
- into an extra list called PreDataList, and then it continues as normal while using
|
|
|
|
- the final language code page for any conversions needed.
|
|
|
|
-
|
|
|
|
- Note: it must avoid caching the .isl files while determining the code pages, since
|
|
|
|
- the conversion is done *before* the caching. }
|
|
|
|
-
|
|
|
|
-{$IFDEF UNICODE}
|
|
|
|
{ 0. Determine final language code pages }
|
|
{ 0. Determine final language code pages }
|
|
AddStatus(SCompilerStatusDeterminingCodePages);
|
|
AddStatus(SCompilerStatusDeterminingCodePages);
|
|
|
|
|
|
@@ -8874,7 +8678,6 @@ begin
|
|
|
|
|
|
{ 0.2. Read [LangOptions] in the script }
|
|
{ 0.2. Read [LangOptions] in the script }
|
|
ReadMessagesFromScriptPre;
|
|
ReadMessagesFromScriptPre;
|
|
-{$ENDIF}
|
|
|
|
|
|
|
|
{ 1. Read Default.isl messages }
|
|
{ 1. Read Default.isl messages }
|
|
AddStatus(SCompilerStatusReadingDefaultMessages);
|
|
AddStatus(SCompilerStatusReadingDefaultMessages);
|
|
@@ -9046,8 +8849,7 @@ begin
|
|
end;
|
|
end;
|
|
SetupFile := TFile.Create(ExeFilename, fdOpenExisting, faReadWrite, fsNone);
|
|
SetupFile := TFile.Create(ExeFilename, fdOpenExisting, faReadWrite, fsNone);
|
|
try
|
|
try
|
|
- UpdateSetupPEHeaderFields(SetupFile, RemoveManifestDllHijackProtection,
|
|
|
|
- TerminalServicesAware, DEPCompatible, ASLRCompatible);
|
|
|
|
|
|
+ UpdateSetupPEHeaderFields(SetupFile, TerminalServicesAware, DEPCompatible, ASLRCompatible);
|
|
SizeOfExe := SetupFile.Size.Lo;
|
|
SizeOfExe := SetupFile.Size.Lo;
|
|
finally
|
|
finally
|
|
SetupFile.Free;
|
|
SetupFile.Free;
|
|
@@ -9107,10 +8909,7 @@ begin
|
|
True);
|
|
True);
|
|
|
|
|
|
{ Update manifest if needed }
|
|
{ Update manifest if needed }
|
|
- if RemoveManifestDllHijackProtection then begin
|
|
|
|
- AddStatus(Format(SCompilerStatusUpdatingManifest, ['SETUP.EXE']));
|
|
|
|
- CompExeUpdate.RemoveManifestDllHijackProtection(ExeFile, False);
|
|
|
|
- end else if UseSetupLdr then begin
|
|
|
|
|
|
+ if UseSetupLdr then begin
|
|
AddStatus(Format(SCompilerStatusUpdatingManifest, ['SETUP.EXE']));
|
|
AddStatus(Format(SCompilerStatusUpdatingManifest, ['SETUP.EXE']));
|
|
CompExeUpdate.PreventCOMCTL32Sideloading(ExeFile);
|
|
CompExeUpdate.PreventCOMCTL32Sideloading(ExeFile);
|
|
end;
|
|
end;
|
|
@@ -9186,9 +8985,7 @@ begin
|
|
FileLocationEntryFilenames.Clear;
|
|
FileLocationEntryFilenames.Clear;
|
|
FreeLineInfoList(ExpectedCustomMessageNames);
|
|
FreeLineInfoList(ExpectedCustomMessageNames);
|
|
FreeLangData;
|
|
FreeLangData;
|
|
-{$IFDEF UNICODE}
|
|
|
|
FreePreLangData;
|
|
FreePreLangData;
|
|
-{$ENDIF}
|
|
|
|
FreeScriptFiles;
|
|
FreeScriptFiles;
|
|
FreeLineInfoList(CodeText);
|
|
FreeLineInfoList(CodeText);
|
|
FreeAndNil(CompressProps);
|
|
FreeAndNil(CompressProps);
|
|
@@ -9360,10 +9157,6 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
initialization
|
|
initialization
|
|
-{$IFNDEF UNICODE}
|
|
|
|
- GetLeadBytes(CompilerLeadBytes);
|
|
|
|
- ConstLeadBytes := @CompilerLeadBytes;
|
|
|
|
-{$ENDIF}
|
|
|
|
finalization
|
|
finalization
|
|
if CryptProv <> 0 then begin
|
|
if CryptProv <> 0 then begin
|
|
CryptReleaseContext(CryptProv, 0);
|
|
CryptReleaseContext(CryptProv, 0);
|