You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.7 KiB
75 lines
1.7 KiB
|
15 years ago
|
|
||
|
15 years ago
|
#include "setup/directory.hpp"
|
||
|
15 years ago
|
|
||
|
15 years ago
|
#include "util/load.hpp"
|
||
|
|
#include "util/storedenum.hpp"
|
||
|
15 years ago
|
|
||
|
15 years ago
|
namespace setup {
|
||
|
|
|
||
|
15 years ago
|
namespace {
|
||
|
|
|
||
|
15 years ago
|
STORED_FLAGS_MAP(stored_inno_directory_options_0,
|
||
|
|
directory_entry::NeverUninstall,
|
||
|
|
directory_entry::DeleteAfterInstall,
|
||
|
|
directory_entry::AlwaysUninstall,
|
||
|
15 years ago
|
);
|
||
|
|
|
||
|
|
// starting with version 5.2.0
|
||
|
15 years ago
|
STORED_FLAGS_MAP(stored_inno_directory_options_1,
|
||
|
|
directory_entry::NeverUninstall,
|
||
|
|
directory_entry::DeleteAfterInstall,
|
||
|
|
directory_entry::AlwaysUninstall,
|
||
|
|
directory_entry::SetNtfsCompression,
|
||
|
|
directory_entry::UnsetNtfsCompression,
|
||
|
15 years ago
|
);
|
||
|
|
|
||
|
15 years ago
|
} // anonymous namespace
|
||
|
|
|
||
|
15 years ago
|
void directory_entry::load(std::istream & is, const inno_version & version) {
|
||
|
15 years ago
|
|
||
|
15 years ago
|
if(version < INNO_VERSION(1, 3, 21)) {
|
||
|
15 years ago
|
::load<uint32_t>(is); // uncompressed size of the directory entry structure
|
||
|
15 years ago
|
}
|
||
|
15 years ago
|
|
||
|
15 years ago
|
is >> encoded_string(name, version.codepage());
|
||
|
15 years ago
|
|
||
|
15 years ago
|
load_condition_data(is, version);
|
||
|
15 years ago
|
|
||
|
15 years ago
|
if(version >= INNO_VERSION(4, 0, 11) && version < INNO_VERSION(4, 1, 0)) {
|
||
|
15 years ago
|
is >> encoded_string(permissions, version.codepage());
|
||
|
15 years ago
|
} else {
|
||
|
|
permissions.clear();
|
||
|
|
}
|
||
|
|
|
||
|
|
if(version >= INNO_VERSION(2, 0, 11)) {
|
||
|
15 years ago
|
attributes = load_number<uint32_t>(is);
|
||
|
15 years ago
|
} else {
|
||
|
|
attributes = 0;
|
||
|
|
}
|
||
|
|
|
||
|
15 years ago
|
load_version_data(is, version);
|
||
|
15 years ago
|
|
||
|
|
if(version >= INNO_VERSION(4, 1, 0)) {
|
||
|
15 years ago
|
permission = load_number<int16_t>(is);
|
||
|
15 years ago
|
} else {
|
||
|
|
permission = -1;
|
||
|
|
}
|
||
|
|
|
||
|
|
if(version >= INNO_VERSION(5, 2, 0)) {
|
||
|
15 years ago
|
options = stored_flags<stored_inno_directory_options_1>(is).get();
|
||
|
15 years ago
|
} else {
|
||
|
15 years ago
|
options = stored_flags<stored_inno_directory_options_0>(is).get();
|
||
|
15 years ago
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
15 years ago
|
} // namespace setup
|
||
|
|
|
||
|
|
ENUM_NAMES(setup::directory_entry::flags, "Directory Option",
|
||
|
15 years ago
|
"never uninstall",
|
||
|
|
"delete after install",
|
||
|
|
"always uninstall",
|
||
|
|
"set NTFS compression",
|
||
|
|
"unset NTFS compression",
|
||
|
|
)
|