From 4fd2b980a6ae5b9e7976d10334f1e5d6d5ed6099 Mon Sep 17 00:00:00 2001 From: crackedmind Date: Mon, 17 Jun 2024 22:11:27 +0500 Subject: [PATCH] Add support for Inno Setup 6.3.0+ --- src/setup/data.cpp | 20 +++++++++++++++++++- src/setup/data.hpp | 11 +++++++++++ src/setup/header.cpp | 11 +++++++++-- src/setup/header.hpp | 9 +++++++-- src/setup/icon.cpp | 2 +- src/setup/icon.hpp | 4 ++-- src/setup/run.cpp | 4 ++++ src/setup/run.hpp | 3 ++- src/setup/version.cpp | 1 + 9 files changed, 56 insertions(+), 9 deletions(-) diff --git a/src/setup/data.cpp b/src/setup/data.cpp index 23eeb17..bcec596 100644 --- a/src/setup/data.cpp +++ b/src/setup/data.cpp @@ -149,13 +149,24 @@ void data_entry::load(std::istream & is, const info & i) { if(i.version >= INNO_VERSION(5, 1, 13)) { flagreader.add(SolidBreak); } - if(i.version >= INNO_VERSION(5, 5, 7)) { + if(i.version >= INNO_VERSION(5, 5, 7) && i.version < INNO_VERSION(6, 3, 0)) { // Actually added in Inno Setup 5.5.9 but the data version was not bumped flagreader.add(Sign); flagreader.add(SignOnce); } options |= flagreader; + + if (i.version >= INNO_VERSION(6, 3, 0)) { + stored_flag_reader flagreader2(is, i.version.bits()); + + flagreader2.add(NoSetting); + flagreader2.add(Yes); + flagreader2.add(Once); + flagreader2.add(Check); + + sign_options |= flagreader2; + } if(options & ChunkCompressed) { chunk.compression = i.header.compression; @@ -206,3 +217,10 @@ NAMES(setup::data_entry::flags, "File Location Option", "sign once", "bzipped", ) + +NAMES(setup::data_entry::sign, "File Sign Option", + "no setting", + "yes", + "once", + "check" + ) diff --git a/src/setup/data.hpp b/src/setup/data.hpp index fcc2374..e30c966 100644 --- a/src/setup/data.hpp +++ b/src/setup/data.hpp @@ -60,6 +60,14 @@ struct data_entry { // obsolete: BZipped ); + + FLAGS(sign, + + NoSetting, + Yes, + Once, + Check + ); stream::chunk chunk; @@ -73,6 +81,8 @@ struct data_entry { boost::uint64_t file_version; flags options; + + sign sign_options; /*! * Load one data entry. @@ -86,5 +96,6 @@ struct data_entry { } // namespace setup NAMED_FLAGS(setup::data_entry::flags) +NAMED_FLAGS(setup::data_entry::sign) #endif // INNOEXTRACT_SETUP_DATA_HPP diff --git a/src/setup/header.cpp b/src/setup/header.cpp index ad9139e..63c67b9 100644 --- a/src/setup/header.cpp +++ b/src/setup/header.cpp @@ -261,6 +261,10 @@ void header::load(std::istream & is, const version & version) { changes_environment.clear(); changes_associations.clear(); } + if(version >= INNO_VERSION(6, 3, 0)) { + is >> util::binary_string(architectures_allowed_1); + is >> util::binary_string(architectures_installed_in_64bit_mode_1); + } if(version >= INNO_VERSION(5, 2, 5)) { is >> util::ansi_string(license_text); is >> util::ansi_string(info_before); @@ -462,10 +466,10 @@ void header::load(std::istream & is, const version & version) { compression = stored_enum(is).get(); } - if(version >= INNO_VERSION(5, 6, 0)) { + if(version >= INNO_VERSION(5, 6, 0) && version < INNO_VERSION(6, 3, 0)) { architectures_allowed = stored_flags(is).get(); architectures_installed_in_64bit_mode = stored_flags(is).get(); - } else if(version >= INNO_VERSION(5, 1, 0)) { + } else if(version >= INNO_VERSION(5, 1, 0) && version < INNO_VERSION(6, 3, 0)) { architectures_allowed = stored_flags(is).get(); architectures_installed_in_64bit_mode = stored_flags(is).get(); } else { @@ -662,6 +666,9 @@ void header::load(std::istream & is, const version & version) { flagreader.add(UsePreviousPrivileges); flagreader.add(WizardResizable); } + if(version >= INNO_VERSION(6, 3, 0)) { + flagreader.add(UninstallLogging); + } options |= flagreader; diff --git a/src/setup/header.hpp b/src/setup/header.hpp index 9a55a10..2786ff5 100644 --- a/src/setup/header.hpp +++ b/src/setup/header.hpp @@ -91,7 +91,6 @@ struct header { AppendDefaultGroupName, EncryptionUsed, ChangesEnvironment, - ShowUndisplayableLanguages, SetupLogging, SignedUninstaller, UsePreviousLanguage, @@ -103,6 +102,7 @@ struct header { AppNameHasConsts, UsePreviousPrivileges, WizardResizable, + UninstallLogging, // Obsolete flags Uninstallable, @@ -117,7 +117,8 @@ struct header { DetectLanguageUsingLocale, DisableDirExistsWarning, BackSolid, - OverwriteUninstRegEntries + OverwriteUninstRegEntries, + ShowUndisplayableLanguages ); @@ -165,6 +166,10 @@ struct header { std::string setup_mutex; std::string changes_environment; std::string changes_associations; + std::string architectures_allowed_1; + std::string architectures_installed_in_64bit_mode_1; + + std::string license_text; std::string info_before; std::string info_after; diff --git a/src/setup/icon.cpp b/src/setup/icon.cpp index 46be687..5382aa9 100644 --- a/src/setup/icon.cpp +++ b/src/setup/icon.cpp @@ -97,7 +97,7 @@ void icon_entry::load(std::istream & is, const info & i) { if(i.version.bits() != 16) { flagreader.add(UseAppPaths); } - if(i.version >= INNO_VERSION(5, 0, 3)) { + if(i.version >= INNO_VERSION(5, 0, 3) && i.version <= INNO_VERSION(6, 3, 0)) { flagreader.add(FolderShortcut); } if(i.version >= INNO_VERSION(5, 4, 2)) { diff --git a/src/setup/icon.hpp b/src/setup/icon.hpp index 97534d2..fe758b9 100644 --- a/src/setup/icon.hpp +++ b/src/setup/icon.hpp @@ -45,12 +45,12 @@ struct icon_entry : public item { NeverUninstall, CreateOnlyIfFileExists, UseAppPaths, - FolderShortcut, ExcludeFromShowInNewInstall, PreventPinning, HasAppUserModelToastActivatorCLSID, // obsolete options: - RunMinimized + RunMinimized, + FolderShortcut ); enum close_setting { diff --git a/src/setup/run.cpp b/src/setup/run.cpp index 0a83790..98bf564 100644 --- a/src/setup/run.cpp +++ b/src/setup/run.cpp @@ -106,6 +106,9 @@ void run_entry::load(std::istream & is, const info & i) { if(i.version >= INNO_VERSION(6, 1, 0)) { flagreader.add(DontLogParameters); } + if(i.version >= INNO_VERSION(6, 3, 0)) { + flagreader.add(LogOutput); + } options = flagreader; } @@ -123,6 +126,7 @@ NAMES(setup::run_entry::flags, "Run Option", "32 bit", "64 bit", "run as original user", + "log output" ) NAMES(setup::run_entry::wait_condition, "Run Wait Type", diff --git a/src/setup/run.hpp b/src/setup/run.hpp index be832aa..cead27b 100644 --- a/src/setup/run.hpp +++ b/src/setup/run.hpp @@ -50,7 +50,8 @@ struct run_entry : public item { Bits32, Bits64, RunAsOriginalUser, - DontLogParameters + DontLogParameters, + LogOutput ); enum wait_condition { diff --git a/src/setup/version.cpp b/src/setup/version.cpp index 87d90e9..571ac8e 100644 --- a/src/setup/version.cpp +++ b/src/setup/version.cpp @@ -183,6 +183,7 @@ const known_version versions[] = { { "Inno Setup Setup Data (5.6.2) (u)", /* prerelease */ INNO_VERSION_EXT(5, 6, 2, 0), version::Unicode }, { "Inno Setup Setup Data (6.0.0) (u)", INNO_VERSION_EXT(6, 0, 0, 0), version::Unicode }, { "Inno Setup Setup Data (6.1.0) (u)", INNO_VERSION_EXT(6, 1, 0, 0), version::Unicode }, + { "Inno Setup Setup Data (6.3.0)", INNO_VERSION_EXT(6, 3, 0, 0), version::Unicode }, }; } // anonymous namespace