unit StructVerDEFVER_EXTSUF_;

interface
uses
  Windows, MyTypes, MainInfo, structDEFVER_EXTSUF_;

const
  UNI_FIRST = 5205; // First Inno Setup version that had Unicode support
  ANSI_LAST = 5601; // From IS version 6.0 there is only Unicode version

{$DEFINE ARCH_EXTSUF_}
// If unit for non-unicode version then previous define will be just ARCH
// so INNO_UNICODE will not be defined 
{$IF Defined(ARCHu) or Defined(ARCHur) or (DEFVER > ANSI_LAST)}
  {$DEFINE INNO_UNICODE}
{$IFEND}

{$DEFINE EXT_EXTSUF_}
// Same trick as with INNO_UNICODE but for RT versions
{$IF Defined(EXTr) or Defined(EXTur)}
  {$DEFINE INNO_RTVER}
{$IFEND}

type
  TAnInnoVer = class(TInnoVer)
  public
    constructor Create; override;
    procedure SetupSizes(var Info: TMySetupInfo); override;
    procedure UnifySetupLdrOffsetTable(var p; var ot:TMySetupLdrOffsetTable); override;
    procedure UnifySetupHeader(var p; var sh:TMySetupHeader); override;
    procedure UnifySetupISSigKeyEntry(var p; var sk:TMySetupISSigKeyEntry); override;
    procedure UnifyFileEntry(var p; var fe:TMySetupFileEntry); override;
    procedure UnifyFileLocationEntry(var p; var fl:TMySetupFileLocationEntry); override;
    procedure UnifyRegistryEntry(var p; var re:TMySetupRegistryEntry); override;
    procedure UnifyRunEntry(var p; var re:TMySetupRunEntry); override;
    procedure UnifyIconEntry(var p; var ie:TMySetupIconEntry); override;
    procedure UnifyTaskEntry(var p; var te:TMySetupTaskEntry); override;
    procedure UnifyComponentEntry(var p; var ce:TMySetupComponentEntry); override;
    procedure UnifyTypeEntry(var p; var te:TMySetupTypeEntry); override;
    procedure UnifyCustomMessageEntry(var p; var ce:TMySetupCustomMessageEntry); override;
    procedure UnifyLanguageEntry(var p; var le:TMySetupLanguageEntry); override;
    procedure UnifyDirEntry(var p; var de: TMySetupDirEntry); override;
    procedure UnifyIniEntry(var p; var ie: TMySetupIniEntry); override;
    procedure UnifyDeleteEntry(var p; var de: TMySetupDeleteEntry); override;
  end;

implementation

const
  SetupFileOptionTable: array [0..MySetupFileOptionLast] of byte = (
  ord(structDEFVER_EXTSUF_.foConfirmOverwrite)                                           ,  {foConfirmOverwrite        }
  ord(structDEFVER_EXTSUF_.foUninsNeverUninstall)                                        ,  {foUninsNeverUninstall     }
  ord(structDEFVER_EXTSUF_.foRestartReplace)                                             ,  {foRestartReplace          }
  ord(structDEFVER_EXTSUF_.foDeleteAfterInstall)                                         ,  {foDeleteAfterInstall      }
  ord(structDEFVER_EXTSUF_.foRegisterServer)                                             ,  {foRegisterServer          }
  ord(structDEFVER_EXTSUF_.foRegisterTypeLib)                                            ,  {foRegisterTypeLib         }
  ord(structDEFVER_EXTSUF_.foSharedFile)                                                 ,  {foSharedFile              }
  {$IF DEFVER>=3005}
  ord(structDEFVER_EXTSUF_.foCompareTimeStamp)                                           ,  {foCompareTimeStamp        }
  {$ELSE}
  ord(structDEFVER_EXTSUF_.foCompareTimeStampAlso)                                       ,  {foCompareTimeStamp        }
  {$IFEND}
  ord(structDEFVER_EXTSUF_.foFontIsntTrueType)                                           ,  {foFontIsntTrueType        }
  ord(structDEFVER_EXTSUF_.foSkipIfSourceDoesntExist)                                    ,  {foSkipIfSourceDoesntExist }
  ord(structDEFVER_EXTSUF_.foOverwriteReadOnly)                                          ,  {foOverwriteReadOnly       }
  ord(structDEFVER_EXTSUF_.foOverwriteSameVersion)                                       ,  {foOverwriteSameVersion    }
  ord(structDEFVER_EXTSUF_.foCustomDestName)                                             ,  {foCustomDestName          }
  {$IF DEFVER>=1325}ord(structDEFVER_EXTSUF_.foOnlyIfDestFileExists)    {$ELSE}255{$IFEND} ,  {foOnlyIfDestFileExists    }
  {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.foNoRegError)              {$ELSE}255{$IFEND} ,  {foNoRegError              }
  {$IF DEFVER>=3001}ord(structDEFVER_EXTSUF_.foUninsRestartDelete)      {$ELSE}255{$IFEND} ,  {foUninsRestartDelete      }
  {$IF DEFVER>=3005}ord(structDEFVER_EXTSUF_.foOnlyIfDoesntExist)       {$ELSE}255{$IFEND} ,  {foOnlyIfDoesntExist       }
  {$IF DEFVER>=3005}ord(structDEFVER_EXTSUF_.foIgnoreVersion)           {$ELSE}255{$IFEND} ,  {foIgnoreVersion           }
  {$IF DEFVER>=3005}ord(structDEFVER_EXTSUF_.foPromptIfOlder)           {$ELSE}255{$IFEND} ,  {foPromptIfOlder           }
  {$IF DEFVER>=4000}ord(structDEFVER_EXTSUF_.foDontCopy)                {$ELSE}255{$IFEND} ,  {foDontCopy                }
  {$IF DEFVER>=4005}ord(structDEFVER_EXTSUF_.foUninsRemoveReadOnly)     {$ELSE}255{$IFEND} ,  {foUninsRemoveReadOnly     }
  {$IF DEFVER>=4108}ord(structDEFVER_EXTSUF_.foRecurseSubDirsExternal)  {$ELSE}255{$IFEND} ,  {foRecurseSubDirsExternal  }
  {$IF DEFVER>=4201}ord(structDEFVER_EXTSUF_.foReplaceSameVersionIfContentsDiffer){$ELSE}255{$IFEND} ,
  {$IF DEFVER>=4205}ord(structDEFVER_EXTSUF_.foDontVerifyChecksum)      {$ELSE}255{$IFEND} ,
  {$IF DEFVER>=5003}ord(structDEFVER_EXTSUF_.foUninsNoSharedFilePrompt) {$ELSE}255{$IFEND} ,
  {$IF DEFVER>=5100}ord(structDEFVER_EXTSUF_.foCreateAllSubDirs)        {$ELSE}255{$IFEND} ,
  {$IF DEFVER>=5102}ord(structDEFVER_EXTSUF_.fo32bit)                   {$ELSE}255{$IFEND} ,  {fo32bit                   }
  {$IF DEFVER>=5102}ord(structDEFVER_EXTSUF_.fo64bit)                   {$ELSE}255{$IFEND} ,  {fo64bit                   }
  {$IF DEFVER>=5200}ord(structDEFVER_EXTSUF_.foExternalSizePreset)      {$ELSE}255{$IFEND} ,  {foExternalSizePreset      }
  {$IF DEFVER>=5200}ord(structDEFVER_EXTSUF_.foSetNTFSCompression)      {$ELSE}255{$IFEND} ,  {foSetNTFSCompression      }
  {$IF DEFVER>=5200}ord(structDEFVER_EXTSUF_.foUnsetNTFSCompression)    {$ELSE}255{$IFEND} ,  {foUnsetNTFSCompression    }
  {$IF DEFVER>=5300}ord(structDEFVER_EXTSUF_.foGacInstall)              {$ELSE}255{$IFEND} ,  {foGacInstall              }
  {$IF DEFVER>=6500}ord(structDEFVER_EXTSUF_.foDownload)                {$ELSE}255{$IFEND} ,
  {$IF DEFVER>=6500}ord(structDEFVER_EXTSUF_.foExtractArchive)          {$ELSE}255{$IFEND}
);

  SetupFileLocationFlagTable: array[0..MySetupFileLocationFlagLast] of byte = (
    ord(structDEFVER_EXTSUF_.foVersionInfoValid)                                              ,
    {$IF DEFVER<6403} ord(structDEFVER_EXTSUF_.foVersionInfoNotValid)      {$ELSE}255{$IFEND} ,
    {$IF DEFVER>=4010}ord(structDEFVER_EXTSUF_.foTimeStampInUTC)           {$ELSE}255{$IFEND} ,
    {$IF (DEFVER>=4100) AND (DEFVER<6403)}ord(structDEFVER_EXTSUF_.foIsUninstExe) {$ELSE}255{$IFEND} ,
    {$IF DEFVER>=4108}ord(structDEFVER_EXTSUF_.foCallInstructionOptimized) {$ELSE}255{$IFEND} ,
    {$IF (DEFVER>=4200) AND (DEFVER<5507)}ord(structDEFVER_EXTSUF_.foTouch){$ELSE}255{$IFEND} ,
    {$IF DEFVER>=4202}ord(structDEFVER_EXTSUF_.foChunkEncrypted)           {$ELSE}255{$IFEND} ,
    {$IF DEFVER>=4205}ord(structDEFVER_EXTSUF_.foChunkCompressed)          {$ELSE}255{$IFEND} ,
    {$IF (DEFVER>=5113) AND (DEFVER<6403)}ord(structDEFVER_EXTSUF_.foSolidBreak)  {$ELSE}255{$IFEND} ,
    {$IF (DEFVER>=5601) AND (DEFVER<6300)}ord(structDEFVER_EXTSUF_.foSign) {$ELSE}255{$IFEND} ,
    {$IF (DEFVER>=5601) AND (DEFVER<6300)}ord(structDEFVER_EXTSUF_.foSignOnce)    {$ELSE}255{$IFEND}
  );

  SetupRegistryOptionTable: array[0..MySetupRegistryOptionLast] of byte = (
  ord(structDEFVER_EXTSUF_.roCreateValueIfDoesntExist)                                   ,  {roCreateValueIfDoesntExist    }
  ord(structDEFVER_EXTSUF_.roUninsDeleteValue)                                           ,  {roUninsDeleteValue            }
  ord(structDEFVER_EXTSUF_.roUninsClearValue)                                            ,  {roUninsClearValue             }
  ord(structDEFVER_EXTSUF_.roUninsDeleteEntireKey)                                       ,  {roUninsDeleteEntireKey        }
  ord(structDEFVER_EXTSUF_.roUninsDeleteEntireKeyIfEmpty)                                ,  {roUninsDeleteEntireKeyIfEmpty }
  ord(structDEFVER_EXTSUF_.roPreserveStringType)                                         ,  {roPreserveStringType          }
  ord(structDEFVER_EXTSUF_.roDeleteKey)                                                  ,  {roDeleteKey                   }
  ord(structDEFVER_EXTSUF_.roDeleteValue)                                                ,  {roDeleteValue                 }
  ord(structDEFVER_EXTSUF_.roNoError)                                                    ,  {roNoError                     }
  ord(structDEFVER_EXTSUF_.roDontCreateKey)                                              ,  {roDontCreateKey               }
  {$IF DEFVER>=5100}ord(structDEFVER_EXTSUF_.ro32bit)                 {$ELSE}255{$IFEND} ,  {ro32bit                       }
  {$IF DEFVER>=5100}ord(structDEFVER_EXTSUF_.ro64bit)                 {$ELSE}255{$IFEND}    {ro64bit                       }
);

  SetupDirOptionTable: array[0..MySetupDirOptionLast] of byte = (
  ord(structDEFVER_EXTSUF_.doUninsNeverUninstall)                                          ,  {doUninsNeverUninstall   }
  ord(structDEFVER_EXTSUF_.doDeleteAfterInstall)                                           ,  {doDeleteAfterInstall    }
  ord(structDEFVER_EXTSUF_.doUninsAlwaysUninstall)                                         ,  {doUninsAlwaysUninstall  }
  {$IF DEFVER>=5200}ord(structDEFVER_EXTSUF_.doSetNTFSCompression)      {$ELSE}255{$IFEND} ,  {doSetNTFSCompression    }
  {$IF DEFVER>=5200}ord(structDEFVER_EXTSUF_.doUnsetNTFSCompression)    {$ELSE}255{$IFEND}    {doUnsetNTFSCompression  }
);

  SetupIniOptionTable: array[0..MySetupIniOptionLast] of byte = (
  ord(structDEFVER_EXTSUF_.ioCreateKeyIfDoesntExist)                       ,  {ioCreateKeyIfDoesntExist     }
  ord(structDEFVER_EXTSUF_.ioUninsDeleteEntry)                             ,  {ioUninsDeleteEntry           }
  ord(structDEFVER_EXTSUF_.ioUninsDeleteEntireSection)                     ,  {ioUninsDeleteEntireSection   }
  ord(structDEFVER_EXTSUF_.ioUninsDeleteSectionIfEmpty)                    ,  {ioUninsDeleteSectionIfEmpty  }
  ord(structDEFVER_EXTSUF_.ioHasValue)                                        {ioHasValue                   }
);

  SetupHeaderOptionTable: array[0..MySetupHeaderOptionLast] of byte = (
    ord(structDEFVER_EXTSUF_.shDisableStartupPrompt),
    {$IF DEFVER<5310}ord(structDEFVER_EXTSUF_.shUninstallable)             {$ELSE}255{$IFEND},
    ord(structDEFVER_EXTSUF_.shCreateAppDir),
    ord(structDEFVER_EXTSUF_.shAllowNoIcons),
    {$IF (DEFVER>=3003) OR (DEFVER < 3000)}ord(structDEFVER_EXTSUF_.shAlwaysRestart) {$ELSE}255{$IFEND},
    ord(structDEFVER_EXTSUF_.shAlwaysUsePersonalGroup),
    {$IF DEFVER<6400}ord(structDEFVER_EXTSUF_.shWindowVisible)             {$ELSE}255{$IFEND},
    {$IF DEFVER<6400}ord(structDEFVER_EXTSUF_.shWindowShowCaption)         {$ELSE}255{$IFEND},
    {$IF DEFVER<6400}ord(structDEFVER_EXTSUF_.shWindowResizable)           {$ELSE}255{$IFEND},
    {$IF DEFVER<6400}ord(structDEFVER_EXTSUF_.shWindowStartMaximized)      {$ELSE}255{$IFEND},
    ord(structDEFVER_EXTSUF_.shEnableDirDoesntExistWarning),
    ord(structDEFVER_EXTSUF_.shPassword),
    ord(structDEFVER_EXTSUF_.shAllowRootDirectory),
    ord(structDEFVER_EXTSUF_.shDisableFinishedPage),
    {$IF DEFVER<5601}ord(structDEFVER_EXTSUF_.shChangesAssociations)        {$ELSE}255{$IFEND},
    {$IF DEFVER<6700}ord(structDEFVER_EXTSUF_.shUsePreviousAppDir)          {$ELSE}255{$IFEND},
    {$IF DEFVER<6400}ord(structDEFVER_EXTSUF_.shBackColorHorizontal)        {$ELSE}255{$IFEND},
    {$IF DEFVER<6700}ord(structDEFVER_EXTSUF_.shUsePreviousGroup)           {$ELSE}255{$IFEND},
    ord(structDEFVER_EXTSUF_.shUpdateUninstallLogAppName),
    {$IF (DEFVER>=2001) AND (DEFVER<6700)}ord(structDEFVER_EXTSUF_.shUsePreviousSetupType){$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.shDisableReadyMemo)          {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.shAlwaysShowComponentsList)  {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.shFlatComponentsList)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.shShowComponentSizes)        {$ELSE}255{$IFEND},
    {$IF (DEFVER>=2001) AND (DEFVER<6700)}ord(structDEFVER_EXTSUF_.shUsePreviousTasks){$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.shDisableReadyPage)          {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.shAlwaysShowDirOnReadyPage)  {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.shAlwaysShowGroupOnReadyPage){$ELSE}255{$IFEND},
    {$IF DEFVER>=2018}ord(structDEFVER_EXTSUF_.shAllowUNCPath)              {$ELSE}255{$IFEND},
    {$IF DEFVER>=3000}ord(structDEFVER_EXTSUF_.shUserInfoPage)              {$ELSE}255{$IFEND},
    {$IF (DEFVER>=3000) AND (DEFVER<6700)}ord(structDEFVER_EXTSUF_.shUsePreviousUserInfo){$ELSE}255{$IFEND},
    {$IF DEFVER>=3001}ord(structDEFVER_EXTSUF_.shUninstallRestartComputer)  {$ELSE}255{$IFEND},
    {$IF DEFVER>=3003}ord(structDEFVER_EXTSUF_.shRestartIfNeededByRun)      {$ELSE}255{$IFEND},
    {$IF DEFVER>=3008}ord(structDEFVER_EXTSUF_.shShowTasksTreeLines)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=4009}ord(structDEFVER_EXTSUF_.shAllowCancelDuringInstall)  {$ELSE}255{$IFEND},
    {$IF DEFVER>=4103}ord(structDEFVER_EXTSUF_.shWizardImageStretch)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=4108}ord(structDEFVER_EXTSUF_.shAppendDefaultDirName)      {$ELSE}255{$IFEND},
    {$IF DEFVER>=4108}ord(structDEFVER_EXTSUF_.shAppendDefaultGroupName)    {$ELSE}255{$IFEND},
    {$IF (DEFVER>=4202) AND (DEFVER<6500)}ord(structDEFVER_EXTSUF_.shEncryptionUsed){$ELSE}255{$IFEND},
    {$IF (DEFVER>=5004) AND (DEFVER<5601)}ord(structDEFVER_EXTSUF_.shChangesEnvironment){$ELSE}255{$IFEND},
    {$IF (DEFVER>=5107) AND (NOT DEFINED(INNO_UNICODE))}
      ord(structDEFVER_EXTSUF_.shShowUndisplayableLanguages)
    {$ELSE}255{$IFEND},
    {$IF DEFVER>=5113}ord(structDEFVER_EXTSUF_.shSetupLogging)             {$ELSE}255{$IFEND},
    {$IF DEFVER>=5201}ord(structDEFVER_EXTSUF_.shSignedUninstaller)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=5308}ord(structDEFVER_EXTSUF_.shUsePreviousLanguage)      {$ELSE}255{$IFEND},
    {$IF DEFVER>=5309}ord(structDEFVER_EXTSUF_.shDisableWelcomePage)       {$ELSE}255{$IFEND},
    {$IF DEFVER>=5500}ord(structDEFVER_EXTSUF_.shCloseApplications)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=5500}ord(structDEFVER_EXTSUF_.shRestartApplications)      {$ELSE}255{$IFEND},
    {$IF DEFVER>=5500}ord(structDEFVER_EXTSUF_.shAllowNetworkDrive)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=5507}ord(structDEFVER_EXTSUF_.shForceCloseApplications)   {$ELSE}255{$IFEND},
    {$IF DEFVER>=6000}ord(structDEFVER_EXTSUF_.shAppNameHasConsts)         {$ELSE}255{$IFEND},
    {$IF DEFVER>=6000}ord(structDEFVER_EXTSUF_.shUsePreviousPrivileges)    {$ELSE}255{$IFEND},
    {$IF (DEFVER>=6000) AND (DEFVER<6600)}ord(structDEFVER_EXTSUF_.shWizardResizable){$ELSE}255{$IFEND},
    {$IF DEFVER>=6300}ord(structDEFVER_EXTSUF_.shUninstallLogging)         {$ELSE}255{$IFEND},
    {$IF DEFVER>=6600}ord(structDEFVER_EXTSUF_.shWizardModern)              {$ELSE}255{$IFEND},
    {$IF DEFVER>=6600}ord(structDEFVER_EXTSUF_.shWizardBorderStyled)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=6600}ord(structDEFVER_EXTSUF_.shWizardKeepAspectRatio)     {$ELSE}255{$IFEND},
    {$IF (DEFVER>=6600) AND (DEFVER<6700)}ord(structDEFVER_EXTSUF_.shWizardLightButtonsUnstyled){$ELSE}255{$IFEND},
    {$IF DEFVER>=6700}ord(structDEFVER_EXTSUF_.shRedirectionGuard)         {$ELSE}255{$IFEND},
    {$IF DEFVER>=6700}ord(structDEFVER_EXTSUF_.shWizardBevelsHidden)       {$ELSE}255{$IFEND}
    //{$IF DEFVER>=6700}ord(structDEFVER_EXTSUF_.shUnusedPadding)            {$ELSE}255{$IFEND}
  );

  SetupRunOptionTable: array[0..MySetupRunOptionLast] of byte = (
    ord(structDEFVER_EXTSUF_.roShellExec),
    ord(structDEFVER_EXTSUF_.roSkipIfDoesntExist),
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.roPostInstall)         {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.roUnchecked)           {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.roSkipIfSilent)        {$ELSE}255{$IFEND},
    {$IF DEFVER>=2001}ord(structDEFVER_EXTSUF_.roSkipIfNotSilent)     {$ELSE}255{$IFEND},
    {$IF DEFVER>=2008}ord(structDEFVER_EXTSUF_.roHideWizard)          {$ELSE}255{$IFEND},
    {$IF DEFVER>=5110}ord(structDEFVER_EXTSUF_.roRun32Bit)            {$ELSE}255{$IFEND},
    {$IF DEFVER>=5110}ord(structDEFVER_EXTSUF_.roRun64Bit)            {$ELSE}255{$IFEND},
    {$IF DEFVER>=5200}ord(structDEFVER_EXTSUF_.roRunAsOriginalUser)   {$ELSE}255{$IFEND},
    {$IF DEFVER>=6100}ord(structDEFVER_EXTSUF_.roDontLogParameters)   {$ELSE}255{$IFEND}, 
    {$IF DEFVER>=6300}ord(structDEFVER_EXTSUF_.roLogOutput)           {$ELSE}255{$IFEND}
  );

constructor TAnInnoVer.Create;
begin
  VerSupported:=DEFVER;
  IsUnicode:={$IFDEF INNO_UNICODE}true{$ELSE}false{$ENDIF};
  IsRT:={$IFDEF INNO_RTVER}true{$ELSE}false{$ENDIF};
  SetupID:=SetupLdrOffsetTableId;
  {$IF DEFVER>=5105}
    OfsTabVers:=SetupLdrOffsetTableVersion;
  {$IFEND}
  OfsTabSize:=sizeof(TSetupLdrOffsetTable);
end;

procedure TAnInnoVer.SetupSizes(var Info: TMySetupInfo);
begin
  Info.SetupHeader.Size:=sizeof(TSetupHeader);
  {$IFDEF WIN64}
  Info.SetupHeader.TypeInfo := TypeInfo(TSetupHeader);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupHeader.NumStrings:=SetupHeaderStrings;
    Info.SetupHeader.NumAnsiStrings:=SetupHeaderAnsiStrings;
    {$ELSE}
    Info.SetupHeader.NumStrings:=0;
    Info.SetupHeader.NumAnsiStrings:=SetupHeaderStrings+SetupHeaderAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupHeader.NumStrings:=0;
  Info.SetupHeader.NumAnsiStrings:=SetupHeaderStrings;
  {$IFEND}

  {$IF DEFVER>=4000}
  Info.SetupLanguageEntry.Size:=sizeof(TSetupLanguageEntry);
  {$IFDEF WIN64}
  Info.SetupLanguageEntry.TypeInfo := TypeInfo(TSetupLanguageEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupLanguageEntry.NumStrings:=SetupLanguageEntryStrings;
    Info.SetupLanguageEntry.NumAnsiStrings:=SetupLanguageEntryAnsiStrings;
    {$ELSE}
    Info.SetupLanguageEntry.NumStrings:=0;
    Info.SetupLanguageEntry.NumAnsiStrings:=SetupLanguageEntryStrings+SetupLanguageEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupLanguageEntry.NumStrings:=0;
  Info.SetupLanguageEntry.NumAnsiStrings:=SetupLanguageEntryStrings;
  {$IFEND}
  {$ELSEIF DEFVER >= 2001}
  Info.SetupLanguageEntry.Size:=sizeof(TSetupLangOptions);
  {$IFDEF WIN64}
  Info.SetupLanguageEntry.TypeInfo := TypeInfo(TSetupLangOptions);
  {$ENDIF}
  Info.SetupLanguageEntry.NumStrings:=0;
  Info.SetupLanguageEntry.NumAnsiStrings:=SetupLangOptionsStrings;
  {$ELSE}
  Info.SetupLanguageEntry.Size:=0;
  {$IFDEF WIN64}
  Info.SetupLanguageEntry.TypeInfo := nil;
  {$ENDIF}
  Info.SetupLanguageEntry.NumStrings:=0;
  Info.SetupLanguageEntry.NumAnsiStrings:=0;
  {$IFEND}

  {$IF DEFVER>=4201}
  Info.SetupCustomMessageEntry.Size:=sizeof(TSetupCustomMessageEntry);
  {$IFDEF WIN64}
  Info.SetupCustomMessageEntry.TypeInfo := TypeInfo(TSetupCustomMessageEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupCustomMessageEntry.NumStrings:=SetupCustomMessageEntryStrings;
    Info.SetupCustomMessageEntry.NumAnsiStrings:=SetupCustomMessageEntryAnsiStrings;
    {$ELSE}
    Info.SetupCustomMessageEntry.NumStrings:=0;
    Info.SetupCustomMessageEntry.NumAnsiStrings:=SetupCustomMessageEntryStrings+SetupCustomMessageEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupCustomMessageEntry.NumStrings:=0;
  Info.SetupCustomMessageEntry.NumAnsiStrings:=SetupCustomMessageEntryStrings;
  {$IFEND}
  {$ELSE}
  Info.SetupCustomMessageEntry.Size:=0;
  {$IFDEF WIN64}
  Info.SetupCustomMessageEntry.TypeInfo := nil;
  {$ENDIF}
  Info.SetupCustomMessageEntry.NumStrings:=0;
  Info.SetupCustomMessageEntry.NumAnsiStrings:=0;
  {$IFEND}

  {$IF DEFVER>=4100}
  Info.SetupPermissionEntry.Size:=sizeof(TSetupPermissionEntry);
  {$IFDEF WIN64}
  Info.SetupPermissionEntry.TypeInfo := TypeInfo(TSetupPermissionEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupPermissionEntry.NumStrings:=SetupPermissionEntryStrings;
    Info.SetupPermissionEntry.NumAnsiStrings:=SetupPermissionEntryAnsiStrings;
    {$ELSE}
    Info.SetupPermissionEntry.NumStrings:=0;
    Info.SetupPermissionEntry.NumAnsiStrings:=SetupPermissionEntryStrings+SetupPermissionEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupPermissionEntry.NumStrings:=0;
  Info.SetupPermissionEntry.NumAnsiStrings:=SetupPermissionEntryStrings;
  {$IFEND}
  {$ELSE}
  Info.SetupPermissionEntry.Size:=0;
  {$IFDEF WIN64}
  Info.SetupPermissionEntry.TypeInfo := nil;
  {$ENDIF}
  Info.SetupPermissionEntry.NumStrings:=0;
  Info.SetupPermissionEntry.NumAnsiStrings:=0;
  {$IFEND}

{$IF DEFVER >= 2001}
  Info.SetupTypeEntry.Size:=sizeof(TSetupTypeEntry);
  {$IFDEF WIN64}
  Info.SetupTypeEntry.TypeInfo := TypeInfo(TSetupTypeEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
      Info.SetupTypeEntry.NumStrings:=SetupTypeEntryStrings;
      Info.SetupTypeEntry.NumAnsiStrings:=SetupTypeEntryAnsiStrings;
    {$ELSE}
      Info.SetupTypeEntry.NumStrings:=0;
      Info.SetupTypeEntry.NumAnsiStrings:=SetupTypeEntryStrings+SetupTypeEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
    Info.SetupTypeEntry.NumStrings:=0;
    Info.SetupTypeEntry.NumAnsiStrings:=SetupTypeEntryStrings;
  {$IFEND}
{$ELSE}
  Info.SetupTypeEntry.Size:=0;
  {$IFDEF WIN64}
  Info.SetupTypeEntry.TypeInfo := nil;
  {$ENDIF}
  Info.SetupTypeEntry.NumStrings:=0;
  Info.SetupTypeEntry.NumAnsiStrings:=0;
{$IFEND}

{$IF DEFVER >= 2001}
  Info.SetupComponentEntry.Size:=sizeof(TSetupComponentEntry);
  {$IFDEF WIN64}
  Info.SetupComponentEntry.TypeInfo := TypeInfo(TSetupComponentEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
      Info.SetupComponentEntry.NumStrings:=SetupComponentEntryStrings;
      Info.SetupComponentEntry.NumAnsiStrings:=SetupComponentEntryAnsiStrings;
    {$ELSE}
      Info.SetupComponentEntry.NumStrings:=0;
      Info.SetupComponentEntry.NumAnsiStrings:=SetupComponentEntryStrings+SetupComponentEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
    Info.SetupComponentEntry.NumStrings:=0;
    Info.SetupComponentEntry.NumAnsiStrings:=SetupComponentEntryStrings;
  {$IFEND}
{$ELSE}
  Info.SetupComponentEntry.Size:=0;
  {$IFDEF WIN64}
  Info.SetupComponentEntry.TypeInfo := nil;
  {$ENDIF}
  Info.SetupComponentEntry.NumStrings:=0;
  Info.SetupComponentEntry.NumAnsiStrings:=0;
{$IFEND}

{$IF DEFVER >= 2001}
  Info.SetupTaskEntry.Size:=sizeof(TSetupTaskEntry);
  {$IFDEF WIN64}
  Info.SetupTaskEntry.TypeInfo := TypeInfo(TSetupTaskEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
      Info.SetupTaskEntry.NumStrings:=SetupTaskEntryStrings;
      Info.SetupTaskEntry.NumAnsiStrings:=SetupTaskEntryAnsiStrings;
    {$ELSE}
      Info.SetupTaskEntry.NumStrings:=0;
      Info.SetupTaskEntry.NumAnsiStrings:=SetupTaskEntryStrings+SetupTaskEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
    Info.SetupTaskEntry.NumStrings:=0;
    Info.SetupTaskEntry.NumAnsiStrings:=SetupTaskEntryStrings;
  {$IFEND}
{$ELSE}
  Info.SetupTaskEntry.Size:=0;
  {$IFDEF WIN64}
  Info.SetupTaskEntry.TypeInfo := nil;
  {$ENDIF}
  Info.SetupTaskEntry.NumStrings:=0;
  Info.SetupTaskEntry.NumAnsiStrings:=0;
{$IFEND}

  Info.SetupDirEntry.Size:=sizeof(TSetupDirEntry);
  {$IFDEF WIN64}
  Info.SetupDirEntry.TypeInfo := TypeInfo(TSetupDirEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupDirEntry.NumStrings:=SetupDirEntryStrings;
    Info.SetupDirEntry.NumAnsiStrings:=SetupDirEntryAnsiStrings;
    {$ELSE}
    Info.SetupDirEntry.NumStrings:=0;
    Info.SetupDirEntry.NumAnsiStrings:=SetupDirEntryStrings+SetupDirEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupDirEntry.NumStrings:=0;
  Info.SetupDirEntry.NumAnsiStrings:=SetupDirEntryStrings;
  {$IFEND}

  {$IF DEFVER >= 6500}
    {$IFDEF WIN64}
    Info.SetupISSigKeyEntry.TypeInfo := TypeInfo(TSetupISSigKeyEntry);
    {$ENDIF}
    Info.SetupISSigKeyEntry.Size := sizeof(TSetupISSigKeyEntry);
    Info.SetupISSigKeyEntry.NumStrings := SetupISSigKeyEntryStrings;
    Info.SetupISSigKeyEntry.NumAnsiStrings := SetupISSigKeyEntryAnsiStrings;
  {$ELSE}
    Info.SetupISSigKeyEntry.Size := 0;
    Info.SetupISSigKeyEntry.NumStrings := 0;
    Info.SetupISSigKeyEntry.NumAnsiStrings := 0;
  {$IFEND}

  Info.SetupFileEntry.Size:=sizeof(TSetupFileEntry);
  {$IFDEF WIN64}
  Info.SetupFileEntry.TypeInfo := TypeInfo(TSetupFileEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupFileEntry.NumStrings:=SetupFileEntryStrings;
    Info.SetupFileEntry.NumAnsiStrings:=SetupFileEntryAnsiStrings;
    {$ELSE}
    Info.SetupFileEntry.NumStrings:=0;
    Info.SetupFileEntry.NumAnsiStrings:=SetupFileEntryStrings+SetupFileEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupFileEntry.NumStrings:=0;
  Info.SetupFileEntry.NumAnsiStrings:=SetupFileEntryStrings;
  {$IFEND}

  Info.SetupIconEntry.Size:=sizeof(TSetupIconEntry);
  {$IFDEF WIN64}
  Info.SetupIconEntry.TypeInfo := TypeInfo(TSetupIconEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupIconEntry.NumStrings:=SetupIconEntryStrings;
    Info.SetupIconEntry.NumAnsiStrings:=SetupIconEntryAnsiStrings;
    {$ELSE}
    Info.SetupIconEntry.NumStrings:=0;
    Info.SetupIconEntry.NumAnsiStrings:=SetupIconEntryStrings+SetupIconEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupIconEntry.NumStrings:=0;
  Info.SetupIconEntry.NumAnsiStrings:=SetupIconEntryStrings;
  {$IFEND}

  Info.SetupIniEntry.Size:=sizeof(TSetupIniEntry);
  {$IFDEF WIN64}
  Info.SetupIniEntry.TypeInfo := TypeInfo(TSetupIniEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupIniEntry.NumStrings:=SetupIniEntryStrings;
    Info.SetupIniEntry.NumAnsiStrings:=SetupIniEntryAnsiStrings;
    {$ELSE}
    Info.SetupIniEntry.NumStrings:=0;
    Info.SetupIniEntry.NumAnsiStrings:=SetupIniEntryStrings+SetupIniEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupIniEntry.NumStrings:=0;
  Info.SetupIniEntry.NumAnsiStrings:=SetupIniEntryStrings;
  {$IFEND}

  Info.SetupRegistryEntry.Size:=sizeof(TSetupRegistryEntry);
  {$IFDEF WIN64}
  Info.SetupRegistryEntry.TypeInfo := TypeInfo(TSetupRegistryEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupRegistryEntry.NumStrings:=SetupRegistryEntryStrings;
    Info.SetupRegistryEntry.NumAnsiStrings:=SetupRegistryEntryAnsiStrings;
    {$ELSE}
    Info.SetupRegistryEntry.NumStrings:=0;
    Info.SetupRegistryEntry.NumAnsiStrings:=SetupRegistryEntryStrings+SetupRegistryEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupRegistryEntry.NumStrings:=0;
  Info.SetupRegistryEntry.NumAnsiStrings:=SetupRegistryEntryStrings;
  {$IFEND}

  Info.SetupDeleteEntry.Size:=sizeof(TSetupDeleteEntry);
  {$IFDEF WIN64}
  Info.SetupDeleteEntry.TypeInfo := TypeInfo(TSetupDeleteEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupDeleteEntry.NumStrings:=SetupDeleteEntryStrings;
    Info.SetupDeleteEntry.NumAnsiStrings:=SetupDeleteEntryAnsiStrings;
    {$ELSE}
    Info.SetupDeleteEntry.NumStrings:=0;
    Info.SetupDeleteEntry.NumAnsiStrings:=SetupDeleteEntryStrings+SetupDeleteEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupDeleteEntry.NumStrings:=0;
  Info.SetupDeleteEntry.NumAnsiStrings:=SetupDeleteEntryStrings;
  {$IFEND}

  Info.SetupRunEntry.Size:=sizeof(TSetupRunEntry);
  {$IFDEF WIN64}
  Info.SetupRunEntry.TypeInfo := TypeInfo(TSetupRunEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupRunEntry.NumStrings:=SetupRunEntryStrings;
    Info.SetupRunEntry.NumAnsiStrings:=SetupRunEntryAnsiStrings;
    {$ELSE}
    Info.SetupRunEntry.NumStrings:=0;
    Info.SetupRunEntry.NumAnsiStrings:=SetupRunEntryStrings+SetupRunEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupRunEntry.NumStrings:=0;
  Info.SetupRunEntry.NumAnsiStrings:=SetupRunEntryStrings;
  {$IFEND}

  Info.SetupFileLocationEntry.Size:=sizeof(TSetupFileLocationEntry);
  {$IFDEF WIN64}
  Info.SetupFileLocationEntry.TypeInfo := TypeInfo(TSetupFileLocationEntry);
  {$ENDIF}
  {$IF DEFVER>=UNI_FIRST}
    {$IFDEF INNO_UNICODE}
    Info.SetupFileLocationEntry.NumStrings:=SetupFileLocationEntryStrings;
    Info.SetupFileLocationEntry.NumAnsiStrings:=SetupFileLocationEntryAnsiStrings;
    {$ELSE}
    Info.SetupFileLocationEntry.NumStrings:=0;
    Info.SetupFileLocationEntry.NumAnsiStrings:=SetupFileLocationEntryStrings+SetupFileLocationEntryAnsiStrings;
    {$ENDIF}
  {$ELSE}
  Info.SetupFileLocationEntry.NumStrings:=0;
  Info.SetupFileLocationEntry.NumAnsiStrings:=SetupFileLocationEntryStrings;
  {$IFEND}
end;

// the following procedures extract information from important
// version-specific data structures. they are applied to whatever
// data is read from the installation file. all the other extraction
// code operates on the produced unified version-independent structures

procedure TAnInnoVer.UnifySetupLdrOffsetTable(var p; var ot:TMySetupLdrOffsetTable);
var
  oot:TSetupLdrOffsetTable absolute p;
begin
  LoadBinaryData(ot.ID, oot.ID, Length(oot.ID));
  LoadIntData(ot.Version {$IF DEFVER>=5105} , oot.Version {$IFEND} );
  LoadIntData(ot.TotalSize, oot.TotalSize);
  LoadIntData(ot.OffsetEXE, oot.OffsetEXE);
  //{$IF DEFVER<=4106} // since the main installer exe is not unpacked, there's no need for its size
  //LoadIntData(ot.CompressedSizeEXE, oot.CompressedSizeEXE);
  //{$IFEND}
  LoadIntData(ot.UncompressedSizeEXE, oot.UncompressedSizeEXE);
  LoadIntData(ot.CRCEXE, {$IF DEFVER>=4003} oot.CRCEXE {$ELSE} oot.AdlerEXE {$IFEND});
  LoadIntData(ot.Offset0, oot.Offset0);
  LoadIntData(ot.Offset1, oot.Offset1);
  {$IF DEFVER>=4010}
    LoadIntData(ot.TableCRC, oot.TableCRC);
    ot.TableCRCUsed := True;
  {$ELSE}
    ot.TableCRCUsed := False;
  {$IFEND}
end;

procedure TAnInnoVer.UnifySetupHeader(var p; var sh:TMySetupHeader);
var
  osh:TSetupHeader absolute p;
begin
  LoadTextData(sh.AppName, osh.AppName);
  LoadTextData(sh.AppVerName, osh.AppVerName);
  LoadTextData(sh.AppId, osh.AppId);
  LoadTextData(sh.AppCopyright, osh.AppCopyright);
  LoadTextData(sh.AppPublisher, osh.AppPublisher);
  LoadTextData(sh.AppPublisherURL, osh.AppPublisherURL);
  LoadTextData(sh.AppSupportPhone {$IF DEFVER>=5113} , osh.AppSupportPhone {$IFEND} );
  LoadTextData(sh.AppSupportURL, osh.AppSupportURL);
  LoadTextData(sh.AppUpdatesURL, osh.AppUpdatesURL);
  LoadTextData(sh.AppVersion, osh.AppVersion);
  LoadTextData(sh.DefaultDirName, osh.DefaultDirName);
  LoadTextData(sh.DefaultGroupName, osh.DefaultGroupName);
  LoadTextData(sh.BaseFilename, osh.BaseFilename);
  LoadIntData(sh.NumLanguageEntries {$IF DEFVER>=4000} , osh.NumLanguageEntries {$IFEND} );
  LoadBinaryData(sh.CompiledCodeText {$IF DEFVER>=4000} , osh.CompiledCodeText {$IFEND} );
  LoadBinaryData(sh.LicenseText, osh.LicenseText);
  LoadBinaryData(sh.InfoBeforeText, osh.InfoBeforeText);
  LoadBinaryData(sh.InfoAfterText, osh.InfoAfterText);
  LoadIntData(sh.NumCustomMessageEntries {$IF DEFVER>=4201} , osh.NumCustomMessageEntries {$IFEND} );
  LoadIntData(sh.NumPermissionEntries {$IF DEFVER>=4100} , osh.NumPermissionEntries {$IFEND} );
  LoadIntData(sh.NumTypeEntries {$IF DEFVER>=2001} , osh.NumTypeEntries {$IFEND} );
  LoadIntData(sh.NumComponentEntries {$IF DEFVER>=2001} , osh.NumComponentEntries {$IFEND} );
  LoadIntData(sh.NumTaskEntries {$IF DEFVER>=2001} , osh.NumTaskEntries {$IFEND} );
  LoadIntData(sh.NumDirEntries, osh.NumDirEntries);
  LoadIntData(sh.NumFileEntries, osh.NumFileEntries);
  LoadIntData(sh.NumISSigKeyEntries {$IF DEFVER>=6500} , osh.NumISSigKeyEntries {$IFEND} );
  LoadIntData(sh.NumFileLocationEntries, osh.NumFileLocationEntries);
  LoadIntData(sh.NumIconEntries, osh.NumIconEntries);
  LoadIntData(sh.NumIniEntries, osh.NumIniEntries);
  LoadIntData(sh.NumRegistryEntries, osh.NumRegistryEntries);
  LoadIntData(sh.NumInstallDeleteEntries, osh.NumInstallDeleteEntries);
  LoadIntData(sh.NumUninstallDeleteEntries, osh.NumUninstallDeleteEntries);
  LoadIntData(sh.NumRunEntries, osh.NumRunEntries);
  LoadIntData(sh.NumUninstallRunEntries, osh.NumUninstallRunEntries);
  sh.MinVersion := TMySetupVersionData(osh.MinVersion);
  sh.OnlyBelowVersion := TMySetupVersionData(osh.OnlyBelowVersion);
  LoadIntData(sh.ExtraDiskSpaceRequired, osh.ExtraDiskSpaceRequired);
  {$IF DEFVER<6400}
  LoadIntData(sh.BackColor, osh.BackColor);
  LoadIntData(sh.BackColor2, osh.BackColor2);
  {$IFEND}
  sh.WizardStyle := {$IF (DEFVER>=6000) AND (DEFVER<6600)} TMySetupWizardStyle(osh.WizardStyle) {$ELSE} wsClassic {$IFEND} ;
  sh.WizardDarkStyle := {$IF DEFVER>=6600} TMySetupWizardDarkStyle(osh.WizardDarkStyle) {$ELSE} wdsLight {$IFEND} ;
  {$IF DEFVER>=4000}
    LoadIntData(sh.SlicesPerDisk, osh.SlicesPerDisk);
  {$ELSE}
    sh.SlicesPerDisk := 1;
  {$IFEND}
  {$IF DEFVER>=4105}
    case osh.CompressMethod of
      {$IF DEFVER>=4205}
      cmStored:                 sh.CompressMethod := MyTypes.cmStored;
      {$IFEND}
      {$IF DEFVER<>4205}
      cmZip:                    sh.CompressMethod := MyTypes.cmZip;
      {$IFEND}
      cmBzip:                   sh.CompressMethod := MyTypes.cmBzip;
      cmLZMA:                   sh.CompressMethod := MyTypes.cmLZMA;
      {$IF DEFVER>=5309}
      cmLZMA2:                  sh.CompressMethod := MyTypes.cmLZMA2;
      {$IFEND}
    end;
  {$ELSEIF DEFVER >= 2017}
    if shBzipUsed in osh.Options then
      sh.CompressMethod := MyTypes.cmBzip
    else
      sh.CompressMethod := MyTypes.cmZip;
  {$ELSE}
    sh.CompressMethod := MyTypes.cmZip;
  {$IFEND}
  {$IF (DEFVER>=4202) AND (DEFVER<6500)}
    sh.EncryptionUsed := shEncryptionUsed in osh.Options;
    {$IF DEFVER>=6400}
      sh.PasswordHash.HashType := htSHA256;
      FillChar(sh.PasswordSalt, SizeOf(sh.PasswordSalt), 0);
      sh.Is64Encryption.PasswordTest := osh.PasswordTest;
      Move(osh.EncryptionKDFSalt, sh.Is64Encryption.EncryptionKDFSalt, SizeOf(sh.Is64Encryption.EncryptionKDFSalt));
      sh.Is64Encryption.EncryptionKDFIterations := osh.EncryptionKDFIterations;
      Move(osh.EncryptionBaseNonce, sh.Is64Encryption.EncryptionBaseNonce, SizeOf(sh.Is64Encryption.EncryptionBaseNonce));
    {$ELSE}
      {$IF DEFVER>=5309}
        sh.PasswordHash.HashType := htSHA1;
        Move(osh.PasswordHash, sh.PasswordHash.SHA1, sizeof(sh.PasswordHash.SHA1));
      {$ELSE}
        sh.PasswordHash.HashType := htMD5;
        Move(osh.PasswordHash, sh.PasswordHash.MD5, sizeof(sh.PasswordHash.MD5));
      {$IFEND}
      FillChar(sh.Is64Encryption, SizeOf(sh.Is64Encryption), 0);
      Move(osh.PasswordSalt, sh.PasswordSalt, sizeof(sh.PasswordSalt));
    {$IFEND}
  {$ELSE}
    sh.EncryptionUsed := False;
    FillChar(sh.PasswordSalt, sizeof(sh.PasswordSalt), 0);
    FillChar(sh.Is64Encryption, SizeOf(sh.Is64Encryption), 0);
  {$IFEND}
  {$IF DEFVER>=6300}
    LoadTextData(sh.ArchitecturesAllowed, osh.ArchitecturesAllowed);
    LoadTextData(sh.ArchitecturesInstallIn64BitMode, osh.ArchitecturesInstallIn64BitMode);
  {$ELSEIF DEFVER>=5100}
    sh.ArchitecturesAllowed := '';
    if (paX86 in osh.ArchitecturesAllowed) then sh.ArchitecturesAllowed := 'x86 '; 
    if ( {$IF DEFVER>=5102} paX64 {$ELSE} paAMD64 {$IFEND} in osh.ArchitecturesAllowed) then sh.ArchitecturesAllowed := sh.ArchitecturesAllowed + 'x64 '; 
    if (paIA64 in osh.ArchitecturesAllowed) then sh.ArchitecturesAllowed := sh.ArchitecturesAllowed + 'ia64';
    sh.ArchitecturesInstallIn64BitMode := '';
    if (paX86 in osh.ArchitecturesInstallIn64BitMode) then sh.ArchitecturesInstallIn64BitMode := 'x86 '; 
    if ( {$IF DEFVER>=5102} paX64 {$ELSE} paAMD64 {$IFEND} in osh.ArchitecturesInstallIn64BitMode) then sh.ArchitecturesInstallIn64BitMode := sh.ArchitecturesInstallIn64BitMode + 'x64 '; 
    if (paIA64 in osh.ArchitecturesInstallIn64BitMode) then sh.ArchitecturesInstallIn64BitMode := sh.ArchitecturesInstallIn64BitMode + 'ia64';
  {$ELSE}
    sh.ArchitecturesAllowed := '';
    sh.ArchitecturesInstallIn64BitMode := '';
  {$IFEND}
  {$IF DEFVER>=3004}
    case osh.PrivilegesRequired of
      prNone:       sh.PrivilegesRequired := MyTypes.prNone;
      prPowerUser:  sh.PrivilegesRequired := MyTypes.prPowerUser;
      prAdmin:      sh.PrivilegesRequired := MyTypes.prAdmin;
      {$IF DEFVER>=5307}
      prLowest:     sh.PrivilegesRequired := MyTypes.prLowest;
      {$IFEND}
    end;
  {$ELSE}
    if (shAdminPrivilegesRequired in osh.Options) then
      sh.PrivilegesRequired := MyTypes.prAdmin
    else
      sh.PrivilegesRequired := MyTypes.prNone;
  {$IFEND}
  sh.PrivilegesRequiredOverridesAllowed := [];
  {$IF DEFVER>=6000}
  if proCommandLine in osh.PrivilegesRequiredOverridesAllowed then sh.PrivilegesRequiredOverridesAllowed := sh.PrivilegesRequiredOverridesAllowed + [TMySetupPrivilegesRequiredOverride.proCommandLine];
  if proDialog in osh.PrivilegesRequiredOverridesAllowed then sh.PrivilegesRequiredOverridesAllowed := sh.PrivilegesRequiredOverridesAllowed + [TMySetupPrivilegesRequiredOverride.proDialog];
  {$IFEND}
  LoadTextData(sh.UninstallFilesDir, osh.UninstallFilesDir);
  LoadTextData(sh.UninstallDisplayName, osh.UninstallDisplayName);
  LoadTextData(sh.UninstallDisplayIcon, osh.UninstallDisplayIcon);
  LoadTextData(sh.AppMutex, osh.AppMutex);
  LoadTextData(sh.DefaultUserInfoName {$IF DEFVER>=3000} , osh.DefaultUserInfoName {$IFEND} );
  LoadTextData(sh.DefaultUserInfoOrg {$IF DEFVER>=3000} , osh.DefaultUserInfoOrg {$IFEND} );
  LoadTextData(sh.DefaultUserInfoSerial {$IF DEFVER>=3008} , osh.DefaultUserInfoSerial {$IFEND} );
  LoadTextData(sh.AppReadmeFile {$IF DEFVER>=4204} , osh.AppReadmeFile {$IFEND} );
  LoadTextData(sh.AppContact {$IF DEFVER>=4204} , osh.AppContact {$IFEND} );
  LoadTextData(sh.AppComments {$IF DEFVER>=4204} , osh.AppComments {$IFEND} );
  LoadTextData(sh.AppModifyPath {$IF DEFVER>=4204} , osh.AppModifyPath {$IFEND} );
  LoadTextData(sh.CreateUninstallRegKey, {$IF DEFVER>=5308} osh.CreateUninstallRegKey {$ELSE} shCreateUninstallRegKey in osh.Options {$IFEND} );
  LoadTextData(sh.Uninstallable {$IF DEFVER>=5310} , osh.Uninstallable {$IFEND} );
  LoadTextData(sh.CloseApplicationsFilter {$IF DEFVER>=5500} , osh.CloseApplicationsFilter {$IFEND} );
  LoadTextData(sh.SetupMutex {$IF DEFVER>=5506} , osh.SetupMutex {$IFEND} );
  LoadTextData(sh.ChangesEnvironment, {$IF DEFVER>=5601} osh.ChangesEnvironment {$ELSEIF DEFVER>=5004} TSetupHeaderOption.shChangesEnvironment in osh.Options {$ELSE} False {$IFEND} );
  LoadTextData(sh.ChangesAssociations, {$IF DEFVER<5601} shChangesAssociations in osh.Options {$ELSE} osh.ChangesAssociations {$IFEND} );
  {$IF DEFVER>=4010}
  sh.ShowLanguageDialog := TMySetupShowLanguageDialog(osh.ShowLanguageDialog);
  {$ELSEIF DEFVER>=4000}
  if shShowLanguageDialog in osh.Options then
    sh.ShowLanguageDialog := slYes
  else
    sh.ShowLanguageDialog := slNo;
  {$ELSE}
  sh.ShowLanguageDialog := slNo;
  {$IFEND}
  {$IF DEFVER>=5303}
    case osh.DisableDirPage of
      dpAuto: sh.DisableDirPage := MyTypes.dpAuto;
      dpNo:   sh.DisableDirPage := MyTypes.dpNo;
      dpYes:  sh.DisableDirPage := MyTypes.dpYes;
    end;
    case osh.DisableProgramGroupPage of
      dpAuto: sh.DisableProgramGroupPage := MyTypes.dpAuto;
      dpNo:   sh.DisableProgramGroupPage := MyTypes.dpNo;
      dpYes:  sh.DisableProgramGroupPage := MyTypes.dpYes;
    end;
  {$ELSE}
    if (shDisableDirPage in osh.Options) then
      sh.DisableDirPage := MyTypes.dpYes
    else
      sh.DisableDirPage := MyTypes.dpNo;
    if (shDisableProgramGroupPage in osh.Options) then
      sh.DisableProgramGroupPage := MyTypes.dpYes
    else
      sh.DisableProgramGroupPage := MyTypes.dpNo;
  {$IFEND}
  {$IF DEFVER>=4010}
    case osh.LanguageDetectionMethod of
      ldUILanguage: sh.LanguageDetectionMethod := MyTypes.ldUILanguage;
      ldLocale:     sh.LanguageDetectionMethod := MyTypes.ldLocale;
      ldNone:       sh.LanguageDetectionMethod := MyTypes.ldNone;
    end;
  {$ELSE}
    sh.LanguageDetectionMethod := MyTypes.ldNone;
  {$IFEND}
  LoadIntData(sh.UninstallDisplaySize {$IF DEFVER>=5306} , osh.UninstallDisplaySize {$IFEND} );
  TranslateSet(osh.Options, sh.Options, PByteArray(@SetupHeaderOptionTable)^, MySetupHeaderOptionLast);
end;

procedure TAnInnoVer.UnifySetupISSigKeyEntry(var p; var sk:TMySetupISSigKeyEntry);
{$IF DEFVER>=6500}
var
  osk: TSetupISSigKeyEntry absolute p;
{$IFEND}
begin
  LoadTextData(sk.PublicX {$IF DEFVER>=6500} , osk.PublicX {$IFEND} );
  LoadTextData(sk.PublicY {$IF DEFVER>=6500} , osk.PublicY {$IFEND} );
  LoadTextData(sk.RuntimeID {$IF DEFVER>=6500} , osk.RuntimeID {$IFEND} );
end;

procedure TAnInnoVer.UnifyFileEntry(var p; var fe:TMySetupFileEntry);
var
  ofe: TSetupFileEntry absolute p;
begin
  LoadTextData(fe.SourceFilename, ofe.SourceFilename);
  LoadTextData(fe.DestName, ofe.DestName);
  LoadTextData(fe.Components {$IF DEFVER>=2001} , ofe.Components {$IFEND} );
  LoadTextData(fe.Tasks {$IF DEFVER>=2001} , ofe.Tasks {$IFEND} );
  LoadTextData(fe.Check {$IF DEFVER>=4000} , ofe.Check {$IFEND} );
  LoadTextData(fe.Languages {$IF DEFVER>=4001} , ofe.Languages {$IFEND} );
  LoadTextData(fe.AfterInstall {$IF DEFVER>=4100} , ofe.AfterInstall {$IFEND} );
  LoadTextData(fe.BeforeInstall {$IF DEFVER>=4100} , ofe.BeforeInstall {$IFEND} );
  fe.PermissionsEntry := {$IF DEFVER>=4100} ofe.PermissionsEntry {$ELSE} 0 {$IFEND} ;
  fe.MinVersion := TMySetupVersionData(ofe.MinVersion);
  fe.OnlyBelowVersion := TMySetupVersionData(ofe.OnlyBelowVersion);
  LoadIntData(fe.LocationEntry, ofe.LocationEntry);
  LoadIntData(fe.ExternalSize, ofe.ExternalSize);
  LoadIntData(fe.Attribs, ofe.Attribs);
  case ofe.FileType of
    ftUserFile:  fe.FileType := MyTypes.ftUserFile;
    ftUninstExe: fe.FileType := MyTypes.ftUninstExe;
    {$IF DEFVER<5000}
    ftRegSvrExe: fe.FileType := MyTypes.ftRegSvrExe;
    {$IFEND}
  end;
  TranslateSet(ofe.Options, fe.Options, PByteArray(@SetupFileOptionTable)^, MySetupFileOptionLast);
end;

procedure TAnInnoVer.UnifyFileLocationEntry(var p; var fl:TMySetupFileLocationEntry);
var
  ofl: TSetupFileLocationEntry absolute p;
begin
  LoadIntData(fl.FirstSlice, {$IF DEFVER>=4000} ofl.FirstSlice {$ELSE} ofl.FirstDisk {$IFEND} );
  LoadIntData(fl.LastSlice, {$IF DEFVER>=4000} ofl.LastSlice {$ELSE} ofl.LastDisk {$IFEND} );
  LoadIntData(fl.StartOffset, ofl.StartOffset);
  LoadIntData(fl.ChunkSuboffset {$IF DEFVER>4000} , ofl.ChunkSuboffset {$IFEND} );
  LoadIntData(fl.ChunkCompressedSize, {$IF DEFVER<=4000} ofl.CompressedSize {$ELSE} ofl.ChunkCompressedSize {$IFEND} );
  LoadIntData(fl.OriginalSize, ofl.OriginalSize);
  {$IF DEFVER>=6400}
    fl.SHA256Sum := ofl.SHA256Sum;
    fl.HashType := htSHA256;
  {$ELSEIF DEFVER>=5309}
    fl.SHA1Sum := ofl.SHA1Sum;
    fl.HashType := htSHA1;
  {$ELSEIF DEFVER>=4200}
    fl.MD5Sum := ofl.MD5Sum;
    fl.HashType := htMD5;
  {$ELSEIF DEFVER>=4001}
    fl.CRC := ofl.CRC;
    fl.HashType := htCRC32;
  {$ELSE}
    fl.CRC := ofl.Adler;
    fl.HashType := htAdler;
  {$IFEND}
  fl.TimeStamp := {$IF DEFVER<4010} ofl.Date {$ELSEIF DEFVER<5507} ofl.TimeStamp {$ELSEIF DEFVER<6601} ofl.SourceTimeStamp {$ELSE} ofl.TimeStamp {$IFEND} ;
  fl.FileVersionMS := ofl.FileVersionMS;
  fl.FileVersionLS := ofl.FileVersionLS;
  fl.Contents := '';
  fl.PrimaryFileEntry := -1;
  {$IF DEFVER>=6403}
    fl.Sign := fsNoSetting;
  {$ELSEIF DEFVER>=6300}
    fl.Sign := TMySetupFileLocationSign(ofl.Sign);
  {$ELSEIF DEFVER>=5602}
    if foSign in ofl.Flags then fl.Sign := fsYes 
    else if foSign in ofl.Flags then fl.Sign := fsOnce
    else fl.Sign := fsNoSetting;
  {$ELSE}
    fl.Sign:=fsNoSetting;
  {$IFEND}
  TranslateSet(ofl.Flags, fl.Flags, PByteArray(@SetupFileLocationFlagTable)^, MySetupFileLocationFlagLast);
  {$IF DEFVER<4205}
    Include(fl.Flags, MyTypes.foChunkCompressed);
  {$IFEND}
end;

procedure TAnInnoVer.UnifyRegistryEntry(var p; var re:TMySetupRegistryEntry);
var
  ore: TSetupRegistryEntry absolute p;
begin
  re.RootKey := {$IFDEF WIN64} (HKEY_LOCAL_MACHINE and $ffffffff00000000) or {$ENDIF} ore.RootKey;
  LoadTextData(re.Subkey, ore.Subkey);
  LoadTextData(re.ValueName, ore.ValueName);
  LoadTextData(re.ValueData, ore.ValueData);
  LoadTextData(re.Components {$IF DEFVER>=2001} , ore.Components {$IFEND} );
  LoadTextData(re.Tasks {$IF DEFVER>=2001} , ore.Tasks {$IFEND} );
  LoadTextData(re.Check {$IF DEFVER>=4000} , ore.Check {$IFEND} );
  LoadTextData(re.Languages {$IF DEFVER>=4001} , ore.Languages {$IFEND} );
  LoadTextData(re.AfterInstall {$IF DEFVER>=4100} , ore.AfterInstall {$IFEND} );
  LoadTextData(re.BeforeInstall {$IF DEFVER>=4100} , ore.BeforeInstall {$IFEND} );
  re.MinVersion := TMySetupVersionData(ore.MinVersion);
  re.OnlyBelowVersion := TMySetupVersionData(ore.OnlyBelowVersion);
  case ore.Typ of
    rtNone         : re.Typ := MyTypes.rtNone;
    rtString       : re.Typ := MyTypes.rtString;
    rtExpandString : re.Typ := MyTypes.rtExpandString;
    rtDWord        : re.Typ := MyTypes.rtDWord;
    rtBinary       : re.Typ := MyTypes.rtBinary;
    rtMultiString  : re.Typ := MyTypes.rtMultiString;
    {$IF DEFVER>=5205}
    rtQWord        : re.Typ := MyTypes.rtQWord;
    {$IFEND}
  end;
  TranslateSet(ore.Options, re.Options, PByteArray(@SetupRegistryOptionTable)^, MySetupRegistryOptionLast);
end;

procedure TAnInnoVer.UnifyRunEntry(var p; var re:TMySetupRunEntry);
var
  ore: TSetupRunEntry absolute p;
begin
  LoadTextData(re.Name, ore.Name);
  LoadTextData(re.Parameters, ore.Parameters);
  LoadTextData(re.WorkingDir, ore.WorkingDir);
  LoadTextData(re.RunOnceId, ore.RunOnceId);
  LoadTextData(re.Verb {$IF DEFVER>=5113} , ore.Verb {$IFEND} );
  LoadTextData(re.StatusMsg {$IF DEFVER>=2001} , ore.StatusMsg {$IFEND} );
  LoadTextData(re.Description {$IF DEFVER>=2001} , ore.Description {$IFEND} );
  LoadTextData(re.Components {$IF DEFVER>=2001} , ore.Components {$IFEND} );
  LoadTextData(re.Tasks {$IF DEFVER>=2001} , ore.Tasks {$IFEND} );
  LoadTextData(re.Check {$IF DEFVER>=4000} , ore.Check {$IFEND} );
  LoadTextData(re.Languages {$IF DEFVER>=4001} , ore.Languages {$IFEND} );
  LoadTextData(re.AfterInstall {$IF DEFVER>=4100} , ore.AfterInstall {$IFEND} );
  LoadTextData(re.BeforeInstall {$IF DEFVER>=4100} , ore.BeforeInstall {$IFEND} );
  re.MinVersion := TMySetupVersionData(ore.MinVersion);
  re.OnlyBelowVersion := TMySetupVersionData(ore.OnlyBelowVersion);
  case ore.Wait of
    rwWaitUntilTerminated : re.Wait := MyTypes.rwWaitUntilTerminated;
    rwNoWait              : re.Wait := MyTypes.rwNoWait;
    rwWaitUntilIdle       : re.Wait := MyTypes.rwWaitUntilIdle;
  end;
  TranslateSet(ore.Options, re.Options, PByteArray(@SetupRunOptionTable)^, MySetupRunOptionLast);
end;

procedure TAnInnoVer.UnifyIconEntry(var p; var ie:TMySetupIconEntry);
var
  oie: TSetupIconEntry absolute p;
begin
  LoadTextData(ie.IconName, oie.IconName);
  LoadTextData(ie.Filename, oie.Filename);
  LoadTextData(ie.Parameters, oie.Parameters);
  LoadTextData(ie.WorkingDir, oie.WorkingDir);
  LoadTextData(ie.IconFilename, oie.IconFilename);
  LoadTextData(ie.Comment, oie.Comment);
  LoadIntData(ie.IconIndex, oie.IconIndex);
  LoadIntData(ie.ShowCmd {$IF DEFVER>=1325} , oie.ShowCmd {$IFEND} );
  ie.CloseOnExit := TMySetupIconCloseOnExit(ord(oie.CloseOnExit));
  LoadIntData(ie.HotKey {$IF DEFVER>=2001} , oie.HotKey {$IFEND} );
  LoadTextData(ie.Components {$IF DEFVER>=2001} , oie.Components {$IFEND} );
  LoadTextData(ie.Tasks {$IF DEFVER>=2001} , oie.Tasks {$IFEND} );
  LoadTextData(ie.Check {$IF DEFVER>=4000} , oie.Check {$IFEND} );
  LoadTextData(ie.Languages {$IF DEFVER>=4001} , oie.Languages {$IFEND} );
  LoadTextData(ie.AfterInstall {$IF DEFVER>=4100} , oie.AfterInstall {$IFEND} );
  LoadTextData(ie.BeforeInstall {$IF DEFVER>=4100} , oie.BeforeInstall {$IFEND} );
  ie.MinVersion := TMySetupVersionData(oie.MinVersion);
  ie.OnlyBelowVersion := TMySetupVersionData(oie.OnlyBelowVersion);
end;

procedure TAnInnoVer.UnifyTaskEntry(var p; var te:TMySetupTaskEntry);
{$IF DEFVER>=2001}
var
  ote: TSetupTaskEntry absolute p;
{$IFEND}
begin
  {$IF DEFVER>=2001}
    LoadTextData(te.Name, ote.Name);
    LoadTextData(te.Description, ote.Description);
    LoadTextData(te.GroupDescription, ote.GroupDescription);
    LoadTextData(te.Components, ote.Components);
    LoadTextData(te.Check {$IF DEFVER>=4000} , ote.Check {$IFEND} );
    LoadTextData(te.Languages {$IF DEFVER>=4001} , ote.Languages {$IFEND} );
    te.MinVersion := TMySetupVersionData(ote.MinVersion);
    te.OnlyBelowVersion := TMySetupVersionData(ote.OnlyBelowVersion);
    Move(ote.Options, te.Options, sizeof(ote.Options));
 {$IFEND}
end;

procedure TAnInnoVer.UnifyComponentEntry(var p; var ce:TMySetupComponentEntry);
{$IF DEFVER>=2001}
var
  oce: TSetupComponentEntry absolute p;
{$IFEND}
begin
  {$IF DEFVER>=2001}
    LoadTextData(ce.Name, oce.Name);
    LoadTextData(ce.Description, oce.Description);
    LoadTextData(ce.Types, oce.Types);
    LoadIntData(ce.ExtraDiskSpaceRequired, oce.ExtraDiskSpaceRequired);
    LoadTextData(ce.Check {$IF DEFVER>=6500} , oce.CheckOnce {$ELSEIF DEFVER>=4000} , oce.Check {$IFEND} );
    LoadTextData(ce.Languages {$IF DEFVER>=4001} , oce.Languages {$IFEND} );
    ce.MinVersion := TMySetupVersionData(oce.MinVersion);
    ce.OnlyBelowVersion := TMySetupVersionData(oce.OnlyBelowVersion);
    Move(oce.Options, ce.Options, sizeof(oce.Options));
  {$IFEND}
end;

procedure TAnInnoVer.UnifyTypeEntry(var p; var te:TMySetupTypeEntry);
{$IF DEFVER>=2001}
var
  ote: TSetupTypeEntry absolute p;
{$IFEND}
begin
  {$IF DEFVER>=2001}
    LoadTextData(te.Name, ote.Name);
    LoadTextData(te.Description, ote.Description);
    LoadTextData(te.Check {$IF DEFVER>=6500} , ote.CheckOnce {$ELSEIF DEFVER>=4000} , ote.Check {$IFEND} );
    LoadTextData(te.Languages {$IF DEFVER>=4001} , ote.Languages {$IFEND} );
    te.MinVersion := TMySetupVersionData(ote.MinVersion);
    te.OnlyBelowVersion := TMySetupVersionData(ote.OnlyBelowVersion);
    Move(ote.Options, te.Options, sizeof(ote.Options));
    te.Typ := {$IF DEFVER>=4003} TMySetupTypeType(ote.Typ) {$ELSE} Low(TMySetupTypeType) {$IFEND} ;
 {$IFEND}
end;

procedure TAnInnoVer.UnifyCustomMessageEntry(var p; var ce:TMySetupCustomMessageEntry);
{$IF DEFVER>=4201}
var
  oce: TSetupCustomMessageEntry absolute p;
{$IFEND}
begin
  {$IF DEFVER>=4201}
  LoadTextData(ce.Name, oce.Name);
  LoadTextData(ce.Value, oce.Value);
  LoadIntData(ce.LangIndex, oce.LangIndex);
  {$IFEND}
end;

procedure TAnInnoVer.UnifyLanguageEntry(var p; var le:TMySetupLanguageEntry);
{$IF DEFVER>=4000}
var
  ole: TSetupLanguageEntry absolute p;
{$IFEND}
begin
  {$IF DEFVER>=4000}
  le.LanguageCodePage := {$IF (DEFVER>=4202) AND not Defined(INNO_UNICODE)} ole.LanguageCodePage {$ELSE} 0 {$IFEND} ;
  LoadTextData(le.Name, ole.Name);
  LoadTextData(le.LanguageName, ole.LanguageName {$IF (DEFVER>=4202) AND not Defined(INNO_UNICODE)} , 1200 {$IFEND} );
  LoadTextData(le.DialogFontName, ole.DialogFontName);
  LoadTextData(le.TitleFontName {$IF DEFVER<6600} , ole.TitleFontName {$IFEND} );
  LoadTextData(le.WelcomeFontName, ole.WelcomeFontName);
  LoadTextData(le.CopyrightFontName {$IF DEFVER<6600} , ole.CopyrightFontName {$IFEND} );
  LoadBinaryData(le.Data, ole.Data);
  LoadBinaryData(le.LicenseText {$IF DEFVER>=4001} , ole.LicenseText {$IFEND} );
  LoadBinaryData(le.InfoBeforeText {$IF DEFVER>=4001} , ole.InfoBeforeText {$IFEND} );
  LoadBinaryData(le.InfoAfterText {$IF DEFVER>=4001} , ole.InfoAfterText {$IFEND} );
  le.LanguageID := ole.LanguageID;
  LoadIntData(le.DialogFontSize, ole.DialogFontSize);
  LoadIntData(le.TitleFontSize {$IF DEFVER<6600} , ole.TitleFontSize {$IFEND} );
  LoadIntData(le.WelcomeFontSize, ole.WelcomeFontSize);
  LoadIntData(le.CopyrightFontSize {$IF DEFVER<6600} , ole.CopyrightFontSize {$IFEND} );
  LoadIntData(le.DialogFontBaseScaleHeight {$IF DEFVER>=6600} , ole.DialogFontBaseScaleHeight {$IFEND} );
  LoadIntData(le.DialogFontBaseScaleWidth {$IF DEFVER>=6600} , ole.DialogFontBaseScaleWidth {$IFEND} );
  le.RightToLeft := {$IF DEFVER>=5203} ole.RightToLeft {$ELSE} false {$IFEND} ;
  {$IFEND}
end;

procedure TAnInnoVer.UnifyDirEntry(var p; var de: TMySetupDirEntry);
var
  ode: TSetupDirEntry absolute p;
begin
  LoadTextData(de.DirName, ode.DirName);
  LoadTextData(de.Components {$IF DEFVER>=2001} , ode.Components {$IFEND} );
  LoadTextData(de.Tasks {$IF DEFVER>=2001} , ode.Tasks {$IFEND} );
  LoadTextData(de.Languages {$IF DEFVER>=4001} , ode.Languages {$IFEND} );
  LoadTextData(de.Check {$IF DEFVER>=3008} , ode.Check {$IFEND} );
  LoadTextData(de.AfterInstall {$IF DEFVER>=4100} , ode.AfterInstall {$IFEND} );
  LoadTextData(de.BeforeInstall {$IF DEFVER>=4100} , ode.BeforeInstall {$IFEND} );
  LoadIntData(de.Attribs {$IF DEFVER>=2011} , ode.Attribs {$IFEND} );
  de.MinVersion := TMySetupVersionData(ode.MinVersion);
  de.OnlyBelowVersion := TMySetupVersionData(ode.OnlyBelowVersion);
  TranslateSet(ode.Options, de.Options, PByteArray(@SetupDirOptionTable)^, MySetupDirOptionLast);
end;

procedure TAnInnoVer.UnifyIniEntry(var p; var ie: TMySetupIniEntry);
var
  oie: TSetupIniEntry absolute p;
begin
  LoadTextData(ie.Filename, oie.Filename);
  LoadTextData(ie.Section, oie.Section);
  LoadTextData(ie.Entry, oie.Entry);
  LoadTextData(ie.Value, oie.Value);
  LoadTextData(ie.Components {$IF DEFVER>=2001} , oie.Components {$IFEND} );
  LoadTextData(ie.Tasks {$IF DEFVER>=2001} , oie.Tasks {$IFEND} );
  LoadTextData(ie.Languages {$IF DEFVER>=4001} , oie.Languages {$IFEND} );
  LoadTextData(ie.Check {$IF DEFVER>=3008} , oie.Check {$IFEND} );
  LoadTextData(ie.AfterInstall {$IF DEFVER>=4100} , oie.AfterInstall {$IFEND} );
  LoadTextData(ie.BeforeInstall {$IF DEFVER>=4100} , oie.BeforeInstall {$IFEND} );
  ie.MinVersion := TMySetupVersionData(oie.MinVersion);
  ie.OnlyBelowVersion := TMySetupVersionData(oie.OnlyBelowVersion);
  TranslateSet(oie.Options, ie.Options, PByteArray(@SetupIniOptionTable)^, MySetupIniOptionLast);
end;

procedure TAnInnoVer.UnifyDeleteEntry(var p; var de: TMySetupDeleteEntry);
var
  ode: TSetupDeleteEntry absolute p;
begin
  LoadTextData(de.Name, ode.Name);
  LoadTextData(de.Components {$IF DEFVER>=2001} , ode.Components {$IFEND} );
  LoadTextData(de.Tasks {$IF DEFVER>=2001} , ode.Tasks {$IFEND} );
  LoadTextData(de.Languages {$IF DEFVER>=4001} , ode.Languages {$IFEND} );
  LoadTextData(de.Check {$IF DEFVER>=3008} , ode.Check {$IFEND} );
  LoadTextData(de.AfterInstall {$IF DEFVER>=4100} , ode.AfterInstall {$IFEND} );
  LoadTextData(de.BeforeInstall {$IF DEFVER>=4100} , ode.BeforeInstall {$IFEND} );
  de.MinVersion := TMySetupVersionData(ode.MinVersion);
  de.OnlyBelowVersion := TMySetupVersionData(ode.OnlyBelowVersion);
  case ode.DeleteType of
    dfFiles:              de.DeleteType := MyTypes.dfFiles;
    dfFilesAndOrSubdirs:  de.DeleteType := MyTypes.dfFilesAndOrSubdirs;
    dfDirIfEmpty:         de.DeleteType := MyTypes.dfDirIfEmpty;
  end;
end;

begin
  TInnoVer.RegisterVersion(TAnInnoVer);
end.