From 63d236934fd0ea359468a840edbe39a5599214c0 Mon Sep 17 00:00:00 2001 From: anders_k Date: Wed, 30 Dec 2020 01:11:01 +0000 Subject: [PATCH] NOTINDEXED file attribute ability git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7242 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/generalpurpose.but | 2 ++ Source/Platform.h | 3 +++ Source/script.cpp | 22 ++++++++-------------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Docs/src/generalpurpose.but b/Docs/src/generalpurpose.but index a16376d1..22eb3077 100644 --- a/Docs/src/generalpurpose.but +++ b/Docs/src/generalpurpose.but @@ -155,6 +155,8 @@ Sets the file attributes of 'filename'. Valid attributes can be combined with | \b \e{TEMPORARY} or \e{FILE_ATTRIBUTE_TEMPORARY} +\b \e{NOTINDEXED} or \e{FILE_ATTRIBUTE_NOT_CONTENT_INDEXED} + The error flag will be set if the file's attributes cannot be set (i.e. the file doesn't exist, or you don't have the right permissions). You can only set attributes. It's not possible to unset them. If you want to remove an attribute use NORMAL. This way all attributes are erased. This command doesn't support wildcards. \S2{regdll} RegDLL diff --git a/Source/Platform.h b/Source/Platform.h index a715b587..c18d9012 100644 --- a/Source/Platform.h +++ b/Source/Platform.h @@ -760,6 +760,9 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG; # define FILE_ATTRIBUTE_TEMPORARY 0x00000100 # define FILE_ATTRIBUTE_OFFLINE 0x00001000 #endif +#ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED +# define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x002000 +#endif // fopen diff --git a/Source/script.cpp b/Source/script.cpp index e6d9611b..d2aaf610 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -3862,20 +3862,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) { #define MBD(x) {x,_T(#x)}, struct { int id; const TCHAR *str; } list[] = { - MBD(FILE_ATTRIBUTE_NORMAL) - MBD(FILE_ATTRIBUTE_ARCHIVE) - MBD(FILE_ATTRIBUTE_HIDDEN) - MBD(FILE_ATTRIBUTE_OFFLINE) - MBD(FILE_ATTRIBUTE_READONLY) - MBD(FILE_ATTRIBUTE_SYSTEM) - MBD(FILE_ATTRIBUTE_TEMPORARY) - {FILE_ATTRIBUTE_NORMAL,_T("NORMAL")}, // Short alias - {FILE_ATTRIBUTE_ARCHIVE,_T("ARCHIVE")}, - {FILE_ATTRIBUTE_HIDDEN,_T("HIDDEN")}, - {FILE_ATTRIBUTE_OFFLINE,_T("OFFLINE")}, - {FILE_ATTRIBUTE_READONLY,_T("READONLY")}, - {FILE_ATTRIBUTE_SYSTEM,_T("SYSTEM")}, - {FILE_ATTRIBUTE_TEMPORARY,_T("TEMPORARY")}, + MBD(FILE_ATTRIBUTE_NORMAL) {FILE_ATTRIBUTE_NORMAL,_T("NORMAL")}, // Short alias + MBD(FILE_ATTRIBUTE_ARCHIVE) {FILE_ATTRIBUTE_ARCHIVE,_T("ARCHIVE")}, + MBD(FILE_ATTRIBUTE_HIDDEN) {FILE_ATTRIBUTE_HIDDEN,_T("HIDDEN")}, + MBD(FILE_ATTRIBUTE_OFFLINE) {FILE_ATTRIBUTE_OFFLINE,_T("OFFLINE")}, + MBD(FILE_ATTRIBUTE_READONLY) {FILE_ATTRIBUTE_READONLY,_T("READONLY")}, + MBD(FILE_ATTRIBUTE_SYSTEM) {FILE_ATTRIBUTE_SYSTEM,_T("SYSTEM")}, + MBD(FILE_ATTRIBUTE_TEMPORARY) {FILE_ATTRIBUTE_TEMPORARY,_T("TEMPORARY")}, + MBD(FILE_ATTRIBUTE_NOT_CONTENT_INDEXED) {FILE_ATTRIBUTE_NOT_CONTENT_INDEXED,_T("NOTINDEXED")}, {FILE_ATTRIBUTE_NORMAL,_T("0")}, }; #undef MBD