Browse Source

Add support for Inno Setup 1.3.x with x < 24

The previously supported "1.3.21" was really a misidentified 1.3.24.

This is mostly based on the Inno Setup changelog for version 1.3:
 http://www.jrsoftware.org/files/is1.3-whatsnew.htm

Only installers for the following versions were available to be tested:
 - 1.3.3
 - 1.3.9
 - 1.3.10
 - 1.3.21
pull/108/head
Daniel Scharrer 7 years ago
parent
commit
6fe02e1d3d
  1. 1
      CHANGELOG
  2. 2
      src/setup/delete.cpp
  3. 2
      src/setup/directory.cpp
  4. 2
      src/setup/file.cpp
  5. 66
      src/setup/header.cpp
  6. 12
      src/setup/icon.cpp
  7. 2
      src/setup/ini.cpp
  8. 8
      src/setup/registry.cpp
  9. 12
      src/setup/run.cpp
  10. 11
      src/setup/version.cpp
  11. 4
      src/setup/windows.cpp

1
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

2
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<boost::uint32_t>(is); // uncompressed size of the entry
}

2
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<boost::uint32_t>(is); // uncompressed size of the entry
}

2
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<boost::uint32_t>(is); // uncompressed size of the entry
}

66
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<boost::uint32_t>(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<boost::int32_t>(is, version.bits());
info_before_size = util::load<boost::int32_t>(is, version.bits());
info_after_size = util::load<boost::int32_t>(is, version.bits());
@ -320,7 +328,7 @@ void header::load(std::istream & is, const version & version) {
winver.load(is, version);
back_color = util::load<boost::uint32_t>(is);
if(version >= INNO_VERSION(1, 3, 21)) {
if(version >= INNO_VERSION(1, 3, 3)) {
back_color2 = util::load<boost::uint32_t>(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<stored_log_mode>(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<stored_bool_auto_no_yes>(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));

12
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<boost::uint32_t>(is); // uncompressed size of the entry
}
@ -61,11 +61,15 @@ void icon_entry::load(std::istream & is, const version & version) {
icon_index = util::load<boost::int32_t>(is, version.bits());
if(version >= INNO_VERSION(1, 3, 21)) {
if(version >= INNO_VERSION(1, 3, 24)) {
show_command = util::load<boost::int32_t>(is);
} else {
show_command = 1;
}
if(version >= INNO_VERSION(1, 3, 15)) {
close_on_exit = stored_enum<stored_close_setting>(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<flags> 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);

2
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<boost::uint32_t>(is); // uncompressed size of the entry
}

8
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<boost::uint32_t>(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)) {

12
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<boost::uint32_t>(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<boost::int32_t>(is);
} else {
show_command = 0;
@ -80,8 +80,10 @@ void run_entry::load(std::istream & is, const version & version) {
stored_flag_reader<flags> 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)) {

11
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;

4
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<boost::uint16_t>(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<boost::uint8_t>(is);
nt_service_pack.major = util::load<boost::uint8_t>(is);
} else {

Loading…
Cancel
Save