diff --git a/CHANGELOG b/CHANGELOG index 7fea13e..edf35bf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ innoextract 1.8 (WIP) - Added support for pre-release Inno Setup 5.6.2 installers used by GOG - Added support for a modified Inno Setup 5.5.7 variant - Added support for a modified Inno Setup 5.5.7 variant with an uppercase (U) in the data version + - Added support for Inno Setup 1.3.x installers with x < 24 - Added support for installers using an alternative setup loader magic - Added support for using boost_{zlib,bzip2} when statically linking Boost - Fixed extracting files from slices larger than 2 GiB with 32-bit builds diff --git a/src/setup/delete.cpp b/src/setup/delete.cpp index 112de0f..8898c76 100644 --- a/src/setup/delete.cpp +++ b/src/setup/delete.cpp @@ -38,7 +38,7 @@ STORED_ENUM_MAP(delete_target_type_map, delete_entry::Files, void delete_entry::load(std::istream & is, const version & version) { - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the entry } diff --git a/src/setup/directory.cpp b/src/setup/directory.cpp index eaf3b77..10f86ce 100644 --- a/src/setup/directory.cpp +++ b/src/setup/directory.cpp @@ -47,7 +47,7 @@ STORED_FLAGS_MAP(stored_inno_directory_options_1, void directory_entry::load(std::istream & is, const version & version) { - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the entry } diff --git a/src/setup/file.cpp b/src/setup/file.cpp index e740d54..604bc98 100644 --- a/src/setup/file.cpp +++ b/src/setup/file.cpp @@ -76,7 +76,7 @@ void file_entry::load(std::istream & is, const version & version) { options = 0; - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the entry } diff --git a/src/setup/header.cpp b/src/setup/header.cpp index 9316801..d3606e4 100644 --- a/src/setup/header.cpp +++ b/src/setup/header.cpp @@ -148,17 +148,17 @@ void header::load(std::istream & is, const version & version) { options = 0; - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the setup header } is >> util::encoded_string(app_name, version.codepage()); is >> util::encoded_string(app_versioned_name, version.codepage()); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 0)) { is >> util::encoded_string(app_id, version.codepage()); } is >> util::encoded_string(app_copyright, version.codepage()); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 0)) { is >> util::encoded_string(app_publisher, version.codepage()); is >> util::encoded_string(app_publisher_url, version.codepage()); } else { @@ -169,7 +169,7 @@ void header::load(std::istream & is, const version & version) { } else { app_support_phone.clear(); } - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 0)) { is >> util::encoded_string(app_support_url, version.codepage()); is >> util::encoded_string(app_updates_url, version.codepage()); is >> util::encoded_string(app_version, version.codepage()); @@ -184,20 +184,28 @@ void header::load(std::istream & is, const version & version) { uninstall_icon_name.clear(); } is >> util::encoded_string(base_filename, version.codepage()); - if(version >= INNO_VERSION(1, 3, 21)) { - if(version < INNO_VERSION(5, 2, 5)) { - is >> util::ansi_string(license_text); - is >> util::ansi_string(info_before); - is >> util::ansi_string(info_after); - } + if(version >= INNO_VERSION(1, 3, 0) && version < INNO_VERSION(5, 2, 5)) { + is >> util::ansi_string(license_text); + is >> util::ansi_string(info_before); + is >> util::ansi_string(info_after); + } else { + license_text.clear(), info_before.clear(), info_after.clear(); + } + if(version >= INNO_VERSION(1, 3, 3)) { is >> util::encoded_string(uninstall_files_dir, version.codepage()); + } else { + uninstall_files_dir.clear(); + } + if(version >= INNO_VERSION(1, 3, 6)) { is >> util::encoded_string(uninstall_name, version.codepage()); is >> util::encoded_string(uninstall_icon, version.codepage()); + } else { + uninstall_name.clear(), uninstall_icon.clear(); + } + if(version >= INNO_VERSION(1, 3, 14)) { is >> util::encoded_string(app_mutex, version.codepage()); } else { - license_text.clear(), info_before.clear(), info_after.clear(); - uninstall_files_dir.clear(), uninstall_name.clear(); - uninstall_icon.clear(), app_mutex.clear(); + app_mutex.clear(); } if(version >= INNO_VERSION(3, 0, 0)) { is >> util::encoded_string(default_user_name, version.codepage()); @@ -311,7 +319,7 @@ void header::load(std::istream & is, const version & version) { boost::int32_t license_size = 0; boost::int32_t info_before_size = 0; boost::int32_t info_after_size = 0; - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { license_size = util::load(is, version.bits()); info_before_size = util::load(is, version.bits()); info_after_size = util::load(is, version.bits()); @@ -320,7 +328,7 @@ void header::load(std::istream & is, const version & version) { winver.load(is, version); back_color = util::load(is); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 3)) { back_color2 = util::load(is); } else { back_color2 = 0; @@ -384,10 +392,10 @@ void header::load(std::istream & is, const version & version) { install_mode = NormalInstallMode; } - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 0)) { uninstall_log_mode = stored_enum(is).get(); } else { - uninstall_log_mode = AppendLog; + uninstall_log_mode = NewLog; } if(version >= INNO_VERSION(5, 0, 0)) { @@ -398,7 +406,7 @@ void header::load(std::istream & is, const version & version) { uninstall_style = ClassicStyle; } - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 6)) { dir_exists_warning = stored_enum(is).get(); } else { dir_exists_warning = Auto; @@ -494,7 +502,7 @@ void header::load(std::istream & is, const version & version) { if(version < INNO_VERSION(5, 3, 3)) { flagreader.add(DisableDirPage); } - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 6)) { flagreader.add(DisableDirExistsWarning); } if(version < INNO_VERSION(5, 3, 3)) { @@ -504,7 +512,7 @@ void header::load(std::istream & is, const version & version) { if(version < INNO_VERSION(3, 0, 0) || version >= INNO_VERSION(3, 0, 3)) { flagreader.add(AlwaysRestart); } - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 3)) { flagreader.add(BackSolid); } flagreader.add(AlwaysUsePersonalGroup); @@ -526,20 +534,26 @@ void header::load(std::istream & is, const version & version) { if(version < INNO_VERSION(3, 0, 0)) { flagreader.add(AlwaysCreateUninstallIcon); } - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 6)) { flagreader.add(OverwriteUninstRegEntries); } if(version < INNO_VERSION(5, 6, 1)) { flagreader.add(ChangesAssociations); } } - if(version >= INNO_VERSION(1, 3, 21)) { - if(version < INNO_VERSION(5, 3, 8)) { - flagreader.add(CreateUninstallRegKey); - } + if(version >= INNO_VERSION(1, 3, 0) && version < INNO_VERSION(5, 3, 8)) { + flagreader.add(CreateUninstallRegKey); + } + if(version >= INNO_VERSION(1, 3, 1)) { flagreader.add(UsePreviousAppDir); + } + if(version >= INNO_VERSION(1, 3, 3)) { flagreader.add(BackColorHorizontal); + } + if(version >= INNO_VERSION(1, 3, 10)) { flagreader.add(UsePreviousGroup); + } + if(version >= INNO_VERSION(1, 3, 20)) { flagreader.add(UpdateUninstallLogAppName); } if(version >= INNO_VERSION(2, 0, 0)) { @@ -649,7 +663,7 @@ void header::load(std::istream & is, const version & version) { disable_program_group_page = (options & DisableProgramGroupPage) ? Yes : No; } - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { if(license_size > 0) { std::string temp; temp.resize(size_t(license_size)); diff --git a/src/setup/icon.cpp b/src/setup/icon.cpp index 94515d8..3c202c9 100644 --- a/src/setup/icon.cpp +++ b/src/setup/icon.cpp @@ -38,7 +38,7 @@ STORED_ENUM_MAP(stored_close_setting, icon_entry::NoSetting, void icon_entry::load(std::istream & is, const version & version) { - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the entry } @@ -61,11 +61,15 @@ void icon_entry::load(std::istream & is, const version & version) { icon_index = util::load(is, version.bits()); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 24)) { show_command = util::load(is); + } else { + show_command = 1; + } + if(version >= INNO_VERSION(1, 3, 15)) { close_on_exit = stored_enum(is).get(); } else { - show_command = 1, close_on_exit = NoSetting; + close_on_exit = NoSetting; } if(version >= INNO_VERSION(2, 0, 7)) { @@ -77,7 +81,7 @@ void icon_entry::load(std::istream & is, const version & version) { stored_flag_reader flagreader(is, version.bits()); flagreader.add(NeverUninstall); - if(version >= INNO_VERSION(1, 3, 21) && version < INNO_VERSION(1, 3, 26)) { + if(version < INNO_VERSION(1, 3, 26)) { flagreader.add(RunMinimized); } flagreader.add(CreateOnlyIfFileExists); diff --git a/src/setup/ini.cpp b/src/setup/ini.cpp index c18f26c..e1bc19e 100644 --- a/src/setup/ini.cpp +++ b/src/setup/ini.cpp @@ -42,7 +42,7 @@ STORED_FLAGS_MAP(stored_ini_flags, void ini_entry::load(std::istream & is, const version & version) { - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the entry } diff --git a/src/setup/registry.cpp b/src/setup/registry.cpp index 166507a..c89e644 100644 --- a/src/setup/registry.cpp +++ b/src/setup/registry.cpp @@ -60,7 +60,7 @@ STORED_ENUM_MAP(stored_registry_entry_type_2, registry_entry::None, void registry_entry::load(std::istream & is, const version & version) { - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the entry } @@ -112,10 +112,14 @@ void registry_entry::load(std::istream & is, const version & version) { flagreader.add(UninsDeleteEntireKey); flagreader.add(UninsDeleteEntireKeyIfEmpty); flagreader.add(PreserveStringType); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 9)) { flagreader.add(DeleteKey); flagreader.add(DeleteValue); + } + if(version >= INNO_VERSION(1, 3, 12)) { flagreader.add(NoError); + } + if(version >= INNO_VERSION(1, 3, 16)) { flagreader.add(DontCreateKey); } if(version >= INNO_VERSION(5, 1, 0)) { diff --git a/src/setup/run.cpp b/src/setup/run.cpp index e68d883..7a515af 100644 --- a/src/setup/run.cpp +++ b/src/setup/run.cpp @@ -40,14 +40,14 @@ STORED_ENUM_MAP(stored_run_wait_condition, run_entry::WaitUntilTerminated, void run_entry::load(std::istream & is, const version & version) { - if(version < INNO_VERSION(1, 3, 21)) { + if(version < INNO_VERSION(1, 3, 0)) { (void)util::load(is); // uncompressed size of the entry } is >> util::encoded_string(name, version.codepage()); is >> util::encoded_string(parameters, version.codepage()); is >> util::encoded_string(working_dir, version.codepage()); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 9)) { is >> util::encoded_string(run_once_id, version.codepage()); } else { run_once_id.clear(); @@ -70,7 +70,7 @@ void run_entry::load(std::istream & is, const version & version) { load_version_data(is, version); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 24)) { show_command = util::load(is); } else { show_command = 0; @@ -80,8 +80,10 @@ void run_entry::load(std::istream & is, const version & version) { stored_flag_reader flagreader(is, version.bits()); - flagreader.add(ShellExec); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 2, 3)) { + flagreader.add(ShellExec); + } + if(version >= INNO_VERSION(1, 3, 9)) { flagreader.add(SkipIfDoesntExist); } if(version >= INNO_VERSION(2, 0, 0)) { diff --git a/src/setup/version.cpp b/src/setup/version.cpp index de599e8..8ae9453 100644 --- a/src/setup/version.cpp +++ b/src/setup/version.cpp @@ -71,7 +71,11 @@ struct known_version { }; const known_version versions[] = { - { "Inno Setup Setup Data (1.3.21)", INNO_VERSION_EXT(1, 3, 21, 0), 0 }, + { "Inno Setup Setup Data (1.3.3)", INNO_VERSION_EXT(1, 3, 3, 0), 0 }, + { "Inno Setup Setup Data (1.3.9)", INNO_VERSION_EXT(1, 3, 9, 0), 0 }, + { "Inno Setup Setup Data (1.3.10)", INNO_VERSION_EXT(1, 3, 10, 0), 0 }, + { "Inno Setup Setup Data (1.3.21)", /* ambiguous */ INNO_VERSION_EXT(1, 3, 21, 0), 0 }, + { "Inno Setup Setup Data (1.3.24)", INNO_VERSION_EXT(1, 3, 24, 0), 0 }, { "Inno Setup Setup Data (1.3.25)", INNO_VERSION_EXT(1, 3, 25, 0), 0 }, { "Inno Setup Setup Data (2.0.0)", INNO_VERSION_EXT(2, 0, 0, 0), 0 }, { "Inno Setup Setup Data (2.0.1)", /* ambiguous */ INNO_VERSION_EXT(2, 0, 1, 0), 0 }, @@ -324,6 +328,11 @@ void version::load(std::istream & is) { bool version::is_ambiguous() const { + if(value == INNO_VERSION(1, 3, 21)) { + // might be either 1.3.21 or 1.3.24 + return true; + } + if(value == INNO_VERSION(2, 0, 1)) { // might be either 2.0.1 or 2.0.2 return true; diff --git a/src/setup/windows.cpp b/src/setup/windows.cpp index 7e3c3a6..f087352 100644 --- a/src/setup/windows.cpp +++ b/src/setup/windows.cpp @@ -34,7 +34,7 @@ const windows_version windows_version::none = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0 void windows_version::data::load(std::istream & is, const version & version) { - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 19)) { build = util::load(is); } else { build = 0; @@ -50,7 +50,7 @@ void windows_version::load(std::istream & is, const version & version) { win_version.load(is, version); nt_version.load(is, version); - if(version >= INNO_VERSION(1, 3, 21)) { + if(version >= INNO_VERSION(1, 3, 19)) { nt_service_pack.minor = util::load(is); nt_service_pack.major = util::load(is); } else {