diff --git a/build.bat b/build.bat index 4094f4a..600028e 100644 --- a/build.bat +++ b/build.bat @@ -16,13 +16,13 @@ echo Building nvm.exe go build src\nvm.go REM Group the file with the helper binaries -move nvm.exe %GOBIN% +move nvm.exe "%GOBIN%" REM Codesign the executable -.\buildtools\signtools\x64\signtool.exe sign /debug /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a %GOBIN%\nvm.exe +.\buildtools\signtools\x64\signtool.exe sign /debug /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a "%GOBIN%\nvm.exe" -for /f %%i in ('%GOBIN%\nvm.exe version') do set AppVersion=%%i +for /f %%i in ('"%GOBIN%\nvm.exe" version') do set AppVersion=%%i echo nvm.exe v%AppVersion% built. REM Create the distribution folder @@ -38,10 +38,10 @@ REM Create the distribution directory mkdir "%DIST%" REM Create the "no install" zip version -for %%a in (%GOBIN%) do (buildtools\zip -j -9 -r "%DIST%\nvm-noinstall.zip" "%CD%\LICENSE" "%%a\*" -x "%GOBIN%\nodejs.ico") +for %%a in ("%GOBIN%") do (buildtools\zip -j -9 -r "%DIST%\nvm-noinstall.zip" "%CD%\LICENSE" %%a\* -x "%GOBIN%\nodejs.ico") REM Generate the installer (InnoSetup) -buildtools\iscc %INNOSETUP% /o%DIST% +buildtools\iscc "%INNOSETUP%" "/o%DIST%" buildtools\zip -j -9 -r "%DIST%\nvm-setup.zip" "%DIST%\nvm-setup.exe" REM Generate checksums diff --git a/buildtools/Default.isl b/buildtools/Default.isl index a2711fe..ce9b70e 100644 --- a/buildtools/Default.isl +++ b/buildtools/Default.isl @@ -1,7 +1,7 @@ -; *** Inno Setup version 5.5.3+ English messages *** +; *** Inno Setup version 6.1.0+ English messages *** ; ; To download user-contributed translations of this file, go to: -; http://www.jrsoftware.org/files/istrans/ +; https://jrsoftware.org/files/istrans/ ; ; Note: When translating this text, do not add periods (.) to the end of ; messages that didn't have them already, because on those messages Inno @@ -42,6 +42,7 @@ ErrorTitle=Error SetupLdrStartupMessage=This will install %1. Do you wish to continue? LdrCannotCreateTemp=Unable to create a temporary file. Setup aborted LdrCannotExecTemp=Unable to execute file in the temporary directory. Setup aborted +HelpTextNote= ; *** Startup error messages LastErrorMessage=%1.%n%nError %2: %3 @@ -55,7 +56,6 @@ WindowsServicePackRequired=This program requires %1 Service Pack %2 or later. NotOnThisPlatform=This program will not run on %1. OnlyOnThisPlatform=This program must be run on %1. OnlyOnTheseArchitectures=This program can only be installed on versions of Windows designed for the following processor architectures:%n%n%1 -MissingWOW64APIs=The version of Windows you are running does not include functionality required by Setup to perform a 64-bit installation. To correct this problem, please install Service Pack %1. WinVersionTooLowError=This program requires %1 version %2 or later. WinVersionTooHighError=This program cannot be installed on %1 version %2 or later. AdminPrivilegesRequired=You must be logged in as an administrator when installing this program. @@ -63,6 +63,16 @@ PowerUserPrivilegesRequired=You must be logged in as an administrator or as a me SetupAppRunningError=Setup has detected that %1 is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit. UninstallAppRunningError=Uninstall has detected that %1 is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit. +; *** Startup questions +PrivilegesRequiredOverrideTitle=Select Setup Install Mode +PrivilegesRequiredOverrideInstruction=Select install mode +PrivilegesRequiredOverrideText1=%1 can be installed for all users (requires administrative privileges), or for you only. +PrivilegesRequiredOverrideText2=%1 can be installed for you only, or for all users (requires administrative privileges). +PrivilegesRequiredOverrideAllUsers=Install for &all users +PrivilegesRequiredOverrideAllUsersRecommended=Install for &all users (recommended) +PrivilegesRequiredOverrideCurrentUser=Install for &me only +PrivilegesRequiredOverrideCurrentUserRecommended=Install for &me only (recommended) + ; *** Misc. errors ErrorCreatingDir=Setup was unable to create the directory "%1" ErrorTooManyFilesInDir=Unable to create a file in the directory "%1" because it contains too many files @@ -93,7 +103,7 @@ ButtonNewFolder=&Make New Folder ; *** "Select Language" dialog messages SelectLanguageTitle=Select Setup Language -SelectLanguageLabel=Select the language to use during the installation: +SelectLanguageLabel=Select the language to use during the installation. ; *** Common wizard text ClickNext=Click Next to continue, or Cancel to exit Setup. @@ -141,6 +151,7 @@ WizardSelectDir=Select Destination Location SelectDirDesc=Where should [name] be installed? SelectDirLabel3=Setup will install [name] into the following folder. SelectDirBrowseLabel=To continue, click Next. If you would like to select a different folder, click Browse. +DiskSpaceGBLabel=At least [gb] GB of free disk space is required. DiskSpaceMBLabel=At least [mb] MB of free disk space is required. CannotInstallToNetworkDrive=Setup cannot install to a network drive. CannotInstallToUNCPath=Setup cannot install to a UNC path. @@ -168,6 +179,7 @@ NoUninstallWarningTitle=Components Exist NoUninstallWarning=Setup has detected that the following components are already installed on your computer:%n%n%1%n%nDeselecting these components will not uninstall them.%n%nWould you like to continue anyway? ComponentSize1=%1 KB ComponentSize2=%1 MB +ComponentsDiskSpaceGBLabel=Current selection requires at least [gb] GB of disk space. ComponentsDiskSpaceMBLabel=Current selection requires at least [mb] MB of disk space. ; *** "Select Additional Tasks" wizard page @@ -198,6 +210,18 @@ ReadyMemoComponents=Selected components: ReadyMemoGroup=Start Menu folder: ReadyMemoTasks=Additional tasks: +; *** TDownloadWizardPage wizard page and DownloadTemporaryFile +DownloadingLabel=Downloading additional files... +ButtonStopDownload=&Stop download +StopDownload=Are you sure you want to stop the download? +ErrorDownloadAborted=Download aborted +ErrorDownloadFailed=Download failed: %1 %2 +ErrorDownloadSizeFailed=Getting size failed: %1 %2 +ErrorFileHash1=File hash failed: %1 +ErrorFileHash2=Invalid file hash: expected %1, found %2 +ErrorProgress=Invalid progress: %1 of %2 +ErrorFileSize=Invalid file size: expected %1, found %2 + ; *** "Preparing to Install" wizard page WizardPreparing=Preparing to Install PreparingDesc=Setup is preparing to install [name] on your computer. @@ -208,6 +232,7 @@ ApplicationsFound2=The following applications are using files that need to be up CloseApplications=&Automatically close the applications DontCloseApplications=&Do not close the applications ErrorCloseApplications=Setup was unable to automatically close all applications. It is recommended that you close all applications using files that need to be updated by Setup before continuing. +PrepareToInstallNeedsRestart=Setup must restart your computer. After restarting your computer, run Setup again to complete the installation of [name].%n%nWould you like to restart now? ; *** "Installing" wizard page WizardInstalling=Installing @@ -237,7 +262,10 @@ SelectDirectoryLabel=Please specify the location of the next disk. ; *** Installation phase messages SetupAborted=Setup was not completed.%n%nPlease correct the problem and run Setup again. -EntryAbortRetryIgnore=Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation. +AbortRetryIgnoreSelectAction=Select action +AbortRetryIgnoreRetry=&Try again +AbortRetryIgnoreIgnore=&Ignore the error and continue +AbortRetryIgnoreCancel=Cancel installation ; *** Installation status messages StatusClosingApplications=Closing applications... @@ -268,14 +296,24 @@ ErrorRegWriteKey=Error writing to registry key:%n%1\%2 ErrorIniEntry=Error creating INI entry in file "%1". ; *** File copying errors -FileAbortRetryIgnore=Click Retry to try again, Ignore to skip this file (not recommended), or Abort to cancel installation. -FileAbortRetryIgnore2=Click Retry to try again, Ignore to proceed anyway (not recommended), or Abort to cancel installation. +FileAbortRetryIgnoreSkipNotRecommended=&Skip this file (not recommended) +FileAbortRetryIgnoreIgnoreNotRecommended=&Ignore the error and continue (not recommended) SourceIsCorrupted=The source file is corrupted SourceDoesntExist=The source file "%1" does not exist -ExistingFileReadOnly=The existing file is marked as read-only.%n%nClick Retry to remove the read-only attribute and try again, Ignore to skip this file, or Abort to cancel installation. +ExistingFileReadOnly2=The existing file could not be replaced because it is marked read-only. +ExistingFileReadOnlyRetry=&Remove the read-only attribute and try again +ExistingFileReadOnlyKeepExisting=&Keep the existing file ErrorReadingExistingDest=An error occurred while trying to read the existing file: -FileExists=The file already exists.%n%nWould you like Setup to overwrite it? -ExistingFileNewer=The existing file is newer than the one Setup is trying to install. It is recommended that you keep the existing file.%n%nDo you want to keep the existing file? +FileExistsSelectAction=Select action +FileExists2=The file already exists. +FileExistsOverwriteExisting=&Overwrite the existing file +FileExistsKeepExisting=&Keep the existing file +FileExistsOverwriteOrKeepAll=&Do this for the next conflicts +ExistingFileNewerSelectAction=Select action +ExistingFileNewer2=The existing file is newer than the one Setup is trying to install. +ExistingFileNewerOverwriteExisting=&Overwrite the existing file +ExistingFileNewerKeepExisting=&Keep the existing file (recommended) +ExistingFileNewerOverwriteOrKeepAll=&Do this for the next conflicts ErrorChangingAttr=An error occurred while trying to change the attributes of the existing file: ErrorCreatingTemp=An error occurred while trying to create a file in the destination directory: ErrorReadingSource=An error occurred while trying to read the source file: @@ -287,6 +325,16 @@ ErrorRegisterServer=Unable to register the DLL/OCX: %1 ErrorRegSvr32Failed=RegSvr32 failed with exit code %1 ErrorRegisterTypeLib=Unable to register the type library: %1 +; *** Uninstall display name markings +; used for example as 'My Program (32-bit)' +UninstallDisplayNameMark=%1 (%2) +; used for example as 'My Program (32-bit, All users)' +UninstallDisplayNameMarks=%1 (%2, %3) +UninstallDisplayNameMark32Bit=32-bit +UninstallDisplayNameMark64Bit=64-bit +UninstallDisplayNameMarkAllUsers=All users +UninstallDisplayNameMarkCurrentUser=Current user + ; *** Post-installation errors ErrorOpeningReadme=An error occurred while trying to open the README file. ErrorRestartingComputer=Setup was unable to restart the computer. Please do this manually. diff --git a/buildtools/ISCmplr.dll b/buildtools/ISCmplr.dll index 6b40678..35e8cf4 100644 Binary files a/buildtools/ISCmplr.dll and b/buildtools/ISCmplr.dll differ diff --git a/buildtools/ISPP.dll b/buildtools/ISPP.dll index 5a02b92..42b51a7 100644 Binary files a/buildtools/ISPP.dll and b/buildtools/ISPP.dll differ diff --git a/buildtools/ISPPBuiltins.iss b/buildtools/ISPPBuiltins.iss index d233fb4..f7f6d0d 100644 --- a/buildtools/ISPPBuiltins.iss +++ b/buildtools/ISPPBuiltins.iss @@ -1,15 +1,10 @@ -; BEGIN ISPPBUILTINS.ISS +// Inno Setup Preprocessor // -// Inno Setup Preprocessor 5 +// Inno Setup (C) 1997-2020 Jordan Russell. All Rights Reserved. +// Portions Copyright (C) 2000-2020 Martijn Laan. All Rights Reserved. +// Portions Copyright (C) 2001-2004 Alex Yackimoff. All Rights Reserved. // -// Copyright (C) 2001-2004 Alex Yackimoff. All Rights Reserved. -// Portions by Martijn Laan. -// http://ispp.sourceforge.net -// -// Inno Setup (C) 1997-2009 Jordan Russell. All Rights Reserved. -// Portions by Martijn Laan. -// -// $Id: ISPPBuiltins.iss,v 1.3 2010/12/29 15:20:26 mlaan Exp $ +// See the ISPP help file for more documentation of the functions defined by this file // #if defined(ISPP_INVOKED) && !defined(_BUILTINS_ISS_) // @@ -19,55 +14,37 @@ // #define _BUILTINS_ISS_ // -// =========================================================================== -// -// Default states for options. -// -//#pragma parseroption -b+ ; short circuit boolean evaluation: on -//#pragma parseroption -m- ; short circuit multiplication evaluation (0 * A will not eval A): off -//#pragma parseroption -p+ ; string literals without escape sequences: on -//#pragma parseroption -u- ; allow undeclared identifiers: off -//#pragma option -c+ ; pass script to the compiler: on -//#pragma option -e- ; emit empty lines to translation: off -//#pragma option -v- ; verbose mode: off -// -// --------------------------------------------------------------------------- -// -// Verbose levels: -// 0 - #include and #file acknowledgements -// 1 - information about any temp files created by #file -// 2 - #insert and #append acknowledgements -// 3 - reserved -// 4 - #dim, #define and #undef acknowledgements -// 5 - reserved -// 6 - conditional inclusion acknowledgements -// 7 - reserved -// 8 - show strings emitted with #emit directive -// 9 - macro and functions successfull call acknowledgements -//10 - Local macro array allocation acknowledgements -// -//#pragma verboselevel 0 -// -#ifndef __POPT_P__ -# define private CStrings -# pragma parseroption -p+ +#ifdef __OPT_E__ +# define private EnableOptE +# pragma option -e- #endif -// + +#ifndef __POPT_P__ +# define private DisablePOptP +#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 MaxInt 0x7FFFFFFFFFFFFFFFL +#define MinInt 0x8000000000000000L + #define NULL #define void -// + // TypeOf constants -// + #define TYPE_ERROR 0 #define TYPE_NULL 1 #define TYPE_INTEGER 2 @@ -75,15 +52,15 @@ #define TYPE_MACRO 4 #define TYPE_FUNC 5 #define TYPE_ARRAY 6 -// + // Helper macro to find out the type of an array element or expression. TypeOf // standard function only allows identifier as its parameter. Use this macro // to convert an expression to identifier. -// + #define TypeOf2(any Expr) TypeOf(Expr) -// + // ReadReg constants -// + #define HKEY_CLASSES_ROOT 0x80000000UL #define HKEY_CURRENT_USER 0x80000001UL #define HKEY_LOCAL_MACHINE 0x80000002UL @@ -94,7 +71,7 @@ #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 @@ -105,9 +82,9 @@ #define HKLM64 HKEY_LOCAL_MACHINE_64 #define HKU64 HKEY_USERS_64 #define HKCC64 HKEY_CURRENT_CONFIG_64 -// + // Exec constants -// + #define SW_HIDE 0 #define SW_SHOWNORMAL 1 #define SW_NORMAL 1 @@ -122,9 +99,9 @@ #define SW_RESTORE 9 #define SW_SHOWDEFAULT 10 #define SW_MAX 10 -// + // Find constants -// + #define FIND_MATCH 0x00 #define FIND_BEGINS 0x01 #define FIND_ENDS 0x02 @@ -135,9 +112,9 @@ #define FIND_OR 0x08 #define FIND_NOT 0x10 #define FIND_TRIM 0x20 -// + // FindFirst constants -// + #define faReadOnly 0x00000001 #define faHidden 0x00000002 #define faSysFile 0x00000004 @@ -146,9 +123,9 @@ #define faArchive 0x00000020 #define faSymLink 0x00000040 #define faAnyFile 0x0000003F -// + // GetStringFileInfo standard names -// + #define COMPANY_NAME "CompanyName" #define FILE_DESCRIPTION "FileDescription" #define FILE_VERSION "FileVersion" @@ -157,72 +134,77 @@ #define ORIGINAL_FILENAME "OriginalFilename" #define PRODUCT_NAME "ProductName" #define PRODUCT_VERSION "ProductVersion" -// + // GetStringFileInfo helpers -// + #define GetFileCompany(str FileName) GetStringFileInfo(FileName, COMPANY_NAME) -#define GetFileCopyright(str FileName) GetStringFileInfo(FileName, LEGAL_COPYRIGHT) #define GetFileDescription(str FileName) GetStringFileInfo(FileName, FILE_DESCRIPTION) -#define GetFileProductVersion(str FileName) GetStringFileInfo(FileName, PRODUCT_VERSION) #define GetFileVersionString(str FileName) GetStringFileInfo(FileName, FILE_VERSION) -// -// ParseVersion -// -// Macro internally calls GetFileVersion function and parses string returned -// by that function (in form "0.0.0.0"). All four version elements are stored -// in by-reference parameters Major, Minor, Rev, and Build. Macro returns -// string returned by GetFileVersion. -// +#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), \ + +#define GetVersionComponents(str FileName, *Major, *Minor, *Rev, *Build) \ + Local[1] = Local[0] = GetVersionNumbersString(FileName), \ Local[1] == "" ? "" : ( \ Major = Int(DeleteToFirstPeriod(Local[1])), \ Minor = Int(DeleteToFirstPeriod(Local[1])), \ Rev = Int(DeleteToFirstPeriod(Local[1])), \ Build = Int(Local[1]), \ Local[0]) -// -// EncodeVer -// -// Encodes given four version elements to a 32 bit integer number (8 bits for -// each element, i.e. elements must be within 0...255 range). -// + +#define GetPackedVersion(str FileName, *Version) \ + Local[0] = GetVersionComponents(FileName, Local[1], Local[2], Local[3], Local[4]), \ + Version = PackVersionComponents(Local[1], Local[2], Local[3], Local[4]), \ + Local[0] + +#define GetVersionNumbers(str FileName, *MS, *LS) \ + Local[0] = GetPackedVersion(FileName, Local[1]), \ + UnpackVersionNumbers(Local[1], MS, LS), \ + Local[0] + +#define PackVersionNumbers(int VersionMS, int VersionLS) \ + VersionMS << 32 | (VersionLS & 0xFFFFFFFF) + +#define PackVersionComponents(int Major, int Minor, int Rev, int Build) \ + Major << 48 | (Minor & 0xFFFF) << 32 | (Rev & 0xFFFF) << 16 | (Build & 0xFFFF) + +#define UnpackVersionNumbers(int Version, *VersionMS, *VersionLS) \ + VersionMS = Version >> 32, \ + VersionLS = Version & 0xFFFFFFFF, \ + void + +#define UnpackVersionComponents(int Version, *Major, *Minor, *Rev, *Build) \ + Major = Version >> 48, \ + Minor = (Version >> 32) & 0xFFFF, \ + Rev = (Version >> 16) & 0xFFFF, \ + Build = Version & 0xFFFF, \ + void + +#define VersionToStr(int Version) \ + Str(Version >> 48 & 0xFFFF) + "." + Str(Version >> 32 & 0xFFFF) + "." + \ + Str(Version >> 16 & 0xFFFF) + "." + Str(Version & 0xFFFF) + #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) -// -// DecodeVer -// -// Decodes given 32 bit integer encoded version to its string representation, -// Digits parameter indicates how many elements to show (if the fourth element -// is 0, it won't be shown anyway). -// -#define DecodeVer(int Ver, int Digits = 3) \ - Str(Ver >> 0x18 & 0xFF) + (Digits > 1 ? "." : "") + \ + (Major & 0xFF) << 24 | (Minor & 0xFF) << 16 | (Revision & 0xFF) << 8 | (Build >= 0 ? Build & 0xFF : 0) + +#define DecodeVer(int Version, int Digits = 3) \ + Str(Version >> 24 & 0xFF) + (Digits > 1 ? "." : "") + \ (Digits > 1 ? \ - Str(Ver >> 0x10 & 0xFF) + (Digits > 2 ? "." : "") : "") + \ + Str(Version >> 16 & 0xFF) + (Digits > 2 ? "." : "") : "") + \ (Digits > 2 ? \ - Str(Ver >> 0x08 & 0xFF) + (Digits > 3 && (Local = Ver & 0xFF) ? "." : "") : "") + \ + Str(Version >> 8 & 0xFF) + (Digits > 3 && (Local = Version & 0xFF) ? "." : "") : "") + \ (Digits > 3 && Local ? \ - Str(Ver & 0xFF) : "") -// -// FindSection -// -// Returns index of the line following the header of the section. This macro -// is intended to be used with #insert directive. -// + Str(Version & 0xFF) : "") + #define FindSection(str Section = "Files") \ Find(0, "[" + Section + "]", FIND_MATCH | FIND_TRIM) + 1 -// -// FindSectionEnd -// -// Returns index of the line following last entry of the section. This macro -// is intended to be used with #insert directive. -// + #if VER >= 0x03000000 # define FindNextSection(int Line) \ Find(Line, "[", FIND_BEGINS | FIND_TRIM, "]", FIND_ENDS | FIND_AND) @@ -232,23 +214,12 @@ # define FindSectionEnd(str Section = "Files") \ FindSection(Section) + EntryCount(Section) #endif -// -// FindCode -// -// Returns index of the line (of translation) following either [Code] section -// header, or "program" keyword, if any. -// + #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) -// -// ExtractFilePath -// -// Returns directory portion of the given filename without backslash (unless -// it is a root directory). If PathName doesn't contain directory portion, -// the result is an empty string. -// + #define ExtractFilePath(str PathName) \ (Local[0] = \ !(Local[1] = RPos("\", PathName)) ? \ @@ -258,54 +229,32 @@ ((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) -// -// ExtractFileName -// -// Returns name portion of the given filename. If PathName ends with -// a backslash, the result is an empty string. -// + #define ExtractFileName(str PathName) \ !(Local[0] = RPos("\", PathName)) ? \ PathName : \ Copy(PathName, Local[0] + 1) -// -// ChangeFileExt -// -// Changes extension in FileName with NewExt. NewExt must not contain -// period. -// + #define ChangeFileExt(str FileName, str NewExt) \ !(Local[0] = RPos(".", FileName)) ? \ FileName + "." + NewExt : \ Copy(FileName, 1, Local[0]) + NewExt -// -// RemoveFileExt -// -// Removes extension in FileName. -// + #define RemoveFileExt(str FileName) \ !(Local[0] = RPos(".", FileName)) ? \ FileName : \ Copy(FileName, 1, Local[0] - 1) -// -// AddBackslash -// -// Adds a backslash to the string, if it's not already there. -// + #define AddBackslash(str S) \ Copy(S, Len(S)) == "\" ? S : S + "\" -// -// RemoveBackslash -// -// Removes trailing backslash from the string unless the string points to -// a root directory. -// + #define RemoveBackslash(str S) \ Local[0] = Len(S), \ Local[0] > 0 ? \ @@ -315,52 +264,52 @@ Copy(S, 1, Local[0] - 1)) : \ S : \ "" -// -// Delete -// -// Deletes specified number of characters beginning with Index from S. S is -// passed by reference (therefore is modified). Acts like Delete function in -// Delphi (from System unit). -// + #define Delete(str *S, int Index, int Count = MaxInt) \ S = Copy(S, 1, Index - 1) + Copy(S, Index + Count) -// -// Insert -// -// Inserts specified Substr at Index'th character into S. S is passed by -// reference (therefore is modified). -// + #define Insert(str *S, int Index, str Substr) \ Index > Len(S) + 1 ? \ S : \ S = Copy(S, 1, Index - 1) + SubStr + Copy(S, Index) -// -// YesNo, IsDirSet -// -// Returns nonzero value if given string is "yes", "true" or "1". Intended to -// be used with SetupSetting function. This macro replaces YesNo function -// available in previous releases. -// + #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) -// -#ifdef CStrings +#define SameText(str S1, str S2) \ + LowerCase(S1) == LowerCase(S2) + +#define SameStr(str S1, str S2) \ + S1 == S2 + +#define WarnRenamedVersion(str OldName, str NewName) \ + Warning("Function """ + OldName + """ has been renamed. Use """ + NewName + """ instead.") + +#define ParseVersion(str FileName, *Major, *Minor, *Rev, *Build) \ + WarnRenamedVersion("ParseVersion", "GetVersionComponents"), \ + GetVersionComponents(FileName, Major, Minor, Rev, Build) + +#define GetFileVersion(str FileName) \ + WarnRenamedVersion("GetFileVersion", "GetVersionNumbersString"), \ + GetVersionNumbersString(FileName) + +#ifdef DisablePOptP # pragma parseroption -p- #endif -#endif -; END ISPPBUILTINS.ISS +#ifdef EnableOptE +# pragma option -e+ +#endif +#endif \ No newline at end of file diff --git a/buildtools/Setup.e32 b/buildtools/Setup.e32 index e3e9107..7fcf47c 100644 Binary files a/buildtools/Setup.e32 and b/buildtools/Setup.e32 differ diff --git a/buildtools/SetupLdr.e32 b/buildtools/SetupLdr.e32 index d3e577c..9bf36ba 100644 Binary files a/buildtools/SetupLdr.e32 and b/buildtools/SetupLdr.e32 differ diff --git a/buildtools/iscc.exe b/buildtools/iscc.exe index 498c5e6..37c6e1b 100644 Binary files a/buildtools/iscc.exe and b/buildtools/iscc.exe differ diff --git a/buildtools/islzma.dll b/buildtools/islzma.dll index fba2bf8..81fd05a 100644 Binary files a/buildtools/islzma.dll and b/buildtools/islzma.dll differ diff --git a/buildtools/zip.exe b/buildtools/zip.exe index ee3a4c6..aff7be8 100644 Binary files a/buildtools/zip.exe and b/buildtools/zip.exe differ