48 changed files with 831 additions and 294 deletions
@ -1,17 +0,0 @@
|
||||
|
||||
#ifndef INNOEXTRACT_BLOCKREADER_HPP |
||||
#define INNOEXTRACT_BLOCKREADER_HPP |
||||
|
||||
#include <iostream> |
||||
|
||||
#include "Version.hpp" |
||||
|
||||
class BlockReader { |
||||
|
||||
public: |
||||
|
||||
static std::istream * get(std::istream & base, const InnoVersion & version); |
||||
|
||||
}; |
||||
|
||||
#endif // INNOEXTRACT_BLOCKREADER_HPP
|
||||
@ -1,15 +1,15 @@
|
||||
|
||||
#include "ExeReader.hpp" |
||||
#include <loader/ExeReader.hpp> |
||||
|
||||
#include <iostream> |
||||
#include <iomanip> |
||||
#include <algorithm> |
||||
#include <cstring> |
||||
|
||||
#include "Types.hpp" |
||||
#include "ExeFormat.hpp" |
||||
#include "Utils.hpp" |
||||
#include "Output.hpp" |
||||
#include "loader/ExeFormat.hpp" |
||||
#include "util/Output.hpp" |
||||
#include "util/Types.hpp" |
||||
#include "util/Utils.hpp" |
||||
|
||||
using std::cout; |
||||
using std::string; |
||||
@ -1,14 +1,14 @@
|
||||
|
||||
#include "SetupLoader.hpp" |
||||
#include <loader/SetupLoader.hpp> |
||||
|
||||
#include <iomanip> |
||||
|
||||
#include <lzma.h> |
||||
|
||||
#include "ExeReader.hpp" |
||||
#include "SetupLoaderFormat.hpp" |
||||
#include "Utils.hpp" |
||||
#include "Output.hpp" |
||||
#include "loader/ExeReader.hpp" |
||||
#include "loader/SetupLoaderFormat.hpp" |
||||
#include "util/Output.hpp" |
||||
#include "util/Utils.hpp" |
||||
|
||||
using std::cout; |
||||
using std::string; |
||||
@ -1,7 +1,7 @@
|
||||
|
||||
#include "CustomMessageEntry.hpp" |
||||
#include "setup/CustomMessageEntry.hpp" |
||||
|
||||
#include "LoadingUtils.hpp" |
||||
#include "util/LoadingUtils.hpp" |
||||
|
||||
void CustomMessageEntry::load(std::istream & is, const InnoVersion & version) { |
||||
|
||||
@ -0,0 +1,82 @@
|
||||
|
||||
#include "setup/DirectoryEntry.hpp" |
||||
|
||||
#include "util/LoadingUtils.hpp" |
||||
#include "util/StoredEnum.hpp" |
||||
|
||||
STORED_FLAGS_MAP(StoredInnoDirectoryOptions0, |
||||
doUninsNeverUninstall, |
||||
doDeleteAfterInstall, |
||||
doUninsAlwaysUninstall, |
||||
); |
||||
|
||||
// starting with version 5.2.0
|
||||
STORED_FLAGS_MAP(StoredInnoDirectoryOptions1, |
||||
doUninsNeverUninstall, |
||||
doDeleteAfterInstall, |
||||
doUninsAlwaysUninstall, |
||||
doSetNTFSCompression, |
||||
doUnsetNTFSCompression, |
||||
); |
||||
|
||||
void DirectoryEntry::load(std::istream & is, const InnoVersion & version) { |
||||
|
||||
is >> EncodedString(name, version.codepage()); |
||||
if(version > INNO_VERSION(1, 3, 26)) { |
||||
is >> EncodedString(components, version.codepage()); |
||||
is >> EncodedString(tasks, version.codepage()); |
||||
} else { |
||||
components.clear(), tasks.clear(); |
||||
} |
||||
if(version >= INNO_VERSION(4, 0, 1)) { |
||||
is >> EncodedString(languages, version.codepage()); |
||||
} else { |
||||
languages.clear(); |
||||
} |
||||
if(version >= INNO_VERSION(3, 0, 8)) { |
||||
is >> EncodedString(check, version.codepage()); |
||||
} else { |
||||
check.clear(); |
||||
} |
||||
if(version >= INNO_VERSION(4, 0, 11) && version < INNO_VERSION(4, 1, 0)) { |
||||
is >> EncodedString(permissions, version.codepage()); |
||||
} else { |
||||
permissions.clear(); |
||||
} |
||||
if(version >= INNO_VERSION(4, 1, 0)) { |
||||
is >> EncodedString(afterInstall, version.codepage()); |
||||
is >> EncodedString(beforeInstall, version.codepage()); |
||||
} else { |
||||
afterInstall.clear(), beforeInstall.clear(); |
||||
} |
||||
|
||||
if(version >= INNO_VERSION(2, 0, 11)) { |
||||
attributes = loadNumber<u32>(is); |
||||
} else { |
||||
attributes = 0; |
||||
} |
||||
|
||||
minVersion.load(is, version); |
||||
onlyBelowVersion.load(is, version); |
||||
|
||||
if(version >= INNO_VERSION(4, 1, 0)) { |
||||
permission = loadNumber<s16>(is); |
||||
} else { |
||||
permission = -1; |
||||
} |
||||
|
||||
if(version >= INNO_VERSION(5, 2, 0)) { |
||||
options = StoredFlags<StoredInnoDirectoryOptions1>(is).get(); |
||||
} else { |
||||
options = StoredFlags<StoredInnoDirectoryOptions0>(is).get(); |
||||
} |
||||
|
||||
} |
||||
|
||||
ENUM_NAMES(InnoDirectoryOptions::Enum, "Directory Option", |
||||
"never uninstall", |
||||
"delete after install", |
||||
"always uninstall", |
||||
"set NTFS compression", |
||||
"unset NTFS compression", |
||||
) |
||||
@ -0,0 +1,47 @@
|
||||
|
||||
#ifndef INNOEXTRACT_SETUP_DIRECTORYENTRY_HPP |
||||
#define INNOEXTRACT_SETUP_DIRECTORYENTRY_HPP |
||||
|
||||
#include <iostream> |
||||
|
||||
#include "setup/Version.hpp" |
||||
#include "setup/WindowsVersion.hpp" |
||||
#include "util/Enum.hpp" |
||||
#include "util/Flags.hpp" |
||||
#include "util/Types.hpp" |
||||
|
||||
FLAGS(InnoDirectoryOptions, |
||||
doUninsNeverUninstall, |
||||
doDeleteAfterInstall, |
||||
doUninsAlwaysUninstall, |
||||
doSetNTFSCompression, |
||||
doUnsetNTFSCompression, |
||||
) |
||||
|
||||
NAMED_ENUM(InnoDirectoryOptions::Enum) |
||||
|
||||
struct DirectoryEntry { |
||||
|
||||
std::string name; |
||||
std::string components; |
||||
std::string tasks; |
||||
std::string languages; |
||||
std::string check; |
||||
std::string permissions; |
||||
std::string afterInstall; |
||||
std::string beforeInstall; |
||||
|
||||
u32 attributes; |
||||
|
||||
WindowsVersion minVersion; |
||||
WindowsVersion onlyBelowVersion; |
||||
|
||||
int permission; //!< index into the permission entry list
|
||||
|
||||
InnoDirectoryOptions options; |
||||
|
||||
void load(std::istream & is, const InnoVersion & version); |
||||
|
||||
}; |
||||
|
||||
#endif // INNOEXTRACT_SETUP_DIRECTORYENTRY_HPP
|
||||
@ -0,0 +1,222 @@
|
||||
|
||||
#include "setup/FileEntry.hpp" |
||||
|
||||
#include "util/LoadingUtils.hpp" |
||||
#include "util/StoredEnum.hpp" |
||||
|
||||
namespace { |
||||
|
||||
enum FileCopyMode { |
||||
cmNormal, |
||||
cmIfDoesntExist, |
||||
cmAlwaysOverwrite, |
||||
cmAlwaysSkipIfSameOrOlder, |
||||
}; |
||||
|
||||
STORED_ENUM_MAP(StoredFileCopyMode, cmNormal, |
||||
cmNormal, |
||||
cmIfDoesntExist, |
||||
cmAlwaysOverwrite, |
||||
cmAlwaysSkipIfSameOrOlder, |
||||
); |
||||
|
||||
STORED_ENUM_MAP(StoredFileType0, FileEntry::UserFile, |
||||
FileEntry::UserFile, |
||||
FileEntry::UninstExe, |
||||
); |
||||
|
||||
// win32, before 5.0.0
|
||||
STORED_ENUM_MAP(StoredFileType1, FileEntry::UserFile, |
||||
FileEntry::UserFile, |
||||
FileEntry::UninstExe, |
||||
FileEntry::RegSvrExe, |
||||
); |
||||
|
||||
} |
||||
|
||||
NAMED_ENUM(FileCopyMode) |
||||
|
||||
ENUM_NAMES(FileCopyMode, "File Copy Mode", |
||||
"normal", |
||||
"if doesn't exist", |
||||
"always overwrite", |
||||
"always skip if same or older", |
||||
) |
||||
|
||||
void FileEntry::load(std::istream & is, const InnoVersion & version) { |
||||
|
||||
options = 0; |
||||
|
||||
is >> EncodedString(source, version.codepage()); |
||||
is >> EncodedString(destination, version.codepage()); |
||||
is >> EncodedString(installFontName, version.codepage()); |
||||
if(version >= INNO_VERSION(5, 2, 5)) { |
||||
is >> EncodedString(strongAssemblyName, version.codepage()); |
||||
} else { |
||||
strongAssemblyName.clear(); |
||||
} |
||||
if(version > INNO_VERSION(1, 3, 26)) { |
||||
is >> EncodedString(components, version.codepage()); |
||||
is >> EncodedString(tasks, version.codepage()); |
||||
} else { |
||||
components.clear(), tasks.clear(); |
||||
} |
||||
if(version >= INNO_VERSION(4, 0, 1)) { |
||||
is >> EncodedString(languages, version.codepage()); |
||||
} else { |
||||
languages.clear(); |
||||
} |
||||
if(version >= INNO_VERSION(3, 0, 8)) { |
||||
is >> EncodedString(check, version.codepage()); |
||||
} else { |
||||
check.clear(); |
||||
} |
||||
if(version >= INNO_VERSION(4, 1, 0)) { |
||||
is >> EncodedString(afterInstall, version.codepage()); |
||||
is >> EncodedString(beforeInstall, version.codepage()); |
||||
} else { |
||||
afterInstall.clear(), beforeInstall.clear(); |
||||
} |
||||
|
||||
minVersion.load(is, version); |
||||
onlyBelowVersion.load(is, version); |
||||
|
||||
location = loadNumber<s32>(is); |
||||
attributes = loadNumber<u32>(is); |
||||
externalSize = (version >= INNO_VERSION(4, 0, 0)) ? loadNumber<u64>(is) : loadNumber<u32>(is); |
||||
|
||||
if(version < INNO_VERSION(3, 0, 5)) { |
||||
FileCopyMode copyMode = StoredEnum<StoredFileCopyMode>(is).get(); |
||||
// TODO this might be wrong
|
||||
switch(copyMode) { |
||||
case cmNormal: options |= foPromptIfOlder; break; |
||||
case cmIfDoesntExist: options |= foOnlyIfDoesntExist | foPromptIfOlder; break; |
||||
case cmAlwaysOverwrite: options |= foIgnoreVersion | foPromptIfOlder; break; |
||||
case cmAlwaysSkipIfSameOrOlder: break; |
||||
} |
||||
} |
||||
|
||||
if(version >= INNO_VERSION(4, 1, 0)) { |
||||
permission = loadNumber<s16>(is); |
||||
} else { |
||||
permission = -1; |
||||
} |
||||
|
||||
StoredFlagReader<FileOptions> flags; |
||||
|
||||
flags.add(foConfirmOverwrite); |
||||
flags.add(foUninsNeverUninstall); |
||||
flags.add(foRestartReplace); |
||||
flags.add(foDeleteAfterInstall); |
||||
if(version.bits != 16) { |
||||
flags.add(foRegisterServer); |
||||
flags.add(foRegisterTypeLib); |
||||
flags.add(foSharedFile); |
||||
if(version < INNO_VERSION(1, 3, 26)) { |
||||
flags.add(foIsReadmeFile); |
||||
} |
||||
} |
||||
flags.add(foCompareTimeStamp); |
||||
flags.add(foFontIsntTrueType); |
||||
flags.add(foSkipIfSourceDoesntExist); |
||||
flags.add(foOverwriteReadOnly); |
||||
if(version > INNO_VERSION(1, 2, 26)) { |
||||
flags.add(foOverwriteSameVersion); |
||||
flags.add(foCustomDestName); |
||||
flags.add(foOnlyIfDestFileExists); |
||||
} |
||||
if(version > INNO_VERSION(1, 3, 26)) { |
||||
flags.add(foNoRegError); |
||||
} |
||||
if(version >= INNO_VERSION(3, 0, 1)) { |
||||
flags.add(foUninsRestartDelete); |
||||
} |
||||
if(version >= INNO_VERSION(3, 0, 5)) { |
||||
flags.add(foOnlyIfDoesntExist); |
||||
flags.add(foIgnoreVersion); |
||||
flags.add(foPromptIfOlder); |
||||
} |
||||
if(version >= INNO_VERSION(3, 0, 8)) { |
||||
flags.add(foDontCopy); |
||||
} |
||||
if(version >= INNO_VERSION(4, 0, 5)) { |
||||
flags.add(foUninsRemoveReadOnly); |
||||
} |
||||
if(version >= INNO_VERSION(4, 1, 8)) { |
||||
flags.add(foRecurseSubDirsExternal); |
||||
} |
||||
if(version >= INNO_VERSION(4, 2, 1)) { |
||||
flags.add(foReplaceSameVersionIfContentsDiffer); |
||||
} |
||||
if(version >= INNO_VERSION(4, 2, 5)) { |
||||
flags.add(foDontVerifyChecksum); |
||||
} |
||||
if(version >= INNO_VERSION(5, 0, 3)) { |
||||
flags.add(foUninsNoSharedFilePrompt); |
||||
} |
||||
if(version >= INNO_VERSION(5, 1, 0)) { |
||||
flags.add(foCreateAllSubDirs); |
||||
} |
||||
if(version >= INNO_VERSION(5, 1, 2)) { |
||||
flags.add(fo32Bit); |
||||
flags.add(fo64Bit); |
||||
} |
||||
if(version >= INNO_VERSION(5, 2, 0)) { |
||||
flags.add(foExternalSizePreset); |
||||
flags.add(foSetNTFSCompression); |
||||
flags.add(foUnsetNTFSCompression); |
||||
} |
||||
if(version >= INNO_VERSION(5, 2, 5)) { |
||||
flags.add(foGacInstall); |
||||
} |
||||
|
||||
options = flags.get(is); |
||||
|
||||
if(version.bits == 16 || version >= INNO_VERSION(5, 0, 0)) { |
||||
type = StoredEnum<StoredFileType0>(is).get(); |
||||
} else { |
||||
type = StoredEnum<StoredFileType1>(is).get(); |
||||
} |
||||
} |
||||
|
||||
ENUM_NAMES(FileOptions::Enum, "File Option", |
||||
"confirm overwrite", |
||||
"never uninstall", |
||||
"restart replace", |
||||
"delete after install", |
||||
"register server", |
||||
"register type lib", |
||||
"shared file", |
||||
"compare timestamp", |
||||
"font isn't truetype", |
||||
"skip if source doesn't exist", |
||||
"overwrite readonly", |
||||
"overwrite same version", |
||||
"custom destination name", |
||||
"only if destination exists", |
||||
"no reg error", |
||||
"uninstall restart delete", |
||||
"only if doesn't exist", |
||||
"ignore version", |
||||
"prompt if older", |
||||
"don't copy", |
||||
"uninstall remove readonly", |
||||
"recurse subdirectories external", |
||||
"replace same version if contents differ", |
||||
"don't verify checksum", |
||||
"uninstall no shared file prompt", |
||||
"create all sub dirs", |
||||
"32 bit", |
||||
"64 bit", |
||||
"external size preset", |
||||
"set ntfs compression", |
||||
"unset ntfs compression", |
||||
"gac install", |
||||
"readme", |
||||
) |
||||
|
||||
ENUM_NAMES(FileEntry::Type, "File Entry Type", |
||||
"user file", |
||||
"uninstaller exe", |
||||
"reg server exe", |
||||
) |
||||
@ -0,0 +1,91 @@
|
||||
|
||||
#ifndef INNOEXTRACT_SETUP_FILEENTRY_HPP |
||||
#define INNOEXTRACT_SETUP_FILEENTRY_HPP |
||||
|
||||
#include <iostream> |
||||
|
||||
#include "setup/Version.hpp" |
||||
#include "setup/WindowsVersion.hpp" |
||||
#include "util/Enum.hpp" |
||||
#include "util/Flags.hpp" |
||||
#include "util/Types.hpp" |
||||
|
||||
FLAGS(FileOptions, |
||||
foConfirmOverwrite, |
||||
foUninsNeverUninstall, |
||||
foRestartReplace, |
||||
foDeleteAfterInstall, |
||||
foRegisterServer, |
||||
foRegisterTypeLib, |
||||
foSharedFile, |
||||
foCompareTimeStamp, |
||||
foFontIsntTrueType, |
||||
foSkipIfSourceDoesntExist, |
||||
foOverwriteReadOnly, |
||||
foOverwriteSameVersion, |
||||
foCustomDestName, |
||||
foOnlyIfDestFileExists, |
||||
foNoRegError, |
||||
foUninsRestartDelete, |
||||
foOnlyIfDoesntExist, |
||||
foIgnoreVersion, |
||||
foPromptIfOlder, |
||||
foDontCopy, |
||||
foUninsRemoveReadOnly, |
||||
foRecurseSubDirsExternal, |
||||
foReplaceSameVersionIfContentsDiffer, |
||||
foDontVerifyChecksum, |
||||
foUninsNoSharedFilePrompt, |
||||
foCreateAllSubDirs, |
||||
fo32Bit, |
||||
fo64Bit, |
||||
foExternalSizePreset, |
||||
foSetNTFSCompression, |
||||
foUnsetNTFSCompression, |
||||
foGacInstall, |
||||
|
||||
// obsolete options:
|
||||
foIsReadmeFile, |
||||
) |
||||
|
||||
NAMED_ENUM(FileOptions::Enum) |
||||
|
||||
struct FileEntry { |
||||
|
||||
enum Type { |
||||
UserFile, |
||||
UninstExe, |
||||
RegSvrExe, |
||||
}; |
||||
|
||||
std::string source; |
||||
std::string destination; |
||||
std::string installFontName; |
||||
std::string strongAssemblyName; |
||||
std::string components; |
||||
std::string tasks; |
||||
std::string languages; |
||||
std::string check; |
||||
std::string afterInstall; |
||||
std::string beforeInstall; |
||||
|
||||
WindowsVersion minVersion; |
||||
WindowsVersion onlyBelowVersion; |
||||
|
||||
int location; //!< index into the file location entry list
|
||||
u32 attributes; |
||||
u64 externalSize; |
||||
|
||||
int permission; //!< index into the permission entry list
|
||||
|
||||
FileOptions options; |
||||
|
||||
Type type; |
||||
|
||||
void load(std::istream & is, const InnoVersion & version); |
||||
|
||||
}; |
||||
|
||||
NAMED_ENUM(FileEntry::Type) |
||||
|
||||
#endif // INNOEXTRACT_SETUP_FILEENTRY_HPP
|
||||
@ -1,10 +1,11 @@
|
||||
|
||||
#include "LanguageEntry.hpp" |
||||
#include "setup/LanguageEntry.hpp" |
||||
|
||||
#include <sstream> |
||||
#include <iconv.h> |
||||
#include "LoadingUtils.hpp" |
||||
#include "Output.hpp" |
||||
|
||||
#include "util/LoadingUtils.hpp" |
||||
#include "util/Output.hpp" |
||||
|
||||
void convert(iconv_t converter, const std::string & from, std::string & to); |
||||
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
#include "PermissionEntry.hpp" |
||||
#include "setup/PermissionEntry.hpp" |
||||
|
||||
#include "LoadingUtils.hpp" |
||||
#include "util/LoadingUtils.hpp" |
||||
|
||||
void PermissionEntry::load(std::istream & is, const InnoVersion & version) { |
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
#include "SetupComponentEntry.hpp" |
||||
#include "setup/SetupComponentEntry.hpp" |
||||
|
||||
#include "StoredEnum.hpp" |
||||
#include "LoadingUtils.hpp" |
||||
#include "util/LoadingUtils.hpp" |
||||
#include "util/StoredEnum.hpp" |
||||
|
||||
STORED_FLAGS_MAP(StoredSetupComponentOptions0, |
||||
coFixed, |
||||
@ -1,8 +1,8 @@
|
||||
|
||||
#include "SetupTaskEntry.hpp" |
||||
#include "setup/SetupTaskEntry.hpp" |
||||
|
||||
#include "LoadingUtils.hpp" |
||||
#include "StoredEnum.hpp" |
||||
#include "util/LoadingUtils.hpp" |
||||
#include "util/StoredEnum.hpp" |
||||
|
||||
STORED_FLAGS_MAP(StoredSetupTaskOptions0, |
||||
toExclusive, |
||||
@ -1,8 +1,8 @@
|
||||
|
||||
#include "SetupTypeEntry.hpp" |
||||
#include "setup/SetupTypeEntry.hpp" |
||||
|
||||
#include "StoredEnum.hpp" |
||||
#include "LoadingUtils.hpp" |
||||
#include "util/LoadingUtils.hpp" |
||||
#include "util/StoredEnum.hpp" |
||||
|
||||
STORED_FLAGS_MAP(StoredSetupTypeOptions, |
||||
CustomSetupType, |
||||
@ -1,11 +1,11 @@
|
||||
|
||||
#include "Version.hpp" |
||||
#include "setup/Version.hpp" |
||||
|
||||
#include <cstring> |
||||
|
||||
#include <boost/static_assert.hpp> |
||||
|
||||
#include "Utils.hpp" |
||||
#include <util/Utils.hpp> |
||||
|
||||
typedef char StoredLegacySetupDataVersion[12]; |
||||
|
||||
@ -0,0 +1,17 @@
|
||||
|
||||
#ifndef INNOEXTRACT_STREAM_BLOCKREADER_HPP |
||||
#define INNOEXTRACT_STREAM_BLOCKREADER_HPP |
||||
|
||||
#include <iostream> |
||||
|
||||
#include "setup/Version.hpp" |
||||
|
||||
class BlockReader { |
||||
|
||||
public: |
||||
|
||||
static std::istream * get(std::istream & base, const InnoVersion & version); |
||||
|
||||
}; |
||||
|
||||
#endif // INNOEXTRACT_STREAM_BLOCKREADER_HPP
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
#include "ChunkFilter.hpp" |
||||
#include "stream/ChunkFilter.hpp" |
||||
|
||||
#include <lzma.h> |
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
#include "Output.hpp" |
||||
#include "util/Output.hpp" |
||||
|
||||
namespace color { |
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
#include "Utils.hpp" |
||||
#include "util/Utils.hpp" |
||||
|
||||
#include <algorithm> |
||||
|
||||
Loading…
Reference in new issue