123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- ; BEGIN ISPPBUILTINS.ISS
- #if defined(ISPP_INVOKED) && !defined(_BUILTINS_ISS_)
- #if PREPROCVER < 0x01000000
- # error Inno Setup Preprocessor version is outdated
- #endif
- #define _BUILTINS_ISS_
- #ifndef __POPT_P__
- # define private CStrings
- #else
- # pragma parseroption -p-
- #endif
- #define NewLine "\n"
- #define Tab "\t"
- #pragma parseroption -p+
- #pragma spansymbol "\"
- #define True 1
- #define False 0
- #define Yes True
- #define No False
- #define MaxInt 0x7FFFFFFFL
- #define MinInt 0x80000000L
- #define NULL
- #define void
- #define TYPE_ERROR 0
- #define TYPE_NULL 1
- #define TYPE_INTEGER 2
- #define TYPE_STRING 3
- #define TYPE_MACRO 4
- #define TYPE_FUNC 5
- #define TYPE_ARRAY 6
- #define TypeOf2(any Expr) TypeOf(Expr)
- #define HKEY_CLASSES_ROOT 0x80000000UL
- #define HKEY_CURRENT_USER 0x80000001UL
- #define HKEY_LOCAL_MACHINE 0x80000002UL
- #define HKEY_USERS 0x80000003UL
- #define HKEY_CURRENT_CONFIG 0x80000005UL
- #define HKEY_CLASSES_ROOT_64 0x82000000UL
- #define HKEY_CURRENT_USER_64 0x82000001UL
- #define HKEY_LOCAL_MACHINE_64 0x82000002UL
- #define HKEY_USERS_64 0x82000003UL
- #define HKEY_CURRENT_CONFIG_64 0x82000005UL
- #define HKCR HKEY_CLASSES_ROOT
- #define HKCU HKEY_CURRENT_USER
- #define HKLM HKEY_LOCAL_MACHINE
- #define HKU HKEY_USERS
- #define HKCC HKEY_CURRENT_CONFIG
- #define HKCR64 HKEY_CLASSES_ROOT_64
- #define HKCU64 HKEY_CURRENT_USER_64
- #define HKLM64 HKEY_LOCAL_MACHINE_64
- #define HKU64 HKEY_USERS_64
- #define HKCC64 HKEY_CURRENT_CONFIG_64
- #define SW_HIDE 0
- #define SW_SHOWNORMAL 1
- #define SW_NORMAL 1
- #define SW_SHOWMINIMIZED 2
- #define SW_SHOWMAXIMIZED 3
- #define SW_MAXIMIZE 3
- #define SW_SHOWNOACTIVATE 4
- #define SW_SHOW 5
- #define SW_MINIMIZE 6
- #define SW_SHOWMINNOACTIVE 7
- #define SW_SHOWNA 8
- #define SW_RESTORE 9
- #define SW_SHOWDEFAULT 10
- #define SW_MAX 10
- #define FIND_MATCH 0x00
- #define FIND_BEGINS 0x01
- #define FIND_ENDS 0x02
- #define FIND_CONTAINS 0x03
- #define FIND_CASESENSITIVE 0x04
- #define FIND_SENSITIVE FIND_CASESENSITIVE
- #define FIND_AND 0x00
- #define FIND_OR 0x08
- #define FIND_NOT 0x10
- #define FIND_TRIM 0x20
- #define faReadOnly 0x00000001
- #define faHidden 0x00000002
- #define faSysFile 0x00000004
- #define faVolumeID 0x00000008
- #define faDirectory 0x00000010
- #define faArchive 0x00000020
- #define faSymLink 0x00000040
- #define faAnyFile 0x0000003F
- #define COMPANY_NAME "CompanyName"
- #define FILE_DESCRIPTION "FileDescription"
- #define FILE_VERSION "FileVersion"
- #define INTERNAL_NAME "InternalName"
- #define LEGAL_COPYRIGHT "LegalCopyright"
- #define ORIGINAL_FILENAME "OriginalFilename"
- #define PRODUCT_NAME "ProductName"
- #define PRODUCT_VERSION "ProductVersion"
- #define GetFileCompany(str FileName) GetStringFileInfo(FileName, COMPANY_NAME)
- #define GetFileDescription(str FileName) GetStringFileInfo(FileName, FILE_DESCRIPTION)
- #define GetFileVersionString(str FileName) GetStringFileInfo(FileName, FILE_VERSION)
- #define GetFileCopyright(str FileName) GetStringFileInfo(FileName, LEGAL_COPYRIGHT)
- #define GetFileOriginalFilename(str FileName) GetStringFileInfo(FileName, ORIGINAL_FILENAME)
- #define GetFileProductVersion(str FileName) GetStringFileInfo(FileName, PRODUCT_VERSION)
- #define DeleteToFirstPeriod(str *S) \
- Local[1] = Copy(S, 1, (Local[0] = Pos(".", S)) - 1), \
- S = Copy(S, Local[0] + 1), \
- Local[1]
- #define ParseVersion(str FileName, *Major, *Minor, *Rev, *Build) \
- Local[1] = Local[0] = GetFileVersion(FileName), \
- Local[1] == "" ? "" : ( \
- Major = Int(DeleteToFirstPeriod(Local[1])), \
- Minor = Int(DeleteToFirstPeriod(Local[1])), \
- Rev = Int(DeleteToFirstPeriod(Local[1])), \
- Build = Int(Local[1]), \
- Local[0])
- #define EncodeVer(int Major, int Minor, int Revision = 0, int Build = -1) \
- Major << 24 | (Minor & 0xFF) << 16 | (Revision & 0xFF) << 8 | (Build >= 0 ? Build & 0xFF : 0)
- #define DecodeVer(int Ver, int Digits = 3) \
- Str(Ver >> 0x18 & 0xFF) + (Digits > 1 ? "." : "") + \
- (Digits > 1 ? \
- Str(Ver >> 0x10 & 0xFF) + (Digits > 2 ? "." : "") : "") + \
- (Digits > 2 ? \
- Str(Ver >> 0x08 & 0xFF) + (Digits > 3 && (Local = Ver & 0xFF) ? "." : "") : "") + \
- (Digits > 3 && Local ? \
- Str(Ver & 0xFF) : "")
- #define FindSection(str Section = "Files") \
- Find(0, "[" + Section + "]", FIND_MATCH | FIND_TRIM) + 1
- #if VER >= 0x03000000
- # define FindNextSection(int Line) \
- Find(Line, "[", FIND_BEGINS | FIND_TRIM, "]", FIND_ENDS | FIND_AND)
- # define FindSectionEnd(str Section = "Files") \
- FindNextSection(FindSection(Section))
- #else
- # define FindSectionEnd(str Section = "Files") \
- FindSection(Section) + EntryCount(Section)
- #endif
- #define FindCode() \
- Local[1] = FindSection("Code"), \
- Local[0] = Find(Local[1] - 1, "program", FIND_BEGINS, ";", FIND_ENDS | FIND_AND), \
- (Local[0] < 0 ? Local[1] : Local[0] + 1)
- #define ExtractFilePath(str PathName) \
- (Local[0] = \
- !(Local[1] = RPos("\", PathName)) ? \
- "" : \
- Copy(PathName, 1, Local[1] - 1)), \
- Local[0] + \
- ((Local[2] = Len(Local[0])) == 2 && Copy(Local[0], Local[2]) == ":" ? \
- "\" : \
- "")
- #define ExtractFileDir(str PathName) \
- RemoveBackslash(ExtractFilePath(PathName))
- #define ExtractFileExt(str PathName) \
- Local[0] = RPos(".", PathName), \
- Copy(PathName, Local[0] + 1)
- #define ExtractFileName(str PathName) \
- !(Local[0] = RPos("\", PathName)) ? \
- PathName : \
- Copy(PathName, Local[0] + 1)
- #define ChangeFileExt(str FileName, str NewExt) \
- !(Local[0] = RPos(".", FileName)) ? \
- FileName + "." + NewExt : \
- Copy(FileName, 1, Local[0]) + NewExt
- #define RemoveFileExt(str FileName) \
- !(Local[0] = RPos(".", FileName)) ? \
- FileName : \
- Copy(FileName, 1, Local[0] - 1)
- #define AddBackslash(str S) \
- Copy(S, Len(S)) == "\" ? S : S + "\"
- #define RemoveBackslash(str S) \
- Local[0] = Len(S), \
- Local[0] > 0 ? \
- Copy(S, Local[0]) == "\" ? \
- (Local[0] == 3 && Copy(S, 2, 1) == ":" ? \
- S : \
- Copy(S, 1, Local[0] - 1)) : \
- S : \
- ""
- #define Delete(str *S, int Index, int Count = MaxInt) \
- S = Copy(S, 1, Index - 1) + Copy(S, Index + Count)
- #define Insert(str *S, int Index, str Substr) \
- Index > Len(S) + 1 ? \
- S : \
- S = Copy(S, 1, Index - 1) + SubStr + Copy(S, Index)
- #define YesNo(str S) \
- (S = LowerCase(S)) == "yes" || S == "true" || S == "1"
- #define IsDirSet(str SetupDirective) \
- YesNo(SetupSetting(SetupDirective))
- #define Power(int X, int P = 2) \
- !P ? 1 : X * Power(X, P - 1)
- #define Min(int A, int B, int C = MaxInt) \
- A < B ? A < C ? Int(A) : Int(C) : Int(B)
- #define Max(int A, int B, int C = MinInt) \
- A > B ? A > C ? Int(A) : Int(C) : Int(B)
- #define SameText(str S1, str S2) \
- LowerCase(S1) == LowerCase(S2)
- #define SameStr(str S1, str S2) \
- S1 == S2
- #ifdef CStrings
- # pragma parseroption -p-
- #endif
- #endif
- ; END ISPPBUILTINS.ISS
|