NSIS Users Manual - documentation.help · Appendix F: Changelog and Release Notes 3.02 Changelog...

Post on 13-May-2020

22 views 0 download

Transcript of NSIS Users Manual - documentation.help · Appendix F: Changelog and Release Notes 3.02 Changelog...

NSISUsersManualCheckhttp://nsis.sf.netfornews,information,support,examples,tutorialsandmore.

Quicklinks:FAQ-AlistoffrequentlyaskedquestionsNSISWiki-Examples,functions,tutorials,plug-ins,softwareandmoreForum-PostquestionsordiscussNSISfeatures

Copyright(C)1999-2017Contributors

Chapter1:IntroductiontoNSISAboutNSISMainFeaturesFeatureListUnicodeinstallers

Chapter2:Tutorial:TheBasicsIntroductionScriptFilesScriptingstructure

InstallerAttributesPagesSectionsFunctionsWorkingwithScripts

LogicalCodeStructuresVariablesDebuggingScripts

ScriptExecutionCompilerCommands

CompilerModernUIPlug-insMore

Chapter3:CommandLineUsageMakeNSISUsage

Options

NotesEnvironmentvariablesExamples

InstallerUsageCommonOptionsUninstallerSpecificOptionsExamples

Chapter4:ScriptingReferenceScriptFileFormatVariables

UserVariablesVar

OtherWritableVariablesConstantsConstantsUsedinStrings

LabelsRelativeJumpsPages

OrderingPageOptionsCallbacksPageUninstPagePageExPageExEndPageCallbacks

SectionsSectionCommands

AddSizeSectionSectionEndSectionInSectionGroupSectionGroupEnd

UninstallSectionFunctions

FunctionCommandsFunctionFunctionEnd

CallbackFunctionsInstallCallbacks

.onGUIInit

.onInit

.onInstFailed

.onInstSuccess

.onGUIEnd

.onMouseOverSection

.onRebootFailed

.onSelChange

.onUserAbort

.onVerifyInstDirUninstallCallbacks

un.onGUIInitun.onInitun.onUninstFailedun.onUninstSuccessun.onGUIEndun.onRebootFailedun.onSelChangeun.onUserAbort

InstallerAttributesGeneralAttributes

AddBrandingImageAllowRootDirInstallAutoCloseWindowBGFontBGGradientBrandingTextCaptionChangeUICheckBitmapCompletedTextComponentTextCRCCheckDetailsButtonTextDirTextDirVarDirVerify

FileErrorTextIconInstallButtonTextInstallColorsInstallDirInstallDirRegKeyInstProgressFlagsInstTypeLicenseBkColorLicenseDataLicenseForceSelectionLicenseTextManifestDPIAwareManifestSupportedOSMiscButtonTextNameOutFileRequestExecutionLevelSetFontShowInstDetailsShowUninstDetailsSilentInstallSilentUnInstallSpaceTextsSubCaptionUninstallButtonTextUninstallCaptionUninstallIconUninstallSubCaptionUninstallTextWindowIconXPStyle

CompilerFlagsAllowSkipFilesFileBufSizeSetCompressSetCompressorSetCompressorDictSizeSetDatablockOptimize

SetDateSaveSetOverwriteUnicode

VersionInformationVIAddVersionKeyVIProductVersionVIFileVersion

InstructionsBasicInstructions

DeleteExecExecShellExecShellWaitExecWaitFileRenameReserveFileRMDirSetOutPath

Registry,INI,FileInstructionsDeleteINISecDeleteINIStrDeleteRegKeyDeleteRegValueEnumRegKeyEnumRegValueExpandEnvStringsFlushINIReadEnvStrReadINIStrReadRegDWORDReadRegStrWriteINIStrWriteRegBinWriteRegDWORDWriteRegStrWriteRegExpandStrWriteRegMultiStrSetRegView

GeneralPurposeInstructionsCallInstDLLCopyFilesCreateDirectoryCreateShortcutGetDLLVersionGetDLLVersionLocalGetFileTimeGetFileTimeLocalGetFullPathNameGetTempFileNameSearchPathSetFileAttributesRegDLLUnRegDLL

FlowControlInstructionsAbortCallClearErrorsGetCurrentAddressGetFunctionAddressGetLabelAddressGotoIfAbortIfErrorsIfFileExistsIfRebootFlagIfSilentIntCmpIntCmpUMessageBoxReturnQuitSetErrorsStrCmpStrCmpS

FileInstructionsFileCloseFileOpen

FileReadFileReadUTF16LEFileReadByteFileReadWordFileSeekFileWriteFileWriteUTF16LEFileWriteByteFileWriteWordFindCloseFindFirstFindNext

UninstallerInstructionsWriteUninstaller

MiscellaneousInstructionsGetErrorLevelGetInstDirErrorInitPluginsDirNopSetErrorLevelSetShellVarContextSleep

StringManipulationInstructionsStrCpyStrLen

StackSupportExchPopPush

IntegerSupportIntFmtIntOp

RebootInstructionsRebootSetRebootFlag

InstallLoggingInstructionsLogSetLogText

SectionManagement

SectionSetFlagsSectionGetFlagsSectionSetTextSectionGetTextSectionSetInstTypesSectionGetInstTypesSectionSetSizeSectionGetSizeSetCurInstTypeGetCurInstTypeInstTypeSetTextInstTypeGetText

UserInterfaceInstructionsBringToFrontCreateFontDetailPrintEnableWindowFindWindowGetDlgItemHideWindowIsWindowLockWindowSendMessageSetAutoCloseSetBrandingImageSetDetailsViewSetDetailsPrintSetCtlColorsSetSilentShowWindow

MultipleLanguagesInstructionsLoadLanguageFileLangStringLicenseLangString

MultipleLanguagesLanguageSelectionLangDLLPlug-inRTLLanguages

Plug-inDLLs

UsingPlug-inCommandsCallingplug-insmanually

SilentInstallers/UninstallersChapter5:CompileTimeCommands

CompilerUtilityCommands!include!addincludedir!addplugindir!appendfile!cd!delfile!echo!error!execute!makensis!packhdr!finalize!system!tempfile!getdllversion!warning!pragma!verbose

Predefines${__COUNTER__}${__FILE__}${__FILEDIR__}${__LINE__}${__DATE__}${__TIME__}${__TIMESTAMP__}${NSIS_VERSION}${NSIS_PACKEDVERSION}${NSIS_CHAR_SIZE}${NSIS_PTR_SIZE}${U+1}...${U+10FFFF}ScopePredefines

${__GLOBAL__}${__SECTION__}

${__FUNCTION__}${__PAGEEX__}${__UNINSTALL__}${__MACRO__}

Readenvironmentvariables$%envVarName%

ConditionalCompilation!define!undef!ifdef!ifndef!if!ifmacrodef!ifmacrondef!else!endif!insertmacro!macro!macroend!macroundef!searchparse!searchreplace

AppendixA:ModernUserInterfaceAppendixB:DLL/TLBLibrarySetup

IntroductionLibraryInstallation

IntroductionParametersOptions

LIBRARY_X64LIBRARY_SHELL_EXTENSIONLIBRARY_COMLIBRARY_IGNORE_VERSION

NotesExample

UnsharedDLLSharedDLL

LibraryUninstallationIntroduction

ParametersOptions

LIBRARY_X64LIBRARY_SHELL_EXTENSIONLIBRARY_COM

ExampleVisualBasic6Run-TimeFiles

AppendixC:UsefulScriptsGetInternetExplorerversionIs.NETFrameworkinstalled?IsMacromediaFlashPlayerinstalled?ConnecttotheInternetGetInstallerFilenamePreventMultipleInstancesMore

AppendixD:UsefulInformationErrorLevelsAdduninstallinformationtoAdd/RemoveProgramsCallinganexternalDLLusingtheSystem.dllplug-inDumpContentofLogWindowtoFileHowtoReadREG_MULTI_SZValuesPredefinedMacrosforUnicodesupport

AppendixE:UsefulHeadersFileFunctionsHeader

IntroductionLocateGetSizeDriveSpaceGetDrivesGetTimeGetFileAttributesGetFileVersionGetExeNameGetExePathGetParametersGetOptionsGetOptionsSGetRootGetParent

GetFileNameGetBaseNameGetFileExtBannerTrimPathDirStateRefreshShellIcons

TextFunctionsHeaderIntroductionLineFindLineReadFileReadFromEndLineSumFileJoinTextCompareTextCompareSConfigReadConfigReadSConfigWriteConfigWriteSFileRecodeTrimNewLines

WordFunctionsHeaderIntroductionWordFindWordFindSWordFind2XWordFind2XSWordFind3XWordFind3XSWordReplaceWordReplaceSWordAddWordAddSWordInsertWordInsertSStrFilterStrFilterSVersionCompareVersionConvert

AppendixF:ChangelogandReleaseNotes3.02

ChangelogMajorChangesMinorChangesTranslations

3.01Changelog

MajorChangesMinorChangesTranslations

3.0ReleaseNotesChangelog

MinorChangesTranslations

3.0ReleaseCandidate2Changelog

MajorChangesMinorChangesTranslations

3.0ReleaseCandidate1Changelog

MajorChangesMinorChangesTranslations

3.0Beta3Changelog

MajorChangesMinorChangesTranslations

3.0Beta2Changelog

MajorChangesMinorChangesBuildSystem

3.0Beta1ReleaseNotesChangelog

MajorChangesMinorChangesTranslations

3.0Beta0ReleaseNotesChangelog

MajorChangesMinorChanges

3.0Alpha2ReleaseNotes

KnownIssuesChangelog

MajorChangesMinorChanges

3.0Alpha1ReleaseNotes

KnownIssuesChangelog

MajorChangesMinorChanges

3.0Alpha0ReleaseNotes

KnownIssuesChangelog

MajorChangesMinorChangesTranslations

2.51Changelog

MinorChangesTranslations

2.50Changelog

MajorChangesMinorChanges

2.49Changelog

2.48Changelog

2.47ReleaseNotesChangelog

MajorChangesMinorChanges

2.46Changelog

MinorChangesTranslationsBuildSystem

2.45ReleaseNotesChangelog

MajorChangesMinorChangesModernUITranslationsBuildSystem

2.44Changelog

MajorChangesMinorChanges

2.43ReleaseNotesChangelog

MinorChangesUtilitiesandPlug-insTranslationsPlug-inAPIBuildSystem

2.42ReleaseNotesChangelog

MajorChangesMinorChangesTranslationsBuildSystem

2.41Changelog

MinorChangesTranslationsBuildSystem

2.40Changelog

MajorChangesMinorChangesTranslations

2.39Changelog

MajorChangesMinorChanges

2.38Changelog

MajorChangesMinorChangesModernUITranslations

2.37Changelog

MajorChangesMinorChangesUtilitiesandPlug-insTranslationBuildSystem

2.36ReleaseNotesChangelog

MajorChangesModernUInsDialogsMinorChangesUtilitiesandPlug-insTranslationBuildSystem

2.35Changelog

MajorChangesMinorChanges

UtilitiesandPlug-ins2.34

ReleaseNotesChangelog

MajorChangesMinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.33ReleaseNotesChangelog

MajorChangesMinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.32ReleaseNotesChangelog

MajorChangesMinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.31ReleaseNotesChangelog

MinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.30ReleaseNotesChangelog

MajorChangesMinorChangesUtilitiesandPlug-insTranslations

BuildSystem2.29

ReleaseNotesChangelog

MajorChangesMinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.28Changelog

MajorChangesMinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.27ReleaseNotesChangelog

MajorChangesMinorChangesBuildSystem

2.26ReleaseNotesChangelog

MajorChangesMinorChangesNew/ChangedCommandsUtilitiesandPlug-insTranslationsBuildSystem

2.25Changelog

MajorChangesMinorChangesNew/ChangedCommandsUtilitiesandPlug-insTranslationsBuildSystem

2.24Changelog

MajorChangesMinorChangesNew/ChangedCommandsUtilitiesandPlug-insTranslationsBuildSystem

2.23Changelog

MinorChangesUtilitiesandPlug-insBuildSystem

2.22ReleaseNotesChangelog

MinorChangesNew/ChangedCommandsTranslationsBuildSystem

2.21Changelog

MajorChangesMinorChangesNew/ChangedCommandsTranslationsBuildSystem

2.20Changelog

MinorChangesTranslationsBuildSystem

2.19Changelog

MinorChangesNew/ChangedCommandsPlug-insTranslations

2.18

ChangelogMinorChangesTranslations

2.17Changelog

MinorChangesTranslations

2.16ReleaseNotesChangelog

MajorChangesNew/ChangedCommandsMinorChangesTranslationsBuildSystem

2.15Changelog

New/ChangedCommandsMinorChangesTranslationsBuildSystem

2.14ReleaseNotesChangelog

MajorChangesMinorChanges

2.13ReleaseNotesChangelog

MajorChangesNew/ChangedCommandsMinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.12Changelog

MajorChangesNew/ChangedCommands

MinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.11ReleaseNotesChangelog

MajorChangesNew/ChangedCommandsMinorChangesUtilitiesandPlug-insTranslationsBuildSystem

2.10Changelog

MajorChangesMinorChangesTranslationsBuildSystem

2.09Changelog

MajorChangesNew/ChangedCommandsMinorChangesTranslationsBuildSystem

2.08ReleaseNotesChangelog

MajorChangesMinorChangesBuildSystem

2.07ReleaseNotesChangelog

MajorChangesNew/ChangedCommandsMinorChangesIncludeFiles

UtilitiesandPlug-insTranslations

2.06Changelog

MajorChangesNew/ChangedCommandsMinorChangesUtilitiesandPlug-ins

2.05ReleaseNotesChangelog

New/ChangedCommandsMinorChanges

2.04Changelog

MajorChangesMinorChanges

2.03ReleaseNotesChangelog

MajorChangesNew/ChangedCommandsMinorChanges

2.02Changelog

MajorChangesNew/ChangedCommandsMinorChangesUtilitiesandPlug-ins

2.01ReleaseNotesChangelog

MajorChangesNew/ChangedCommandsMinorChangesUtilitiesandPlug-ins

2.0ReleaseNotesChangelog

Changesfrom1.98ChangesfromRC4

2.0ReleaseCandidate4Changelog

MajorChangesMinorChangesUtilitiesandPlug-ins

2.0ReleaseCandidate3Changelog

MinorChangesUtilitiesandPlug-ins

2.0ReleaseCandidate2Changelog

MinorChangesUtilitiesandPlug-ins

2.0ReleaseCandidate1ReleaseNotesChangelog

MajorChangesUtilitiesandPlug-ins

2.0Beta4ReleaseNotesChangelog

MajorChangesNew/ChangedCommandsMinorChangesUtilitiesandPlug-ins

2.0Beta32.0Beta22.0Beta12.0Beta02.0Alpha72.0Alpha62.0Alpha52.0Alpha42.0Alpha32.0Alpha22.0Alpha12.0Alpha0

OlderVersionsAppendixG:BuildingNSIS

BuildinginGeneralBuildingonWindowsBuildingonPOSIXNightlyBuilds

AppendixH:CreditsProgrammersTestersDesignersTranslatorsWriters

AppendixI:LicenseCopyrightApplicablelicenseszlib/libpnglicensebzip2licenseCommonPublicLicenseversion1.0SpecialexceptionforLZMAcompressionmodule

Previous|Contents|Next

Chapter1:IntroductiontoNSISAboutNSISMainFeaturesFeatureListUnicodeinstallers

Previous|Contents|Next

Previous|Contents|Next

Chapter2:Tutorial:TheBasicsIntroductionScriptFilesScriptingstructure

InstallerAttributesPagesSectionsFunctionsWorkingwithScriptsScriptExecutionCompilerCommands

CompilerModernUIPlug-insMore

Previous|Contents|Next

Previous|Contents|Next

Chapter3:CommandLineUsageMakeNSISUsage

OptionsNotesEnvironmentvariablesExamples

InstallerUsageCommonOptionsUninstallerSpecificOptionsExamples

Previous|Contents|Next

Previous|Contents|Next

Chapter4:ScriptingReferenceScriptFileFormatVariables

UserVariablesOtherWritableVariablesConstantsConstantsUsedinStrings

LabelsRelativeJumpsPages

OrderingPageOptionsCallbacksPageUninstPagePageExPageExEndPageCallbacks

SectionsSectionCommandsUninstallSection

FunctionsFunctionCommandsCallbackFunctions

InstallerAttributesGeneralAttributesCompilerFlagsVersionInformation

InstructionsBasicInstructionsRegistry,INI,FileInstructionsGeneralPurposeInstructionsFlowControlInstructionsFileInstructionsUninstallerInstructionsMiscellaneousInstructionsStringManipulationInstructions

StackSupportIntegerSupportRebootInstructionsInstallLoggingInstructionsSectionManagementUserInterfaceInstructionsMultipleLanguagesInstructions

MultipleLanguagesLanguageSelectionLangDLLPlug-inRTLLanguages

Plug-inDLLsUsingPlug-inCommandsCallingplug-insmanually

SilentInstallers/Uninstallers

Previous|Contents|Next

Previous|Contents|Next

Chapter5:CompileTimeCommandsCompilerUtilityCommands

!include!addincludedir!addplugindir!appendfile!cd!delfile!echo!error!execute!makensis!packhdr!finalize!system!tempfile!getdllversion!warning!pragma!verbose

Predefines${__COUNTER__}${__FILE__}${__FILEDIR__}${__LINE__}${__DATE__}${__TIME__}${__TIMESTAMP__}${NSIS_VERSION}${NSIS_PACKEDVERSION}${NSIS_CHAR_SIZE}${NSIS_PTR_SIZE}${U+1}...${U+10FFFF}ScopePredefines

Readenvironmentvariables$%envVarName%

ConditionalCompilation

!define!undef!ifdef!ifndef!if!ifmacrodef!ifmacrondef!else!endif!insertmacro!macro!macroend!macroundef!searchparse!searchreplace

Previous|Contents|Next

Previous|Contents|Next

1.1AboutNSISTheinstallerisyourapplication'sfirstimpression.Sloworunsuccessfulsoftwareinstallationsisoneofthemostirritatingcomputerproblems.Aquickanduserfriendlyinstalleristhereforeanessentialpartofyoursoftwareproduct.NSIS(NullsoftScriptableInstallSystem)isatoolthatallowsprogrammerstocreatesuchinstallersforWindows.Itisreleasedunderanopensourcelicenseandiscompletelyfreeforanyuse.

NSIScreatesinstallersthatarecapableofinstalling,uninstalling,settingsystemsettings,extractingfiles,etc.Becauseit'sbasedonscriptfilesyoucanfullycontroleverypartofyourinstaller.Thescriptinglanguagesupportsvariables,functionsandstringmanipulation,justlikeanormalprogramminglanguage-butdesignedforthecreationofinstallers.Evenwithallthesefeatures,NSISisstillthesmallestinstallersystemavailable.Withthedefaultoptions,ithasanoverheadofonly34KB.

WithNSIS3youcanalsocreateUnicodeinstallers,targetingallthelanguagessupportedbytheOSwithoutdisplayissues.

Previous|Contents|Next

Previous|Contents|Next

1.2MainFeaturesSmalloverheadsize

NSIShasbeendesignedtobesmall,fastandefficient.Whileotherinstallersoftenaddhundredsofkilobytesorseveralmegabytestoyourinstallerdata,afullyfeaturedNSISinstallerhasaoverheadofonly34KB.

CompatiblewithallmajorWindowsversions

YoucancreateasingleinstallerthatiscompatiblewithWindows95,98,ME,NT4,2000,XP,2003,Vista,Server2008,7,Server2008R2,8,Server2012,8.1,Server2012R2andWindows10.

Uniquecompressionmethods

Youcanchoosebetweenthreedifferentintegratedcompressionmethods(ZLib,BZip2,LZMA).LZMAcompressiongivesbetterresultsthananyothercommoncompressionmethod.Youdon'thavetouselargeself-extractingarchivemodulesorotherapplications,thecompressionsupportisincludedinthe34KBoverhead.

Scriptbased

Unlikeothersystemsthatcanonlygenerateinstallersbasedonalistoffilesandregistrykeys,NSIShasapowerfulscriptinglanguage.Thisscriptlanguageisdesignedforinstallersandhascommandsthathelpyoutoperformmanyinstallationtasks.Youcaneasilyaddcustomlogicandhandledifferentupgrades,versionchecksandmore.OntheNSISWikiyoucanfindalotmore.

Multiplelanguagesinoneinstaller

Oneinstallercansupportmultipleinterfacelanguages.Morethan60translationsarealreadyincludedandyoucanalsocreateyourownlanguagefiles.RTL(right-to-left)languagessuchasArabicandHebrewarefullysupported.CreatingaUnicodenativeinstallerisalsopossiblefor

evenmoresupportedlanguages.

Manyfeaturesandchecksforthetargetsystem

Thescriptlanguageprovidescommandsyoucanuseonthetargetsystem.Fromsimplefeatureslikefoldercreationandregistryeditingtotext/binaryfilemodification,modificationofenvironmentvariablesandsystemreboots.Byusingoneoftheprovidedplug-insyoucanevencalltheWindowsAPIdirectly.

Customdialogsandinterfaces

Youcancreatecustomwizardpagestogetuserinputorintegrateconfigurationoptions.NSISincludesaclassicandmodernwizardinterface,butitisevenpossibletocreateyourowncustominterface.

Plug-insystem

NSIScanbeextendedwithplug-insthatcancommunicatewiththeinstaller.TheycanbewritteninC,C++,Delphioranotherlanguageandcanbeusedtoperforminstallationtasksorextendtheinstallerinterface.Youcanusetheplug-inwithasinglelineofscriptcode.Plug-insarealsobecompressedlikeotherinstallationdataandwillonlybeincludedwhenyouareusingtheirfeatures.

Supportforwebinstallation,filepatching

TheNSISdistributionincludesasetofplug-insthatallowyoutodownloadfilesfromtheinternet,makeinternetconnections,patchexistingfilesandmore.

Projectintegration,differentreleasesandautomaticbuilds

TheNSIScompilerfeaturesapowerfulpreprocessor.Thisallowsyoutoeasilyintegratemultipleprojectsintoasingleinstallerorautomaticallygenerateinstallerbuilds.Youcanalsogeneratedifferentreleasessuchasliteandfullversions.

Easyandhumanreadablefileformats

TheNSISscriptformatandtheformatusedforinterfacedialogsareeasy,documentedandhumanlyreadable,soyoucanedityourfileswithyourfavoriteeditor.Thisalsomakesautomaticscriptgenerationpossible.

Previous|Contents|Next

Previous|Contents|Next

1.3FeatureListGeneratesselfcontainedexecutableinstallersSupportforZLIB,BZIP2andLZMAdatacompression(filescanbecompressedindividuallyortogether)Uninstallsupport(installercangenerateanuninstaller)Customizableuserinterface(dialogs,fonts,backgrounds,icons,text,checkmarks,imagesetc.)ClassicandModernwizardinterfaceFullymultilingual,supportformultiplelanguagesinoneinstaller.Morethan60translationsareavailable,butyoucanalsocreateyourown.Unicodesupportallowingevenmorelanguages.Pagesystem:YoucanaddstandardwizardpagesorcustompagesUserselectionofinstallationcomponents,treeforcomponentselectionMultipleinstallconfigurations(usuallyMinimal,Typical,Full),andcustomconfigurationInstallerself-verificationusingaCRC32checksumSmalloverheadovercompresseddatasize(34KBwithdefaultoptions)AbilitytodisplayalicenseagreementintextorRTFformatAbilitytodetectdestinationdirectoryfromtheregistryEasytouseplug-insystem(lotsofplug-insforcreationofcustomdialogs,internetconnections,HTTPdownloading,filepatching,Win32APIcallsetc.areincluded)Installerscanbeaslargeas2GBOptionalsilentmodeforautomatedinstallationsApreprocessorwithsupportfordefinedsymbols,macro's,conditionalcompilation,standardpredefinesAlovelycodingexperiencewithelementsofPHPandassembly(includesuservariables,astack,realflowcontrol,etc.)InstallershavetheirownVMsthatletyouwritecodethatcansupport:

Fileextraction(withconfigurableoverwriteparameters)File/directorycopying,renaming,deletion,searchingPlug-inDLLcalling

DLL/ActiveXcontrolregistration/deregistrationExecutableexecution(shellexecuteandwaitoptions)ShortcutcreationRegistrykeyreading/setting/enumerating/deletingINIfilereading/writingGenerictextfilereading/writingPowerfulstringandintegermanipulationWindowfindingbasedonclassnameortitleUserinterfacemanipulation(font/textsetting)WindowmessagesendingUserinteractionwithmessageboxesorcustompagesBranching,comparisons,etc.ErrorcheckingRebootsupport,includingdeleteorrenameonrebootInstallerbehaviourcommands(suchasshow/hide/wait/etc)UserfunctionsinscriptCallbackfunctionsforuseractions

Completelyfreeforanyuse.Seelicense.

Previous|Contents|Next

Previous|Contents|Next

1.4UnicodeinstallersStartingwithNSISv3.0youcanchoosetocreateUnicodeinstallersbysettingtheUnicodeattribute.TheseinstallerswillnotworkonWindows95/98/MEbuttheywillallowyoutodisplayyourinstallerinanyUnicodelanguagesupportedbytheOS.

WhenbuildingaUnicodeinstallerNSISvariablescanholdUnicodecharacters(0001-FFFF).Thereshouldbenoneedtomodifyyourexistingscripts.Ifyouwanttoread/writeUnicodefiles,specificinstructionshavebeenaddedtoread/writeUTF-16LEstringsfrom/todisk.

Previous|Contents|Next

Previous|Contents|Next

2.1IntroductionMostsoftwarepackagesyoudownloadorbuycomewithaninstaller.Theinstallercopiesand/orupdatesfiles,writesregistrykeys,writesconfiguration,createsshortcuts,etc.Allofthisisdoneautomaticallyfortheuser.Alltheuserneedstodoissupplysomeinformationandtheinstallerwilldotherest.Theusergoesthroughawizard,makestheappropriatechoicesandwaitsuntiltheinstallerfinishes.Aftertheinstallerhasfinishedtheuserisleftonlywiththesimpletaskofstartingtheprogram.Theuserdoesn'thavetoworryaboutthingshemighthaveforgottenbecauseallofthenecessarystepsweredonebytheinstaller.

NSISisatoolfordeveloperstocreatesuchinstallers.NSISallowsyoutocreateeverythingfrombasicinstallersthatjustcopiesfilestoverycomplexinstallersthathandlealotofadvancedtaskssuchaswritingregistrykeys,settingsenvironmentvariables,downloadingthelatestfilesfromtheinternet,customizingconfigurationfilesandmore.NSISisveryflexibleanditsscriptinglanguageiseasytolearn.

NSIScompilesallofthefilesandtheinstallationscriptintooneexecutablefilesoyourapplicationwillbeeasytodistribute.NSISaddsonlyabout34KBofcodeofitsown(forthedefaultconfiguration)tothedata.NSISboaststhesmallestoverheadavailablewhilestillprovidingalotofoptionsthankstoitspowerfulscriptinglanguageandsupportofexternalplug-ins.

Previous|Contents|Next

Previous|Contents|Next

2.2ScriptFilesTocreateaNSISinstalleryoufirsthavetowriteaNSISscript.ANSISscriptisjustaregulartextfilewithaspecialsyntax.Youcaneditscriptswithanytexteditor.It'srecommendedtouseatexteditorthatshowslinenumbersbecauseNSISuseslinenumberstoindicatewhereerrorslie,andtowarnyouaboutwhereerrorsmightlie.Aneditorthatsupportssyntaxhighlightingisalsorecommended.YoucandownloadeditorsmadeespeciallyforNSISandfilesforsyntaxhighlightingfromtheNSISWiki.

InaNSISscripteverylineistreatedasacommand.Ifyourcommandistoolongforonelineyoucanuseaback-slash-'\'-attheendoftheline.Thecompilerwilltreatthenewlineasanadditiontothepreviouslineandwillnotexpectanewcommand.Forexample:

MessageboxMB_OK|MB_ICONINFORMATION\"ThisisasamplethatshowshowtouselinebreaksforlargercommandsinNSISscripts"

Ifyouwanttouseadouble-quoteinastringyoucaneitheruse$\"toescapethequoteorquotethestringwithadifferenttypeofquotesuchas`or'.

Formoredetailsaboutthescriptformat,seeScriptFileFormat.

Thedefaultextensionforascriptfileis.nsi.Headerfileshavethe.nshextension.Headerfilescanhelpyouarrangeyourscriptbydividingittomorethanoneblockofcode,youcanalsoputfunctionsormacrosinheaderfilesandincludetheheaderfilesinmultipleinstallers.Thismakesupdatingeasieranditalsomakesyourscriptseasiertoread.Toincludeaheaderfileinyourscriptuse!include.HeaderfilesthatresideintheIncludedirectoryunderyourNSISdirectorycanbeincludedjustbytheirname.Forexample:

!includeSections.nsh

Previous|Contents|Next

Previous|Contents|Next

2.3ScriptingstructureANSISscriptcontainsInstallerAttributes,PagesandSections/Functions.YoucanalsouseCompilerCommandsforcompile-timeoperations.TheOutFileinstructionisrequiredandtellsNSISwheretowritetheinstaller,youalsoneedatleastonesection.

2.3.1InstallerAttributes

InstallerAttributesdeterminethebehaviorandthelookandfeelofyourinstaller.Withtheseattributesyoucanchangetextsthatwillbeshownduringtheinstallation,thenumberofinstallationtypesetc.Mostofthesecommandscanonlybesetandarenotchangeableduringruntime.

OtherbasicinstructionsareNameandInstallDir.

Formoreinformationaboutinstallerattributes,havealookatInstallerAttributes.

2.3.2Pages

Anon-silentinstallerhasasetofwizardpagestolettheuserconfiguretheinstaller.YoucansetwhichpagestodisplayusingthePagecommand(orPageExformoreadvancedsettings).Atypicalsetofpageslookslikethis:

PagelicensePagecomponentsPagedirectoryPageinstfilesUninstPageuninstConfirmUninstPageinstfiles

Fortheinstaller,thistypicalsetofpageswilldisplayalicenseagreement,allowselectionofcomponentstoinstall,allowselectionofaninstallationdirectory,andfinallyinstalltheselectedcomponentsintheinstfilespage.Fortheuninstaller,itwilldisplayaconfirmationpage,anduninstallinthe

instfilespage.

2.3.3Sections

It'scommonforinstallerstohaveseveralthingstheusercaninstall.ForexampleintheNSISdistributioninstalleryoucanchoosetoinstalladditionaltools,plug-ins,examplesandmore.Eachofthesecomponentshasitsownpieceofcode.Iftheuserselectstoinstallthiscomponentthentheinstallerwillexecutethatcode.Inthescript,thatcodeisdefinedinsections.Eachsectioncorrespondstoonecomponentonthecomponentspage.Thesection'snameisthedisplayedcomponentnameandthesectioncodewillbeexecutedifthatcomponentisselected.Itispossibletobuildyourinstallerwithonlyonesectionbutifyouwanttousethecomponentspageandlettheuserchoosewhattoinstall,you'llhavetousemorethanonesection.

Uninstallerscanalsohavemultiplesections.Uninstallersectionnamesareprefixedwith'un.'.Forexample:

Section"InstallerSection"SectionEnd

Section"un.UninstallerSection"SectionEnd

Theinstructionsthatcanbeusedinsectionsareverydifferentfromtheinstallerattributesinstructions,theyareexecutedatruntimeontheuser'scomputer.Thoseinstructionscanextractfiles,readfromandwritetotheregistry,INIfilesornormalfiles,createdirectories,createshortcutsandalotmore.YoucanfindoutmoreinInstructions.

ThemostbasicinstructionsareSetOutPathwhichtellstheinstallerwheretoextractfilesandFilewhichextractsfiles.

Example:

Section"MyProgram"SetOutPath$INSTDIRFile"MyProgram.exe"

File"Readme.txt"SectionEnd

FormoreinformationaboutsectionsseeSections.

2.3.4Functions

Functionscancontainscriptcode,justlikesections.Thedifferencebetweensectionsandfunctionsisthewaytheyarecalled.Therearetwotypesoffunctions,userfunctionsandcallbackfunctions.

UserfunctionsarecalledbytheuserfromwithinsectionsorotherfunctionsusingtheCallinstruction.Userfunctionswillnotexecuteunlessyoucallthem.AfterthecodeinthefunctionhasexecutedtheinstallerwillcontinueexecutingtheinstructionsthatcameaftertheCallinstruction,unlessyouhaveabortedtheinstallationinsidethefunction.Userfunctionsareveryusefulifyouhaveasetofinstructionsthatneedtobeexecutedatseverallocationsintheinstallers.Ifyouputthecodeintoafunctionyoucansavethecopyingtimeandyoucanmaintainthecodemoreeasily.

Callbackfunctionsarecalledbytheinstalleruponcertaindefinedeventssuchaswhentheinstallerstarts.Callbacksareoptional.Ifforexampleyouwanttowelcometheusertoyourinstalleryoucandefineafunctioncalled.onInit.TheNSIScompilerwillrecognizethisfunctionasacallbackfunctionbythenameandwillcallitwhentheinstallerstarts.

Function.onInitMessageBoxMB_YESNO"ThiswillinstallMyProgram.Doyouwishtocontinue?"IDYESgogogoAbortgogogo:FunctionEnd

Aborthasaspecialmeaningincallbackfunctions.Eachcallbackfunctionhasitsownmeaningforit,havealookatCallbackFunctionsformoreinformation.IntheaboveexampleAborttellstheinstallertostopinitializingtheinstallerandquitimmediately.

FormoreinformationaboutfunctionsseeFunctions.

2.3.5WorkingwithScripts

2.3.5.1LogicalCodeStructures

Conditionallyexecutingcode,orexecutingcodeinaloopcanbedoneusingStrCmp,IntCmp,IfErrors,Gotoandmore.However,there'samucheasierwaydothis.TheLogicLibprovidessomeverysimplemacrosthatalloweasyconstructionofcomplexlogicalstructures.Itssyntax,explainedinLogicLib.nsh,issimilartootherprogramminglanguagesandcanprovetobesimplerforbeginnersandadvancedusersalike.

Forexample,checkingavalueofavariablewithouttheLogicLibcanbedoneasfollows.

StrCmp$0'somevalue'0+3MessageBoxMB_OK'$$0issomevalue'GotodoneStrCmp$0'someothervalue'0+3MessageBoxMB_OK'$$0issomeothervalue'Gotodone#elseMessageBoxMB_OK'$$0is"$0"'done:

However,withtheLogicLibthecodeismuchmorereadableandeasytounderstand,ascanbeseeninthefollowingexample.

${If}$0=='somevalue'MessageBoxMB_OK'$$0issomevalue'${ElseIf}$0=='someothervalue'MessageBoxMB_OK'$$0issomeothervalue'${Else}MessageBoxMB_OK'$$0is"$0"'${EndIf}

Thesamecanalsobedoneusingaswitch,asshowninthefollowingexample.

${Switch}$0${Case}'somevalue'MessageBoxMB_OK'$$0issomevalue'${Break}${Case}'someothervalue'MessageBoxMB_OK'$$0issomeothervalue'${Break}${Default}MessageBoxMB_OK'$$0is"$0"'${Break}${EndSwitch}

Multipleconditionsarealsosupported.Thefollowingexamplewillnotifytheuser,ifboth$0and$1areempty.

${If}$0==''${AndIf}$1==''MessageBoxMB_OK|MB_ICONSTOP'bothareempty!'${EndIf}

TheLogicLibremovestheneedforlabelsandrelativejumps,thuspreventslabelnameconflicts,andremovestheneedtomanuallyadjustrelativejumpoffsetseverytimethescriptischanged.

Italsosimplifiesloopingbysupportingthecommonwhile,doandforloops.AllofthefollowingexamplescounttofiveusingtheLogicLib.

StrCpy$R10${While}$R1<5IntOp$R1$R1+1DetailPrint$R1${EndWhile}

${For}$R115DetailPrint$R1${Next}

StrCpy$R10

${Do}IntOp$R1$R1+1DetailPrint$R1${LoopUntil}$R1>=5

TousetheLogicLibthefollowinglineneedstobeaddednearthetopofthescript.

!includeLogicLib.nsh

MoreexamplescanbefoundinLogicLib.nsi.

2.3.5.2Variables

Youcandeclareyourownvariables($VARNAME)withtheVarcommand.VariablesareglobalandcanbeusedinanySectionorFunction.

Declaringandusingauservariable:

VarBLA;Declarethevariable

Sectionbla

StrCpy$BLA"123";Nowyoucanusethevariable$BLA

SectionEnd

Inadditionthereisastack,whichcanalsobeusedfortemporarystorage.ToaccessthestackusethecommandsPushandPop.Pushaddsavaluetothestack,Popremovesoneandsetsthevariable.

Forsharedcode,thereare20registersavailable(like$0and$R0).Thesestaticvariablesdon'thavetobedeclaredandyouwon'tgetanynameconflicts.Ifyouwanttousethesevariablesinsharedcode,storetheoriginalvaluesonthestackandrestoretheoriginalvaluesafterwards.

Aftercallingthefunction,thevariablescontainthesamevalueasbefore.Notetheorderwhenusingmultiplevariables(last-infirst-out):

Functionbla

Push$R0Push$R1

...code...

Pop$R1Pop$R0

FunctionEnd

2.3.5.3DebuggingScripts

ThemoreyouworkwithNSISthemorecomplexthescriptswillbecome.Thiswillincreasethepotentialofmistakes,especiallywhendealingwithlotsofvariables.Thereareafewpossibilitiestohelpyoudebuggingthecode.TodisplaythecontentsofvariablesyoushoulduseMessageBoxesorDetailPrint.Togetabriefoverviewaboutallvariablesyoushouldusetheplug-inDumpState.BydefaultallactionsoftheInstallerareprintedoutintheLogWindow.Youcanaccessthelogifyouright-clickintheLogWindowandselect"CopyDetailsToClipboard".Thereisalsoawaytowriteitdirectlytoafile,seehere.

2.3.6ScriptExecution

Whenauserrunsaninstalleroruninstaller,pagesaredisplayedintheordertheyweredefinedinthescript.Whentheinstfilespageisreached,sections,correspondingtotheselectedcomponents,areexecutedintheordertheyweredefinedinthescript.Ifthecomponentspageisnotdisplayed,allsectionsareexecuted,assumingtheywerenotunselectedorsomehowdisabledbythescript.

Besidecodeinsections,there'salsocodeincallbackfunctions.If

defined,theymightbeexecutedbeforethesectionscode.Forexample,the.onInitcallbackfunctionisexecutedbeforeanythingelseinthescript.Therearealsopagecallbackfunctionswhichareexecutedatcertainpointsofthepagedisplayprocess.

2.3.7CompilerCommands

Compilercommandswillbeexecutedatcompiletimeonyourcomputer.Theycanbeusedforconditionalcompilation,toincludeheaderfiles,toexecuteapplications,tochangetheworkingdirectoryandmore.Themostcommonusageisdefines.Definesarecompiletimeconstants.Youcandefineyourproduct'sversionnumberanduseitinyourscript.Forexample:

!defineVERSION"1.0.3"Name"MyProgram${VERSION}"OutFile"MyProgramInstaller-${VERSION}.exe"

FormoreinformationaboutdefinesseeConditionalCompilation.

Anothercommonuseismacros.Macrosareusedtoinsertcodeatcompiletime,dependingondefinesandusingthevaluesofthedefines.Themacro'scommandsareinsertedatcompiletime.Thisallowsyoutowriteageneralcodeonlyonceanduseitalotoftimesbutwithafewchanges.Forexample:

!macroMyFuncUNFunction${UN}MyFuncCall${UN}DoRegStuffReadRegStr$0HKLMSoftware\MyProgramkeyDetailPrint$0FunctionEnd!macroend

!insertmacroMyFunc""!insertmacroMyFunc"un."

Thismacrohelpsyouavoidwritingthesamecodeforboththeinstaller

andtheuninstaller.Thetwo!insertmacrosinserttwofunctions,onefortheinstallercalledMyFuncandonefortheuninstallercalledun.MyFuncandbothdoexactlythesamething.

FormoreinformationseeCompileTimeCommands.

Previous|Contents|Next

Previous|Contents|Next

2.4CompilerThesecondthingyouneedtodoinordertocreateyourinstallerafteryouhavecreatedyourscriptistocompileyourscript.MakeNSIS.exeistheNSIScompiler.Itreadsyourscript,parsesitandcreatesaninstallerforyou.

Tocompileyoucanright-clickyour.nsifileandselectCompileNSISScript.ThiswillcauseMakeNSISW,theNSISCompilerInterface,tolaunchandcallMakeNSIStocompileyourscript.MakeNSISWreceivestheoutputofMakeNSISandpresentsittoyouinawindowwhereyoucanseeit,copyit,testtheinstallerandmore.Usingmakensis.exefromthecommandpromptisalsopossible.

Thecompilerwillcheckyourscriptandgiveyouwarningsoranerror.Ifanerroroccurs(i.e.2parametersrequiredbutonly1given)thecompilerwillabortandashorterrormessageincludingthelinenumberwillbedisplayed.Fornon-criticalerrorsthecompilerwillgiveawarning(i.e.twoDirTextcommandsinonescript).Ifyourscripthasnoerrorsthecompilerwilloutputaninstallerforyoutodistribute.

NSISsupportsdifferentcompressionmethods,asexplainedhere.ZLIBisthedefaultcompressionmethod,whichisfastandusesonlyalittlebitofmemory.LZMAisagoodmethodforthecreationofsmallinstallersforinternetdistribution.BZIP2usuallycompressesbetterthanZLIBbutnotasgoodasLZMA,itisusefulifyouneedlowermemoryusageorfastscriptcompilation.

ItisalsopossibletocompileWindowsinstallersonLinux,BSDorMacOSXservers.SeeBuildingNSISfordetails.

Previous|Contents|Next

Previous|Contents|Next

2.5ModernUIApopularuserinterfaceforNSISistheModernUserInterface.IthasaninterfacelikethewizardsofrecentWindowsversions.TheModernUIisnotonlyacustomizedresourcefile,ithasalotsofnewinterfaceelements.Itfeaturesawhiteheadertodescribethecurrentstep,adescriptionareaonthecomponentpage,awelcomepage,afinishpagethatallowstheusertoruntheapplicationorrebootthesystemandmore.

Formoreinformation,seetheModernUI2ReadmeandtheModernUIExamples.

Previous|Contents|Next

Previous|Contents|Next

2.6Plug-insNSISsupportplug-insthatcanbecalledfromthescript.Plug-insareDLLfileswritteninC,C++,DelphioranotherprogramminglanguageandthereforeprovideamorepowerfulcodebasetoNSIS.

Aplug-incalllookslikethis:

DLLName::FunctionName"parameternumber1""parameternumber2""parameternumber3"

Everyplug-in'sfunctionhasitsownrequirementswhenitcomestoparameters,somewillrequirenone,somewillacceptasmanyparametersasyouwanttosend.Examples:

nsExec::ExecToLog'"${NSISDIR}\makensis.exe"/CMDHELP'Pop$0;Processexitcodeor"error"InstallOptions::dialog"$PLUGINSDIR\test.ini"Pop$0;success/back/cancel/errorNSISdl::downloadhttp://download.nullsoft.com/winamp/client/winamp291_lite.exe$R0Pop$0;"success"oraerrorcode

Theplug-insthatNSISknowsofarelistedatthetopofthecompileroutput(verboselevel4).NSISsearchesforplug-insinthePluginsfolderunderyourNSISdirectoryandlistsalloftheiravailablefunctions.Youcanuse!addplugindirtotellNSIStosearchinotherdirectoriestoo.

TheNSISdistributionalreadyincludesmanyplug-ins.InstallOptionsisapopularplug-inthatallowsyoutocreatecustompages,incombinationwiththeNSISPagecommands(SeePages).TheStartmenuplug-inprovidesapagethatallowstheusertochooseaStartMenufolder.Therearealotofplug-insfordifferentpurposes,takealookintheDocsfolderforhelpfilesandexamples.Youcanfindadditionalplug-insonline:NSISWiki.

Youcanalsocreateaplug-inyourself.C/C++andDelphiheaderfilesarealreadyavailable,seetheexamplepluginforhowtodothis.Sourcecodeofincludedplug-inscanalsobefoundinthesourcecodepackage.

Previous|Contents|Next

Previous|Contents|Next

2.7MoreThistutorialhasdescribedthebasicNSISfeatures,tolearnmoreabouteverythingNSIScando,takesometimetoreadtherestofthismanual.

Previous|Contents|Next

Previous|Contents|Next

3.1MakeNSISUsageNSISinstallersaregeneratedbyusingthe'MakeNSIS'programtocompileaNSISscript(.NSI)intoaninstallerexecutable.TheNSISdevelopmentkitinstallersetsupyourcomputersothatyoucancompilea.nsifilebysimplyright-clickingonitinExplorerandselecting'compile'.

IfyouwanttouseMakeNSISonthecommandline,thesyntaxofmakensisis:

makensis[option|script.nsi|-][...]

3.1.1Options

/LICENSEdisplayslicenseinformation.The/Vswitchfollowedbyanumberbetween0and4willsettheverbosityofoutputaccordingly.0=nooutput,1=errorsonly,2=warningsanderrors,3=info,warnings,anderrors,4=alloutput.The/Pswitchfollowedbyanumberbetween0and5willsetthepriorityofthecompilerprocessaccordingly.0=idle,1=belownormal,2=normal(default),3=abovenormal,4=high,5=realtime.The/Oswitchfollowedbyafilenametellsthecompilertoprintitslogtothatfile(insteadofthescreen)/PAUSEmakesmakensispausebeforequitting,whichisusefulwhenexecutingdirectlyfromWindows./NOCONFIGdisablesinclusionofnsisconf.nsh.Withoutthisparameter,installerdefaultsaresetfromnsisconf.nsh./CMDHELPprintsbasicusageinformationforcommand(ifspecified),orallcommands(ifcommandisnotspecified)./HDRINFOprintsinformationaboutwhichoptionswereusedtocompilemakensis./NOCDdisablesthecurrentdirectorychangetothatofthe.nsifile/INPUTCHARSETallowsyoutospecifyaspecificcodepageforfileswithoutaBOM.(ACP|OEM|CP#|UTF8|UTF16<LE|BE>)/OUTPUTCHARSETallowsyoutospecifythecodepageusedbystdoutwhentheoutputisredirected.(ACP|OEM|CP#|UTF8[SIG]|UTF16<LE|BE>[BOM])

/PPOor/SAFEPPOwillonlyrunthepreprocessorandprinttheresulttostdout.Thesafeversionwillnotexecuteinstructionslike!appendfileor!system.!packhdrand!finalizeareneverexecuted./WXtreatswarningsaserrorsUsingthe/Dswitchoneormoretimeswilladdtosymbolstothegloballydefinedlist(See!define).Usingthe/Xswitchoneormoretimeswillexecutethecodeyouspecifyfollowingit.Example:"/XAutoCloseWindowfalse"Specifyingadash(-)forthescriptnamewilltellmakensistousethestandardinputasasource.

3.1.2Notes

Parametersareprocessedinorder.makensis/Ddefscript.nsiisnotthesameasmakensisscript.nsi/Ddef.Ifmultiplescriptsarespecified,theyaretreatedasoneconcatenatedscript.

3.1.3Environmentvariables

makensischecksanumberofenvironmentvariablesthattellitwheretolocatethethingsitneedsinordertocreateinstallers.Thesevariablesinclude:

NSISDIR,NSISCONFDIR-Placeswherensisdataandconfigfilesareinstalled.NSISDIRaltersthescriptvariable${NSISDIR}.Seesection4.2.3formoreinfo.APPDATA(onWindows)orHOME(onotherplatforms)-Locationoftheper-userconfigurationfile.

3.1.4Examples

Basicusage:

makensis.exemyscript.nsi

Quietmode:

makensis.exe/V1myscript.nsi

Forcecompressor:

makensis.exe/X"SetCompressor/FINALlzma"myscript.nsi

Changescriptbehavior:

makensis.exe/DUSE_UPX/DVERSION=1.337/DNO_IMAGESmyscript.nsi

Parametersorder:

makensis/XSectionsectioncontents.nsi/XSectionEnd

Previous|Contents|Next

Previous|Contents|Next

3.2InstallerUsageGeneratedinstallersanduninstallersacceptafewoptionsonthecommandline.Theseoptionsgivetheuserabitmorecontrolovertheinstallationprocess.

3.2.1CommonOptions

/NCRCdisablestheCRCcheck,unlessCRCCheckforcewasusedinthescript./Srunstheinstalleroruninstallersilently.Seesection4.12formoreinformation./Dsetsthedefaultinstallationdirectory($INSTDIR),overridingInstallDirandInstallDirRegKey.Itmustbethelastparameterusedinthecommandlineandmustnotcontainanyquotes,evenifthepathcontainsspaces.Onlyabsolutepathsaresupported.

3.2.2UninstallerSpecificOptions

_?=sets$INSTDIR.Italsostopstheuninstallerfromcopyingitselftothetemporarydirectoryandrunningfromthere.ItcanbeusedalongwithExecWaittowaitfortheuninstallertofinish.Itmustbethelastparameterusedinthecommandlineandmustnotcontainanyquotes,evenifthepathcontainsspaces.

3.2.3Examples

installer.exe/NCRC

installer.exe/S

installer.exe/D=C:\ProgramFiles\NSIS

installer.exe/NCRC/S/D=C:\ProgramFiles\NSIS

uninstaller.exe/S_?=C:\ProgramFiles\NSIS

#uninstalloldversionExecWait'"$INSTDIR\uninstaller.exe"/S_?=$INSTDIR'

Previous|Contents|Next

Previous|Contents|Next

4.1ScriptFileFormatANSISScriptFile(.nsi)isjustatextfilewithscriptcode.

Commands

Commandslinesareintheformat'command[parameters]'

File"myfile"

Comments

Linesbeginningwith;or#arecomments.Youcanputcommentsaftercommands.YoucanalsouseC-stylecommentstocommentoneormorelines.

;Comment#Comment

#Comment\Anothercommentline(see`Longcommands`sectionbelow)

/*CommentComment*/

Name/*comment*/mysetup

File"myfile";Comment

Ifyouwantaparametertostartwith;or#putitinquotes.

Plug-ins

Tocallaplug-in,use'plugin::command[parameters]'.FormoreinfoseePlug-inDLLs.

nsExec::Exec"myfile"

Numbers

Forparametersthataretreatedasnumbers,usedecimal(thenumber)orhexadecimal(with0xprependedtoit,i.e.0x12345AB),oroctal(numbersbeginningwitha0andnox).

ColorsshouldbesetinhexadecimalRGBformat,likeHTMLbutwithoutthe#.

IntCmp10x1lbl_equal

SetCtlColors$HWNDCCCCCC

Strings

Torepresentstringsthathavespaces,usequotes:

MessageBoxMB_OK"Hithere!"

Quotesonlyhavethepropertyofcontainingaparameteriftheysurroundtherestoftheparameter.Theycanbeeithersinglequotes,doublequotes,orthebackwardsinglequote.

Youcanescapequotesusing$\:

MessageBoxMB_OK"I'llbehappy";thisoneputsa'insideastringMessageBoxMB_OK'Andhesaidtome"Hithere!"';thisoneputsa"insideastringMessageBoxMB_OK`Andhesaidtome"I'llbehappy!"`;thisoneputsboth'and"sinsideastringMessageBoxMB_OK"$\"Aquotefromawiseman$\"saidthewiseman";thisoneshowsescapingofquotes

Itisalsopossibletoputnewlines,tabsetc.inastringusing$\r,$\n,$\tetc.Moreinformation...

Variables

Variablesstartwith$.Uservariablesmustbedeclared.

VarMYVAR

StrCpy$MYVAR"myvalue"

Moreinformation...

Longcommands

Toextendacommandovermultiplelines,useabackslash(\)attheendoftheline.Thenextlinewilleffectivelybeconcatenatedtotheendofit.Forexample:

CreateShortcut"$SMPROGRAMS\NSIS\ZIP2EXEprojectworkspace.lnk"\"$INSTDIR\source\zip2exe\zip2exe.dsw"

MessageBoxMB_YESNO|MB_ICONQUESTION\"Doyouwanttoremoveallfilesinthefolder?\(Ifyouhaveanythingyoucreatedthatyouwant\tokeep,clickNo)"\IDNONoRemoveLabel

Lineextensionforlongcommandsworksforcommentsaswell.Itcanbeabitconfusing,soitshouldbeavoided.

#Acomment\stillacommenthere...

Configurationfile

Ifafilenamed"nsisconf.nsh"intheconfigdirectoryexists,itwillbeincludedbydefaultbeforeanyscripts(unlessthe/NOCONFIGcommandlineparameterisused).TheconfigdirectoryonWindowsisthesamedirectoryasmakensis.exeisin.Onotherplatformsthisissetatinstalltimeanddefaultsto$PREFIX/etc/.Youcanalterthisatruntime,seesection3.1.3formoreinformation.

Previous|Contents|Next

Previous|Contents|Next

4.2VariablesAllvariablesareglobalandcanbeusedinSectionsorFunctions.Notethatbydefault,variablesarelimitedto1024characters.Toextendthislimit,buildNSISwithabiggervalueoftheNSIS_MAX_STRLENbuildsettingorusethespecialbuild.

4.2.1UserVariables

$VARNAME

UservariablesmustbedeclaredwiththeVarcommand.Youcanusethesevariablestostorevalues,workwithstringmanipulationetc.

4.2.1.1Var

[/GLOBAL]var_name

Declareauservariable.Allowedcharactersforvariablesnames:[a-z][A-Z][0-9]and'_'.Alldefinedvariablesareglobal,evenifdefinedinasectionorafunction.Tomakethisclear,variablesdefinedinasectionorafunctionmustusethe/GLOBALflag.The/GLOBALflagisnotrequiredoutsideofsectionsandfunctions.

Varexample

FunctiontestVarVar/GLOBALexample2

StrCpy$example"examplevalue"StrCpy$example2"anotherexamplevalue"FunctionEnd

4.2.2OtherWritableVariables

$0,$1,$2,$3,$4,$5,$6,$7,$8,$9,$R0,$R1,$R2,$R3,$R4,$R5,

$R6,$R7,$R8,$R9

Registers.Thesevariablescanbeusedjustlikeuservariables,butareusuallyusedinsharedfunctionsormacros.Youdon'thavetodeclarethesevariablessoyouwon'tgetanynameconflictswhenusingtheminsharedcode.Whenusingthesevariablesinsharedcodeit'srecommendedthatyouusethestacktosaveandrestoretheiroriginalvalues.Thesevariablescanalsobeusedforcommunicationwithplug-insbecausetheycanbereadandwrittenbytheplug-inDLLs.

$INSTDIR

Theinstallationdirectory($INSTDIRismodifiableusingStrCpy,ReadRegStr,ReadINIStr,etc.-Thiscouldbeused,forexample,inthe.onInitfunctiontodoamoreadvanceddetectionofinstalllocation).

Notethatinuninstallercode,$INSTDIRcontainsthedirectorywheretheuninstallerlies.Itdoesnotnecessarilycontainthesamevalueitcontainedintheinstaller.Forexample,ifyouwritetheuninstallerto$WINDIRandtheuserdoesn'tmoveit,$INSTDIRwillbe$WINDIRintheuninstaller.Ifyouwritetheuninstallertoanotherlocation,youshouldkeeptheinstaller's$INSTDIRintheregistryoranalternativestoringfacilityandreaditintheuninstaller.

$OUTDIR

Thecurrentoutputdirectory(setimplicitlyviaSetOutPathorexplicitlyviaStrCpy,ReadRegStr,ReadINIStr,etc)

$CMDLINE

Thecommandlineoftheinstaller.Theformatofthecommandlinecanbeoneofthefollowing:

"full\pathto\installer.exe"PARAMETERPARAMETERPARAMETERinstaller.exePARAMETERPARAMETERPARAMETERForparsingoutthePARAMETERportion,seeGetParameters.If/D=isspecifiedonthecommandline(tooverridetheinstalldirectory)itwon'tshowupin$CMDLINE.

$LANGUAGE

Theidentifierofthelanguagethatiscurrentlyused.Forexample,Englishis1033.Youcanonlychangethisvariablein.onInit.

4.2.3Constants

ConstantscanalsobeusedintheInstallDirattribute.

NotethatsomeofthenewconstantswillnotworkoneveryOS.Forexample,$CDBURN_AREAwillonlyworkonWindowsXPandabove.Ifit'susedonWindows98,it'llbeempty.Unlessmentionedotherwise,aconstantshouldbeavailableoneveryOS.

$PROGRAMFILES,$PROGRAMFILES32,$PROGRAMFILES64

Theprogramfilesdirectory(usuallyC:\ProgramFilesbutdetectedatruntime).OnWindowsx64,$PROGRAMFILESand$PROGRAMFILES32pointtoC:\ProgramFiles(x86)while$PROGRAMFILES64pointstoC:\ProgramFiles.Use$PROGRAMFILES64wheninstallingx64applications.

$COMMONFILES,$COMMONFILES32,$COMMONFILES64

Thecommonfilesdirectory.Thisisadirectoryforcomponentsthataresharedacrossapplications(usuallyC:\ProgramFiles\CommonFilesbutdetectedatruntime).OnWindowsx64,$COMMONFILESand$COMMONFILES32pointtoC:\ProgramFiles(x86)\CommonFileswhile$COMMONFILES64pointstoC:\ProgramFiles\CommonFiles.Use$COMMONFILES64wheninstallingx64applications.

$DESKTOP

TheWindowsdesktopdirectory.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

$EXEDIR

Thedirectorycontainingtheinstallerexecutable(technicallythisisa

variableandyoucanmodifyit,butitisprobablynotagoodidea).

$EXEFILE

Thebasenameoftheinstallerexecutable.

$EXEPATH

Thefullpathoftheinstallerexecutable.

${NSISDIR}

AsymbolthatcontainsthepathwhereNSISisinstalled.UsefulifyouwanttoreferenceresourcesthatareinNSISdirectorye.g.Icons,UIsetc.

Whencompiledwithsupportforkeepingmakensisandthedatainthesameplace(thedefaultonWindows),itisinthesameplaceasmakensis,onotherplatformsitissetatcompiletime(SeetheINSTALLfileforinfo).InbothinstancesyoucanmodifyitatruntimebysettingtheNSISDIRenvironmentvariable.Seesection3.1.3formoreinfo.

$WINDIR

TheWindowsdirectory(usuallyC:\WindowsorC:\WinNTbutdetectedatruntime).

$SYSDIR

TheWindowssystemdirectory(usuallyC:\Windows\SystemorC:\WinNT\System32butdetectedatruntime).

$TEMP

Thetemporarydirectory.

$STARTMENU

Thestartmenufolder(usefulforaddingstartmenuitemsusingCreateShortcut).Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

$SMPROGRAMS

Thestartmenuprogramsfolder(usethiswheneveryouwant$STARTMENU\Programs).Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

$SMSTARTUP

Thestartmenuprograms/startupfolder.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

$QUICKLAUNCH

ThequicklaunchfolderforIE4activedesktopandabove.Ifquicklaunchisnotavailableitsimplyreturnsthesameas$TEMP.

$DOCUMENTS

Thedocumentsdirectory.AtypicalpathforthecurrentuserisC:\DocumentsandSettings\Foo\MyDocuments.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisnotavailableonWindows95unlessInternetExplorer4isinstalled.

$SENDTO

ThedirectorythatcontainsSendTomenushortcutitems.

$RECENT

Thedirectorythatcontainsshortcutstotheuser'srecentlyuseddocuments.

$FAVORITES

Thedirectorythatcontainsshortcutstotheuser'sfavoritewebsites,

documents,etc.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisnotavailableonWindows95unlessInternetExplorer4isinstalled.

$MUSIC

Theuser'smusicfilesdirectory.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisavailableonWindowsXP,MEandabove.

$PICTURES

Theuser'spicturefilesdirectory.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisavailableonWindows2000,XP,MEandabove.

$VIDEOS

Theuser'svideofilesdirectory.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisavailableonWindowsXP,MEandabove.

$NETHOOD

ThedirectorythatcontainslinkobjectsthatmayexistintheMyNetworkPlaces/NetworkNeighborhoodfolder.

ThisconstantisnotavailableonWindows95unlessInternetExplorer4withActiveDesktopisinstalled.

$FONTS

Thesystem'sfontsdirectory.

$TEMPLATES

Thedocumenttemplatesdirectory.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

$APPDATA

Theapplicationdatadirectory.DetectionofthecurrentuserpathrequiresInternetExplorer4andabove.DetectionofthealluserspathrequiresInternetExplorer5andabove.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisnotavailableonWindows95unlessInternetExplorer4withActiveDesktopisinstalled.

$LOCALAPPDATA

Thelocal(non-roaming)applicationdatadirectory.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisavailableonWindowsME,2000andabove.

$PRINTHOOD

ThedirectorythatcontainslinkobjectsthatmayexistinthePrintersfolder.

ThisconstantisnotavailableonWindows95andWindows98.

$INTERNET_CACHE

InternetExplorer'stemporaryinternetfilesdirectory.

ThisconstantisnotavailableonWindows95norWindowsNT4unlessInternetExplorer4withActiveDesktopisinstalled.

$COOKIES

InternetExplorer'scookiesdirectory.

ThisconstantisnotavailableonWindows95norWindowsNT4unlessInternetExplorer4withActiveDesktopisinstalled.

$HISTORY

InternetExplorer'shistorydirectory.

ThisconstantisnotavailableonWindows95norWindowsNT4unlessInternetExplorer4withActiveDesktopisinstalled.

$PROFILE

Theuser'sprofiledirectory.AtypicalpathisC:\DocumentsandSettings\Foo.

ThisconstantisavailableonWindows2000andabove.

$ADMINTOOLS

Adirectorywhereadministrativetoolsarekept.Thecontextofthisconstant(AllUsersorCurrentuser)dependsontheSetShellVarContextsetting.Thedefaultisthecurrentuser.

ThisconstantisavailableonWindows2000,MEandabove.

$RESOURCES

TheresourcesdirectorythatstoresthemesandotherWindowsresources(usually$WINDIR\Resourcesbutdetectedatruntime).

ThisconstantisavailableonWindowsXPandabove.

$RESOURCES_LOCALIZED

ThelocalizedresourcesdirectorythatstoresthemesandotherWindowsresources(usually$WINDIR\Resources\1033butdetectedatruntime).

ThisconstantisavailableonWindowsXPandabove.

$CDBURN_AREA

AdirectorywherefilesawaitingtobeburnedtoCDarestored.

ThisconstantisavailableonWindowsXPandabove.

$HWNDPARENT

HWNDofthemainwindow(indecimal).

$PLUGINSDIR

Thepathtoatemporaryfoldercreateduponthefirstusageofaplug-inoracalltoInitPluginsDir.Thisfolderisautomaticallydeletedwhentheinstallerexits.ThismakesthisfoldertheidealfoldertoholdINIfilesforInstallOptions,bitmapsforthesplashplug-in,oranyotherfilethataplug-inneedstowork.

4.2.4ConstantsUsedinStrings

$$

Usetorepresent$.

$\r

Usetorepresentacarriagereturn(\r).

$\n

Usetorepresentanewline(\n).

$\t

Usetorepresentatab(\t).

Previous|Contents|Next

Previous|Contents|Next

4.3LabelsLabelsarethetargetsofGotoinstructionsandthevariousbranchinginstructions(suchasIfErrors,MessageBox,IfFileExists,andStrCmp).LabelsmustbewithinaSectionoraFunction.Labelsarelocalinscope,meaningtheyareonlyaccessiblefromwithintheSectionorFunctionthattheyresidein.Todeclarealabel,simplyuse:

MyLabel:

Labelscannotbeginwitha-,+,!,$,or0-9.Whenspecifyinglabelsforthevariousinstructionsthatrequirethem,rememberthatbothanemptystring("")and0bothrepresentthenextinstruction(meaningnoGotowilloccur).Labelsbeginningwithaperiod(.)areglobal,meaningyoucanjumptothemfromanyfunctionorsection(thoughyoucannotjumptoanuninstallgloballabelfromtheinstaller,andviceversa).

Previous|Contents|Next

Previous|Contents|Next

4.4RelativeJumpsUnlikelabels,relativejumpsare,asthenamesuggests,relativetotheplacetheyarecalledfrom.Youcanuserelativejumpswhereveryoucanuselabels.Relativejumpsaremarkedbynumbers.+1jumpstothenextinstruction(thedefaultadvancement),+2willskiponeinstructionandgotothesecondinstructionfromthecurrentinstruction,-2willjumptwoinstructionsbackward,and+10willskip9instructions,jumpingtothetenthinstructionfromthecurrentinstruction.

Ainstructioniseverycommandthatisexecutedatrun-time,whentheinstallerisrunning.MessageBox,Goto,GetDLLVersion,FileRead,SetShellVarContextareallinstructions.AddSize,Section,SectionGroup,SectionEnd,SetOverwrite(andeverythingunderCompilerFlags),Name,SetFont,LangString,arenotinstructionsbecausetheyareexecutedatcompiletime.

Examples:

Goto+2MessageBoxMB_OK"Youwillnevereverseethismessagebox"MessageBoxMB_OK"Thelastmessagewasskipped,thisoneshouldbeshown"

Goto+4MessageBoxMB_OK"Thefollowingmessagewillbeskipped"Goto+3MessageBoxMB_OK"Youwillnevereverseethismessagebox"Goto-3MessageBoxMB_OK"Done"

Notethatmacroinsertionisnotconsideredasoneinstructionwhenitcomestorelativejumps.Themacroisexpandedbeforerelativejumpsareapplied,andsorelativejumpscanjumpintocodeinsideaninsertedmacro.Thefollowingcode,forexample,willnotskipthemacro.Itwillshowamessagebox.

!macrorelative_jump_test

MessageBoxMB_OK"firstmacroline"MessageBoxMB_OK"secondmacroline"!macroend

Goto+2!insertmacrorelative_jump_test

Previous|Contents|Next

Previous|Contents|Next

4.5PagesEach(non-silent)NSISinstallerhasasetofpages.EachpagecanbeaNSISbuilt-inpageoracustompagecreatedbyauser'sfunction(withnsDialogsorInstallOptionsforexample).

Thescriptcontrolsthepageorder,appearance,andbehavior.Youcanskippages,paintthemwhite,forcetheusertostayinacertainpageuntilacertainconditionismet,showareadmepage,showcustomdesignedpagesforinputandmore.Inthissectionyouwilllearnhowtodoalloftheabove.

Therearetwobasiccommandsregardingpages,PageandUninstPage.Thefirstaddsapagetotheinstaller,thesecondaddsapagetotheuninstaller.OntopofthosetwothereisthePageExcommandwhichallowsyoutoaddapagetoeitheroneandwithgreateramountofoptions.PageExallowsyoutosetoptionstothespecificpageyouareaddinginsteadofusingthedefaultthat'ssetoutsideofPageEx.

4.5.1Ordering

ThepageorderissetsimplybytheorderPage,UninstPageandPageExappearinthescript.Forexample:

PagelicensePagecomponentsPagedirectoryPageinstfilesUninstPageuninstConfirmUninstPageinstfiles

ThiscodewilltellNSIStofirstshowthelicensepage,thenthecomponentsselectionpage,thenthedirectoryselectionpageandfinallytheinstalllogwheresectionsareexecuted.Theuninstallerwillfirstshowtheuninstallconfirmationpageandthentheuninstallationlog.

Youcanspecifythesamepagetypemorethanonce.

ForbackwardscompatibilitywitholdNSISscripts,thefollowinginstallerpageswillbeaddedifnoinstallerpagecommandsareused:license(ifLicenseTextandLicenseDatawerespecified),components(ifComponentTextwasspecifiedandthereismorethanonevisiblesection),directory(ifDirTextwasspecified)andinstfiles.Whentherearenouninstallerpagecommandsthefollowinguninstallerpageswillbeadded:uninstallconfirmationpage(ifUninstallTextwasspecified)andinstfiles.Thismethodisdeprecated,convertingscriptstousepagecommandsishighlyrecommendedbecauseyoucanusethenewstandardlanguagestrings.

4.5.2PageOptions

Eachpagehasitsuniquesetofdatathatdefineshowitwilllookandact.Thissectiondescribeswhatdataeachtypeofpageusesandhowyoucansetit.Callbackfunctionsaredescribedbelowandarenotdealtwithinthissection.

Thelistbelowliststhecommandsthataffectacertainpagetype.Unlessotherwisementioned,thesecommandscanbeusedbothinsideandoutsideofaPageExblock.IfusedinsideaPageExblocktheywillonlyaffectthecurrentpagebeingsetbyPageEx,otherwisetheywillsetthedefaultforallotherpages.

Licensepage

LicenseTextLicenseDataLicenseForceSelection

Componentsselectionpage

ComponentText

Directoryselectionpage

DirTextDirVar(canonlybeusedinPageEx)DirVerify

Un/Installationlogpage

DetailsButtonTextCompletedText

Uninstallconfirmationpage

DirVar(canonlybeusedinPageEx)UninstallText

UseCaptiontosetthepagecaption.

4.5.3Callbacks

Eachbuilt-inpagehasthreecallbackfunctions:thepre-function,theshowfunctionandtheleave-function.Thepre-functioniscalledrightbeforethepageiscreated,theshow-functioniscalledrightafterithasbeencreatedbutbeforeitisshownandtheleave-functioniscalledrightaftertheuserhaspressedthenextbutton(beforeactuallyleavingthepage).

Thepre-functionallowsyoutoskipthepageusingAbort.Theshow-functionallowsyoutotweakthepage'suserinterfacewithCreateFont,SetCtlColors,SendMessageetc.Theleave-functionallowsyoutoforcetheusertostayonthecurrentpageusingAbort.

Acustompageonlyhastwocallbackfunctions,onethatcreatesitwhichismandatory,andoneleave-functionthatactsjustliketheleave-functionforbuilt-inpages.

Examples:

PagelicenseskipLicense""stayInLicensePagecustomcustomPage""":custompage"Pageinstfiles

FunctionskipLicenseMessageBoxMB_YESNO"Doyouwanttoskipthelicensepage?"IDNOno

Abortno:FunctionEnd

FunctionstayInLicenseMessageBoxMB_YESNO"Doyouwanttostayinthelicensepage?"IDNOnoAbortno:FunctionEnd

FunctioncustomPageGetTempFileName$R0File/oname=$R0customPage.iniInstallOptions::dialog$R0Pop$R1StrCmp$R1"cancel"doneStrCmp$R1"back"doneStrCmp$R1"success"doneerror:MessageBoxMB_OK|MB_ICONSTOP"InstallOptionserror:$\r$\n$R1"done:FunctionEnd

4.5.4Page

custom[creator_function][leave_function][caption][/ENABLECANCEL]ORinternal_page_type[pre_function][show_function][leave_function][/ENABLECANCEL]

Addsaninstallerpage.Seetheabovesectionsformoreinformationaboutbuilt-inversuscustompagesandaboutcallbackfunctions.

internal_page_typecanbe:

license-licensepagecomponents-componentsselectionpagedirectory-installationdirectoryselectionpageinstfiles-installationpagewherethesectionsareexecuteduninstConfirm-uninstallconfirmationpage

Thelastpageoftheinstallerhasitscancelbuttondisabledtopreventconfusion.Toenableitanyway,use/ENABLECANCEL.

4.5.5UninstPage

custom[creator_function][leave_function][caption][/ENABLECANCEL]ORinternal_page_type[pre_function][show_function][leave_function][/ENABLECANCEL]

Addsanuninstallerpage.Seetheabovesectionsformoreinformationaboutbuilt-inversuscustompagesandaboutcallbackfunctions.

SeePageforpossiblevaluesofinternal_page_type.

4.5.6PageEx

[un.](custom|uninstConfirm|license|components|directory|instfiles)

Addsaninstallerpageoranuninstallerpageiftheun.prefixwasused.EveryPageExmusthaveamatchingPageExEnd.InaPageExblockyoucansetoptionsthatarespecifictothispageandwillnotbeusedforotherpages.OptionsthatarenotsetwillreverttowhatwassetoutsidethePageExblockorthedefaultifnothingwasset.Tosetthesub-captionforapageuseCaptionorSubCaptiontosetthedefault.TosetthecallbackfunctionsforapagesetwithPageExusePageCallbacks.Seetheabovesectionsformoreinformationaboutbuilt-inversuscustompages.

Exampleusage:

PageExlicenseLicenseText"Readme"LicenseDatareadme.rtfPageExEnd

PageExlicenseLicenseDatalicense.txtLicenseForceSelectioncheckbox

PageExEnd

4.5.7PageExEnd

EndsaPageExblock.

4.5.8PageCallbacks

([creator_function][leave_function])|([pre_function][show_function][leave_function])

SetsthecallbackfunctionsforapagedefinedusingPageEx.CanonlybeusedinsideaPageExblock.Seetheabovesectionsformoreinformationaboutcallbackfunctions.

PageExlicensePageCallbackslicensePrelicenseShowlicenseLeavePageExEnd

Previous|Contents|Next

Previous|Contents|Next

4.6SectionsEachNSISinstallercontainsoneormoresections.Eachofthesesectionsarecreated,modified,andendedwiththefollowingcommands.

Eachsectioncontainszeroormoreinstructions.Sectionsareexecutedinorderbytheresultinginstaller,andifacomponentpageisused,theuserwillhavetheoptionofdisabling/enablingeachvisiblesection.Ifasection'snameis'Uninstall'orisprefixedwith'un.',it'sanuninstallersection.

4.6.1SectionCommands

4.6.1.1AddSize

size_kb

Tellstheinstallerthatthecurrentsectionneedsanadditional"size_kb"kilobytesofdiskspace.Onlyvalidwithinasection(willhavenoeffectoutsideofasectionorinafunction).

SectionAddSize500SectionEnd

4.6.1.2Section

[/o][([!]|[-])section_name][section_index_output]

Beginsandopensanewsection.Ifsection_nameisempty,omitted,orbeginswitha-,thenitisahiddensectionandtheuserwillnothavetheoptionofdisablingit.Ifthesectionnameis'Uninstall'orisprefixedwith'un.',thenitisaanuninstallersection.Ifsection_index_outputisspecified,theparameterwillbe!definedwiththesectionindex(canbe

usedwithSectionSetTextetc).Ifthesectionnamebeginswitha!,thesectionwillbedisplayedasbold.Ifthe/oswitchisspecified,thesectionwillbeunselectedbydefault.

Section"-hiddensection"SectionEnd

Section#hiddensectionSectionEnd

Section"!boldsection"SectionEnd

Section/o"optional"SectionEnd

Section"installsomething"SEC_IDXSectionEnd

Toaccessthesectionindex,curlybracketsmustbeusedandthecodemustbelocatedbelowthesectioninthescript.

Sectiontest1sec1_idSectionEnd

Sectiontest2sec2_idSectionEnd

Function.onInitSectionGetText${sec2_id}$0MessageBoxMB_OK"nameof${sec2_id}:$\n$0"#willcorrectlydisplay'nameof1:test2'FunctionEnd

Function.onInitSectionGetText${sec2_id}$0MessageBoxMB_OK"nameof${sec2_id}:$\n$0"#willincorrectlydisplay'nameof${sec2_id}:test1'#plusawarningstating:#unknownvariable/constant"{sec2_id}"detected,ignoring

FunctionEnd

Sectiontest1sec1_idSectionEnd

Sectiontest2sec2_idSectionEnd

4.6.1.3SectionEnd

Thiscommandclosesthecurrentopensection.

4.6.1.4SectionIn

insttype_index[insttype_index][RO]

Thiscommandspecifieswhichinstalltypes(seeInstType)thecurrentsectiondefaultstotheenabledstatein.MultipleSectionIncommandscanbespecified(theyarecombined).IfyouspecifyROasaparameter,thenthesectionwillberead-only,meaningtheuserwon'tbeabletochangeitsstate.ThefirstinstalltypedefinedusingInstTypeisindexed1,thenext2andsoon.

InstType"full"InstType"minimal"

Section"asection"SectionIn12SectionEnd

Section"anothersection"SectionIn1SectionEnd

4.6.1.5SectionGroup

[/e]section_group_name[index_output]

Thiscommandinsertsasectiongroup.ThesectiongroupmustbeclosedwithSectionGroupEnd,andshouldcontain1ormoresections.Ifthesectiongroupnamebeginswitha!,itsnamewillbedisplayedwithaboldfont.If/eispresent,thesectiongroupwillbeexpandedbydefault.Ifindex_outputisspecified,theparameterwillbe!definedwiththesectionindex(canbeusedwithSectionSetTextetc).Ifthenameisprefixedwith'un.'thesectiongroupisanuninstallersectiongroup.

SectionGroup"somestuff"Section"asection"SectionEndSection"anothersection"SectionEndSectionGroupEnd

4.6.1.6SectionGroupEnd

ClosesasectiongroupopenedwithSectionGroup.

4.6.2UninstallSection

AspecialSectionnamed'Uninstall'mustbecreatedinordertogenerateanuninstaller.Thissectionshouldremoveallfiles,registrykeysetcetcthatwereinstalledbytheinstaller,fromthesystem.Hereisanexampleofasimpleuninstallsection:

Section"Uninstall"Delete$INSTDIR\Uninst.exe;deleteself(seeexplanationbelowwhythisworks)Delete$INSTDIR\myApp.exeRMDir$INSTDIRDeleteRegKeyHKLMSOFTWARE\myAppSectionEnd

ThefirstDeleteinstructionworks(deletingtheuninstaller),becausetheuninstalleristransparentlycopiedtothesystemtemporarydirectoryfor

theuninstall.

Notethatinuninstallercode,$INSTDIRcontainsthedirectorywheretheuninstallerlies.Itdoesnotnecessarilycontainthesamevalueitcontainedintheinstaller.

Previous|Contents|Next

Previous|Contents|Next

4.7FunctionsFunctionsaresimilartoSectionsinthattheycontainzeroormoreinstructions.Userfunctionsarenotcalledbytheinstallerdirectly,insteadtheyarecalledfromSectionsusingtheCallinstruction.Callbackfunctionswillbecalledbytheinstallerwhenacertaineventoccurs.

FunctionsmustbedeclaredoutsideofSectionsorotherFunctions.

4.7.1FunctionCommands

4.7.1.1Function

[function_name]

Beginsandopensanewfunction.Functionnamesbeginningwith"."(e.g.".Whatever")aregenerallyreservedforcallbackfunctions.Functionnamesbeginningwith"un."arefunctionsthatwillbegeneratedintheUninstaller.Hence,normalinstallSectionsandfunctionscannotcalluninstallfunctions,andtheUninstallSectionanduninstallfunctionscannotcallnormalfunctions.

Functionfunc#somecommandsFunctionEnd

SectionCallfuncSectionEnd

4.7.1.2FunctionEnd

Thiscommandclosesthecurrentopenfunction.

4.7.2CallbackFunctions

Youcancreatecallbackfunctions(whichhavespecialnames),thatwillbecalledbytheinstalleratcertainpointsintheinstall.Belowisalistofavailablecallbacks:

4.7.2.1InstallCallbacks

4.7.2.1.1.onGUIInit

Thiscallbackwillbecalledjustbeforethefirstpageisloadedandtheinstallerdialogisshown,allowingyoutotweaktheuserinterface.

Example:

!include"WinMessages.nsh"

Function.onGUIInit#1028istheidofthebrandingtextcontrolGetDlgItem$R0$HWNDPARENT1028CreateFont$R1"Tahoma"10700SendMessage$R0${WM_SETFONT}$R10#setbackgroundcolortowhiteandtextcolortoredSetCtlColors$R0FFFFFFFF0000FunctionEnd

4.7.2.1.2.onInit

Thiscallbackwillbecalledwhentheinstallerisnearlyfinishedinitializing.Ifthe'.onInit'functioncallsAbort,theinstallerwillquitinstantly.

Herearetwoexamplesofhowthismightbeused:

Function.onInitMessageBoxMB_YESNO"Thiswillinstall.Continue?"IDYESNoAbortAbort;causesinstallertoquit.NoAbort:FunctionEnd

or:

Function.onInitReadINIStr$INSTDIR$WINDIR\wincmd.iniConfigurationInstallDirStrCmp$INSTDIR""0NoAbortMessageBoxMB_OK"WindowsCommandernotfound.Unabletogetinstallpath."Abort;causesinstallertoquit.NoAbort:FunctionEnd

4.7.2.1.3.onInstFailed

Thiscallbackiscalledwhentheuserhitsthe'cancel'buttonaftertheinstallhasfailed(ifitcouldnotextractafile,ortheinstallscriptusedtheAbortcommand).

Example:

Function.onInstFailedMessageBoxMB_OK"Betterlucknexttime."FunctionEnd

4.7.2.1.4.onInstSuccess

Thiscallbackiscalledwhentheinstallwassuccessful,rightbeforetheinstallwindowcloses(whichmaybeaftertheuserclicks'Close'ifAutoCloseWindoworSetAutoCloseissettofalse).

Example:

Function.onInstSuccessMessageBoxMB_YESNO"Congrats,itworked.Viewreadme?"IDNONoReadmeExecnotepad.exe;viewreadmeorwhatever,ifyouwant.NoReadme:FunctionEnd

4.7.2.1.5.onGUIEnd

Thiscallbackiscalledrightaftertheinstallerwindowcloses.Useittofreeanyuserinterfacerelatedplug-insifneeded.

4.7.2.1.6.onMouseOverSection

Thiscallbackiscalledwheneverthemousepositionoverthesectionstreehaschanged.Thisallowsyoutosetadescriptionforeachsectionforexample.Thesectionidonwhichthemouseisovercurrentlyisstored,temporarily,in$0.

Example:

Function.onMouseOverSectionFindWindow$R0"#32770"""$HWNDPARENTGetDlgItem$R0$R01043;descriptionitem(mustbeaddedtotheUI)

StrCmp$00""+2SendMessage$R0${WM_SETTEXT}0"STR:firstsectiondescription"

StrCmp$01""+2SendMessage$R0${WM_SETTEXT}0"STR:secondsectiondescription"FunctionEnd

4.7.2.1.7.onRebootFailed

ThiscallbackiscalledifRebootfails.WriteUninstaller,plug-ins,FileandWriteRegBinshouldnotbeusedinthiscallback.

Example:

Function.onRebootFailedMessageBoxMB_OK|MB_ICONSTOP"Rebootfailed.Pleaserebootmanually."/SDIDOKFunctionEnd

4.7.2.1.8.onSelChange

Calledwhentheselectionchangesonthecomponentpage.UsefulforusingwithSectionSetFlagsandSectionGetFlags.

Selectionchangesincludebothsectionselectionandinstallationtypechanges.Thesectionidofthechangedsectionisstoredin$0.$0is-1iftheinstallationtypechanged.Youonlygetnotificationsforchanges

initiatedbytheuserandonlyonenotificationperactioneveniftheactionalsoaffectedchildsectionsand/orparentgroups.

4.7.2.1.9.onUserAbort

Thiscallbackiscalledwhentheuserhitsthe'cancel'button,andtheinstallhasn'talreadyfailed.IfthisfunctioncallsAbort,theinstallwillnotbeaborted.

Example:

Function.onUserAbortMessageBoxMB_YESNO"Abortinstall?"IDYESNoCancelAbortAbort;causesinstallertonotquit.NoCancelAbort:FunctionEnd

4.7.2.1.10.onVerifyInstDir

Thiscallbackenablescontroloverwhetherornotaninstallationpathisvalidforyourinstaller.Thiscodewillbecalledeverytimetheuserchangestheinstalldirectory,soitshouldn'tdoanythingcrazywithMessageBoxorthelike.IfthisfunctioncallsAbort,theinstallationpathin$INSTDIRisdeemedinvalid.

Example:

Function.onVerifyInstDirIfFileExists$INSTDIR\Winamp.exePathGoodAbort;if$INSTDIRisnotawinampdirectory,don'tletusinstalltherePathGood:FunctionEnd

4.7.2.2UninstallCallbacks

4.7.2.2.1un.onGUIInit

Thiscallbackwillbecalledjustbeforethefirstpageisloadedandthe

installerdialogisshown,allowingyoutotweaktheuserinterface.

Havealookat.onGUIInitforanexample.

4.7.2.2.2un.onInit

Thiscallbackwillbecalledwhentheuninstallerisnearlyfinishedinitializing.Ifthe'un.onInit'functioncallsAbort,theuninstallerwillquitinstantly.Notethatthisfunctioncanverifyand/ormodify$INSTDIRifnecessary.

Herearetwoexamplesofhowthismightbeused:

Functionun.onInitMessageBoxMB_YESNO"Thiswilluninstall.Continue?"IDYESNoAbortAbort;causesuninstallertoquit.NoAbort:FunctionEnd

or:

Functionun.onInitIfFileExists$INSTDIR\myfile.exefoundMessageboxMB_OK"Uninstallpathincorrect"Abortfound:FunctionEnd

4.7.2.2.3un.onUninstFailed

Thiscallbackiscalledwhentheuserhitsthe'cancel'buttonaftertheuninstallhasfailed(ifitusedtheAbortcommandorotherwisefailed).

Example:

Functionun.onUninstFailedMessageBoxMB_OK"Betterlucknexttime."FunctionEnd

4.7.2.2.4un.onUninstSuccess

Thiscallbackiscalledwhentheuninstallwassuccessful,rightbeforetheinstallwindowcloses(whichmaybeaftertheuserclicks'Close'ifSetAutoCloseissettofalse)..

Example:

Functionun.onUninstSuccessMessageBoxMB_OK"Congrats,it'sgone."FunctionEnd

4.7.2.2.5un.onGUIEnd

Thiscallbackiscalledrightaftertheuninstallerwindowcloses.Useittofreeanyuserinterfacerelatedplug-insifneeded.

4.7.2.2.6un.onRebootFailed

ThiscallbackiscalledifRebootfails.WriteUninstaller,plug-ins,FileandWriteRegBinshouldnotbeusedinthiscallback.

Example:

Functionun.onRebootFailedMessageBoxMB_OK|MB_ICONSTOP"Rebootfailed.Pleaserebootmanually."/SDIDOKFunctionEnd

4.7.2.2.7un.onSelChange

Calledwhentheselectionchangesonthecomponentpage.UsefulforusingwithSectionSetFlagsandSectionGetFlags.

Selectionchangesincludebothsectionselectionandinstallationtypechanges.Thesectionidofthechangedsectionisstoredin$0.$0is-1iftheinstallationtypechanged.Youonlygetnotificationsforchangesinitiatedbytheuserandonlyonenotificationperactioneveniftheactionalsoaffectedchildsectionsand/orparentgroups.

4.7.2.2.8un.onUserAbort

Thiscallbackiscalledwhentheuserhitsthe'cancel'buttonandtheuninstallhasn'talreadyfailed.IfthisfunctioncallsAbort,theinstallwillnotbeaborted.

Example:

Functionun.onUserAbortMessageBoxMB_YESNO"Abortuninstall?"IDYESNoCancelAbortAbort;causesuninstallertonotquit.NoCancelAbort:FunctionEnd

Previous|Contents|Next

Previous|Contents|Next

4.8InstallerAttributes

4.8.1GeneralAttributes

Thecommandsbelowalladjustattributesoftheinstaller.Theseattributescontrolhowtheinstallerlooksandfunctions,includingwhichpagesarepresentintheinstaller,whichtextisdisplayedineachpartofeachpage,thenameoftheinstaller,theicontheinstalleruses,thedefaultinstallationdirectoryandmore.NotethattheseattributescanbesetanywhereinthefileexceptinaSectionorFunction.

Defaultsareboldandunderlined

4.8.1.1AddBrandingImage

(left|right|top|bottom)(width|height)[padding]

Addsabrandingimageonthetop,bottom,left,orrightoftheinstaller.Itssizewillbesetaccordingtothewidth/heightspecified,theinstallerwidth/heightandtheinstallersfont.Thefinalsizewillnotalwaysbewhatyourequested;havealookattheoutputofthecommandfortheactualsize.Becausethisdependsontheinstallersfont,youshoulduseSetFontbeforeAddBrandingImage.Thedefaultpaddingvalueis2.

AddBrandingImageonlyaddsaplaceholderforanimage.Tosettheimageitselfatruntime,useSetBrandingImage.

AddBrandingImageleft100AddBrandingImageright50AddBrandingImagetop20AddBrandingImagebottom35AddBrandingImageleft1005

4.8.1.2AllowRootDirInstall

true|false

Controlswhetherornotinstallsareallowedintherootdirectoryofadrive,ordirectlyintoanetworkshare.Setto'true'tochangethesafebehavior,whichpreventsusersfromselectingC:\or\\Server\Shareasaninstall(andlateron,uninstall)directory.Foradditionaldirectoryselectionpagecustomizability,see.onVerifyInstDir.

4.8.1.3AutoCloseWindow

true|false

Setswhetherornottheinstallwindowautomaticallycloseswhencompleted.ThisisoverrideablefromasectionusingSetAutoClose.

4.8.1.4BGFont

[font_face[height[weight][/ITALIC][/UNDERLINE][/STRIKE]]]

Specifiesthefontusedtoshowthetextonthebackgroundgradient.TosetthecoloruseBGGradient.Thedefaultfontwillbeusedifnoparametersarespecified.ThedefaultfontisboldanditalicTimesNewRoman.

4.8.1.5BGGradient

[off|(topcbotc[textcolor|notext])]

Specifieswhetherornottouseagradientbackgroundwindow.If'off',theinstallerwillnotshowabackgroundwindow,ifnoparametersarespecified,thedefaultblacktobluegradientisused,andotherwisethetop_colororbottom_colorareusedtomakeagradient.Top_colorandbottom_colorarespecifiedusingtheformRRGGBB(inhexadecimal,asinHTML,onlyminustheleading'#',since#canbeusedforcomments).'textcolor'canbespecifiedaswell,or'notext'canbespecifiedtoturnthebigbackgroundtextoff.

4.8.1.6BrandingText

/TRIM(LEFT|RIGHT|CENTER)text

Setsthetextthatisshownatthebottomoftheinstallwindow(bydefaultitis'NullsoftInstallSystemvX.XX').Settingthistoanemptystring("")usesthedefault;tosetthestringtoblank,use""(aspace).Ifitdoesn'tmattertoyou,leaveitthedefaultsothateverybodycanknowwhytheinstallerdidn'tsuck:).Use/TRIMLEFT,/TRIMRIGHTor/TRIMCENTERtotrimdownthesizeofthecontroltothesizeofthestring.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedon.onInit.

4.8.1.7Caption

caption

WhenusedoutsideaPageExblock:Setsthetextforthetitlebaroftheinstaller.Bydefaultitis'$(^Name)Setup',whereNameisspecifiedbytheNameinstruction.Youcanhoweveroverrideitwith'MyAppInstaller'orwhatever.Ifyouspecifyanemptystring(""),thedefaultwillbeused(youcanspecify""tosimulateaemptystring).

WhenusedinsideaPageExblock:Setsthesubcaptionofthecurrentpage.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedon.onInitor.onGUIInit.

4.8.1.8ChangeUI

dialogui_file.exe

Replacesdialog(IDD_LICENSE,IDD_DIR,IDD_SELCOM,IDD_INST,IDD_INSTFILES,IDD_UNINSTorIDD_VERIFY)withadialogfromui_file.exewiththesameresourceID.Youcanalsospecify'all'asthe

dialogifyouwishtoreplaceall7ofthedialogsatoncefromthesameUIfile.ForsomeexampleUIslookatContrib\UIsunderyourNSISdirectory.

IDD_LICENSEmustcontainIDC_EDIT1(RICHEDITcontrol).IDD_DIRmustcontainIDC_DIR(editbox),IDC_BROWSE(button)andIDC_CHECK1(checkbox).IDD_SELCOMmustcontainIDC_TREE1(SysTreeView32control),andIDC_COMBO1(combobox).IDD_INSTmustcontainIDC_BACK(button),IDC_CHILDRECT(staticcontrolthesizeofallotherdialogs),IDC_VERSTR(static),IDOK(button),andIDCANCEL(button).Ifanimagecontrol(staticwithSS_BITMAPstyle)willbefoundinthisdialogitwillbeusedasthedefaultforSetBrandingImage.IDD_INSTFILESmustcontainIDC_LIST1(SysListView32control),IDC_PROGRESS(msctls_progress32control),andIDC_SHOWDETAILS(button).IDD_UNINSTmustcontainIDC_EDIT1(editbox).IDD_VERIFYmustcontainIDC_STR(static).

ChangeUIall"${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe"

4.8.1.9CheckBitmap

bitmap.bmp

Specifiesthebitmapwiththecheckboximagesusedinthecomponent-selectionpagetreeview.

Thisbitmapshouldhaveasizeof96x16pixels,nomorethan8bpp(256colors)andcontainsix16x16imagesforthedifferentstates(inorder:selectionmask,notchecked,checked,greyedout,unchecked&read-only,checked&read-only).Usemagentaasmaskcolor(thisareawillbetransparent).

4.8.1.10CompletedText

text

Replacesthedefaulttext("Completed")thatisprintedattheendoftheinstallifparameterisspecified.Otherwise,thedefaultisused.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforethemessageisprinted.

4.8.1.11ComponentText

[text[subtext][subtext2]]

Usedtochangethedefaulttextonthecomponentpage.

text:Textabovethecontrols,totherightoftheinstallationicon.

subtext:Textnexttotheinstallationtypeselection.

subtext2:Texttotheleftofthecomponentslistandbelowtheinstallationtype.

Thedefaultstringwillbeusedifastringisempty("").

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforethecomponentspageiscreated.

4.8.1.12CRCCheck

on|off|force

SpecifieswhetherornottheinstallerwillperformaCRConitselfbeforeallowinganinstall.Notethatiftheuseruses/NCRConthecommandlinewhenexecutingtheinstaller,andyoudidn'tspecify'force',theCRCwillnotoccur,andtheuserwillbeallowedtoinstalla(potentially)corruptedinstaller.

4.8.1.13DetailsButtonText

show_details_text

Replacesthedefaultdetailsbuttontextof"Showdetails",ifparameterisspecified(otherwisethedefaultisused).

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforetheinstalllog(instfiles)pageiscreated.

4.8.1.14DirText

[text][subtext][browse_button_text][browse_dlg_text]

Usedtochangethedefaulttextonthedirectorypage.

text:Textabovethecontrols,totherightoftheinstallationicon.

subtext:Textonthedirectoryselectionframe.

browse_button_text:TextontheBrowsebutton.

browse_dlg_text:Textonthe"BrowseForFolder"dialog,appearsafterclickingon"Browse"button.

Thedefaultstringwillbeusedifastringisempty("").

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforethedirectorypageiscreated.

4.8.1.15DirVar

user_var(dirinput/output)

Specifieswhichvariableistobeusedtocontainthedirectoryselected.Thisvariableshouldbeinitializedwithadefaultvalue.Thisallowsyoutoeasilycreatetwodifferentdirectorypagesthatwillnotrequireyoutomovevaluesinandoutof$INSTDIR.Thedefaultvariableis$INSTDIR.ThiscanonlybeusedinPageExfordirectoryanduninstConfirmpages.

VarANOTHER_DIRPageExdirectory

DirVar$ANOTHER_DIRPageExEnd

SectionSetOutPath$INSTDIRFile"afile.dat"SetOutPath$ANOTHER_DIRFile"anotherfile.dat"SectionEnd

4.8.1.16DirVerify

auto|leave

If`DirVerifyleave'isused,theNextbuttonwillnotbedisablediftheinstallationdirectoryisnotvalidorthereisnotenoughspace.AflagthatyoucanreadintheleavefunctionusingGetInstDirErrorwillbesetinstead.

PageExdirectoryDirVerifyleavePageCallbacks""""dirLeavePageExEnd

4.8.1.17FileErrorText

file_error_text[noignore_file_error_text]

Replacesthedefaulttextthatcomesupwhenafilecannotbewrittento.Thisstringcancontainareferenceto$0,whichisthefilename($0istemporarilychangedtothisvalue).Example:"Cannotwritetofile$\r$\n$0$\r$\ngoodluck.".

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforeFileisused.

4.8.1.18Icon

[path\]icon.ico

Setstheiconoftheinstaller.Everyimageintheiconfilewillbeincludedintheinstaller.UseUninstallIcontosettheuninstallericon.

4.8.1.19InstallButtonText

install_button_text

Ifparameterisspecified,overridesthedefaultinstallbuttontext(of"Install")withthespecifiedtext.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforetheinstallbuttonshows.

4.8.1.20InstallColors

/windows|(foreground_colorbackground_color)

Setsthecolorstousefortheinstallinfoscreen(thedefaultis00FF00000000.UsetheformRRGGBB(inhexadecimal,asinHTML,onlyminustheleading'#',since#canbeusedforcomments).Notethatif"/windows"isspecifiedastheonlyparameter,thedefaultwindowscolorswillbeused.

4.8.1.21InstallDir

definstdir

Setsthedefaultinstallationdirectory.Seethevariablessectionforvariablesthatcanbeusedtomakethisstring(especially$PROGRAMFILES).Notethatthepartofthisstringfollowingthelast\willbeusediftheuserselects'browse',andmaybeappendedbackontothestringatinstalltime(todisablethis,endthedirectorywitha\

(whichwillrequiretheentireparametertobeenclosedwithquotes).Ifthisdoesn'tmakeanysense,playaroundwiththebrowsebuttonabit.

4.8.1.22InstallDirRegKey

root_keysubkeykey_name

Thisattributetellstheinstallertocheckastringintheregistryanduseitastheinstalldirifthatstringisvalid.Ifthisattributeispresent,itwilloverridetheInstallDirattributeiftheregistrykeyisvalid,otherwiseitwillfallbacktotheInstallDirvalue.Whenqueryingtheregistry,thiscommandwillautomaticallyremoveanyquotes.Ifthestringendsin".exe",itwillautomaticallyremovethefilenamecomponentofthestring(i.e.ifthestringis"C:\ProgramFiles\Foo\app.exe",itwillknowtouse"C:\ProgramFiles\Foo").Formoreadvancedinstalldirectoryconfiguration,set$INSTDIRin.onInit.

LanguagestringsandvariablescannotbeusedwithInstallDirRegKey.

InstallDirRegKeyHKLMSoftware\NSIS""InstallDirRegKeyHKLMSoftware\ACME\ThingyInstallLocation

4.8.1.23InstProgressFlags

[flag[...]]

Validvaluesforflagare"smooth"(smooththeprogressbar)or"colored"(colortheprogressbarwiththecolorssetbyInstallColors.Examples:"InstProgressFlags"(defaultold-schoolwindowslook),"InstProgressFlagssmooth"(newsmoothlook),"InstProgressFlagssmoothcolored"(coloredsmoothlookwhee).Note:neither"smooth"or"colored"workwithXPStyleonwhentheinstallerrunsonWindowsXPwithamoderntheme.

4.8.1.24InstType

install_type_name|/NOCUSTOM|/CUSTOMSTRING=str|/COMPONENTSONLYONCUSTOM

Addsaninstalltypetotheinstalltypelist,ordisablesthecustominstalltype.Therecanbeasmanyas32types,eachonespecifyingthenameoftheinstalltype.Ifthenameisprefixedwith'un.'itisanuninstallerinstalltype.Thenamecancontainvariableswhichwillbeprocessedatruntimebeforethecomponentspageshows.AnotherwayofchangingtheInstTypenameduringruntimeistheInstTypeSetTextcommand.ThedifferenceisthatwithInstTypeSetTextyouaresavingyourprecioususervariables.Thefirsttypeisthedefault(generally'Typical').Ifthe/NOCUSTOMswitchisspecified,thenthe"custom"installtypeisdisabled,andtheuserhastochooseoneofthepre-definedinstalltypes.Alternatively,ifthe/CUSTOMSTRINGswitchisspecified,theparameterwilloverridethe"Custom"installtypetext.Alternatively,ifthe/COMPONENTSONLYONCUSTOMflagisspecified,thecomponentlistwillonlybeshownifthe"Custom"installtypeisselected.

Acceptsvariablesfortypenames.Ifvariablesareused,theymustbeinitializedbeforethecomponentspageiscreated.

4.8.1.25LicenseBkColor

color|/gray|/windows

Setsthebackgroundcolorofthelicensedata.ColorisspecifiedusingtheformRRGGBB(inhexadecimal,asinHTML,onlyminustheleading'#',since#canbeusedforcomments).Defaultis'/gray'.YoucanalsousetheWindowsOSdefinedcolorbyusing'/windows'.

4.8.1.26LicenseData

licdata.(txt|rtf)

SpecifiesatextfileoraRTFfiletouseforthelicensethattheusercanread.Omitthistonothavealicensedisplayed.NotethatthefilemustbeinDOStextformat(\r\n).TodefineamultilinguallicensedatauseLicenseLangString.

IfyouareusingaRTFfileitisrecommendedthatyouedititwithWordPadandnotMSWord.UsingWordPadwillresultinamuchsmallerfile.

UseLicenseLangStringtoshowadifferentlicenseforeverylanguage.

4.8.1.27LicenseForceSelection

(checkbox[accept_text]|radiobuttons[accept_text][decline_text]|

Specifiesifthedisplayedlicensemustbeexplicitlyacceptedornot.Thiscanbedoneeitherbyacheckboxorbyradiobuttons.Bydefaultthe"nextbutton"isdisabledandwillonlybeenabledifthecheckboxisenabledorthecorrectradiobuttonisselected.Ifoffisspecifiedthe"nextbutton"isenabledbydefault.

LicenseForceSelectioncheckboxLicenseForceSelectioncheckbox"iaccept"LicenseForceSelectionradiobuttonsLicenseForceSelectionradiobuttons"iaccept"LicenseForceSelectionradiobuttons"iaccept""idecline"LicenseForceSelectionradiobuttons"""idecline"LicenseForceSelectionoff

4.8.1.28LicenseText

[text[button_text]]

Usedtochangethedefaulttextonthelicensepage.

text:Textabovethecontrols,totherightoftheinstallationicon.

button_text:Textonthe"IAgree"button.

Thedefaultstringwillbeusedifastringisempty("").

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbefore

thelicensepageiscreated.

4.8.1.29ManifestDPIAware

notset|true|false

DeclarethattheinstallerisDPI-aware.ADPI-awareapplicationisnotscaledbytheDWM(DPIvirtualization)sothetextisneverblurry.NSISdoesnotscalethebitmapusedbythetreecontrolonthecomponentpageandsomepluginsmighthavecompatibilityissuessomakesurethatyoutestyourinstalleratdifferentDPIsettingsifyouselecttrue.

SeeMSDNformoreinformationaboutDPI-awareapplications.

4.8.1.30ManifestSupportedOS

none|all|WinVista|Win7|Win8|Win8.1|Win10|{GUID}[...]

DeclarethattheinstalleriscompatiblewiththespecifiedWindowsversion(s).ThisaddsaSupportedOSentryinthecompatibilitysectionoftheapplicationmanifest.ThedefaultisWin7+8+8.1+10.noneisthedefaultifRequestExecutionLevelissettononeforcompatibilityreasons.

Windows8.1andlaterwillfakeitsversionnumberifyoudon'tdeclaresupportforthatparticularversion.YoucanreadmoreabouttheotherchangesinbehavioronMSDN.

4.8.1.31MiscButtonText

[back_button_text[next_button_text][cancel_button_text][close_button_text]]

Replacesthedefaulttextstringsforthefourbuttons(<Back,Next>,CancelandClose).Ifparametersareomitted,thedefaultsareused.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedin.onInit.

4.8.1.32Name

name[name_doubled_ampersands]

Setsthenameoftheinstaller.Thenameisusuallysimplytheproductnamesuchas'MyApp'or'CrapSoftMyApp'.Ifyouhaveoneormoreampersands(&)inthename,setthesecondparametertothesamename,onlywithdoubledampersands.Forexample,ifyourproduct'snameis"Foo&Bar",use:

Name"Foo&Bar""Foo&&Bar"

IfyouhaveampersandsinthenameanduseaLangStringforthename,youwillhavetocreateanotheronewithdoubledampersandstouseasthesecondparameter.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedin.onInit.

4.8.1.33OutFile

[path\]install.exe

SpecifiestheoutputfilethattheMakeNSISshouldwritetheinstallerto.ThisisjustthefilethatMakeNSISwrites,itdoesn'taffectthecontentsoftheinstaller.

4.8.1.34RequestExecutionLevel

none|user|highest|admin

SpecifiestherequestedexecutionlevelforWindowsVistaandhigher.Thevalueisembeddedintheinstalleranduninstaller'sXMLmanifestandtellsWindowswhichprivilegeleveltheinstallerrequires.userrequeststheuser'snormallevelwithnoadministrativeprivileges.highestwillrequestthehighestexecutionlevelavailableforthecurrentuserandwillcauseWindowstoprompttheusertoverifyprivilegeescalationiftheyareamemberoftheadministratorsgroup.Thepromptmight

requestfortheuser'spassword.admin,whichisalsothedefault,requestsadministratorlevelandwillcauseWindowstoprompttheuseraswell.SpecifyingnonewillkeepthemanifestemptyandletWindowsdecidewhichexecutionlevelisrequired.WindowsautomaticallyidentifiesNSISinstallersanddecidesadministratorprivilegesarerequired.Becauseofthis,noneandadminhavevirtuallythesameeffect.

It'srecommendedthateveryapplicationismarkedwitharequiredexecutionlevel.Unmarkedinstallersaresubjecttocompatibilitymode.Workaroundsofthismodeincludeautomaticallymovinganyshortcutscreatedintheuser'sstartmenutoallusers'startmenu.Installersthatdon'tinstallanythingintosystemfoldersnorwritetothelocalmachineregistry(HKLM)shouldspecifyuserexecutionlevel.

MoreinformationaboutthistopiccanbefoundonMSDN.

4.8.1.35SetFont

[/LANG=lang_id]font_face_namefont_size

Setstheinstallerfont.Pleaserememberthatthefontyouchoosemustbepresentontheuser'smachineaswell.Don'tuserarefontsthatonlyyouhave.

Usethe/LANGswitchifyouwishtosetadifferentfontforeachlanguage.Forexample:

SetFont/LANG=${LANG_ENGLISH}"EnglishFont"9SetFont/LANG=${LANG_FRENCH}"FrenchFont"10

TherearetwoLangStringsnamed^Fontand^FontSizewhichcontainthefontandfontsizeforeverylanguage.

4.8.1.36ShowInstDetails

hide|show|nevershow

Setswhetherornotthedetailsoftheinstallareshown.Canbe'hide'to

hidethedetailsbydefault,allowingtheusertoviewthem,or'show'toshowthembydefault,or'nevershow',topreventtheuserfromeverseeingthem.NotethatsectionscanoverridethisusingSetDetailsView.

4.8.1.37ShowUninstDetails

hide|show|nevershow

Setswhetherornotthedetailsoftheuninstallareshown.Canbe'hide'tohidethedetailsbydefault,allowingtheusertoviewthem,or'show'toshowthembydefault,or'nevershow',topreventtheuserfromeverseeingthem.NotethatsectionscanoverridethisusingSetDetailsView.

4.8.1.38SilentInstall

normal|silent|silentlog

Specifieswhetherornottheinstallershouldbesilent.Ifitis'silent'or'silentlog',allsectionsthathavetheSF_SELECTEDflagareinstalledquietly(youcansetthisflagusingSectionSetFlags),withnoscreenoutputfromtheinstalleritself(thescriptcanstilldisplaywhateveritwants,useMessageBox's/SDtospecifyadefaultforsilentinstallers).Notethatifthisissetto'normal'andtheuserrunstheinstallerwith/S(casesensitive)onthecommandline,itwillbehaveasifSilentInstall'silent'wasused.Note:seealsoLogSet.

Seesection4.12formoreinformation.

4.8.1.39SilentUnInstall

normal|silent

Specifieswhetherornottheuninstallershouldbesilent.Ifitis'silent'theuninstallsectionswillrunquietly,withnoscreenoutputfromtheuninstalleritself(thescriptcanstilldisplaywhateveritwants,useMessageBox's/SDtospecifyadefaultforsilentuninstallers).Notethatif

thisissetto'normal'andtheuserrunstheuninstallerwith/Sonthecommandline,itwillbehaveasifSilentUnInstall'silent'wasused.

Seesection4.12formoreinformation.

4.8.1.40SpaceTexts

[req_text[avail_text]]

Ifparametersarespecified,overridesthespacerequiredandspaceavailabletext("Spacerequired:"and"Spaceavailable:"bydefault).If'none'isspecifiedastherequiredtextnospacetextswillbeshown.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforethecomponentspageiscreated.

4.8.1.41SubCaption

[page_numbersubcaption]

Overridesthesubcaptionsforeachoftheinstallerpages(0=":LicenseAgreement",1=":InstallationOptions",2=":InstallationDirectory",3=":InstallingFiles",4=":Completed").Ifyouspecifyanemptystring(""),thedefaultwillbeused(youcanhoweverspecify""toachieveablankstring).

Youcanalsosetasubcaption(oroverridethedefault)usingCaptioninsideaPageExblock.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforetherelevantpageiscreated.

4.8.1.42UninstallButtonText

text

Changesthetextofthebuttonthatbydefaultsays"Uninstall"inthe

uninstaller.Ifnoparameterisspecified,thedefaulttextisused.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforetheuninstallbuttonshows.

4.8.1.43UninstallCaption

caption

Setswhatthetitlebarsoftheuninstallerwilldisplay.Bydefaultitis'$(^Name)Uninstall',whereNameisspecifiedwiththeNamecommand.Youcan,however,overrideitwith'MyAppuninstaller'orwhatever.Ifyouspecifyanemptystring(""),thedefaultwillbeused(youcanspecify""tosimulateaemptystring).

Acceptsvariables.Ifvariablesareused,theymustbeinitializedinun.onInit.

4.8.1.44UninstallIcon

[path\]icon.ico

Setstheiconoftheuninstaller.

4.8.1.45UninstallSubCaption

page_numbersubcaption

Setsthedefaultsubcaptionsfortheuninstallerpages(0=":Confirmation",1=":UninstallingFiles",2=":Completed").Ifyouspecifyanemptystring(""),thedefaultwillbeused(youcanspecify""tosimulateaemptystring).

Youcanalsosetasubcaption(oroverridethedefault)usingCaptioninsideaPageExblock.

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbefore

therelevantpageiscreated.

4.8.1.46UninstallText

text[subtext]

Specifiesthetextsontheuninstallerconfirmpage.

text:Textabovethecontrols

subtext:Textnexttotheuninstalllocation

Acceptsvariables.Ifvariablesareused,theymustbeinitializedbeforetheuninstallerconfirmpageiscreated.

4.8.1.47WindowIcon

on|off

Setswhetherornottheinstaller'siconisdisplayedoncertainpages.

4.8.1.48XPStyle

on|off

SetswhetherornotaXPvisualstylemanifestwillbeaddedtotheinstaller.ThismanifestmakestheinstallerscontrolsusethenewvisualstyleswhenrunningonWindowsXPandlater.Thisaffectstheuninstallertoo.

4.8.2CompilerFlags

Thefollowingcommandsaffecthowthecompilergeneratescodeandcompressesdata.Unlessotherwisenoted,thesecommandsarevalidanywhereinthescriptandaffecteverylinebelowwhereeachoneisplaced(untiloverriddenbyanothercommand).Theycannotbejumpedoverusingflowcontrolinstructions.

Forexample,inthefollowingscript,blah.datwillneverbeoverwritten.

${If}$0==0SetOverwriteon${Else}SetOverwriteoff${EndIf}Fileblah.dat#overwriteisalwaysoffhere!

Instead,thefollowingshouldbeused.

${If}$0==0SetOverwriteonFileblah.dat${Else}SetOverwriteoffFileblah.dat${EndIf}

4.8.2.1AllowSkipFiles

on|off

Thiscommandspecifieswhethertheusershouldbeabletoskipafileornot.AuserhasanoptiontoskipafileifSetOverwriteissettoon(default)andtheinstallerfailstoopenafileforwritingwhentryingtoextractafile.Ifoffisusedtheignorebuttonwhichallowstheusertoskipthefilewillnotbeshownandtheuserwillonlyhaveanoptiontoaborttheinstallation(Cancelbutton)orretryopeningthefileforwriting(Retrybutton).Ifonisusedtheuserwillhaveanoptiontoskipthefile(errorflagwillbeset-seeSetOverwrite).

4.8.2.2FileBufSize

buffer_size_in_mb

Thiscommandsetsthesizeofthecompiler'sinternalfilebuffers.This

commandallowsyoutocontrolthecompiler'smemoryusagebylimitinghowmuchofagivenfileitwillloadintomemoryatonce.Sincethecompilerneedsbothinputandoutput,twicethememorysizespecifiedcouldbeusedatanygiventimeforfilebuffers.ThiscommanddoesnotlimitthecompressionbufferswhichcouldtakeanothercoupleofMB,neitherdoesitlimitthecompiler'sotherinternalbuffers,butthoseshouldn'tnormallytop1MBanyway.Specifyingaverysmallnumbercoulddecreaseperformance.Specifyingaverylargenumbercouldexhaustsystemresourcesandforcethecompilertocancelthecompilationprocess.Thedefaultvalueis32MB.

4.8.2.3SetCompress

auto|force|off

Thiscommandsetsthecompressflagwhichisusedbytheinstallertodeterminewhetherornotdatashouldbecompressed.TypicallytheSetCompressflagwillaffectthecommandsafterit,andthelastSetCompresscommandinthefilealsodetermineswhetherornottheinstallinfosectionanduninstalldataoftheinstalleriscompressed.Ifcompressflagis'auto',thenfilesarecompressedifthecompressedsizeissmallerthantheuncompressedsize.Ifcompressflagissetto'force',thenthecompressedversionisalwaysused.Ifcompressflagis'off'thencompressionisnotused(whichcanbefaster).

Notethatthisoptionhasnoeffectwhensolidcompressionisused.

4.8.2.4SetCompressor

[/SOLID][/FINAL]zlib|bzip2|lzma

Thiscommandsetsthecompressionalgorithmusedtocompressfiles/dataintheinstaller.Itcanonlybeusedoutsideofsectionsandfunctionsandbeforeanydataiscompressed.Differentcompressionmethodscannotbeusedfordifferentfilesinthesameinstaller.Itisrecommendedtouseitattheverytopofthescripttoavoidcompilationerrors.

Threecompressionmethodsaresupported:ZLIB,BZIP2andLZMA.

ZLIB(thedefault)usesthedeflatealgorithm,itisaquickandsimplemethod.Withthedefaultcompressionlevelitusesabout300KBofmemory.

BZIP2usuallygivesbettercompressionratiosthanZLIB,butitisabitslowerandusesmorememory.Withthedefaultcompressionlevelitusesabout4MBofmemory.

LZMAisanewcompressionmethodthatgivesverygoodcompressionratios.Thedecompressionspeedishigh(10-20MB/sona2GHzCPU),thecompressionspeedislower.ThememorysizethatwillbeusedfordecompressionisthedictionarysizeplusafewKBs,thedefaultis8MB.

If/FINALisused,subsequentcallstoSetCompressorwillbeignored.

If/SOLIDisused,alloftheinstallerdataiscompressedinoneblock.Thisresultsingreatercompressionratios.

4.8.2.5SetCompressorDictSize

dict_size_mb

Setsthedictionarysizeinmegabytes(MB)usedbytheLZMAcompressor(defaultis8MB).

4.8.2.6SetDatablockOptimize

on|off

Thiscommandtellsthecompilerwhetherornottododatablockoptimizations.Datablockoptimizationscausesthecompilertochecktoseeifanydatabeingaddedtothedatablockisalreadyinthedatablock,andifso,itissimplyreferencedasopposedtoadded(cansavealittlebitofsize).Itishighlyrecommendedtoleavethisoptionon.

4.8.2.7SetDateSave

on|off

Thiscommandsetsthefiledate/timesavingflagwhichisusedbytheFilecommandtodeterminewhetherornottosavethelastwritedateandtimeofthefile,sothatitcanberestoredoninstallation.Validflagsare'on'and'off'.'on'isthedefault.

4.8.2.8SetOverwrite

on|off|try|ifnewer|ifdiff|lastused

ThiscommandsetstheoverwriteflagwhichisusedbytheFilecommandtodeterminewhetherornotthefileshouldoverwriteanyexistingfilesthatarepresent.Ifoverwriteflagis'on',filesareoverwritten(thisisthedefault).Ifoverwriteflagis'off',filesthatarealreadypresentarenotoverwritten.Ifoverwriteflagis'try',filesareoverwrittenifpossible(meaningthatifthefileisnotabletobewrittento,itisskippedwithoutanyuserinteraction).Ifoverwriteflagis'ifnewer',thenfilesareonlyoverwritteniftheexistingfileisolderthanthenewfile.Ifoverwriteflagis'ifdiff',thenfilesareonlyoverwritteniftheexistingfileisolderornewerthanthenewfile.Notethatwhenin'ifnewer'or'ifdiff'mode,thedestinationfile'sdateisset,regardlessofwhatSetDateSaveissetto.

SetOverwriteoffFileprogram.cfg#configfilewedon'twanttooverwriteSetOverwriteon

4.8.2.9Unicode

true|false

GenerateaUnicodeinstaller.Itcanonlybeusedoutsideofsectionsandfunctionsandbeforeanydataiscompressed.

4.8.3VersionInformation

4.8.3.1VIAddVersionKey

[/LANG=lang_id]keynamevalue

Addsastringentrytotheversioninformationstoredintheinstalleranduninstaller.ThesecanbeviewedintheFilePropertiesVersionorDetailstab.keynamecaneitherbeaspecialnameknownbyWindowsorauserdefinedname./LANG=0canbeusedtoindicatealanguageneutrallanguageid.ThefollowingnamesareknownbyWindows:

ProductNameCommentsCompanyNameLegalCopyrightFileDescriptionFileVersionProductVersionInternalNameLegalTrademarksOriginalFilenamePrivateBuildSpecialBuild

Thedisplayednameofthesespecialentriesaretranslatedonthetargetsystem,whereasuserdefinedkeynamesremainuntranslated.

VIAddVersionKey/LANG=${LANG_ENGLISH}"ProductName""TestApplication"VIAddVersionKey/LANG=${LANG_ENGLISH}"Comments""Atestcomment"VIAddVersionKey/LANG=${LANG_ENGLISH}"CompanyName""Fakecompany"VIAddVersionKey/LANG=${LANG_ENGLISH}"LegalTrademarks""TestApplicationisatrademarkofFakecompany"VIAddVersionKey/LANG=${LANG_ENGLISH}"LegalCopyright""©Fakecompany"VIAddVersionKey/LANG=${LANG_ENGLISH}"FileDescription""TestApplication"VIAddVersionKey/LANG=${LANG_ENGLISH}"FileVersion""1.2.3"

4.8.3.2VIProductVersion

version_string_X.X.X.X

SetstheProductVersionintheVS_FIXEDFILEINFOversioninformationblock.

VIProductVersion1.2.3.4

4.8.3.3VIFileVersion

version_string_X.X.X.X

SetstheFileVersionintheVS_FIXEDFILEINFOversioninformationblock(YoushouldalsosettheFileVersionstringwithVIAddVersionKeysotheinformationisdisplayedatthetopoftheVersionTabinthePropertiesofthefile).Ifyoudon'tprovideaFileVersiontheProductVersionisusedintheVS_FIXEDFILEINFOblock.

VIFileVersion1.2.3.4

Previous|Contents|Next

Previous|Contents|Next

4.9Instructions

4.9.1BasicInstructions

TheinstructionsthatNSISusesforscriptingaresortofacrossbetweenPHPandassembly.Therearenorealhighlevellanguageconstructsbuttheinstructionsthemselvesare(forthemostpart)highlevel,andyouhavehandystringcapability(i.e.youdon'thavetoworryaboutconcatenatingstrings,etc).Youessentiallyhave25registers(20generalpurpose,5specialpurpose),andastack.

4.9.1.1Delete

[/REBOOTOK]file

Deletefile(whichcanbeafileorwildcard,butshouldbespecifiedwithafullpath)fromthetargetsystem.If/REBOOTOKisspecifiedandthefilecannotbedeletedthenthefileisdeletedwhenthesystemreboots--ifthefilewillbedeletedonareboot,therebootflagwillbeset.Theerrorflagissetiffilesarefoundandcannotbedeleted.Theerrorflagisnotsetwhentryingtodeleteafilethatdoesnotexist.

Delete$INSTDIR\somefile.dat

Warning:The/REBOOTOKswitchrequiresadministratorrightsonWindowsNTandlater.

4.9.1.2Exec

command

Executethespecifiedprogramandcontinueimmediately.Notethatthefilespecifiedmustexistonthetargetsystem,notthecompilingsystem.$OUTDIRisusedastheworkingdirectory.Theerrorflagissetiftheprocesscouldnotbelaunched.Note,ifthecommandcouldhavespaces,

youshouldputitinquotestodelimititfromparameters.e.g.:Exec'"$INSTDIR\command.exe"parameters'.Ifyoudon'tputitinquotesitwillnotworkonWindows9xwithorwithoutparameters.

Exec'"$INSTDIR\someprogram.exe"'Exec'"$INSTDIR\someprogram.exe"someparameters'

4.9.1.3ExecShell

[/INVOKEIDLIST]actioncommand[parameters][SW_SHOWDEFAULT|SW_SHOWNORMAL|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_HIDE]

ExecutethespecifiedprogramusingShellExecuteEx.Notethatactionisusually"open","print",etc,butcanbeanemptystringtousethedefaultaction.Parametersandtheshowtypeareoptional.$OUTDIRisusedastheworkingdirectory.Theerrorflagissetiftheprocesscouldnotbelaunched.

ExecShell"open""http://nsis.sf.net/"ExecShell"open""$INSTDIR\readme.txt"ExecShell"print""$INSTDIR\readme.txt"ExecShell/INVOKEIDLIST"properties""$TEMP"

4.9.1.4ExecShellWait

[/INVOKEIDLIST]actioncommand[parameters][SW_SHOWDEFAULT|SW_SHOWNORMAL|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_HIDE]

ExecutethespecifiedprogramusingExecShellandwaitforexecutedprocesstoquit.ItwillonlywaitforexecutablefilesandnototherfiletypesnorURLs.

4.9.1.5ExecWait

command[user_var(exitcode)]

Executethespecifiedprogramandwaitfortheexecutedprocesstoquit.SeeExecformoreinformation.IfnooutputvariableisspecifiedExecWait

setstheerrorflagiftheprogramexecutedreturnsanonzeroerrorcode,orifthereisanerror.Ifanoutputvariableisspecified,ExecWaitsetsthevariablewiththeexitcode(andonlysetstheerrorflagifanerroroccurs;ifanerroroccursthecontentsoftheuservariableareundefined).Note,ifthecommandcouldhavespaces,youshouldputitinquotestodelimititfromparameters.e.g.:ExecWait'"$INSTDIR\command.exe"parameters'.Ifyoudon'tputitinquotesitwillnotworkonWindows9xwithorwithoutparameters.

ExecWait'"$INSTDIR\someprogram.exe"'ExecWait'"$INSTDIR\someprogram.exe"'$0DetailPrint"someprogramreturned$0"

4.9.1.6File

[/nonfatal][/a]([/r][/xfile|wildcard[...]](file|wildcard)[...]|/oname=file.datinfile.dat)

Addsfile(s)tobeextractedtothecurrentoutputpath($OUTDIR).

Notethattheoutputfilenameis$OUTDIR\filename_portion_of_file.Use/oname=Xswitchtochangetheoutputname.Xmaycontainvariablesandcanbeafullyqualifiedpathorarelativepathinwhichcaseitwillbeappendedto$OUTDIRsetbySetOutPath.Whenusingthisswitch,onlyonefilecanbespecified.Iftheoutputnamecontainsspaces,quotetheentireparameter,including/oname,asshownintheexamplesbelow.Wildcardsaresupported.Ifthe/rswitchisused,matchingfilesanddirectoriesarerecursivelysearchedforinsubdirectories.Ifjustonepathsegmentisspecified(e.g.File/rsomething),thecurrentdirectorywillberecursivelysearched.Ifmorethanonesegmentisspecified(e.g.File/rsomething\*.*),thelastpathsegmentwillbeusedasthematchingconditionandanythingbeforeitspecifieswhichdirectorytosearchrecursively.Ifadirectorynamematches,allofitscontentsisaddedrecursively.Directorystructureispreserved.Usethe/xswitchtoexcludefilesanddirectories.Ifthe/aswitchisused,theattributesofthefile(s)addedwillbepreserved.

TheFilecommandsetstheerrorflagifoverwritemodeissetto'try'andthefilecouldnotbeoverwritten,oriftheoverwritemodeissetto'on'andthefilecouldnotbeoverwrittenandtheuserselectsignore.Ifthe/nonfatalswitchisusedandnofilesarefound,awarningwillbeissuedinsteadofanerror.

Filesomething.exeFile/asomething.exeFile*.exeFile/r*.datFile/rdataFile/oname=temp.datsomefile.extFile/oname=$TEMP\temp.datsomefile.extFile"/oname=$TEMP\namewithspaces.dat"somefile.extFile/nonfatal"afilethatmightnotexist"File/r/xCVSmyproject\*.*File/r/x*.res/x*.obj/x*.pchsource\*.*

Note:whenusingthe/rswitch,bothmatchingdirectoriesandfileswillbesearched.Thisisalwaysdonewithorwithouttheuseofwildcards,evenifthegivenpathperfectlymatchesonedirectory.Thatmeans,thefollowingdirectorystructure:

<DIR>somethingfile.datanother.dat<DIR>dirsomething<DIR>dir2file2.dat<DIR>another<DIR>somethingreadme.txt

withthefollowingFileusage:

File/rsomething

willmatchthedirectorynamedsomethingintherootdirectory,thefilenamedsomethinginthedirectorynameddirandthedirectorynamedsomethinginthedirectorynamedanother.Tomatchonlythedirectorynamedsomethingintherootdirectory,usethefollowing:

File/rsomething\*.*

Whenadding\*.*,itwillbeusedasthematchingconditionandsomethingwillbeusedasthedirectorytosearch.Whenonlysomethingisspecified,thecurrentdirectorywillberecursivelysearchedforeveryfileanddirectorynamedsomethingandanother\somethingwillbematched.

4.9.1.7Rename

[/REBOOTOK]source_filedest_file

Renamesource_filetodest_file.Youcanuseittomoveafilefromanywhereonthesystemtoanywhereelseandyoucanmoveadirectorytosomewhereelseonthesamedrive.Thedestinationfilemustnotexistorthemovewillfail(unlessyouareusing/REBOOTOK).If/REBOOTOKisspecified,andthefilecannotbemoved(if,forexample,thedestinationexists),thenthefileismovedwhenthesystemreboots.Ifthefilewillbemovedonareboot,therebootflagwillbeset.Theerrorflagissetifthefilecannotberenamed(and/REBOOTOKisnotused)orifthesourcefiledoesnotexist.

Ifnoabsolutepathisspecifiedthecurrentfolderwillbeused.ThecurrentfolderisthefoldersetusingthelastSetOutPathinstruction.IfyouhavenotusedSetOutPaththecurrentfolderis$EXEDIR.

Rename$INSTDIR\file.ext$INSTDIR\file.dat

Warning:The/REBOOTOKswitchrequiresadministratorrightsonWindowsNTandlater.

4.9.1.8ReserveFile

[/nonfatal][/r][/xfile|wildcard[...]]file[file...]|[/nonfatal]/pluginfile.dll

Reservesafileinthedatablockforlateruse.Filesareaddedtothecompresseddatablockintheordertheyappearinthescript.Functions,however,arenotnecessarilycalledintheordertheyappearinthescript.Therefore,ifyouaddafileinafunctioncalledearlybutputthefunctionattheendofthescript,allofthefilesaddedearlierwillhavetobedecompressedtogettotherequiredfile.Thisprocesscantakealongtimeiftherealotoffiles..onInitisonesuchfunction.Itiscalledattheverybeginning,beforeanythingelseappears.Ifyouputitattheveryendofthescript,extractsomefilesinitandhavelotsoffilesaddedbeforeit,theinstallermighttakeaverylongtimetoload.Thisiswherethiscommandcomesuseful,allowingyoutospeeduptheloadingprocessbyincludingthefileatthetopofthedatablockinsteadoflettingNSISseekallthewaydowntothebottomofthecompresseddatablock.

Use/plugintoreserveapluginin${NSISDIR}\Plugins\*.

SeeFileformoreinformationabouttheparameters.

4.9.1.9RMDir

[/r][/REBOOTOK]directory_name

Removethespecifieddirectory(fullyqualifiedpathwithnowildcards).Without/r,thedirectorywillonlyberemovedifitiscompletelyempty.If/risspecifiedthedirectorywillberemovedrecursively,soalldirectoriesandfilesinthespecifieddirectorywillberemoved.If/REBOOTOKisspecified,anyfileordirectorywhichcouldnotberemovedduringtheprocesswillberemovedonreboot--ifanyfileordirectorywillberemovedonareboot,therebootflagwillbeset.Theerrorflagissetifanyfileordirectorycannotberemoved.

RMDir$INSTDIRRMDir$INSTDIR\dataRMDir/r/REBOOTOK$INSTDIRRMDir/REBOOTOK$INSTDIR\DLLs

Notethatthecurrentworkingdirectorycannotbedeleted.ThecurrentworkingdirectoryissetbySetOutPath.Forexample,thefollowingexamplewillnotdeletethedirectory.

SetOutPath$TEMP\dirRMDir$TEMP\dir

Thenextexamplewillsucceedindeletingthedirectory.

SetOutPath$TEMP\dirSetOutPath$TEMPRMDir$TEMP\dir

Warning:UsingRMDir/r$INSTDIRintheuninstallerisnotsafe.Thoughitisunlikely,theusermightselecttoinstalltotherootoftheProgramFilesfolderandthiscommandwouldwipeouttheentireProgramFilesfolder,includingallotherinstalledprograms!Theusercanalsoputotherfilesintheinstallationfolderandwouldn'texpectthemtogetdeletedalongwiththeprogram.Solutionsareavailableforeasilyuninstallingonlyfileswhichwereinstalledbytheinstaller.

Warning:The/REBOOTOKswitchrequiresadministratorrightsonWindowsNTandlater.

4.9.1.10SetOutPath

outpath

Setstheoutputpath($OUTDIR)andcreatesit(recursivelyifnecessary),ifitdoesnotexist.Mustbeafullpathname,usuallyisjust$INSTDIR(youcanspecify$INSTDIRwithasingle"-"ifyouarelazy).

SetOutPath$INSTDIRFileprogram.exe

4.9.2Registry,INI,FileInstructions

Inallofthebelowregistryinstructionsuseanemptystring(justtwoquoteswithnothingbetweenthem-"")asthekeynametospecifythedefaultkeywhichisshownas(Default)inregedit.exe.

UseSetRegViewon64-bitWindowstochoosewhichregistryviewisused.

IfafullpathisnotspecifiedforanyoftheINIhandlinginstructions,theWindowsdirectorywillbeused.

4.9.2.1DeleteINISec

ini_filenamesection_name

Deletestheentiresection[section_name]fromini_filename.Ifthesectioncouldnotberemovedfromtheinifile,theerrorflagisset.Itdoesnotsettheerrorflagifthesectioncouldnotbefound.

WriteINIStr$TEMP\something.inisection1something123WriteINIStr$TEMP\something.inisection1somethingelse1234WriteINIStr$TEMP\something.inisection2nsistrueDeleteINISec$TEMP\something.inisection1

4.9.2.2DeleteINIStr

ini_filenamesection_namestr_name

Deletesthestringstr_namefromsection[section_name]fromini_filename.Ifthestringcouldnotberemovedfromtheinifile,theerrorflagisset.Itdoesnotsettheerrorflagifthestringcouldnotbefound.

WriteINIStr$TEMP\something.inisection1something123WriteINIStr$TEMP\something.inisection1somethingelse1234DeleteINIStr$TEMP\something.inisection1somethingelse

4.9.2.3DeleteRegKey

[/ifempty]root_keysubkey

Deletesaregistrykey.If/ifemptyisspecified,theregistrykeywillonlybedeletedifithasnosubkeys(otherwise,thewholeregistrytreewillberemoved).Validvaluesforroot_keyarelistedunderWriteRegStr.Theerrorflagissetifthekeycouldnotberemovedfromtheregistry(orifitdidn'texisttobeginwith).

DeleteRegKeyHKLM"Software\MyCompany\MySoftware"DeleteRegKey/ifemptyHKLM"Software\Akeythatmighthavesubkeys"

4.9.2.4DeleteRegValue

root_keysubkeykey_name

Deletesaregistryvalue.Validvaluesforroot_keyarelistedunderWriteRegStr.Theerrorflagissetifthevaluecouldnotberemovedfromtheregistry(orifitdidn'texisttobeginwith).

DeleteRegValueHKLM"Software\MyCompany\MySoftware""somevalue"

4.9.2.5EnumRegKey

user_var(output)root_keysubkeyindex

Setuservariable$xwiththenameofthe'index'thregistrykeyinroot_key\Subkey.Validvaluesforroot_keyarelistedunderWriteRegStr.Returnsanemptystringiftherearenomorekeys,andreturnsanemptystringandsetstheerrorflagifthereisanerror.

StrCpy$00loop:EnumRegKey$1HKLMSoftware$0StrCmp$1""doneIntOp$0$0+1MessageBoxMB_YESNO|MB_ICONQUESTION"$1$\n$\nMore?"IDYESloopdone:

4.9.2.6EnumRegValue

user_var(output)root_keysubkeyindex

Setuservariable$xwiththenameofthe'index'thregistryvalueinroot_key\Subkey.Validvaluesforroot_keyarelistedunderWriteRegStr.Returnsanemptystringandsetstheerrorflagiftherearenomorevaluesorifthereisanerror.

StrCpy$00loop:ClearErrorsEnumRegValue$1HKLMSoftware\Microsoft\Windows\CurrentVersion$0IfErrorsdoneIntOp$0$0+1ReadRegStr$2HKLMSoftware\Microsoft\Windows\CurrentVersion$1MessageBoxMB_YESNO|MB_ICONQUESTION"$1=$2$\n$\nMore?"IDYESloopdone:

4.9.2.7ExpandEnvStrings

user_var(output)string

Expandsenvironmentvariablesinstringintotheuservariable$x.Ifanenvironmentvariabledoesn'texist,itwillnotbereplaced.Forexample,ifyouuse"%var%"andvardoesn'texists,theresultwillbe"%var%".Ifthereisanerror,thevariableissettoempty,andtheerrorflagisset.

ExpandEnvStrings$0"WINDIR=%WINDIR%$\nTEMP=%TEMP%"

4.9.2.8FlushINI

ini_filename

FlushestheINIfile'sbuffers.Windows9xkeepsallchangestotheINIfileinmemory.Thiscommandcausesthechangestobewrittentothedisk

immediately.UseitifyouedittheINImanually,deleteit,moveitorcopyitrightafteryouchangeitwithWriteINIStr,DeleteINISecorDeleteINStr.

WriteINIStr$TEMP\something.initesttesttestFlushINI$TEMP\something.iniDelete$TEMP\something.ini

4.9.2.9ReadEnvStr

user_var(output)name

Readsfromtheenvironmentstring"name"andsetsthevalueintotheuservariable$x.Ifthereisanerrorreadingthestring,theuservariableissettoempty,andtheerrorflagisset.

ReadEnvStr$0WINDIRReadEnvStr$1TEMP

4.9.2.10ReadINIStr

user_var(output)ini_filenamesection_nameentry_name

Readsfromentry_namein[section_name]ofini_filenameandstoresthevalueintouservariable$x.Theerrorflagwillbesetand$xwillbeassignedtoanemptystringiftheentryisnotfound.

ReadINIStr$0$INSTDIR\winamp.iniwinampoutname

4.9.2.11ReadRegDWORD

user_var(output)root_keysub_keyname

Readsa32-bitDWORDfromtheregistryintotheuservariable$x.Validvaluesforroot_keyarelistedunderWriteRegStr.Theerrorflagwillbesetand$xwillbesettoanemptystring(""whichisinterpretedas0inmathoperations)iftheDWORDisnotpresent.Ifthevalueispresent,but

isnotaDWORD,itwillbereadasastringandtheerrorflagwillbeset.

ReadRegDWORD$0HKLMSoftware\NSISVersionBuild

4.9.2.12ReadRegStr

user_var(output)root_keysub_keyname

Readsfromtheregistryintotheuservariable$x.Validvaluesforroot_keyarelistedunderWriteRegStr.Theerrorflagwillbesetand$xwillbesettoanemptystring("")ifthestringisnotpresent.Ifthevalueispresent,butisoftypeREG_DWORD,itwillbereadandconvertedtoastringandtheerrorflagwillbeset.

ReadRegStr$0HKLMSoftware\NSIS""DetailPrint"NSISisinstalledat:$0"

4.9.2.13WriteINIStr

ini_filenamesection_nameentry_namevalue

Writesentry_name=valueinto[section_name]ofini_filename.Theerrorflagissetifthestringcouldnotbewrittentotheinifile.

WriteINIStr$TEMP\something.inisection1something123WriteINIStr$TEMP\something.inisection1somethingelse1234WriteINIStr$TEMP\something.inisection2nsistrue

4.9.2.14WriteRegBin

root_keysubkeykey_namevaluedata

Thiscommandwritesablockofbinarydatatotheregistry.Validvaluesforroot_keyarelistedunderWriteRegStr.Valuedataisinhexadecimal(e.g.DEADBEEF01223211151).Theerrorflagissetifthebinarydatacouldnotbewrittentotheregistry.Iftheregistrykeydoesn'texistitwill

becreated.

WriteRegBinHKLM"Software\MyCompany\MySoftware""BinaryValue"DEADBEEF01223211151

4.9.2.15WriteRegDWORD

root_keysubkeykey_namevalue

ThiscommandwritesaDWORD(32-bitinteger)totheregistry(auservariablecanbespecified).Validvaluesforroot_keyarelistedunderWriteRegStr.Theerrorflagissetifthedwordcouldnotbewrittentotheregistry.Iftheregistrykeydoesn'texistitwillbecreated.

WriteRegDWORDHKLM"Software\MyCompany\MySoftware""DWORDValue"0xDEADBEEF

4.9.2.16WriteRegStr

root_keysubkeykey_namevalue

Writeastringtotheregistry.SeeWriteRegExpandStrformoredetails.

WriteRegStrHKLM"Software\MyCompany\MySoftware""StringValue""deadbeef"

4.9.2.17WriteRegExpandStr

root_keysubkeykey_namevalue

Writeastringtotheregistry.root_keymustbeoneof:

HKCRorHKEY_CLASSES_ROOTHKLMorHKEY_LOCAL_MACHINEHKCUorHKEY_CURRENT_USERHKUorHKEY_USERSHKCCorHKEY_CURRENT_CONFIGHKDDorHKEY_DYN_DATAHKPDorHKEY_PERFORMANCE_DATA

SHCTXorSHELL_CONTEXTHKCR32orHKCR64HKCU32orHKCU64HKLM32orHKLM64

Ifroot_keyisSHCTXorSHELL_CONTEXT,itwillbereplacedwithHKLMifSetShellVarContextissettoallandwithHKCUifSetShellVarContextissettocurrent.

Theerrorflagissetifthestringcouldnotbewrittentotheregistry.ThetypeofthestringwillbeREG_SZforWriteRegStr,orREG_EXPAND_STRforWriteRegExpandStr.Iftheregistrykeydoesn'texistitwillbecreated.

WriteRegExpandStrHKLM"Software\MyCompany\MySoftware""ExpandStringValue""%WINDIR%\notepad.exe"

4.9.2.18WriteRegMultiStr

/REGEDIT5root_keysubkeykey_namevalue

Writesamulti-stringvalue.The/REGEDIT5switchmustbeusedandspecifiesthatthedataisinthehexformatusedby.regfilesonWindows2000andlater.

WriteRegMultiStr/REGEDIT5HKCU"Software\NSIS\Test""MultiValue"66,00,6f,00,6f,00,00,00,62,00,61,00,72,00,00,00,00,00

4.9.2.19SetRegView

32|64|default|lastused

Setstheregistryviewaffectedbyregistrycommands(rootkeyswitha32/64suffixarenotaffected).On64-bitversionsofWindowstherearetwoviews;onefor32-bitapplicationsandonefor64-bitapplications.Bydefault,32-bitapplicationsrunningon64-bitsystems(WOW64)onlyhaveaccesstothe32-bitview.UsingSetRegView64allowstheinstallertoaccesskeysinthe64-bitviewoftheregistry.RegistryoperationswillfailiftheselectedviewisnotsupportedbyWindows.

AffectsDeleteRegKey,DeleteRegValue,EnumRegKey,EnumRegValue,ReadRegDWORD,ReadRegStr,WriteRegBin,WriteRegDWORD,WriteRegStrandWriteRegExpandStr.

DoesnotaffectInstallDirRegKey.Instead,theregistrymustbereadusingReadRegStrin.onInit.

SetRegView32ReadRegStr$0HKLMSoftware\Microsoft\Windows\CurrentVersionProgramFilesDirDetailPrint$0#printsC:\ProgramFiles(x86)!includex64.nsh${If}${RunningX64}SetRegView64ReadRegStr$0HKLMSoftware\Microsoft\Windows\CurrentVersionProgramFilesDirDetailPrint$0#printsC:\ProgramFiles${EndIf}

Function.onInit${If}${RunningX64}SetRegView64ReadRegStr$INSTDIRHKLMSoftware\NSIS""SetRegViewDefault${EndIf}FunctionEnd

4.9.3GeneralPurposeInstructions

4.9.3.1CallInstDLL

dllfilefunction_name

Callsafunctionnamedfunction_nameinsideaNSISextensionDLL,aplug-in.Seetheexamplepluginforhowtomakeone.ExtensionDLLscanaccessthestackandvariables.Note:Toautomaticallyextractandcallplug-inDLLs,useaplug-incommandinsteadofCallInstDLL.

Push"aparameter"

Push"anotherparameter"CallInstDLL$INSTDIR\somedll.dllsomefunction

Foreasierplug-inhandling,usethenewplug-incallsyntax.

4.9.3.2CopyFiles

[/SILENT][/FILESONLY]filespec_on_destsysdestination_path[size_of_files_in_kb]

Copiesfilesfromthesourcetothedestinationontheinstallingsystem.Usefulwith$EXEDIRifyouwanttocopyfrominstallationmedia,ortocopyfromoneplacetoanotheronthesystem.YoumightseeaWindowsstatuswindowofthecopyoperationiftheoperationtakesalotoftime(todisablethis,use/SILENT).Thelastparametercanbeusedtospecifythesizeofthefilesthatwillbecopied(inkilobytes),sothattheinstallercanapproximatethediskspacerequirements.Onerror,oriftheusercancelsthecopy(onlypossiblewhen/SILENTwasomitted),theerrorflagisset.If/FILESONLYisspecified,onlyfilesarecopied.

Fully-qualifiedpathnamesshouldalwaysbeusedwiththisinstruction.Usingrelativepathswillhaveunpredictableresults.

CreateDirectory$INSTDIR\backupCopyFiles$INSTDIR\*.dat$INSTDIR\backup

4.9.3.3CreateDirectory

path_to_create

Creates(recursivelyifnecessary)thespecifieddirectory.Theerrorflagissetifthedirectorycouldn'tbecreated.

Youshouldalwaysspecifyanabsolutepath.

CreateDirectory$INSTDIR\some\directory

4.9.3.4CreateShortcut

[/NoWorkingDir]link.lnktarget.file[parameters[icon.file[icon_index_number[start_options[keyboard_shortcut[description]]]]]]

Createsashortcut'link.lnk'thatlinksto'target.file',withoptionalparameters'parameters'.Theiconusedfortheshortcutis'icon.file,icon_index_number';fordefaulticonsettingsuseemptystringsforbothicon.fileandicon_index_number.start_optionsshouldbeoneof:SW_SHOWNORMAL,SW_SHOWMAXIMIZED,SW_SHOWMINIMIZED,oranemptystring.keyboard_shortcutshouldbeintheformof'flag|c'whereflagcanbeacombination(using|)of:ALT,CONTROL,EXT,orSHIFT.cisthecharactertouse(a-z,A-Z,0-9,F1-F24,etc).Notethatnospacesareallowedinthisstring.Agoodexampleis"ALT|CONTROL|F8".$OUTDIRisusedastheworkingdirectory.YoucanchangeitbyusingSetOutPathbeforecreatingtheShortcutoruse/NoWorkingDirifyoudon'tneedtosettheworkingdirectory.descriptionshouldbethedescriptionoftheshortcut,orcommentasitiscalledunderXP.Theerrorflagissetiftheshortcutcannotbecreated(i.e.eitherofthepaths(linkortarget)doesnotexist,orsomeothererror).

CreateDirectory"$SMPROGRAMS\MyCompany"CreateShortcut"$SMPROGRAMS\MyCompany\MyProgram.lnk""$INSTDIR\MyProgram.exe"\"somecommandlineparameters""$INSTDIR\MyProgram.exe"2SW_SHOWNORMAL\ALT|CONTROL|SHIFT|F5"adescription"

4.9.3.5GetDLLVersion

filenameuser_var(highdwordoutput)user_var(lowdwordoutput)

GetstheversioninformationfromtheDLL(oranyotherexecutablecontainingversioninformation)in"filename".Setstheuseroutputvariableswiththehighandlowdwordsofversioninformationonsuccess;onfailuretheoutputsareemptyandtheerrorflagisset.ThefollowingexamplereadstheDLLversionandcopiesahumanreadableversionofitinto$0:

GetDllVersion"$INSTDIR\MyDLL.dll"$R0$R1IntOp$R2$R0/0x00010000IntOp$R3$R0&0x0000FFFFIntOp$R4$R1/0x00010000

IntOp$R5$R1&0x0000FFFFStrCpy$0"$R2.$R3.$R4.$R5"

4.9.3.6GetDLLVersionLocal

localfilenameuser_var(highdwordoutput)user_var(lowdwordoutput)

ThisissimilartoGetDLLVersion,onlyitactsonthesystembuildingtheinstaller(itactuallycompilesintotwoStrCpycommands).SetsthetwooutputvariableswiththeDLLversioninformationoftheDLLonthebuildsystem.Use!getdllversionifyouneedtousethevalueswithVIProductVersion.

4.9.3.7GetFileTime

filenameuser_var(highdwordoutput)user_var(lowdwordoutput)

Getsthelastwritetimeof"filename".SetstheuseroutputvariableswiththehighandlowdwordsoftheFILETIMEtimestamponsuccess;onfailuretheoutputsareemptyandtheerrorflagisset.

4.9.3.8GetFileTimeLocal

localfilenameuser_var(highdwordoutput)user_var(lowdwordoutput)

ThisissimilartoGetFileTime,onlyitactsonthesystembuildingtheinstaller(itactuallycompilesintotwoStrCpycommands).Setsthetwooutputvariableswiththefiletimestampofthefileonthebuildsystem.

4.9.3.9GetFullPathName

[/SHORT]user_var(output)path_or_file

Assignthefullpathofthefilespecifiedtouservariable$x.Ifthepathportionoftheparameterisnotfound,theerrorflagwillbesetand$xwill

beempty.If/SHORTisspecified,thepathisconvertedtotheshortfilenameform.However,if/SHORTisnotspecified,thepathisn'tconvertedtoitslongfilenameform.Togetthelongfilename,callGetLongPathNameusingtheSystemplug-in.NotethatGetLongPathNameisonlyavailableonWindows98,Windows2000andabove.

StrCpy$INSTDIR$PROGRAMFILES\NSISSetOutPath$INSTDIRGetFullPathName$0..DetailPrint$0#willprintC:\ProgramFilesGetFullPathName/SHORT$0$INSTDIRDetailPrint$0#willprintC:\Progra~1\NSIS

StrCpy$0C:\Progra~1\NSISSystem::Call'kernel32::GetLongPathName(tr0,t.r1,i${NSIS_MAX_STRLEN})i.r2'StrCmp$2error+2StrCpy$0$1DetailPrint$0#willprintC:\ProgramFiles\NSIS,wheresupported

4.9.3.10GetTempFileName

user_var(output)[base_dir]

Assigntotheuservariable$x,thenameofatemporaryfile.Thefilewillbecreatedforyouanditwillbeempty.Thenameofthetemporaryfileisguaranteedtobeunique.IftowantthetemporaryfiletobecreatedinanotherdirectoryotherthantheWindowstempdirectory,specifyabase_dir.YoushouldDeletethefilewhenyouaredonewithit.

GetTempFileName$0File/oname=$0something.dat#dosomethingwithsomething.datDelete$0

4.9.3.11SearchPath

user_var(output)filename

Assigntotheuservariable$x,thefullpathofthefilenamedbythesecondparameter.Theerrorflagwillbesetand$xwillbeemptyifthefilecannotbefound.UsesSearchPath()tosearchthesystempathsforthefile.

4.9.3.12SetFileAttributes

filenameattribute1|attribute2|...

Setsthefileattributesof'filename'.Validattributescanbecombinedwith|andare:

NORMALorFILE_ATTRIBUTE_NORMAL(youcanuse0toabbreviatethis)ARCHIVEorFILE_ATTRIBUTE_ARCHIVEHIDDENorFILE_ATTRIBUTE_HIDDENOFFLINEorFILE_ATTRIBUTE_OFFLINEREADONLYorFILE_ATTRIBUTE_READONLYSYSTEMorFILE_ATTRIBUTE_SYSTEMTEMPORARYorFILE_ATTRIBUTE_TEMPORARY

Theerrorflagwillbesetifthefile'sattributescannotbeset(i.e.thefiledoesn'texist,oryoudon'thavetherightpermissions).Youcanonlysetattributes.It'snotpossibletounsetthem.IfyouwanttoremoveanattributeuseNORMAL.Thiswayallattributesareerased.Thiscommanddoesn'tsupportwildcards.

4.9.3.13RegDLL

dllfile[entrypoint_name]

LoadsthespecifiedDLLandcallsDllRegisterServer(orentrypoint_nameifspecified).Theerrorflagissetifanerroroccurs(i.e.itcan'tloadtheDLL,initializeOLE,findtheentrypoint,orthefunctionreturnedanythingotherthanERROR_SUCCESS(=0)).

UseSetOutPathtosetthecurrentdirectoryforDLLsthatdependonotherDLLsthatarenowinthepathorintheWindowsdirectory.Forexample,iffoo.dlldependsonbar.dllwhichislocatedin$INSTDIRuse:

SetOutPath$INSTDIRRegDLL$INSTDIR\foo.dll

4.9.3.14UnRegDLL

dllfile

LoadsthespecifiedDLLandcallsDllUnregisterServer.Theerrorflagissetifanerroroccurs(i.e.itcan'tloadtheDLL,initializeOLE,findtheentrypoint,orthefunctionreturnedanythingotherthanERROR_SUCCESS(=0)).

4.9.4FlowControlInstructions

4.9.4.1Abort

[user_message]

Cancelstheinstall,stopsexecutionofscript,anddisplaysuser_messageinthestatusdisplay.Note:youcanusethisfromCallbackfunctionstodospecialthings.PagecallbacksalsousesAbortforspecialpurposes.

AbortAbort"can'tinstall"

4.9.4.2Call

function_name|:label_name|user_var(input)

Callsthefunctionnamedfunction_name,thelabelnamedlabel_name,oravariablethatspecifiesanaddress.AnaddressisreturnedbyGetCurrentAddress,GetFunctionAddressorGetLabelAddress.Acall

returnswhenitencountersaReturninstruction.SectionsandfunctionsareautomaticallyendedwithaReturninstruction.Uninstallfunctionscannotbecalledfrominstallerfunctionsandsections,andvice-versa.

FunctionfuncCall:labelDetailPrint"#1:Thiswillonlyappear1time."label:DetailPrint"#2:Thiswillappearbeforeandaftermessage#1."Call:.global_labelFunctionEnd

SectionCallfuncReturn

.global_label:DetailPrint"#3:Thegloballabelwascalled"SectionEnd

4.9.4.3ClearErrors

Clearstheerrorflag.

ClearErrorsIfErrors0+2MessageBoxMB_OK"thismessageboxwillnevershow"

4.9.4.4GetCurrentAddress

user_var(output)

Getstheaddressofthecurrentinstruction(theGetCurrentAddress)andstoresitintheoutputuservariable.ThisuservariablethencanbepassedtoCallorGoto.

FunctionfuncDetailPrint"function"IntOp$0$0+2;Calculatetheaddressafteroftheinstructionafter"GotocallFunc"intheSectionCall$0DetailPrint"functionend"FunctionEnd

SectionDetailPrint"section"GetCurrentAddress$0GotocallFunc

DetailPrint"backinsection"Return

callFunc:CallfuncDetailPrint"sectionend"SectionEnd

4.9.4.5GetFunctionAddress

user_var(output)function_name

Getstheaddressofthefunctionandstoresitintheoutputuservariable.ThisuservariablethencanbepassedtoCallorGoto.NotethatifyouGotoanaddresswhichistheoutputofGetFunctionAddress,yourfunctionwillneverbereturnedto(whenthefunctionyouGoto'dtoreturns,youreturninstantly).

FunctionfuncDetailPrint"function"FunctionEnd

SectionGetFunctionAddress$0funcCall$0

SectionEnd

4.9.4.6GetLabelAddress

user_var(output)label

Getstheaddressofthelabelandstoresitintheoutputuservariable.ThisuservariablethencanbepassedtoCallorGoto.Notethatyoumayonlycallthiswithlabelsaccessiblefromyourfunction,butyoucancallitfromanywhere(whichispotentiallydangerous).NotethatifyouCalltheoutputofGetLabelAddress,codewillbeexecuteduntilitReturn's(explicitlyorimplicitlyattheendofafunction),andthenyouwillbereturnedtothestatementaftertheCall.

label:DetailPrint"label"GetLabelAddress$0labelIntOp$0$0+4Goto$0DetailPrint"done"

4.9.4.7Goto

label_to_jump_to|+offset|-offset|user_var(target)

Iflabelisspecified,gotothelabel'label_to_jump_to:'.

If+offsetor-offsetisspecified,jumpisrelativebyoffsetinstructions.Goto+1goestothenextinstruction,Goto-1goestothepreviousinstruction,etc.

Ifauservariableisspecified,jumpstoabsoluteaddress(generallyyouwillwanttogetthisvaluefromafunctionlikeGetLabelAddress).CompilerflagcommandsandSectionInaren'tinstructionssojumpingoverthemhasnoeffect.

Gotolabel

Goto+2Goto-2Goto$0

4.9.4.8IfAbort

label_to_goto_if_abort[label_to_goto_if_no_abort]

Will"return"trueiftheinstallationhasbeenaborted.Thiscanhappeniftheuserchoseabortonafilethatfailedtocreate(oroverwrite)oriftheuserabortedbyhand.Thisfunctioncanonlybecalledfromtheleavefunctionoftheinstfilespage.

Pageinstfiles""""instfilesLeave

FunctioninstfilesLeaveIfAbort0+2MessageBoxMB_OK"useraborted"FunctionEnd

4.9.4.9IfErrors

jumpto_iferror[jumpto_ifnoerror]

Checksandclearstheerrorflag,andifitisset,itwillgotojumpto_iferror,otherwiseitwillgotojumpto_ifnoerror.Theerrorflagissetbyotherinstructionswhenarecoverableerror(suchastryingtodeleteafilethatisinuse)occurs.

ClearErrorsFilefile.datIfErrors0+2CallErrorHandler

4.9.4.10IfFileExists

file_to_check_forjump_if_present[jump_otherwise]

Checksforexistenceoffile(s)file_to_check_for(whichcanbeawildcard,oradirectory),andGotosjump_if_presentifthefileexists,otherwiseGotosjump_otherwise.Ifyouwanttochecktoseeifafileisadirectory,useIfFileExistsDIRECTORY\*.*

IfFileExists$WINDIR\notepad.exe0+2MessageBoxMB_OK"notepadisinstalled"

4.9.4.11IfRebootFlag

jump_if_set[jump_if_not_set]

Checkstherebootflag,andjumpstojump_if_setiftherebootflagisset,otherwisejumpstojump_if_not_set.TherebootflagcanbesetbyDeleteandRename,ormanuallywithSetRebootFlag.

IfRebootFlag0norebootMessageBoxMB_YESNO"Arebootisrequiredtofinishtheinstallation.Doyouwishtorebootnow?"IDNOnorebootRebootnoreboot:

4.9.4.12IfSilent

jump_if_silent[jump_if_not]

Checksthesilentflag,andjumpstojump_if_silentiftheinstallerissilent,otherwisejumpstojump_if_not.ThesilentflagcanbesetbySilentInstall,SilentUninstall,SetSilentandbytheuserpassing/Sonthecommandline.

IfSilent+2ExecWait'"$INSTDIR\nonsilentprogram.exe"'

4.9.4.13IntCmp

val1val2jump_if_equal[jump_if_val1_less][jump_if_val1_more]

Comparestwointegersval1andval2.Ifval1andval2areequal,Gotosjump_if_equal,otherwiseifval1<val2,Gotosjump_if_val1_less,otherwiseifval1>val2,Gotosjump_if_val1_more.

IntCmp$05is5lessthan5morethan5is5:DetailPrint"$$0==5"Gotodonelessthan5:DetailPrint"$$0<5"Gotodonemorethan5:DetailPrint"$$0>5"Gotodonedone:

4.9.4.14IntCmpU

val1val2jump_if_equal[jump_if_val1_less][jump_if_val1_more]

SameasIntCmp,buttreatsthevaluesasunsignedintegers.

4.9.4.15MessageBox

mb_option_listmessagebox_text[/SDreturn][return_checkjumpto[return_check_2jumpto_2]]

DisplaysaMessageBoxcontainingthetext"messagebox_text".mb_option_listmustbeoneormoreofthefollowing,delimitedby|s(e.g.MB_YESNO|MB_ICONSTOP).

MB_OK-DisplaywithanOKbuttonMB_OKCANCEL-DisplaywithanOKandacancelbuttonMB_ABORTRETRYIGNORE-Displaywithabort,retry,ignorebuttonsMB_RETRYCANCEL-Displaywithretryandcancelbuttons

MB_YESNO-DisplaywithyesandnobuttonsMB_YESNOCANCEL-Displaywithyes,no,cancelbuttonsMB_ICONEXCLAMATION-DisplaywithexclamationiconMB_ICONINFORMATION-DisplaywithinformationiconMB_ICONQUESTION-DisplaywithquestionmarkiconMB_ICONSTOP-DisplaywithstopiconMB_USERICON-Displaywithinstaller'siconMB_TOPMOST-MakemessageboxtopmostMB_SETFOREGROUND-SetforegroundMB_RIGHT-RightaligntextMB_RTLREADING-RTLreadingorderMB_DEFBUTTON1-Button1isdefaultMB_DEFBUTTON2-Button2isdefaultMB_DEFBUTTON3-Button3isdefaultMB_DEFBUTTON4-Button4isdefault

Return_checkcanbe0(orempty,orleftoff),oroneofthefollowing:

IDABORT-AbortbuttonIDCANCEL-CancelbuttonIDIGNORE-IgnorebuttonIDNO-NobuttonIDOK-OKbuttonIDRETRY-RetrybuttonIDYES-Yesbutton

IfthereturnvalueoftheMessageBoxisreturn_check,theinstallerwillGotojumpto.

Usethe/SDparameterwithoneofthereturn_checkvaluesabovetospecifytheoptionthatwillbeusedwhentheinstallerissilent.Seesection4.12formoreinformation.

MessageBoxMB_OK"simplemessagebox"MessageBoxMB_YESNO"isittrue?"IDYEStrueIDNOfalsetrue:DetailPrint"it'strue!"Gotonextfalse:

DetailPrint"it'sfalse"next:MessageBoxMB_YESNO"isittrue?(defaultstoyesonsilentinstallations)"/SDIDYESIDNOfalse2DetailPrint"it'strue(orsilent)!"Gotonext2false2:DetailPrint"it'sfalse"next2:

4.9.4.16Return

Returnsfromafunctionorsection.

FunctionfuncStrCmp$0"returnnow"0+2Return#dostuffFunctionEnd

SectionCallfunc;"Return"willreturnhereSectionEnd

4.9.4.17Quit

Causestheinstallertoexitassoonaspossible.AfterQuitiscalled,theinstallerwillexit(nocallbackfunctionswillgetachancetorun).

4.9.4.18SetErrors

Setstheerrorflag.

SetErrorsIfErrors0+2

MessageBoxMB_OK"thismessageboxwillalwaysshow"

4.9.4.19StrCmp

str1str2jump_if_equal[jump_if_not_equal]

Compares(caseinsensitively)str1tostr2.Ifstr1andstr2areequal,Gotosjump_if_equal,otherwiseGotosjump_if_not_equal.

StrCmp$0"astring"0+3DetailPrint'$$0=="astring"'Goto+2DetailPrint'$$0!="astring"'

4.9.4.20StrCmpS

str1str2jump_if_equal[jump_if_not_equal]

SameasStrCmp,butcasesensitive.

4.9.5FileInstructions

4.9.5.1FileClose

handle

ClosesafilehandleopenedwithFileOpen.

4.9.5.2FileOpen

user_var(handleoutput)filenameopenmode

Opensafilenamed"filename"andsetsthehandleoutputvariablewiththehandle.Theopenmodeshouldbeoneof"r"(read)"w"(write,allcontentsoffilearedestroyed)or"a"(append,meaningopenedforboth

readandwrite,contentspreserved).Inallopenmodes,thefilepointerisplacedatthebeginningofthefile.Ifthefilecannotbeopenedthehandleoutputissettoemptyandtheerrorflagisset.

Ifnoabsolutepathisspecifiedthecurrentfolderwillbeused.ThecurrentfolderisthefoldersetusingthelastSetOutPathinstruction.IfyouhavenotusedSetOutPaththecurrentfolderis$EXEDIR.

FileOpen$0$INSTDIR\file.datrFileClose$0

4.9.5.3FileRead

handleuser_var(output)[maxlen]

Readsastring(ANSIcharacters)fromafileopenedwithFileOpen.Thestringisreaduntileitheranewline(orcarriagereturnnewlinepair)occurs,oruntilanullbyteisread,oruntilmaxlenismet(ifspecified).Bydefault,stringsarelimitedto1024characters(aspecialbuildwithlargerNSIS_MAX_STRLENcanbecompiledordownloaded).Iftheendoffileisreachedandnomoredataisavailable,theoutputstringwillbeemptyandtheerrorflagwillbeset.

Unicode:DBCStextissupportedbutconversionoutputislimitedtoUCS-2/BMP,surrogatepairsarenotsupported.ThesystemdefaultANSIcodepage(ACP)isusedduringtheconversion.

ClearErrorsFileOpen$0$INSTDIR\file.datrIfErrorsdoneFileRead$0$1DetailPrint$1FileClose$0done:

4.9.5.4FileReadUTF16LE

handleuser_var(output)[maxlen]

ThisfunctionisonlyavailablewhenbuildingaUnicodeinstaller.

Readsastring(UTF-16LEcharacters)fromafileopenedwithFileOpen.Thestringisreaduntileitheranewline(orcarriagereturnnewlinepair)occurs,oruntilanullwide-characterisread,oruntilmaxlenismet(ifspecified).Bydefault,stringsarelimitedto1024characters(aspecialbuildwithlargerNSIS_MAX_STRLENcanbecompiledordownloaded).Iftheendoffileisreachedandnomoredataisavailable,theoutputstringwillbeemptyandtheerrorflagwillbeset.Ifpresent,theBOMatthestartofthefileisskipped.

ClearErrorsFileOpen$0$INSTDIR\file.datrIfErrorsdoneFileReadUTF16LE$0$1DetailPrint$1FileClose$0done:

4.9.5.5FileReadByte

handleuser_var(output)

ReadsabytefromafileopenedwithFileOpen.Thebyteisstoredintheoutputasaninteger(0-255).Iftheendoffileisreachedandnomoredataisavailable,theoutputwillbeemptyandtheerrorflagwillbeset.

ClearErrorsFileOpen$0$INSTDIR\file.datrIfErrorsdoneFileReadByte$0$1FileReadByte$0$2DetailPrint"$1$2"FileClose$0done:

4.9.5.6FileReadWord

handleuser_var(output)

ThisfunctionisonlyavailablewhenbuildingaUnicodeinstaller.

Readsaword(2-bytes)fromafileopenedwithFileOpen.Thewordisstoredintheoutputasaninteger(0-65535).Iftheendoffileisreachedandnomoredataisavailable,theoutputwillbeemptyandtheerrorflagwillbeset.

ClearErrorsFileOpen$0$INSTDIR\file.datrIfErrorsdoneFileReadWord$0$1FileReadWord$0$2DetailPrint"$1$2"FileClose$0done:

4.9.5.7FileSeek

handleoffset[mode][user_var(newposition)]

SeeksafileopenedwithFileOpen.IfmodeisomittedorspecifiedasSET,thefileispositionedto"offset",relativetothebeginningofthefile.IfmodeisspecifiedasCUR,thenthefileispositionedto"offset",relativetothecurrentfileposition.IfmodeisspecifiedasEND,thenthefileispositionedto"offset",relativetotheendofthefile.Ifthefinalparameter"newposition"isspecified,thenewfilepositionwillbestoredinthatvariable.

ClearErrorsFileOpen$0$INSTDIR\file.datrIfErrorsdoneFileSeek$0-5ENDFileRead$0$1

DetailPrint$1FileClose$0done:

4.9.5.8FileWrite

handlestring

WritesanANSIstringtoafileopenedwithFileOpen.Ifanerroroccurswriting,theerrorflagwillbeset.

(IfyouarebuildingaUnicodeinstaller,thefunctionconvertsthestringtoANSI/MBCS.ThesystemdefaultANSIcodepage(ACP)isusedduringtheconversion)

ClearErrorsFileOpen$0$INSTDIR\file.datwIfErrorsdoneFileWrite$0"sometext"FileClose$0done:

4.9.5.9FileWriteUTF16LE

[/BOM]handlestring

ThisfunctionisonlyavailablewhenbuildingaUnicodeinstaller.

WritesaUnicode(UTF-16LE)stringtoafileopenedwithFileOpen.Ifanerroroccurs,theerrorflagwillbeset.ABOMcanbeaddedtoemptyfileswith/BOM.

ClearErrorsFileOpen$0$INSTDIR\file.datwIfErrorsdoneFileWriteUTF16LE$0"sometext"FileClose$0

done:

4.9.5.10FileWriteByte

handlestring

Writestheintegerinterpretationof'string'toafileopenedwithFileOpen.Theerrorflagissetifanerroroccurswhilewriting.Thefollowingcodewritesa"CarriageReturn/LineFeed"pairtothefile.

FileWriteBytefile_handle"13"FileWriteBytefile_handle"10"

Notethatonlythelowbyteoftheintegerisused,i.e.writing256isthesameaswriting0,etc.

4.9.5.11FileWriteWord

handlestring

ThisfunctionisonlyavailablewhenbuildingaUnicodeinstaller.

Writestheintegerinterpretationof'string'asaWORD(2-bytes,range:0-65535)toafileopenedwithFileOpen.Theerrorflagissetifanerroroccurswhilewriting.Thefollowingcodewritesa"CarriageReturn/LineFeed"pairtothefile.

FileWriteWordfile_handle"13"FileWriteWordfile_handle"10"

NotethatonlythelowWORDoftheintegerisused,i.e.writing65536isthesameaswriting0,etc.

4.9.5.12FindClose

handle

ClosesasearchopenedwithFindFirst.

4.9.5.13FindFirst

user_var(handleoutput)user_var(filenameoutput)filespec

Performsasearchfor'filespec',placingthefirstfilefoundinfilename_output(auservariable).Italsoputsthehandleofthesearchintohandle_output(alsoauservariable).Ifnofilesarefound,bothoutputsaresettoemptyandtheerrorflagisset.FindClosemustbeusedtoclosethehandle.Notethatthefilenameoutputiswithoutpath.

FindFirst$0$1$INSTDIR\*.txtloop:StrCmp$1""doneDetailPrint$1FindNext$0$1Gotoloopdone:FindClose$0

4.9.5.14FindNext

handleuser_var(filename_output)

ContinuesasearchbeganwithFindFirst.handleshouldbethehandle_output_variablereturnedbyFindFirst.Ifthesearchiscompleted(therearenomorefiles),filename_outputissettoemptyandtheerrorflagisset.Notethatthefilenameoutputiswithoutpath.

4.9.6UninstallerInstructions

4.9.6.1WriteUninstaller

[Path\]exename.exe

Writestheuninstallertothefilename(andoptionallypath)specified.Onlyvalidfromwithinaninstallsectionorfunctionandrequiresthatyouhaveanuninstallsectioninyourscript.Youcancallthisoneormoretimestowriteoutoneormorecopiesoftheuninstaller.

WriteUninstaller$INSTDIR\uninstaller.exe

4.9.7MiscellaneousInstructions

4.9.7.1GetErrorLevel

user_var(errorleveloutput)

ReturnsthelasterrorlevelsetbySetErrorLevelor-1ifithasneverbeenset.

GetErrorLevel$0IntOp$0$0+1SetErrorLevel$0

4.9.7.2GetInstDirError

user_var(erroroutput)

Useintheleavefunctionofadirectorypage.Readstheflagsetif'DirVerifyleave'isused.Possiblevalues:

0:Noerror

1:Invalidinstallationdirectory

2:Notenoughspaceoninstallationdrive

!includeLogicLib.nshPageExdirectoryDirVerifyleavePageCallbacks""""dirLeave

PageExEnd

FunctiondirLeaveGetInstDirError$0${Switch}$0${Case}0MessageBoxMB_OK"validinstallationdirectory"${Break}${Case}1MessageBoxMB_OK"invalidinstallationdirectory!"Abort${Break}${Case}2MessageBoxMB_OK"notenoughfreespace!"Abort${Break}${EndSwitch}FunctionEnd

4.9.7.3InitPluginsDir

Initializestheplug-insdir($PLUGINSDIR)ifnotalreadyinitialized.

InitPluginsDirFile/oname=$PLUGINSDIR\image.bmpimage.bmp

4.9.7.4Nop

Doesnothing.

4.9.7.5SetErrorLevel

error_level

Setstheerrorleveloftheinstalleroruninstallertoerror_level.SeeError

Levelsformoreinformation.

IfRebootFlag0+2SetErrorLevel4

4.9.7.6SetShellVarContext

current|all

Setsthecontextof$SMPROGRAMSandothershellfolders.Ifsetto'current'(thedefault),thecurrentuser'sshellfoldersareused.Ifsetto'all',the'allusers'shellfolderisused.TheallusersfoldermaynotbesupportedonallOSes.Iftheallusersfolderisnotfound,thecurrentuserfolderwillbeused.Pleasetakeintoconsiderationthata"normaluser"hasnorightstowriteintheallusersarea.Onlyadminshavefullaccessrightstotheallusersarea.YoucancheckthisbyusingtheUserInfoplug-in.SeeContrib\UserInfo\UserInfo.nsiforanexample.

Notethat,ifusedininstallercode,thiswillonlyaffecttheinstaller,andifusedinuninstallercode,thiswillonlyaffecttheuninstaller.Toaffectboth,itneedstobeusedinboth.

SetShellVarContextcurrentStrCpy$0$DESKTOPSetShellVarContextallStrCpy$1$DESKTOPMessageBoxMB_OK$0$\n$1

4.9.7.7Sleep

sleeptime_in_ms

Pausesexecutionintheinstallerforsleeptime_in_msmilliseconds.sleeptime_in_mscanbeavariable,e.g."$0"oranumber,i.e."666".

DetailPrint"sleeping..."Sleep3000

DetailPrint"backtowork"

4.9.8StringManipulationInstructions

4.9.8.1StrCpy

user_var(destination)str[maxlen][start_offset]

Setstheuservariable$xwithstr.strcancontainvariables(includingtheuservariablebeingset(concatenatingstringsthiswayispossible,etc)).Ifmaxlenisspecified,thestringwillbeamaximumofmaxlencharacters(ifmaxlenisnegative,thestringwillbetruncatedabs(maxlen)charactersfromtheend).Ifstart_offsetisspecified,thesourceisoffsetbyit(ifstart_offsetisnegative,itwillstartabs(start_offset)fromtheendofthestring).

StrCpy$0"astring"#="astring"StrCpy$0"astring"3#="as"StrCpy$0"astring"-1#="astrin"StrCpy$0"astring"""2#="string"StrCpy$0"astring"""-3#="ing"StrCpy$0"astring"3-4#="rin"StrCpy$0"$0$0"#="rinrin"

4.9.8.2StrLen

user_var(lengthoutput)str

Setsuservariable$xtothelengthofstr.

StrLen$0"123456"#=6

4.9.9StackSupport

4.9.9.1Exch

[user_var|stack_index]

Whennoparameterisspecified,exchangesthetoptwoelementsofthestack.Whenaparameterisspecifiedandisauservariable,exchangesthetopelementofthestackwiththeparameter.Whenaparameterisspecifiedandisapositiveinteger,Exchwillswaptheitemonthetopofthestackwiththeitemthatisspecifiedbytheoffsetfromthetopofthestackintheparameter.Iftherearenotenoughitemsonthestacktoaccomplishtheexchange,afatalerrorwilloccur(tohelpyoudebugyourcode:).

Push1Push2ExchPop$0#=1

Push1Push2Push3Exch2Pop$0#=1

StrCpy$01Push2Exch$0#=2Pop$1#=1

4.9.9.2Pop

user_var(out)

Popsastringoffofthestackintouservariable$x.Ifthestackisempty,theerrorflagwillbeset.

Push1Pop$0#=1

4.9.9.3Push

string

Pushesastringontothestack.ThestringcanthenbePop'edoffofthestack.

Push"astring"

4.9.10IntegerSupport

4.9.10.1IntFmt

user_var(output)formatnumberstring

Formatsthenumberin"numberstring"usingtheformat"format",andsetstheoutputtouservariable$x.Exampleformatstringsinclude"%08X""%u"

IntFmt$0"0x%08X"195948557IntFmt$0"%c"0x41

4.9.10.2IntOp

user_var(output)value1OP[value2]

Combinesvalue1and(dependingonOP)value2intothespecifieduservariable(user_var).OPisdefinedasoneofthefollowing:

+ADDsvalue1andvalue2-SUBTRACTsvalue2fromvalue1*MULTIPLIEsvalue1andvalue2/DIVIDEsvalue1byvalue2%MODULUSsvalue1byvalue2|BINARYORsvalue1andvalue2&BINARYANDsvalue1andvalue2^BINARYXORsvalue1andvalue2

>>RIGHTSHIFTsvalue1byvalue2<<LEFTSHIFTsvalue1byvalue2~BITWISENEGATEsvalue1(i.e.7becomes4294967288)!LOGICALLYNEGATEsvalue1(i.e.7becomes0)||LOGICALLYORsvalue1andvalue2&&LOGICALLYANDsvalue1andvalue2

IntOp$01+1IntOp$0$0+1IntOp$0$0<<2IntOp$0$0~IntOp$0$0&0xF

4.9.11RebootInstructions

4.9.11.1Reboot

Rebootsthecomputer.Becarefulwiththisone.Ifitfails,.onRebootFailediscalled.Inanycase,thisinstructionneverreturns,justlikeQuit.

MessageBoxMB_YESNO|MB_ICONQUESTION"Doyouwishtorebootthesystem?"IDNO+2Reboot

4.9.11.2SetRebootFlag

true|false

Setstherebootflagtoeithertrueorfalse.Theflag'svaluecanbereadusingIfRebootFlag.

SetRebootFlagtrueIfRebootFlag0+2MessageBoxMB_OK"thismessageboxwillalwaysshow"

4.9.12InstallLoggingInstructions

4.9.12.1LogSet

on|off

Setswhetherinstallloggingto$INSTDIR\install.logwillhappen.$INSTDIRmusthaveavaluebeforeyoucallthisfunctionoritwillnotwork.NotethattheNSIS_CONFIG_LOGbuildsettingmustbeset(sconsNSIS_CONFIG_LOG=yes)whenbuilding(itisnotsetbydefault)tosupportthis.SeeBuildingNSISformoreinformationaboutrecompilingNSIS.

4.9.12.2LogText

text

Ifinstallerloggingisenabled,insertstext"text"intothelogfile.

IfFileExists$WINDIR\notepad.exe0+2LogText"$$WINDIR\notepad.exeexists"

4.9.13SectionManagement

4.9.13.1SectionSetFlags

section_indexsection_flags

Setsthesection'sflags.Theflagisa32-bitinteger.Thefirstbit(lowest)representswhetherthesectioniscurrentlyselected,thesecondbitrepresentswhetherthesectionisasectiongroup(don'tmodifythisunlessyoureallyknowwhatyouaredoing),thethirdbitrepresentswhetherthesectionisasectiongroupend(again,don'tmodify),thefourthbitrepresentswhetherthesectionisshowninboldornot,thefifthbitrepresentswhetherthesectionisread-only,thesixthbitrepresentswhetherthesectiongroupistobeautomaticallyexpanded,theseventhbitissetforsectiongroupswhicharepartiallyselected,theeighthbitisinternallyusedforpartiallyselectedsectiongrouptogglingandtheninthbitisusedforreflectingsectionnamechanges.Theerrorflagwillbeset

ifanoutofrangesectionisspecified.

Eachflaghasaname,prefixedwith`SF_`:

!defineSF_SELECTED1!defineSF_SECGRP2!defineSF_SECGRPEND4!defineSF_BOLD8!defineSF_RO16!defineSF_EXPAND32!defineSF_PSELECTED64

Foranexampleofusagepleaseseetheone-section.nsiexample.

Formoreusefulmacrosanddefinitions,seeInclude\Sections.nsh.

Sectiontesttest_section_idSectionEnd

Function.onInit#setsection'test'asselectedandread-onlyIntOp$0${SF_SELECTED}|${SF_RO}SectionSetFlags${test_section_id}$0FunctionEnd

4.9.13.2SectionGetFlags

section_indexuser_var(output)

Retrievesthesection'sflags.SeeSectionSetFlagsforadescriptionoftheflags.Theerrorflagwillbesetifanoutofrangesectionisspecified.

Sectiontesttest_section_idSectionEnd

Function.onSelChange#keepsection'test'selectedSectionGetFlags${test_section_id}$0

IntOp$0$0|${SF_SELECTED}SectionSetFlags${test_section_id}$0FunctionEnd

4.9.13.3SectionSetText

section_indexsection_text

Setsthedescriptionforthesectionsection_index.Ifthetextissetto""thenthesectionwillbehidden.Theerrorflagwillbesetifanoutofrangesectionisspecified.

Section""test_section_idSectionEnd

Function.onInit#changesection'snameto$WINDIRSectionSetText${test_section_id}$WINDIRFunctionEnd

4.9.13.4SectionGetText

section_indexuser_var(output)

Storesthetextdescriptionofthesectionsection_indexintotheoutput.Ifthesectionishidden,storesanemptystring.Theerrorflagwillbesetifanoutofrangesectionisspecified.

Sectiontesttest_section_idSectionEnd

Function.onInit#append$WINDIRtosection'snameSectionGetText${test_section_id}$0StrCpy$0"$0-$WINDIR"SectionSetText${test_section_id}$0

FunctionEnd

4.9.13.5SectionSetInstTypes

section_indexinst_types

Setstheinstalltypesthesectionspecifiedbysection_indexdefaultstotheenabledstatein.Notethatthesectionindexstartswithzero.Everybitofinst_typesisaflagthattellsifthesectionisinthatinstalltypeornot.Forexample,ifyouhave3installtypesandyouwantthefirstsectiontobeincludedininstalltypes1and3,thenthecommandshouldlooklikethis:

SectionSetInstTypes05

becausethebinaryvaluefor5is"...00101".Theerrorflagwillbesetifthesectionindexspecifiedisoutofrange.

Sectiontesttest_section_idSectionEnd

Function.onInit#associatesection'test'withinstallationtypes3and4SectionSetInstTypes${test_section_id}12FunctionEnd

4.9.13.6SectionGetInstTypes

section_indexuser_var(output)

Retrievestheinstalltypesflagsarrayofasection.SeeaboveexplanationaboutSectionSetInstTypesforadescriptionofhowtodealwiththeoutput.Theerrorflagwillbesetifthesectionindexisoutofrange.

Sectiontesttest_section_idSectionEnd

Function.onInit#associatesection'test'withinstallationtypes5,ontopofitsexistingassociationsSectionGetInstTypes${test_section_id}$0IntOp$0$0|16SectionSetInstTypes${test_section_id}$0FunctionEnd

4.9.13.7SectionSetSize

section_indexnew_size

Setsthesizeofthesectionspecifiedbysection_index.Notethattheindexstartswithzero.TheValueforSizemustbeenteredinKiloByteandsupportsonlywholenumbers.

Sectiontesttest_section_idSectionEnd

Function.onInit#setrequiredsizeofsection'test'to100bytesSectionSetSize${test_section_id}100FunctionEnd

4.9.13.8SectionGetSize

section_indexuser_var

Getsthesizeofthesectionspecifiedbysection_indexandstoresthevalueinthegivenuservariable.Notethattheindexstartswithzero.Theerrorflagwillbesetifthesectionindexisoutofrange.

Sectiontesttest_section_idSectionEnd

Function.onInit#increaserequiredsizeofsection'test'by100KiB

SectionGetSize${test_section_id}$0IntOp$0$0+100SectionSetSize${test_section_id}$0FunctionEnd

4.9.13.9SetCurInstType

inst_type_idx

SetsthecurrentInstType.inst_type_idxshouldbebetween0and31.TheerrorflagisnotsetifanoutofrangeInstTypewasused.

4.9.13.10GetCurInstType

user_var

GetthecurrentInstTypeandstoresitinuser_var.Ifthefirstinstalltypeisselected,0willbeputinuser_var.Ifthesecondinstalltypeisselected,1willbeputinuser_var,andsoon.Thevalueof${NSIS_MAX_INST_TYPES}(32bydefault)meansthattheuserselectedacustomsetofsections(Simplyselecting"Custom"inthedrop-downmenuisnotenoughtotriggerthis,thevalueiscalculatedbythesectionsactuallyselected).

4.9.13.11InstTypeSetText

inst_type_idxtext

SetsthetextofthespecifiedInstType.IfthetextisemptythentheInstTypeisremoved.Byusingapreviouslyunusedinst_type_idxnumberyoucancreatenewInstTypes.Toadd/removeSectionstothisnewInstTypeseeSectionSetInstTypes.UnlikeSectionIntheindexiszerobased,whichmeansthefirstinstalltype'sindexis0.

InstTypeaInstTypeb

Function.onInit#setfirstinstallationtype'snameto$WINDIRInstTypeSetText0$WINDIR#setsecondinstallationtype'snameto$TEMPInstTypeSetText1$TEMPFunctionEnd

4.9.13.12InstTypeGetText

inst_type_idxuser_var

GetsthetextofthespecifiedInstType.

InstTypeaInstTypeb

Function.onInitInstTypeGetText0$0DetailPrint$0#prints'a'InstTypeGetText1$0DetailPrint$0#prints'b'FunctionEnd

4.9.14UserInterfaceInstructions

4.9.14.1BringToFront

Makestheinstallerwindowvisibleandbringsittothetopofthewindowlist.Ifanapplicationwasexecutedthatshowsitselfinfrontoftheinstaller,BringToFrontwouldbringtheinstallerbackinfocus.

RecentWindowsversionsrestrictthesettingofforegroundwindows.Iftheuserisworkingwithanotherapplicationduringinstallation,theusermaybenotifiedusingadifferentmethod.

4.9.14.2CreateFont

user_var(handleoutput)face_name[height][weight][/ITALIC][/UNDERLINE][/STRIKE]

Createsafontandputsitshandleintouser_var.FormoreinformationaboutthedifferentparametershavealookatMSDN'spageabouttheWin32APIfunctionCreateFont().

YoucangetthecurrentfontusedbyNSISusingthe^Fontand^FontSizeLangStrings.

!includeWinMessages.nshGetDlgItem$0$HWNDPARENT1CreateFont$1"TimesNewRoman""7""700"/UNDERLINESendMessage$0${WM_SETFONT}$11

4.9.14.3DetailPrint

user_message

Addsthestring"user_message"tothedetailsviewoftheinstaller.

DetailPrint"thismessagewillbeshownintheinstallationwindow"

4.9.14.4EnableWindow

hwndstate(1|0)

Enablesordisablesmouseandkeyboardinputtothespecifiedwindoworcontrol.Possiblestatesare0(disabled)or1(enabled).

GetDlgItem$0$HWNDPARENT1EnableWindow$00Sleep1000EnableWindow$01

4.9.14.5FindWindow

user_var(hwndoutput)windowclass[windowtitle][windowparent][childafter]

Searchesforawindow.BehaveslikeWin32'sFindWindowEx().Searchesbywindowclass(and/orwindowtitleifspecified).Ifwindowparentorchildafterarespecified,thesearchwillberestrictedassuch.Ifwindowclassorwindowtitleisspecifiedas"",theywillnotbeusedforthesearch.Ifthewindowisnotfoundtheuservariableissetto0.

FindWindow$1"#32770"""$HWNDPARENT#FindstheinnerdialogFindWindow$2"EDIT"""$1#Findsthefirsteditcontrolintheinnerdialog

4.9.14.6GetDlgItem

user_var(output)dialogitem_id

Retrievesthehandleofacontrolidentifiedbyitem_idinthespecifieddialogboxdialog.Ifyouwanttogetthehandleofacontrolintheinnerdialog,firstuseFindWindowtogetthehandleoftheinnerdialog.

GetDlgItem$0$HWNDPARENT1#next/installbutton

4.9.14.7HideWindow

Hidestheinstallerwindow.

4.9.14.8IsWindow

HWNDjump_if_window[jump_if_not_window]

IfHWNDisawindow,Gotosjump_if_window,otherwise,Gotosjump_if_not_window(ifspecified).

GetDlgItem$0$HWNDPARENT1IsWindow$00+3

MessageBoxMB_OK"foundawindow"Goto+2MessageBoxMB_OK"nowindow"

4.9.14.9LockWindow

on|off

LockWindowonpreventsthemainwindowfromredrawingitselfuponchanges.WhenLockWindowoffisused,allcontrolsthatweren'tredrawnsinceLockWindowonwillberedrawn.Thismakesthepagesflickeringlooknicerbecausenowitflickersagroupofcontrolsatthesametime,insteadofonecontrolatatime.Theindividualcontrolflickeringismorenoticeableonoldcomputers.

4.9.14.10SendMessage

HWNDmsgwparamlparam[user_var(returnvalue)][/TIMEOUT=time_in_ms]

SendsamessagetoHWND.Ifauservariable$xisspecifiedasthelastparameter(oronebeforethelastifyouuse/TIMEOUT),thereturnvaluefromSendMessagewillbestoredinit.Notethatwhenspecifying'msg'youmustjustusetheintegervalueofthemessage.IncludeWinMessages.nshtohaveallWindowsmessagesdefinedinyourscript.Ifyouwishtosendstringsuse"STR:astring"aswParamorlParamwhereneeded.Use/TIMEOUT=time_in_mstospecifytheduration,inmilliseconds,ofthetime-outperiod.

!includeWinMessages.nshFindWindow$0"Winampv1.x"SendMessage$0${WM_CLOSE}00

GetDlgItem$1$HWNDPARENT2SendMessage$1${WM_SETTEXT}0"STR:Goodbye"

4.9.14.11SetAutoClose

true|false

Overridesthedefaultautowindow-closingflag(specifiedfortheinstallerusingAutoCloseWindow,andfalsefortheuninstaller).Specify'true'tohavetheinstallwindowimmediatelydisappearaftertheinstallhascompleted,or'false'tomakeitrequireamanualclose.

4.9.14.12SetBrandingImage

[/IMGID=item_id_in_dialog][/RESIZETOFIT]path_to_bitmap_file.bmp

Setsthecurrentbitmapfiledisplayedasthebrandingimage.IfnoIMGIDisspecified,thefirstimagecontrolfoundwillbeused,ortheimagecontrolcreatedbyAddBrandingImage.Notethatthisbitmapmustbepresentontheuser'smachine.UseFilefirsttoputitthere.If/RESIZETOFITisspecifiedtheimagewillbeautomaticallyresized(verypoorly)totheimagecontrolsize.IfyouusedAddBrandingImageyoucangetthissizebycompilingyourscriptandwatchingforAddBrandingImageoutput,itwilltellyouthesize.SetBrandingImagewillnotworkwhencalledfrom.onInit!

4.9.14.13SetDetailsView

show|hide

Showsorhidesthedetails,dependingonwhichparameteryoupass.Overridesthedefaultdetailsview,whichissetviaShowInstDetails.

4.9.14.14SetDetailsPrint

none|listonly|textonly|both|lastused

Setsmodeatwhichcommandsprinttheirstatus.Nonehascommandsbequiet,listonlyhasstatustextonlyaddedtothelistbox,textonlyhasstatustextonlyprintedtothestatusbar,andbothenablesboth(thedefault).Forextractingmanysmallfiles,textonlyisrecommended

(especiallyonwin9xwithsmoothscrollingenabled).

SetDetailsPrintnoneFile"secretfile.dat"SetDetailsPrintboth

4.9.14.15SetCtlColors

hwnd[/BRANDING][text_color|SYSCLR:text_color_id][transparent|bg_color|SYSCLR:bg_color_id]

Setsthetextandbackgroundcolorofastaticcontrol,editcontrol,buttonoradialog.text_colorandbg_colordon'tacceptvariables.UseGetDlgItemtogetthehandle(HWND)ofthecontrol.Tomakethecontroltransparentspecifytransparentasthebackgroundcolorvalue.PrefixthecolorvaluewithSYSCLR:tospecifyaWindowsCOLOR_*constant.Youcanalsospecify/BRANDINGwithorwithouttextcolorandbackgroundcolortomakethecontrolcompletelygray(oranyothercoloryouchoose).ThisisusedbythebrandingtextcontrolintheMUI.

PageComponents""CmpntPageShowFunctionCmpntPageShowFindWindow$1"#32770"""$HWNDPARENTGetDlgItem$0$11006SetCtlColors$00xFF00000x00FF00;RedonGreenGetDlgItem$0$11022SetCtlColors$0SYSCLR:23SYSCLR:24;COLOR_INFOTEXTonCOLOR_INFOBKFunctionEnd

Warning:SettingthebackgroundcolorofcheckboxestotransparentmaynotfunctionproperlywhenusingXPStyleon.ThebackgroundmaybecompletelyblackinsteadoftransparentwhenusingcertainWindowsthemes.

4.9.14.16SetSilent

silent|normal

Setstheinstallertosilentmodeornormalmode.SeeSilentInstallformoreinformationaboutsilentinstallations.Canonlybeusedin.onInit.

4.9.14.17ShowWindow

hwndshow_state

Setsthevisibilityofawindow.Possibleshow_statesarethesameastheWindowsShowWindowfunction.SW_*constantsaredefinedinInclude\WinMessages.nsh.

!includeWinMessages.nshGetDlgItem$0$HWNDPARENT1ShowWindow$0${SW_HIDE}Sleep1000ShowWindow$0${SW_SHOW}

4.9.15MultipleLanguagesInstructions

4.9.15.1LoadLanguageFile

language_file.nlf

Loadsalanguagefilefortheconstructionofalanguagetable.AllofthelanguagefilesthatshipwithNSISareinContrib\LanguageFiles

Afteryouhaveinsertedthelanguagefile${LANG_langfile}willbedefinedasthelanguageid(forexample,${LANG_ENGLISH}willbedefinedas1033).UseitwithLangString,LicenseLangString,LangDLLandVIAddVersionKey.

4.9.15.2LangString

namelanguage_id|0string

Definesamultilingualstring.Thismeansitsvaluemaybedifferent(or

not,it'suptoyou)foreverylanguage.Itallowsyoutoeasilymakeyourinstallermultilingualwithouttheneedtoaddmassiveswitchestothescript.

Eachlanguagestringhasanamethatidentifiesitandavalueforeachlanguageusedbytheinstaller.Theycanbeusedinanyruntimestringinthescript.Tousealanguagestringallyouneedtoaddtothestringis$(LangString_name_here)whereyouwanttheLangStringtobeinserted.

Notes:

Unlikedefinesthatusecurlybraces-{},languagestringsuseparenthesis-().Ifyouchangethelanguageinthe.onInitfunction,notethatlanguagestringsin.onInitwillstillusethedetectedlanguagebasedontheuser'sdefaultWindowslanguagebecausethelanguageisinitializedafter.onInit.Alwayssetlanguagestringsforeverylanguageinyourscript.IfyousetthelanguageIDto0thelastusedlanguagebyLangStringorLoadLanguageFilewillbeused.

Exampleofusage:

LangStringmessage${LANG_ENGLISH}"Englishmessage"LangStringmessage${LANG_FRENCH}"Frenchmessage"LangStringmessage${LANG_KOREAN}"Koreanmessage"

MessageBoxMB_OK"Atranslatedmessage:$(message)"

4.9.15.3LicenseLangString

namelanguage_id|0license_path

DoesthesameasLangStringonlyitloadsthestringfromatext/RTFfileanddefinesaspecialLangStringthatcanonlybeusedbyLicenseData.

LicenseLangStringlicense${LANG_ENGLISH}license-english.txtLicenseLangStringlicense${LANG_FRENCH}license-french.txt

LicenseLangStringlicense${LANG_GERMAN}license-german.txt

LicenseData$(license)

Previous|Contents|Next

Previous|Contents|Next

4.10MultipleLanguagesAsofversion2NSISfullysupportsmultiplelanguages.Theinterfaceofoneinstallercansupportmultiplelanguages.

UseLoadLanguageFileforeverylanguagetoloadthedefaultinterfacetextsandlanguageproperties.VisittheNSIStranslationsforumformoreinformationaboutcreatingnewlanguagefiles.

ThedefaultinterfacetextscaneasilybechangedusinginstructionslikeComponentTextetc.

Youcanalsousethecontentsofthestandardlanguagestringsinyourownstrings(forexample,$(^Name)containstheinstaller'snamesetusingtheNameinstruction).Thenamesofallstandardlanguagestringsarelistedascommentsjustabovethestringsinthelanguagefiles.ThelanguagefilesarelocatedinContrib\LanguageFiles.

Tocreateyourownlanguagestrings,useLangString.

Foranexampleofaninstallerwithmultiplelanguages,seelanguages.nsi.

4.10.1LanguageSelection

Whentheinstallerstartsupitgoesthroughthesestepstoselecttheinterfacelanguage:

1. Getuser'sdefaultWindowsUIlanguage2. Findaperfectmatchforthelanguage3. Ifthereisnoperfectmatch,findaprimarylanguagematch4. Ifthereisnomatch,usethefirstlanguagedefinedinthescript

(makesureyourfirstlanguageisacommononelikeEnglish)5. Ifthelanguagevariable$LANGUAGEhaschangedduring.onInit,

NSISgoesthroughsteps2to4again.

4.10.2LangDLLPlug-in

TheLangDLLplug-inallowsyoutogivetheuseranoptiontochoosethelanguageoftheinstaller.Justpushthelanguageid(${LANG_langfile})anditsnameforeverylanguageinyourinstaller,thenthenumberoflanguagespushed,thecaption,andthetextthattellstheusertoselectthelanguage,calltheplug-infunctionnamedLangDialog,popthereturnedvalueinto$LANGUAGEandyou'regoodtogo.Iftheuserclicksonthecancelbuttonthereturnvaluewillbe"cancel".

Foranexampleofusageseelanguages.nsi.

4.10.3RTLLanguages

RTLlanguagesarelanguagesthatarewrittenfromrighttoleft(e.g.ArabicandHebrew).NSISfullysupportsRTLlanguages.InthelanguagefilethereisaplacetospecifyifthelanguageisRTLornot.TofindoutatruntimeifthecurrentlanguageisRTLornot,checkthevalueofthe$(^RTL)languagestring.Itwillbe1ifthelanguageisRTLand0otherwise.Thiscanbeusefulwhenusingplug-insthatcreatedialogs,theyusuallyhaveRTLsettingstoo.

Previous|Contents|Next

Previous|Contents|Next

4.11Plug-inDLLsTheabilitiesoftheNSISscriptinglanguagecanbeextendedbyutilisingfunctionalityprovidedinaDLLfile.ProbablythebestknownexampleofthisistheInstallOptions.dllbundledwitheveryNSISrelease.

WhentheNSIScompilerstartsitscanstheplug-insdirectoryforDLLsandmakesalistoftheplug-insfoundandtheirexportedfunctions.Duringcompilation,ifasequencesuchasfred::flintstoneisencounteredwherethecompilerexpectedtofindalanguagekeywordthecompilerwilllookthroughthislist.Ifalistentryspecifiesthatfred.dllexportsfunctionflintstoneNSISwillpackthefred.dllfileintothecreatedinstallerbinary.

Duringexecutionofaplug-incommandNSISwillunpackthenecessaryDLLtoatemporaryfolder($PLUGINSDIR),pushalloftheargumentsspecified(right-to-leftorder),andthenexecutetheDLLfunction.

4.11.1UsingPlug-inCommands

Aplug-incalllookslikethis:

InstallOptions::dialog"ini_file_location.ini"

Allparametersarepushedontothestack(inthiscase,theplug-infunctiononlyneedsoneparameter).Someplug-incommandsmaynotneedanyparametersonthestack,othersmightrequiremoreofthem.Touseaplug-incommandyouwillneedtoreadthedocumentationfortheplug-insothatyouknowwhatparametersitsfunctionsrequire.

4.11.2Callingplug-insmanually

Ifyouwanttocallaplug-inthatisstoredonuser'sharddriveorsomewhereelse,useCallInstDLL.Almostallplug-insprovideinstallerfunctionality,sousingplug-incommandsiswayeasier.UsingCallInstDLLcanbeusefulwhenyouhavecreatedplug-insthatarelinkedtoacertainversionofyourapplicationandarebeingcopiedtotheinstallationfolder.

Previous|Contents|Next

Previous|Contents|Next

4.12SilentInstallers/UninstallersSilentinstallersareinstallerswhichrequirenouserinterventionandhavenouserinterface.Theuserdoesn'tseeanydialogandisn'taskedanyquestions.Thisisusefulfornetworkadministratorswhowishtoinstalloruninstallsomethingwithoutuserinterventionsotheycanperformtheoperationquicklyoveranynumberofcomputers.Itisalsousefulforotherdeveloperswhowishtoembedanotherinstallerintheirownandcollectalloftherequiredinformationontheirinstallerinsteadofshowingtwoinstallers.

NSISinstallersanduninstallerscanbebothsilentandnotsilent.Whenaninstalleroranuninstallerissilent,notallcallbackfunctionsarecalled..onGUIInit,.onGUIEnd,theiruninstallerequivalentsandanycallbackrelatedtoaspecificpageorpagetypewillnotbecalled.

Thereareseveralmethodstomakeaninstalleroranuninstallersilent:

1. SilentInstallandSilentUninstall2. SetSilent3. Passing/Sonthecommandline(casesensitive)

Tocheckiftheinstaller/uninstallerissilentuseIfSilent.

Tomakesureyourinstallerwillbesilentwhenitneedsto,youshouldcheckwithIfSilentbeforeeachcommandthatmightrequireuserinterventionorcreateawindow.TheMessageBoxcommand,whichisthemostcommonculpritinsilentinstallers,hasthe/SDswitchtosetadefaultanswerforsilentinstallers.Ifyouwantyourinstaller/uninstallertobeabletobecompletelysilentyoushouldusethisswitch.AllinternalNSISmessageboxeshavedefaultsforsilentinstallers.Thesilent.nsiexampledemonstratesallaspectsofthistopic.

Sincethedirectorypageisnotshowninsilentinstallerstheuserhasanoptiontospecifytheinstallationdirectoryonthecommandline(thisalsoworksonnon-silentinstallers/uninstallers).Todothat,theuserusesthe/Dswitchasinthefollowingexample:

foo.exe/S/D=C:\ProgramFiles\Foo

Ifyourinstaller/uninstallerrequiressomemoreinformationthatcannotbegatheredwhensilent,youcanallowtheusertospecifythatinformationonthecommandlineandprocessitin.onInit.YoucanuseGetOptions.

!includeFileFunc.nsh!insertmacroGetParameters!insertmacroGetOptions

Function.onInit${GetParameters}$R0ClearErrors${GetOptions}$R0/USERNAME=$0FunctionEnd

Theaboveexamplewillcopythevaluetheuserpassesonafter/USERNAME=into$0.Thisallowstheusertospecifytherequiredinformationonthecommandlineinsteadofusingtheinteractiveuserinterface.Theusercanuse:

foo.exe/S/USERNAME=Bar/D=C:\ProgramFiles\Foo

or:

foo.exe/S/USERNAME=stringwithspaces/D=C:\ProgramFiles\Foo

or:

foo.exe/S/USERNAME="stringwithspaces"/D=C:\ProgramFiles\Foo

Ifyourinstaller/uninstallerrequiresalotofinformationandyouwantittobeabletobesilent,youshouldallowtheusertopassonapathtoananswersfile.Thiswouldbemuchmorecomfortablethanwritingalloftheinformationonthecommandline.

Previous|Contents|Next

Previous|Contents|Next

5.1CompilerUtilityCommandsThesecommandsaresimilartotheCpreprocessorintermsofpurposeandfunctionality.Theyallowfileinclusion,conditionalcompilation,executableheaderpackingandprocessexecutionduringthebuildprocess.Note:Noneofthesecommandsallowtheuseofvariables.

Numberliteralssupportthe0b,0o,0nand0xradixprefixes(base2,8,10and16respectively).Note:Thedeprecatedplain0octalprefixisalsosupportedinsomeplacesbutitsusageisdiscouraged.

5.1.1!include

[/NONFATAL][/CHARSET=ACP|OEM|CP#|UTF8|UTF16LE|UTF16BE]file

Thiscommandwillinclude'file'asifitwaspartoftheoriginalscript.Notethatifafileisincludedinanotherdirectory,thecurrentdirectoryisstillwherethescriptwascompiledfrom(notwheretheincludedfileresides).Ifthecompilercan'tfindthefileitwilllookforitineveryincludedirectory.See!addincludedirformoreinformation.Ifthe/nonfatalswitchisusedandnofilesarefound,awarningwillbeissuedinsteadofanerror./charsetcanbeusedtospecifyacodepageforplaintextfileswithoutaBOM.

!includeWinMessages.nsh!includeLibrary.nsh!include/CHARSET=CP1252C:\MyConfig.nsi!include..\MyConfig.nsh!include/NONFATALfile_that_may_exist_or_not.nsh

5.1.2!addincludedir

directory

Addsanotherincludedirectorytotheincludedirectorieslist.Thislistissearchedwhen!includeisused.Thislist'sinitialvalueis${NSISDIR}\Include.

!addincludedir..\include!includesomething.nsh

5.1.3!addplugindir

[/x86-ansi|/x86-unicode]directory

CausestheNSIScompilertoscanthegivendirectoryforplug-inDLLs.Ifyoudon'tspecifytheplug-inarchitectureitisassumedtomatchthecurrenttargetarchitecture.Ifthearchitecturedoesnotmatchtheinstallerwillprobablycrash!

!addplugindir..\mypluginMyPlugin::SomeFunction

5.1.4!appendfile

[/CHARSET=ACP|OEM|CP#|UTF8[SIG]|UTF16<LE|BE>[BOM]][/RawNL]filetext

Appendstexttofile.ThetextiswrittenasANSI(ACP)unlessthefilealreadyhasaBOM.Using/CHARSETwillforceaspecificcharacterencoding.$\nwillbetranslatedto$\r$\nonWindowsunlessyouspecify/RawNL.

!tempfileFILE!appendfile"${FILE}""XPStyleon$\n"!appendfile"${FILE}""Name'test'$\n"!include"${FILE}"!delfile"${FILE}"!undefFILE

5.1.5!cd

new_path

Thiscommandwillchangethecompilertothenewdirectory,new_path.new_pathcanberelativeorabsolute.

!cd..\more-scripts\new

5.1.6!delfile

[/nonfatal]file

Thiscommanddeletesafile.

!tempfileFILE!delfile"${FILE}"!undefFILE

5.1.7!echo

message

Thiscommandwillechoamessagetotheusercompilingthescript.

!echo"helloworld"

5.1.8!error

[message]

Thiscommandwillissueanerrortothescriptcompilerandwillstopexecutionofthescript.Youcanalsoaddamessagetothiserror.

!ifdefVERSION&NOVERSION!error"bothVERSIONandNOVERSIONaredefined"!endif

5.1.9!execute

command[comparecomparevalue|symbol]

Thiscommandwillexecute'command'usingacalltoCreateProcess().Unlike!system,itdoesnotusethecommandlineprocessor,soinput/outputredirectionandcommandslike'cd','dir'and'type'cannotbe

used.Currently,theonlyknownadvantageof!executeover!systemisthatitdoesnotgivetroublewhenthecurrentworkingdirectoryisspecifiedusingUNC.

OnPOSIXplatforms,!executewillusesystem()justlike!system.

!execute'"$%WINDIR%\notepad.exe"/P"${NSISDIR}\COPYING"'

5.1.10!makensis

parameters[comparecomparevalue|symbol]

Thiscommandwill!executeanewinstanceofMakeNSISwiththeparametersyouspecify.

!makensis'-DGENERATEUNINST"${__FILE__}"'=0!system'"signtool"sign...'=0

5.1.11!packhdr

tempfilecommand

ThisoptionmakesthecompileruseanexternalEXEpacker(suchasPetiteorUPX)tocompresstheexecutableheader.Specifyatemporaryfilename(suchas"temp.dat")andacommandline(suchas"C:\programfiles\upx\upx-9temp.dat")tocompresstheheader.

!packhdr"$%TEMP%\exehead.tmp"'"C:\ProgramFiles\UPX\upx.exe""$%TEMP%\exehead.tmp"'

5.1.12!finalize

command[comparecomparevalue]

Thisoptionwillexecute'command'usingacalltosystem()aftertheoutputEXEhasbeengenerated.Youcantypicallyuseittosign(Authenticode)yourinstaller.If'command'containsa'%1'itwillbereplacedbytheexecutablesfilename.

!finalize'sign.bat"%1""ProductInstaller"http://example.com'

5.1.13!system

command[comparecomparevalue|symbol]

Thiscommandwillexecute'command'usingacalltosystem().Youcanstorethereturnvalueinadefine('symbol')orhaltexecutionifthereturnvaluecompared(using'compare')to'comparevalue'isfalse.'compare'canbe'<'or'>'or'<>'or'='.

!system'"%WINDIR%\notepad.exe""${NSISDIR}\COPYING"'!system'echo!definesomething>newinclude.nsh'!includenewinclude.nsh!ifdefsomething!echo"somethingisdefined"!endif

5.1.14!tempfile

symbol

Thiscommandcreatesatemporaryfile.Itputsitspathintoadefine,namedsymbol.

!tempfilePACKHDRTEMP!packhdr"${PACKHDRTEMP}"'"C:\ProgramFiles\UPX\upx.exe""${PACKHDRTEMP}"'

!tempfileFILE!define/dateDATE"%H:%M:%S%d%b,%Y"!system'echobuilton${DATE}>"${FILE}"'!undefDATEFile/oname=build.txt"${FILE}"!delfile"${FILE}"!undefFILE

5.1.15!getdllversion

localfilenamedefine_basename

ThisissimilartoGetDLLVersionLocal,onlyitstorestheversionnumberindefinesandcanthereforebeusedanywhere,notjustinsidefunctionsandsections.

!getdllversion"$%WINDIR%\Explorer.exe"expv_!echo"Explorer.exeversionis${expv_1}.${expv_2}.${expv_3}.${expv_4}"

5.1.16!warning

[message]

Thiscommandwillissueawarningtothescriptcompiler.Youcanalsoaddamessagetothiswarning.

!ifdefUSE_DANGEROUS_STUFF!warning"usingdangerousstuff"!endif

5.1.17!pragma

warning<enable|disable|default>codewarning<push|pop>

Thepragmacommandsallowsyoutochangecompilerfeaturesandbehavior.

!pragmawarningdisable9000;Disablewarningaboutusing"Setup.exe"asthenameOutFile"Setup.exe"

5.1.18!verbose

level|push|pop

Thiscommandwillsetthelevelofverbosity.4=all,3=noscript,2=noinfo,1=nowarnings,0=none.

Passingpushwillcause!verbosetopushthecurrentverbositylevelonaspecialstack.Passingpopwillcause!verbosetopopthecurrentverbositylevelfromthesamestackanduseit.

!verbosepush!verbose1!includeWinMessages.nsh!verbosepop

Previous|Contents|Next

Previous|Contents|Next

5.2PredefinesYoucanusethesestandardpredefinestoautomaticallyaddthebuildtimetothetitleofdevelopmentversions,addthedatetotheversionnumber,etc.

5.2.1${__COUNTER__}

Expandstoanumber(Startingat0andincrementingby1everytimeitisused)

5.2.2${__FILE__}

Currentscriptname.

5.2.3${__FILEDIR__}

Currentscriptdirectory.

5.2.4${__LINE__}

Currentlinenumber.

5.2.5${__DATE__}

Datewhenthescriptstartedcompilingaccordingtothecurrentlocale.

5.2.6${__TIME__}

Timewhenthescriptstartedcompilingaccordingtothecurrentlocale.

5.2.7${__TIMESTAMP__}

Date&timeofthelastmodificationtothescriptfileaccordingtothecurrentlocale.

5.2.8${NSIS_VERSION}

NSISversionusedtobuildthescript.

5.2.9${NSIS_PACKEDVERSION}

NSISversionasa32-bitnumber.

!if0x3014000>="${NSIS_PACKEDVERSION}"!error"NSIS3.15orhigherisrequiredtobuildthisinstaller!"!endif

5.2.10${NSIS_CHAR_SIZE}

Thesizeofacharactercodeunit(inbytes).1inANSIinstallersand2inUnicodeinstallers.

Agraphemeclusterconsistsofabasecharacterplusoptionalcombiningcharactersanddiacriticsandisdefinedasoneormorecodepoints.Oneormorecodeunitsisrequiredtoencodeasinglecodepoint.

5.2.11${NSIS_PTR_SIZE}

Thesizeofapointer(inbytes)inthegeneratedinstaller.

5.2.12${U+1}...${U+10FFFF}

AUnicode(UCS-4)character.

DetailPrint"${U+2115}SIS"#DOUBLE-STRUCKCAPITALN+"SIS"

5.2.13ScopePredefines

Standardpredefinesthatcontaininformationaboutthecurrentcodescope.

5.2.13.1${__GLOBAL__}

Definedintheglobalscope.

Sectiontest!ifdef${__GLOBAL__}!error"thisshouldn'tbehere!"!endifSectionEnd

PageExinstfiles!ifdef${__GLOBAL__}!error"thisshouldn'tbehere!"!endifPageExEnd

5.2.13.2${__SECTION__}

Definedasthesectionname,withoutanyprefixes,insectionscope.

!ifdef__SECTION__!error"thisshouldn'tbehere!"!endif

Sectiontest!ifndef__SECTION__!error"missingpredefine!"!endif

!if${__SECTION__}!=test!error"wrongpredefinevalue!"!endifSectionEnd

Section!test!if${__SECTION__}!=test!error"wrongpredefinevalue!"!endifSectionEnd

Sectionun.test!if${__SECTION__}!=test!error"wrongpredefinevalue!"!endifSectionEnd

5.2.13.3${__FUNCTION__}

Definedasthefunctionname,withoutanyprefixes,infunctionscope.

!ifdef__FUNCTION__!error"thisshouldn'tbehere!"!endif

Functiontest!ifndef__FUNCTION__!error"missingpredefine!"!endif

!if${__FUNCTION__}!=test!error"wrongpredefinevalue!"!endifFunctionEnd

Functionun.test!if${__FUNCTION__}!=test!error"wrongpredefinevalue!"!endifFunctionEnd

5.2.13.4${__PAGEEX__}

DefinedasthepagetypeinPageExscope.

!ifdef__PAGEEX__

!error"thisshouldn'tbehere!"!endif

PageExinstfiles!ifndef__PAGEEX__!error"missingpredefine!"!endif

!if${__PAGEEX__}!=instfiles!error"wrongpagetype"!endifPageExEnd

5.2.13.5${__UNINSTALL__}

Definedinsection,functionorPageExscopesoftheuninstaller.

!ifdef__UNINSTALL__!error"thisshouldn'tbehere!"!endif

Functiontest!ifdef__UNINSTALL__!error"thisshouldn'tbehere!"!endifFunctionEnd

Functionun.test!ifndef__UNINSTALL__!error"missingpredefine!"!endifFunctionEnd

5.2.13.6${__MACRO__}

Definedasthenameofthecurrentmacro.

Previous|Contents|Next

Previous|Contents|Next

5.3Readenvironmentvariables

5.3.1$%envVarName%

$%envVarName%willbereplacedatcompiletimebytheenvironmentvariableenvVarName.

Previous|Contents|Next

Previous|Contents|Next

5.4ConditionalCompilationThecompilermaintainsalistofdefinedsymbols,whichcanbedefinedusing!defineorthe/Dcommandlineswitch.Thesedefinedsymbolscanbeusedforconditionalcompilation(using!ifdef)orforsymbolreplacement(asimpleformofmacros).Toreplaceasymbolwithitsvalue,use${SYMBOL}(ifSYMBOLisnotdefined,notranslationwilloccur).Thetranslationisfirst-come-first-served,meaningifyoudo:

!definesymbol_one${symbol_two}

Ifsymbol_twoisdefinedwhenthatlineoccurs,itwillbereplaced.Otherwise,anyreplacingwilloccurwhen${symbol_one}isreferenced.

Define/conditionalcompilationrelatedcommands:

5.4.1!define

[/ifndef|/redef]([/date|/utcdate]gflag[value])|(/mathgflagval1OPval2)|(/filegflagfilename.txt)

Thiscommandwilladdgflagtotheglobaldefinelist.Thiswillhaveasimilareffectasusingthe/Dswitchonthecommandline(thedefineonlybecomeseffectiveafterthe!definecommand).

If/dateor/utcdateareused,valuewillbepassedtostrftime()andtheresultwillbeusedasthevalueofgflag.strftimeconvertsspecialsymbolsintocertainpartsofthecurrenttimeordate.Forexample,%Hwillbeconvertedintothecurrenthourin24-hourformat.Foracompletelistofavailablesymbols,searchforstrftimeonMSDN.OnPOSIX,youcangetthelistbyusingmanstrftime.

If/mathisused,theresultof'val1OPval2',whereOPmaybe+,-,*,&,|,^,/,<<,>>,>>>or%,willbeusedasthevalueofgflag.Notethatval1ANDval2MUSTbeintegervalues!

If/fileisused,theentiretextfilespecified(includingwhitespaceandnewlines)willbereadandstuffedintogflag.

!defineUSE_SOMETHING!defineVERSION1.2!define/dateNOW"%H:%M:%S%d%b,%Y"!define/mathRESULT3+10!define/mathREST15%${RESULT}!define/fileBunchaStuffsomesourcefile.cpp!define/redefUSE_SOMETHING${RESULT};redefineUSE_SOMETHING

5.4.2!undef

gflag

Removesanitemfromtheglobaldefinelist.Notethat${SYMBOL}whereSYMBOLisundefinedwillbetranslatedto"${SYMBOL}".

!defineSOMETHING!undefSOMETHING

5.4.3!ifdef

gflag[bcheckgflag[...]]

Thiscommand,whenpairedwithan!endifcommand,willtellthecompilerwhetherornottocompilethelinesinbetweenthetwolines.Ifgflagisgloballydefined(using!defineorthe/Dswitch),thenthecontainedlineswillbecompiled.Otherwise,theywillbeskipped.'bcheck'canbespecifiedas&(booleanand)or|(booleanor)alongwithmoregflags--precedenceissimple,lefttoright.

!defineSOMETHING!ifdefSOMETHING!echo"SOMETHINGisdefined"!endif!undefSOMETHING!ifdefSOMETHING!echo"SOMETHINGisdefined"#willneverbeprinted!endif

5.4.4!ifndef

gflag[bcheckgflag[...]]]

Theoppositeof!ifdef.Thelineswillbecompiledwhenthegflaghasnotbeendefined.

5.4.5!if

[!]value[opvalue2][!]/FileExists"c:\path\file.exe"

Thiscommand,whenpairedwithan!endifcommand,willtellthecompilerwhetherornottocompilethelinesinbetweenthetwolines.Ifvalueisnon-zero,orthecomparisonofvalueandvalue2dependingontheoperatorresultsintrue,thecontainedlineswillbecompiled.Otherwise,theywillbeskipped.opcanbeeither==or!=(case-insensitivestringcomparison),S==orS!=(case-sensitivestringcomparison),=,<>,<=,<,>or>=(int/hex/floatcomparison),&(bitwiseANDcomparison),&&or||(booleancomparison).If[!]isset,theresultwillbeflippedfromtruetofalseandviceversa.

!if1<0x2!echo"1issmallerthan2!!"!elseif!3.1>1.99!error"thislineshouldneverappear"!else!error"neithershouldthis"!endif

!if/FileExists".\cert.pfx"!finalize'".\sign.bat""%1"'!endif

5.4.6!ifmacrodef

gflag[bcheckgflag[...]]]

Thiscommand,whenpairedwithan!endifcommand,willtellthecompilerwhetherornottocompilethelinesinbetweenthetwolines.Ifthemacrogflagexists,thenthecontainedlineswillbecompiled.Otherwise,theywillbeskipped.'bcheck'canbespecifiedas&(booleanand)or|(booleanor)alongwithmoregflags--precedenceissimple,lefttoright.

!macroSomeMacro!macroend!ifmacrodefSomeMacro!echo"SomeMacroisdefined"!endif

5.4.7!ifmacrondef

gflag[bcheckgflag[...]]]

Theoppositeof!ifmacrodef.Thelineswillbecompiledwhenthemacrogflagdoesnotexist.

5.4.8!else

[if|ifdef|ifndef|ifmacrodef|ifmacrondef[...]]

Thiscommandallowstoeasilyinsertdifferentcodewhendifferentdefinesormacrosareset.Youcancreateblockslike!ifdef/!else/!endif,!ifdef/!elseifdef/!else/!endifetc.

!ifdefVERSIONOutFileinstaller-${VERSION}.exe!elseOutFileinstaller.exe!endif

5.4.9!endif

Thiscommandclosesablockstartedwith!if,!ifdef,!ifndef,!ifmacrodefor!ifmacrondef.

5.4.10!insertmacro

macro_name[parameter][...]

Insertsthecontentsofamacrothatwascreatedwith!macro.Ifthemacrowascreatedwithparameters,thenyoumustpassasmanyparameterstothemacroasitrequires.

!macroPrinttextDetailPrint"${text}"!macroend!insertmacroPrint"sometext"!insertmacroPrint"somemoretext"

5.4.11!macro

macro_name[parameter][...]

Createsamacronamed'macro_name'.Alllinesbetweenthe!macroandthe!macroendwillbesaved.Toinsertthemacrolateron,use!insertmacro.!macrodefinitionscanhaveoneormoreparametersdefined.Theparametersmaybeaccessedthesamewaya!definewould(e.g.${PARMNAME})frominsidethemacro.

!macroSomeMacroparm1parm2parm3DetailPrint"${parm1}"MessageBoxMB_OK"${parm2}"File"${parm3}"!macroend

5.4.12!macroend

Endsamacrothatwasstartedwith!macro.

5.4.13!macroundef

macro_name

Deletesamacro.

5.4.14!searchparse

[/ignorecase][/noerrors][/file]source_string_or_filesubstring_startOUTPUTSYMBOL1[substring[OUTPUTSYMBOL2[substring...]]]

Parsessource_string_or_file(whichistreatedasastring,orasafilenameif/fileisset),lookingforsubstring_start.Ifsubstring_startisfound,thenOUTPUTSYMBOL1isdefinedtotherestofthestring(minusanyothersubstringthatmaybefound).AnynumberofOUTPUTSYMBOLxmaybespecified,andthefinalsubstringisoptional.

If/noerrorsisspecified,matchinglessthanthefullnumberofstringsisallowed(allOUTPUTSYMBOLxafterthenot-foundsubstringwillbeignored).

If/fileisspecified,thefileistreatedasaseriesoflines.Thefileissearcheduntilallsubstringsarematched.If/noerrorsisspecifiedandnotallstringsarematched,thefirstlinewiththemostsymbolsmatchedisused.

#searchfilename.cppforaline'#defineAPP_VERSION"2.5"'andset${VER_MAJOR}to2,${VER_MINOR}to5.!searchparse/filefilename.cpp`#defineAPP_VERSION"`VER_MAJOR`.`VER_MINOR`"`

5.4.15!searchreplace

[/ignorecase]symbol_outsource_stringsearchforreplacewith

Searchessource_string,lookingforsearchforandreplacingallinstancesofitwithreplacewith.Unlike!define,!searchreplaceallowsyoutoredefinesymbol_outwithoutwarningorerror.

#defines${blah}to"ilikeponies"!searchreplaceblah"iloveponies""love""like"

Previous|Contents|Next

Previous|Contents|Next

AppendixA:ModernUserInterfaceNSIS2makesitispossibletocreateinstallerswithacustomuserinterface.TheModernUIisainterfacewithastylelikethewizardsofrecentWindowsversions.Thisnewinterfacealsofeaturesnewpages(Welcome,Finish,StartMenu)andadescriptionareaonthecomponentspage.Theinterfaceandthegraphicscanbecustomizedusingtheprovidedsettings.UsingtheModernUImacrosandlanguagefiles,writingscriptswithamoderninterfaceiseasy.

FormoreinformationanddocumentationseetheModernUI2Readme.

NSIS2.34broughtwithitanewversionofModernUI-version2.Itisfasterandmoreextendible.Itallowsplug-instoaddnewtypesofpagesandevenchangeexistingpagesusingasimpleNSHfile.ItalsousesnsDialogswhichfasterthanitseldersibling-InstallOptions.

FormoreinformationanddocumentationoftheoldversionseetheModernUIReadme.

Previous|Contents|Next

Previous|Contents|Next

AppendixB:DLL/TLBLibrarySetupIntroductionLibraryInstallation

IntroductionParametersOptionsNotesExample

LibraryUninstallationIntroductionParametersOptionsExample

VisualBasic6Run-TimeFiles

Previous|Contents|Next

Previous|Contents|Next

B.1IntroductionTheLibraryheaderfilecanbeusedtosetupdynamiclinklibraries(DLL)andtypelibraries(TLB).Ifnecessary,thefollowingactionswillbeperformed:

FilecopyingFilecopyingonrebootVersionchecksRegistrationandunregistrationRegistrationandunregistrationonrebootSharedDLLcountingWindowsFileProtectionchecks

ThemacrosarestoredintheheaderfileLibrary.nsh,whichshouldbeincludedinscriptsusingthissystem:

!includeLibrary.nsh

Notethatthelibrarymacrosarelimitedonnon-Windowsplatforms.DLLversioninformationisrequiredwhencompilingonnon-Windowsplatforms.

Previous|Contents|Next

Previous|Contents|Next

B.2LibraryInstallation

B.2.1Introduction

TheInstallLibmacroallowsyoutoinstallalibrary.Itsetstheerrorflagifsomethingwentwrongduringlibrarysetup.

Toasktheuserforareboot,ifrequired,usetheModernUIwithaFinishpageoruseIfRebootFlagandmakeyourownpageormessagebox.

B.2.2Parameters

libtypesharedinstalllocalfiledestfiletempbasedir

libtype

Thetypeofthelibrary

DLL-Dynamiclinklibrary(DLL)REGDLL-DLLthathastoberegisteredREGEXE-EXECOMserverthathastoberegisteredusing/regserverTLB-TypelibraryorDLLthatcontainsatypelibraryREGDLLTLB-DLLthathastoberegisteredandcontainsatypelibrary

shared

Specifywhetherthelibraryissharedwithotherapplications

NOTSHARED-Thelibraryisnotshared$VARNAME-Variablethatisemptywhentheapplicationisinstalledforthefirsttime,whichiswhenthesharedlibrarycountwillbeincreased.

install

Specifytheinstallationmethod

REBOOT_PROTECTED

Upgradethelibraryonrebootwheninuse(requiredforsystemfiles).UpgradethelibraryifthefileisnotprotectedbyWindowsFileProtection.

NOREBOOT_PROTECTED

Warnstheuserwhenthelibraryisinuse.Theuserwillhavetocloseapplicationsusingthelibrary.UpgradethelibraryifthefileisnotprotectedbyWindowsFileProtection.

REBOOT_NOTPROTECTED

Upgradethelibraryonrebootwheninuse(requiredforsystemfiles).UpgradethelibrarywithoutcheckingforWindowsFileProtection.

NOREBOOT_NOTPROTECTED

Warnstheuserwhenthelibraryisinuse.Theuserwillhavetocloseapplicationsusingthelibrary.UpgradethelibrarywithoutcheckingforWindowsFileProtection.

localfile

Locationofthelibraryonthecompilersystem

destfile

Locationtostorethelibraryontheuser'ssystem

tempbasedir

Directoryontheuser'ssystemtostoreatemporaryfilewhenthesystemhastoberebooted.

ForWindows9x/MEsupport,thisdirectoryshouldbeonthesamevolumeasthedestinationfile(destfile).TheWindowstempdirectorycouldbelocatedonanyvolume,soyoucannotusethisdirectory.

B.2.3Options

DefineanyofthefollowingbeforeinsertingaInstallLibmacrotomodifyitsbehaviorasspecified.

B.2.3.1LIBRARY_X64

InstallsaDLLbuiltforWindowsx64.Warning:Thisresetsfilesystemredirection.

B.2.3.2LIBRARY_SHELL_EXTENSION

DefinethisbeforeinsertingInstallLibmacrotocallSHChangeNotifywithSHCNE_ASSOCCHANGEDafterregistration.Usethistorefreshtheshellwheninstallingashellextensionorwhenchangingfileassociations.

B.2.3.3LIBRARY_COM

DefinethisbeforeinsertingInstallLibmacrotocallCoFreeUnusedLibrariesafterregistration.UsethisforunloadingallunnecessarylibrariesfrommemorywheninstallingCOMlibraries.

B.2.3.4LIBRARY_IGNORE_VERSION

DefinethisbeforeinsertingInstallLibmacrotoignoreversioninformationinthefileandalwaysinstallit,evenifitalreadyexists.Usethiswhenanolderorspecificversionisrequired.NotrecommendedforDLLsinstalledto$SYSDIR.

B.2.4Notes

IfyouneedtosupportWindows9x/ME,youcanonlyuseshortfilenames(8.3).Warning:AlwaysuseredistributablefileswhendeployingDLLs,nevercopyfilesfromyoursystemdirectory!

B.2.5Example

B.2.5.1UnsharedDLL

!insertmacroInstallLibREGDLLNOTSHAREDREBOOT_NOTPROTECTEDdllname.dll$SYSDIR\dllname.dll$SYSDIR

B.2.5.2SharedDLL

;Addcodeherethatsets$ALREADY_INSTALLEDtoanon-zerovalueiftheapplicationis;alreadyinstalled.Forexample:

IfFileExists"$INSTDIR\MyApp.exe"0new_installation;ReplaceMyApp.exewithyourapplicationfilenameStrCpy$ALREADY_INSTALLED1new_installation:

!insertmacroInstallLibREGDLL$ALREADY_INSTALLEDREBOOT_NOTPROTECTEDdllname.dll$SYSDIR\dllname.dll$SYSDIR

Previous|Contents|Next

Previous|Contents|Next

B.3LibraryUninstallation

B.3.1Introduction

TheUnInstallLibmacroallowsyoutouninstallalibrary.Itsetstheerrorflagifsomethingwentwrongduringlibraryremoval.

B.3.2Parameters

libtypeshareduninstallfile

libtype

Thetypeofthelibrary

DLL-Dynamiclinklibrary(DLL)REGDLL-DLLthathastobeunregisteredREGEXE-EXECOMserverthathastobeunregisteredusing/unregserverTLB-TypelibraryorDLLthatcontainsatypelibraryREGDLLTLB-DLLthathastobeunregisteredandcontainsatypelibrary

shared

Specifywhetherthelibraryissharedwithotherapplications

NOTSHARED-ThelibraryisnotsharedSHARED-Thelibraryissharedandshouldberemovedifthesharedlibrarycountindicatesthatthefileisnotinuseanymore..

uninstall

Specifytheuninstallationmethod

NOREMOVE

Thelibraryshouldnotberemoved.Youshouldusethisoptionfor

commonorimportantsystemfilessuchastheVisualBasic/C++/MFCruntimes.

REBOOT_PROTECTED

Removethelibraryonrebootwheninuse(requiredforsystemfiles).RemovethelibraryifthefileisnotprotectedbyWindowsFileProtection.

NOREBOOT_PROTECTED

Warnstheuserwhenthelibraryisinuse.Theuserwillhavetocloseapplicationsusingthelibrary.RemovethelibraryifthefileisnotprotectedbyWindowsFileProtection.

REBOOT_NOTPROTECTED

Removethelibraryonrebootwheninuse(requiredforsystemfiles).RemovethelibrarywithoutcheckingforWindowsFileProtection.

NOREBOOT_NOTPROTECTED

Warnstheuserwhenthelibraryisinuse.Theuserwillhavetocloseapplicationsusingthelibrary.RemovethelibrarywithoutcheckingforWindowsFileProtection.

file

Locationofthelibrary

B.3.3Options

DefineanyofthefollowingbeforeinsertingaUnInstallLibmacrotomodifyitsbehaviorasspecified.

B.3.3.1LIBRARY_X64

UninstallsaDLLbuiltforWindowsx64.

Warning:ThisresetsSetRegViewandfilesystemredirection.

B.3.3.2LIBRARY_SHELL_EXTENSION

DefinethisbeforeinsertingUninstallLibmacrotocallSHChangeNotifywithSHCNE_ASSOCCHANGEDafterunregistration.Usethistorefreshtheshellwhenuninstallingashellextensionorwhenchangingfileassociations.

B.3.3.3LIBRARY_COM

DefinethisbeforeinsertingUninstallLibmacrotocallCoFreeUnusedLibrariesafterunregistration.UsethisforunloadingallunnecessarylibrariesfrommemorywhenuninstallingCOMlibraries.

B.3.4Example

!insertmacroUnInstallLibREGDLLSHAREDREBOOT_NOTPROTECTED$SYSDIR\dllname.dll

Previous|Contents|Next

Previous|Contents|Next

B.4VisualBasic6Run-TimeFilesAnewVB6RunTime.nshheaderfileisavailableforthesetupoftheVB6run-timefiles.Toobtainthelatestrun-timefiles,downloadvb6runtime.zipandextractthisfile.

!includeVB6RunTime.nsh

VarAlreadyInstalled

Section"-InstallVB6run-timefiles"

;Addcodeherethatsets$AlreadyInstalledtoanon-zerovalueiftheapplicationisalreadyinstalled.Forexample:IfFileExists"$INSTDIR\MyApp.exe"0new_installation;ReplaceMyApp.exewithyourapplicationfilenameStrCpy$AlreadyInstalled1new_installation:

!insertmacroVB6RunTimeInstallC:\vb6runtimes$AlreadyInstalled;ReplaceC:\vb6runtimeswiththelocationofthefiles

SectionEnd

Section"-un.UninstallVB6run-timefiles"

!insertmacroVB6RunTimeUnInstall

SectionEnd

Remarks:

YoumayhavetoinstalladditionalfilesforsuchVisualBasicapplicationtowork,suchasOCXfilesforuserinterfacecontrols.Installationoftherun-timefilesrequiresAdministratororPowerUserprivileges.UsetheMulti-Userheaderfiletoverifywhethertheseprivilegesareavailable.AddaModernUIfinishpageoranothercheck(seeIfRebootFlag)toallowtheusertorestartthecomputerwhennecessary.

Previous|Contents|Next

Previous|Contents|Next

AppendixC:UsefulScriptsGetInternetExplorerversionIs.NETFrameworkinstalled?IsMacromediaFlashPlayerinstalled?ConnecttotheInternetGetInstallerFilenamePreventMultipleInstancesMore

Previous|Contents|Next

Previous|Contents|Next

C.1GetInternetExplorerversion

;GetIEVersion;;BasedonYazno'sfunction,http://yazno.tripod.com/powerpimpit/;Returns1-6(IEVersion)or''(IEisnotinstalled)ontopofthestack;;Usage:;CallGetIEVersion;Pop$R0;atthispoint$R0is"5"orwhatnot

FunctionGetIEVersionPush$R0ClearErrorsReadRegStr$R0HKLM"Software\Microsoft\InternetExplorer""Version"IfErrorslbl_123lbl_456

lbl_456:;ie4+Strcpy$R0$R01Gotolbl_done

lbl_123:;olderieversionClearErrorsReadRegStr$R0HKLM"Software\Microsoft\InternetExplorer""IVer"IfErrorslbl_error

StrCpy$R0$R03StrCmp$R0'100'lbl_ie1StrCmp$R0'101'lbl_ie2StrCmp$R0'102'lbl_ie2

StrCpy$R0'3';defaulttoie3ifnot100,101,or102.Gotolbl_donelbl_ie1:StrCpy$R0'1'Gotolbl_done

lbl_ie2:StrCpy$R0'2'Gotolbl_donelbl_error:StrCpy$R0''lbl_done:Exch$R0FunctionEnd

Previous|Contents|Next

Previous|Contents|Next

C.2Is.NETFrameworkinstalled?

;IsDotNETInstalled;;BasedonGetDotNETVersion;http://nsis.sourceforge.net/Get_.NET_Version;;Usage:;CallIsDotNETInstalled;Pop$0;StrCmp$01found_dotNETFrameworkno_dotNETFramework

FunctionIsDotNETInstalledPush$0Push$1

StrCpy$01System::Call"mscoree::GetCORVersion(w,i${NSIS_MAX_STRLEN},*i)i.r1"StrCmp$10+2StrCpy$00

Pop$1Exch$0FunctionEnd

Previous|Contents|Next

Previous|Contents|Next

C.3IsMacromediaFlashPlayerinstalled?

;IsFlashInstalled;;ByYazno,http://yazno.tripod.com/powerpimpit/;Returnstheresultontopofthestack;;Usage:;CallIsFlashInstalled;Pop$R0;$R0is"1"or"0"atthispoint

FunctionIsFlashInstalledPush$R0ClearErrorsReadRegStr$R0HKCR"CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}"""IfErrorslbl_naStrCpy$R01Gotolbl_endlbl_na:StrCpy$R00lbl_end:Exch$R0FunctionEnd

Previous|Contents|Next

Previous|Contents|Next

C.4ConnecttotheInternet

;ConnectInternet(usesDialerplug-in);WrittenbyJoostVerburg;;Thisfunctionattemptstomakeaconnectiontotheinternetifthereisno;connectionavailable.Ifyouarenotsurethatasystemusingtheinstaller;hasanactiveinternetconnection,callthisfunctionbeforedownloading;fileswithNSISdl.;;ThefunctionrequiresInternetExplorer3,butaskstoconnectmanuallyif;IE3isnotinstalled.FunctionConnectInternetPush$R0ClearErrorsDialer::AttemptConnectIfErrorsnoie3Pop$R0StrCmp$R0"online"connectedMessageBoxMB_OK|MB_ICONSTOP"Cannotconnecttotheinternet."Quit;Thiswillquittheinstaller.Youmightwanttoaddyourownerrorhandling.noie3:;IE3notinstalledMessageBoxMB_OK|MB_ICONINFORMATION"Pleaseconnecttotheinternetnow."connected:Pop$R0FunctionEnd

Previous|Contents|Next

Previous|Contents|Next

C.5GetInstallerFilename

System::Call'kernel32::GetModuleFileName(p0,t.R0,i${NSIS_MAX_STRLEN})i.r1';$R0willcontaintheinstallerfilename

Previous|Contents|Next

Previous|Contents|Next

C.6PreventMultipleInstancesPutthefollowingcodeinyour.onInitfunction:

System::Call'kernel32::CreateMutex(p0,i0,t"myMutex")p.r1?e'Pop$R0StrCmp$R00+3MessageBoxMB_OK|MB_ICONEXCLAMATION"Theinstallerisalreadyrunning."Abort

'myMutex'mustbereplacedbyauniquevalue!

Previous|Contents|Next

Previous|Contents|Next

C.7MoreYoucanfindmoreusefulscriptsontheNSISWiki,theNSISforumandtheNSISdevelopmentpage.

Previous|Contents|Next

Previous|Contents|Next

AppendixD:UsefulInformationErrorLevelsAdduninstallinformationtoAdd/RemoveProgramsCallinganexternalDLLusingtheSystem.dllplug-inDumpContentofLogWindowtoFileHowtoReadREG_MULTI_SZValuesPredefinedMacrosforUnicodesupport

Previous|Contents|Next

Previous|Contents|Next

D.1ErrorLevelsLikeotherapplications,installersmadebyNSISreturnerrorlevelsasaresultoftheirexecution.CheckingtheerrorlevelcanbeusefulifyoucallanNSISinstallerfromanotherapplicationorinstaller.

0-Normalexecution(noerror)1-Installationabortedbyuser(cancelbutton)2-Installationabortedbyscript

YoucansettheerrorleveltoothervaluesusingSetErrorLevel.

Notethatuninstallerscopythemselvestothetemporarydirectoryandexecutefromtheresotheoriginaluninstallercanbedeleted.Thismeanstheerrorleveltheuninstallersetsisnotavailabletotheexecutingprocess,unlessitsimulatesthiscopyprocessandexecutesthecopieduninstaller.Tosimulatethisprocess,use:

InitPluginsDirCopyFiles$INSTDIR\uninstaller.exe$PLUGINSDIRExecWait'"$PLUGINSDIR\uninstaller.exe"_?=$INSTDIR'$0DetailPrint"uninstallerseterrorlevel$0"

Ifyoudon'tdothis,you'llonlybeabletoknowiftheuninstallerfailedcopyingitselftothetemporarydirectory.

Previous|Contents|Next

Previous|Contents|Next

D.2AdduninstallinformationtoAdd/RemoveProgramsCreateakeywithyourproductnameunderHKLM\Software\Microsoft\Windows\CurrentVersion\Uninstalltoaddentriestothe"Add/RemovePrograms"sectionintheControlPanel.ForWindowsNT(NT4/2000/XP),it'salsopossibletocreatethekeyintheHKCUhive,soitwillonlyappearforthecurrentuser.Thereareseveralvaluesyoucanwritetokeytogiveinformationaboutyourapplicationandtheuninstaller.WriteavalueusingtheWriteRegStrcommand(forstrings)orWriteRegDWORDcommand(forDWORDvalues).

Example:

WriteRegStrHKLM"Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProduct""DisplayName""ApplicationName"WriteRegStrHKLM"Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProduct""UninstallString"'"$INSTDIR\uninst.exe"'

Requiredvalues

DisplayName(string)-NameoftheapplicationUninstallString(string)-Pathandfilenameoftheuninstaller.Youshouldalwaysquotethepath.

Optionalvalues

SomeofthefollowingvalueswillnotbeusedbyolderWindowsversions.

InstallLocation(string)-Installationdirectory($INSTDIR)DisplayIcon(string)-Path,filenameandindexoftheiconthatwillbedisplayednexttoyourapplicationname

Publisher(string)-(Company)nameofthepublisher

ModifyPath(string)-PathandfilenameoftheapplicationmodifyprogramInstallSource(string)-Locationwheretheapplicationwasinstalledfrom

ProductID(string)-ProductIDoftheapplicationRegOwner(string)-Registeredowneroftheapplication

RegCompany(string)-Registeredcompanyoftheapplication

HelpLink(string)-LinktothesupportwebsiteHelpTelephone(string)-Telephonenumberforsupport

URLUpdateInfo(string)-LinktothewebsiteforapplicationupdatesURLInfoAbout(string)-Linktotheapplicationhomepage

DisplayVersion(string)-DisplayedversionoftheapplicationVersionMajor(DWORD)-MajorversionnumberoftheapplicationVersionMinor(DWORD)-Minorversionnumberoftheapplication

NoModify(DWORD)-1ifuninstallerhasnooptiontomodifytheinstalledapplicationNoRepair(DWORD)-1iftheuninstallerhasnooptiontorepairtheinstallation

IfbothNoModifyandNoRepairaresetto1,thebuttondisplays"Remove"insteadof"Modify/Remove".

Previous|Contents|Next

Previous|Contents|Next

D.3CallinganexternalDLLusingtheSystem.dllplug-inSomeinstallersneedtocallfunctionsinthird-partyDLLs.AprimeexampleofthisiswheninstallingaPalm(TM)conduit.

SomebackgroundaboutSystem.dllTheSystem.dllplug-inenablescallingofexternalDLLsbyusingits'Call'function.ThereareanumberofotherfunctionsprovidedbySystem.dllbuttheywillnotbecoveredhere.Formoredetailsabouttheotherfunctions,lockthedoors,takethephoneoffthehook,screwyourheadon*real*tightandheadonovertotheSystemreadme.

DataTypesSystem.dllrecognisesthefollowingdatatypes:

v-void(generallyforreturn)p-pointer(includesvoid*,HANDLE,HWND,UINT_PTRandsoon)i-int(a32bitinteger)l-largeinteger(alsoknownasint64)t-text,string(LPTSTR,pointertofirstcharacter)k-callback.SeeCallbacksectioninsystem.html.*-pointerspecifier->theprocneedsthepointertotype,affectsnextchar(parameter)[ex:'*i'-pointertoint]

MappingSystem.dllvariablestoNSISscriptvariablesThere'snotmuchpointinbeingabletocallanexternalfunctionifyoucan'tgetanydataback.System.dllmapsfunctionvariablestoNSISscriptvariablesinthefollowingway:

NSIS$0..$9becomesSystem.dllr0..r9NSIS$R0..$R9becomesSystem.dllr10..r19

Eachparameterisspecifiedbytype,inputandoutput.Toskipinputoroutputuseadot.Examples:

String(pointertoacharacterarray),inputis'happycalling':

t'happycalling'

String(pointertoacharacterarray),inputistakenfrom$5andchangestothearraymadebythecalleearesavedinto$R8:

tr5R8

Pointertoaninteger,valuetakenfrom$1andputinto$2:

*ir1r2

Pointertoa64-bitinteger,outputpushedonstack,noinput:

*l.s

UsingSystem.dll::CallTocallafunctioninathirdpartyDLL,theCallfunctionisusedlikethis:

System::Call'YourDllName::YourDllFunction(i,*i,t)i(r0,.r1,r2).r3'

The'(r0,.r1,r2).r3'sectionattheendaretheparametersthatarepassedbetweenyourDLLandyourNSISscript.Ascanbeseeninthisparameterslist,typeandinput/outputcanbeseparated.Eachblockof"(parmslist)returnvalue"overridesand/oraddstothelastone.Inthiscase,thefirstblockspecifiesthetypesandthesecondspecifiesinputandoutput.

BeforestartingtocodetheNSISscriptBeforeyoustarttocodeanyNSIScodeyouneedtoknowthefullprototypeofthefunctionyouaregoingtocall.Forthepurposesofthisexample,wewillusethe'CmGetHotSyncExecPath'functionfromthePalm'CondMgr.dll'.Thisfunctionisusedtoreturnthefullpathof'HotSync.exe'.

FunctionDefinition

int__stdcallCmGetHotSyncExecPath(TCHAR*pPath,int*piSize);

where

pPathisapointertoacharacterbuffer.Uponreturn,thisisthepath&filenameoftheinstalledHotSyncmanager.piSizeisapointertoanintegerthatspecifiesthesize(inTCHAR's),ofthebufferreferencedbythepPathparameter.

returnvalues:

0:Noerror-1:Anon-specificerroroccurredERR_REGISTRY_ACCESS(-1006):UnabletoaccessthePalmconfigurationentriesERR_BUFFER_TOO_SMALL(-1010):ThebufferistoosmalltoholdtherequestedinformationERR_INVALID_POINTER(-1013):Thespecifiedpointerisnotavalidpointer

Also,ifthebufferistoosmallthevaluein*intisthesize(inTCHARs)thatthebuffershouldbe.

ThisfunctiondefinitionmapstothefollowingSystem.dlldefinition:

CmGetHotSyncExecPath(t,*i)i

i.e.Ittakesatextvariable,apointertoint,andreturnsanintvalue.

UsingtheexternaldllfunctionNowthatwe'vesortedoutwhatthefunctiondoesandhowitmapstotheSystem.dllformatwecanusethefunctioninaNSISscript.

FirstyouhavetochangetheoutputdirectorytothatwheretheDLLyouwanttouseis.ItmayalsoworkiftheDLLisinthesystempathbutthishasn'tbeentested.

Thefollowingcodefragmentwillinstall'condmgr.dll'toatemporarydirectory,executetheCmGetHotSyncExecPathfunctionanddisplayreturneddata.Savethisscript

;****snip****FunctionloadDll

SetOutPath$TEMP\eInspect;createtempdirectoryFilebin\CondMgr.dll;copydllthereStrCpy$1${NSIS_MAX_STRLEN};assignmemoryto$0System::Call'CondMgr::CmGetHotSyncExecPath(t,*i)i(.r0,r1r1).r2'DetailPrint'Path:"$0"'DetailPrint"Pathlength:$1"DetailPrint"Returnvalue:$2"

FunctionEnd;****snip****

andthisfunctionproducesthefollowingoutputinthe'details'page:

Outputfolder:c:\windows\TEMP\eInspectExtract:CondMgr.dllPath:"C:\Dave\palm\Hotsync.exe"Pathlength:24Returnvalue:0

Writtenbydjc

Acknowledgements&ThanksLotsofthanksgotokichikandSunjammerforspendingalotoftimeassistinginsolvingthisproblem.AlsotobrainsuckerforcreatingtheSystem.dllplug-ininthefirstplace.GoodLuck!

Previous|Contents|Next

Previous|Contents|Next

D.4DumpContentofLogWindowtoFileThisfunctionwilldumpthelogoftheinstaller(installerdetails)toafileofyourchoice.

Touseit,pushafilenameandcallit.Itwilldumpthelogtothefilespecified.Forexample:

GetTempFileName$0Push$0CallDumpLog

Hereisthefunction:

!defineLVM_GETITEMCOUNT0x1004!defineLVM_GETITEMTEXTA0x102D

FunctionDumpLog#WrittenbyKiCHiKExch$5Push$0Push$1Push$2Push$3Push$4Push$6

FindWindow$0"#32770"""$HWNDPARENTGetDlgItem$0$01016StrCmp$00errorFileOpen$5$5"w"StrCmp$50errorSendMessage$0${LVM_GETITEMCOUNT}00$6System::StrAlloc${NSIS_MAX_STRLEN}Pop$3StrCpy$20System::Call"*(i,i,i,i,i,i,i,i,i)p\

(0,0,0,0,0,r3,${NSIS_MAX_STRLEN}).r1"loop:StrCmp$2$6doneSystem::Call"User32::SendMessageA(p,i,p,p)i\($0,${LVM_GETITEMTEXTA},$2,r1)"System::Call"*$3(&t${NSIS_MAX_STRLEN}.r4)"FileWrite$5"$4$\r$\n"IntOp$2$2+1Gotoloopdone:FileClose$5System::Free$1System::Free$3Gotoexiterror:MessageBoxMB_OKerrorexit:Pop$6Pop$4Pop$3Pop$2Pop$1Pop$0Exch$5FunctionEnd

Here'sthefunctiontogenerateaUTF-16LEfileifyou'rebuildingaUnicodeinstaller.

!defineLVM_GETITEMCOUNT0x1004!defineLVM_GETITEMTEXTW0x1073

FunctionDumpLog#WrittenbyKiCHiK,modifiedbyJimParkExch$5Push$0Push$1Push$2Push$3

Push$4Push$6

FindWindow$0"#32770"""$HWNDPARENTGetDlgItem$0$01016StrCmp$00errorFileOpen$5$5"w"FileWriteWord$50xfeff;WritetheBOMStrCmp$50errorSendMessage$0${LVM_GETITEMCOUNT}00$6System::StrAlloc${NSIS_MAX_STRLEN}Pop$3StrCpy$20System::Call"*(i,i,i,i,i,i,i,i,i)p\(0,0,0,0,0,r3,${NSIS_MAX_STRLEN}).r1"loop:StrCmp$2$6doneSystem::Call"User32::SendMessageW(p,i,p,p)i\($0,${LVM_GETITEMTEXTW},$2,r1)"System::Call"*$3(&t${NSIS_MAX_STRLEN}.r4)"FileWriteUTF16LE$5"$4$\r$\n"IntOp$2$2+1Gotoloopdone:FileClose$5System::Free$1System::Free$3Gotoexiterror:MessageBoxMB_OKerrorexit:Pop$6Pop$4Pop$3Pop$2Pop$1Pop$0Exch$5

FunctionEnd

Previous|Contents|Next

Previous|Contents|Next

D.5HowtoReadREG_MULTI_SZValuesKiCHiKwrotethisscripttohelprpetgesinthisforumthread.ItreadsaregistryvalueofthetypeREG_MULTI_SZandprintsitout.Don'tforgettoeditwhereitsays"Editthis!"whenyoutestthisscript.ThevaluesmustpointtoaREG_MULTI_SZvalueortheexamplewillspitoutanerror.

OutFile"REG_MULTI_SZReader.exe"Name"REG_MULTI_SZReader"ShowInstDetailsshow

!defineHKEY_CLASSES_ROOT0x80000000!defineHKEY_CURRENT_USER0x80000001!defineHKEY_LOCAL_MACHINE0x80000002!defineHKEY_USERS0x80000003!defineHKEY_PERFORMANCE_DATA0x80000004!defineHKEY_PERFORMANCE_TEXT0x80000050!defineHKEY_PERFORMANCE_NLSTEXT0x80000060!defineHKEY_CURRENT_CONFIG0x80000005!defineHKEY_DYN_DATA0x80000006!defineKEY_QUERY_VALUE0x0001!defineKEY_ENUMERATE_SUB_KEYS0x0008!defineREG_NONE0!defineREG_SZ1!defineREG_EXPAND_SZ2!defineREG_BINARY3!defineREG_DWORD4!defineREG_DWORD_LITTLE_ENDIAN4!defineREG_DWORD_BIG_ENDIAN5!defineREG_LINK6!defineREG_MULTI_SZ7

!defineRegOpenKeyEx"Advapi32::RegOpenKeyExA(i,t,i,i,*i)i"!defineRegQueryValueEx"Advapi32::RegQueryValueExA(i,t,i,*i,i,*i)i"!defineRegCloseKey"Advapi32::RegCloseKeyA(i)i"

#######Editthis!

!defineROOT_KEY${HKEY_CURRENT_USER}!defineSUB_KEY"Software\JoeSoftware"!defineVALUE"Strings"

#######Stopediting

Section"Read"StrCpy$0""StrCpy$1""StrCpy$2""StrCpy$3""System::Call"${RegOpenKeyEx}(${ROOT_KEY},'${SUB_KEY}',\0,${KEY_QUERY_VALUE}|${KEY_ENUMERATE_SUB_KEYS},.r0).r3"StrCmp$30goonMessageBoxMB_OK|MB_ICONSTOP"Can'topenregistrykey!($3)"Gotodonegoon:

System::Call"${RegQueryValueEx}(r0,'${VALUE}',0,.r1,0,.r2).r3"StrCmp$30readMessageBoxMB_OK|MB_ICONSTOP"Can'tqueryregistryvaluesize!($3)"Gotodoneread:StrCmp$1${REG_MULTI_SZ}multiszMessageBoxMB_OK|MB_ICONSTOP"RegistryvaluenoREG_MULTI_SZ!($3)"Gotodonemultisz:StrCmp$200multiszallocMessageBoxMB_OK|MB_ICONSTOP"Registryvalueempty!($3)"

Gotodonemultiszalloc:

System::Alloc$2Pop$1StrCmp$100multiszgetMessageBoxMB_OK|MB_ICONSTOP"Can'tallocateenoughmemory!($3)"Gotodonemultiszget:System::Call"${RegQueryValueEx}(r0,'${VALUE}',0,n,r1,r2).r3"StrCmp$30multiszprocessMessageBoxMB_OK|MB_ICONSTOP"Can'tqueryregistryvaluedata!($3)"Gotodonemultiszprocess:StrCpy$4$1loop:System::Call"*$4(&t${NSIS_MAX_STRLEN}.r3)"StrCmp$3""doneDetailPrint$3StrLen$5$3IntOp$4$4+$5IntOp$4$4+1Gotoloopdone:System::Free$1

StrCmp$00noCloseSystem::Call"${RegCloseKey}(r0)"noClose:

SectionEnd

Previous|Contents|Next

Previous|Contents|Next

D.6PredefinedMacrosforUnicodesupportTherearetwomacrosthatcanhelpyouwritescriptsthatworkforbothUnicodeandANSIinstallers.TofigureoutifthescriptisbeingcompiledtogenerateaUnicodeinstaller,use!ifdeftocheckfor${NSIS_UNICODE}.Toseewhatthesizeofacharacteris,use${NSIS_CHAR_SIZE}.Itwillbe1forANSIand2forUnicodeinstallers.

Previous|Contents|Next

Previous|Contents|Next

AppendixE:UsefulHeadersFileFunctionsHeader

IntroductionLocateGetSizeDriveSpaceGetDrivesGetTimeGetFileAttributesGetFileVersionGetExeNameGetExePathGetParametersGetOptionsGetOptionsSGetRootGetParentGetFileNameGetBaseNameGetFileExtBannerTrimPathDirStateRefreshShellIcons

TextFunctionsHeaderIntroductionLineFindLineReadFileReadFromEndLineSumFileJoinTextCompareTextCompareSConfigReadConfigReadSConfigWriteConfigWriteSFileRecode

TrimNewLinesWordFunctionsHeader

IntroductionWordFindWordFindSWordFind2XWordFind2XSWordFind3XWordFind3XSWordReplaceWordReplaceSWordAddWordAddSWordInsertWordInsertSStrFilterStrFilterSVersionCompareVersionConvert

Previous|Contents|Next

Previous|Contents|Next

E.1FileFunctionsHeader

E.1.1Introduction

Includeheader:

!include"FileFunc.nsh"

Callfunctions:

SectionInstall${GetFileExt}"C:\MyDownloads\Index.html"$R0;$R0="html"SectionEnd

Sectionun.Install${GetParent}"C:\MyDownloads\Index.html"$R0;$R0="C:\MyDownloads"SectionEnd

E.1.2Locate

Findfiles,directoriesandemptydirectorieswithmaskandsizeoptions.

Syntax:

${Locate}"[Path]""[Options]""Function"

"[Path]";DiskorDirectory;"[Options]";/L=[FD|F|D|DE|FDE];/L=FD-LocateFilesandDirectories(default);/L=F-LocateFilesonly;/L=D-LocateDirectoriesonly;/L=DE-LocateEmptyDirectoriesonly;/L=FDE-LocateFilesandEmptyDirectories

;/M=[mask];/M=*.*-Locateall(default);/M=*.doc-LocateWork.doc,1.doc...;/M=Pho*-LocatePHOTOS,phone.txt...;/M=win???.exe-Locatewinamp.exe,winver.exe...;/M=winamp.exe-Locatewinamp.exeonly;/S=No:No[B|K|M|G];/S=-Don'tlocatefilesize(faster)(default);/S=0:0B-Locateonlyfilesof0Bytesexactly;/S=5:9K-Locateonlyfilesof5to9Kilobytes;/S=:10M-Locateonlyfilesof10Megabyteorless;/S=1G-Locateonlyfilesof1Gigabyteormore;/G=[1|0];/G=1-Locatewithsubdirectories(default);/G=0-Locatewithoutsubdirectories;/B=[0|1];/B=0-Bannerisn'tused(default);/B=1-Bannerisused.Callbackwhenfunction;starttosearchinnewdirectory"Function";Callbackfunctionwhenfound

Function"Function" ;$R9"path\name" ;$R8"path" ;$R7"name" ;$R6"size"($R6=""ifdirectory,$R6="0"iffilewith/S=)

;$R0-$R5arenotused(savedatainthem). ;...

Push$var;If$var="StopLocate"ThenexitfromfunctionFunctionEnd

Note:-Errorflagifdiskordirectoryisn'texist-Errorflagifsyntaxerror-Seealso:Locateplugin

Example(Findonefile):

Section ${Locate}"C:\ftp""/L=F/M=RPCDCOM.rar/S=1K""Example1" ;'RPCDCOM.rar'filein'C:\ftp'withsize1Kbormore

IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2 MessageBoxMB_OK"$$R0=$R0"SectionEnd

FunctionExample1 StrCpy$R0$R9 ;$R0="C:\ftp\files\RPCDCOM.rar"

MessageBoxMB_YESNO'$R0$\n$\nFindnext?'IDYES+2 StrCpy$0StopLocate

Push$0FunctionEnd

Example(Writeresultstoatextfile):

Section GetTempFileName$R0 FileOpen$R1$R0w ${Locate}"C:\ftp""/S=:2M/G=0""Example2" ;foldersandallfileswithsize2Mborless ;don'tscansubdirectories FileClose$R1

IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2 Exec'"notepad.exe""$R0"'SectionEnd

FunctionExample2

StrCmp$R6''0+3 FileWrite$R1"Directory=$R9$\r$\n" goto+2 FileWrite$R1"File=$R9Size=$R6Mb$\r$\n"

Push$0FunctionEnd

Example(WriteresultstoanINIfile):

Section GetTempFileName$R0 ${Locate}"C:\ftp""/L=F/S=0K""Example3" ;allfilesin'C:\ftp'withsizedetectinKb

IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2 Exec'"notepad.exe""$R0"'SectionEnd

FunctionExample3 WriteINIStr$R0"$R8""$R7""$R6Kb"

Push$0FunctionEnd

Example(Deleteemptydirectories):

Section StrCpy$R20 StrCpy$R30

loop: StrCpy$R10 ${Locate}"C:\ftp""/L=DE""Example4" IntOp$R3$R3+1 IntOp$R2$R2+$R1 StrCmp$R0StopLocate+2

StrCmp$R100loop

IfErrors0+2 MessageBoxMB_OK'error'IDOK+2 MessageBoxMB_OK'$R2directorieswereremoved$\n$R3loops'SectionEnd

FunctionExample4 MessageBoxMB_YESNOCANCEL'Deleteempty"$R9"?'IDNOendIDCANCELcancel RMDir$R9 IntOp$R1$R1+1 gotoend

cancel: StrCpy$R0StopLocate

end: Push$R0FunctionEnd

Example(Moveallfilesintoonefolder):

Section StrCpy$R0"C:\ftp";Directorymovefrom StrCpy$R1"C:\ftp2";Directorymoveinto

StrCpy$R20 StrCpy$R30 ${Locate}"$R0""/L=F""Example5"

IfErrors0+2 MessageBoxMB_OK'error'IDOK+4 StrCmp$R300+2 MessageBoxMB_OK'$R2filesweremoved'IDOK+2 MessageBoxMB_OK'$R2filesweremoved$\n$R3fileswereNOTmoved'SectionEnd

FunctionExample5 StrCmp$R8$R1+6 IfFileExists'$R1\$R7'+4 Rename$R9'$R1\$R7' IntOp$R2$R2+1 goto+2 IntOp$R3$R3+1

Push$0FunctionEnd

Example(Copyfileswithlog):

Section StrCpy$R0"C:\ftp";Directorycopyfrom StrCpy$R1"C:\ftp2";Directorycopyinto StrLen$R2$R0

GetTempFileName$0 FileOpen$R3$0w ${Locate}"$R0""/L=FDE""Example6" FileClose$R3

IfErrors0+2 MessageBoxMB_OK'error'

Exec'"notepad.exe""$0"';viewlogSectionEnd

FunctionExample6 StrCpy$1$R8''$R2

StrCmp$R6''0+3 CreateDirectory'$R1$1\$R7' gotoend CreateDirectory'$R1$1' CopyFiles/SILENT$R9'$R1$1'

IfFileExists'$R1$1\$R7'0+3 FileWrite$R3"-old:$R9-new:$R1$1\$R7-success$\r$\n" goto+2 FileWrite$R3"-old:$R9-new:$R1$1\$R7-failed$\r$\n"

end: Push$0FunctionEnd

Example(Recreatedirectorystructure):

Section StrCpy$R0"C:\ftp";Directorystructurefrom StrCpy$R1"C:\ftp2";Directorystructureinto StrLen$R2$R0

${Locate}"$R0""/L=D""Example7"

IfErrors0+2 MessageBoxMB_OK'error'SectionEnd

FunctionExample7 StrCpy$1$R9''$R2 CreateDirectory'$R1$1'

Push$0FunctionEnd

Example(Locatewithbanner-NxSpluginrequired):

Section nxs::Show/NOUNLOAD`$(^Name)Setup`/top\ `Setupsearchingsomething$\r$\nPleasewait...Ifyoucan..`\ /h1/can1/end ${Locate}"C:\WINDOWS""/L=F/M=*.inf/B=1""Example8" nxs::Destroy

SectionEnd

FunctionExample8 StrCmp$R0$R8abortcheck StrCpy$R0$R8 nxs::Update/NOUNLOAD/sub"$R8"/pos78/end

abortcheck: nxs::HasUserAborted/NOUNLOAD Pop$0 StrCmp$010+2 StrCpy$0StopLocate

StrCmp$R9''end ;...

end: Push$0FunctionEnd

E.1.3GetSize

Findthesizeofafile,filesmaskordirectory.Findthesumofthefiles,directoriesandsubdirectories.

Syntax:

${GetSize}"[Path]""[Options]"$var1$var2$var3

"[Path]";DiskorDirectory;"[Options]";/M=[mask];/M=*.*-Findall(default);/M=*.doc-FindWork.doc,1.doc...;/M=Pho*-FindPHOTOS,phone.txt...;/M=win???.exe-Findwinamp.exe,winver.exe...;/M=winamp.exe-Findwinamp.exeonly

;/S=No:No[B|K|M|G];/S=-Don'tfindfilesize(faster)(default);/S=0:0B-Findonlyfilesof0Bytesexactly;/S=5:9K-Findonlyfilesof5to9Kilobytes;/S=:10M-Findonlyfilesof10Megabyteorless;/S=1G-Findonlyfilesof1Gigabyteormore;/G=[1|0];/G=1-Findwithsubdirectories(default);/G=0-Findwithoutsubdirectories;$var1;Result1:Size$var2;Result2:Sumoffiles$var3;Result3:Sumofdirectories

Note:-Errorflagifdiskordirectoryisn'texist-Errorflagifsyntaxerror-Seealso:Locateplugin

Examples:

Section'Findfilesizeof"$WINDIR\Explorer.exe"inKiB'

${GetSize}"$WINDIR""/M=Explorer.exe/S=0K/G=0"$0$1$2 ;$0="220"KiB ;$1="1"files ;$2=""directories

IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

Section'Findfoldersizeof"C:\Installs\Drivers"inMiB'

${GetSize}"C:\Installs\Drivers""/S=0M"$0$1$2 ;$0="132"MiB ;$1="555"files ;$2="55"directories

IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

Section'Findsumoffilesandfoldersin"$WINDIR"(nosubfolders)'

${GetSize}"$WINDIR""/G=0"$0$1$2 ;$0=""size ;$1="253"files ;$2="46"directories

IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

E.1.4DriveSpace

Gettotal,occupiedorfreespaceofthedrive.

Syntax:

${DriveSpace}"[Drive]""[Options]"$var

"[Drive]";Disktocheck;"[Options]";/D=[T|O|F];/D=T-Totalspace(default);/D=O-Occupiedspace;/D=F-Freespace;/S=[B|K|M|G];/S=B-sizeinBytes(default);/S=K-sizeinKilobytes;/S=M-sizeinMegabytes;/S=G-sizeinGigabytes;$var;Result:Size

Note:-Errorflagifdiskisn'texistornotready-Errorflagifsyntaxerror

Example:

Section ${DriveSpace}"C:\""/D=F/S=M"$R0 ;$R0="2530"megabytesfreeondriveC:SectionEnd

E.1.5GetDrives

Findallavailabledrivesinthesystem.

Syntax:

${GetDrives}"[Option]""Function"

"[Option]";[FDD+HDD+CDROM+NET+RAM];FDDFloppyDiskDrives;HDDHardDiskDrives;CDROMCD-ROMDrives;NETNetworkDrives;RAMRAMDiskDrives;;[ALL];Findalldrivesbyletter(default);"Function";Callbackfunctionwhenfound

Function"Function" ;$9"driveletter"(a:\c:\...) ;$8"drivetype"(FDDHDD...)

;$R0-$R9arenotused(savedatainthem). ;...

Push$var;If$var="StopGetDrives"ThenexitfromfunctionFunctionEnd

Example1:

Section ${GetDrives}"FDD+CDROM""Example1"SectionEnd

FunctionExample1 MessageBoxMB_OK"$9($8Drive)"

Push$0FunctionEnd

Example2:

Section ${GetDrives}"ALL""Example2"SectionEnd

FunctionExample2 MessageBoxMB_OK"$9($8Drive)"

Push$0FunctionEnd

Example3(Gettypeofdrive):

Section StrCpy$R0"D:\";Driveletter StrCpy$R1"invalid"

${GetDrives}"ALL""Example3"

MessageBoxMB_OK"Typeofdrive$R0is$R1"SectionEnd

FunctionExample3 StrCmp$9$R00+3 StrCpy$R1$8 StrCpy$0StopGetDrives

Push$0FunctionEnd

E.1.6GetTime

Getlocalorsystemtime.Getfiletime(access,creationandmodification).

Syntax:

${GetTime}"[File]""[Option]"$var1$var2$var3$var4$var5$var6$var7

"[File]";Ignoredif"L"or"LS";"[Option]";[Options];LLocaltime;AlastAccessfiletime;CCreationfiletime;MModificationfiletime;LSSystemtime(UTC);ASlastAccessfiletime(UTC);CSCreationfiletime(UTC);MSModificationfiletime(UTC);$var1;Result1:day$var2;Result2:month$var3;Result3:year$var4;Result4:dayofweekname$var5;Result5:hour$var6;Result6:minute$var7;Result7:seconds

Note:

-Errorflagiffileisn'texist-Errorflagifsyntaxerror-Seealso:Timeplugin

Examples:

Section'Getlocaltime' ${GetTime}"""L"$0$1$2$3$4$5$6 ;$0="01"day ;$1="04"month ;$2="2005"year ;$3="Friday"dayofweekname ;$4="16"hour ;$5="05"minute ;$6="50"seconds

MessageBoxMB_OK'Date=$0/$1/$2($3)$\nTime=$4:$5:$6'SectionEnd

Section'Getfiletime' ${GetTime}"$WINDIR\Explorer.exe""C"$0$1$2$3$4$5$6 ;$0="12"day ;$1="10"month ;$2="2004"year ;$3="Tuesday"dayofweekname ;$4="2"hour ;$5="32"minute ;$6="03"seconds

IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2 MessageBoxMB_OK'Date=$0/$1/$2($3)$\nTime=$4:$5:$6'SectionEnd

Section'Getsystemtime' ${GetTime}"""LS"$0$1$2$3$4$5$6 ;$0="01"day ;$1="04"month

;$2="2005"year ;$3="Friday"dayofweekname ;$4="11"hour ;$5="05"minute ;$6="50"seconds

MessageBoxMB_OK'Date=$0/$1/$2($3)$\nTime=$4:$5:$6'SectionEnd

Section'Converttimeto12-hourformatAM/PM' ${GetTime}"""L"$0$1$2$3$4$5$6

StrCmp$400+3 StrCpy$412 goto+3 StrCmp$412+5 IntCmp$41200+3 StrCpy$7AM goto+3 IntOp$4$4-12 StrCpy$7PM

MessageBoxMB_OK'Date=$0/$1/$2($3)$\nTime=$4:$5:$6$7'SectionEnd

E.1.7GetFileAttributes

Getattributesoffileordirectory.

Syntax:

${GetFileAttributes}"[File]""[Attributes]"$var

"[File]";Fileordirectory;"[Attributes]";"ALL"(default);-allattributesoffilecombinedwith"|"tooutput;

;"READONLY|HIDDEN|SYSTEM|DIRECTORY|ARCHIVE|;DEVICE|NORMAL|TEMPORARY|SPARSE_FILE|REPARSE_POINT|;COMPRESSED|OFFLINE|NOT_CONTENT_INDEXED|ENCRYPTED";-filemusthavespecifiedattributes;$var;Result:;$var=attr1|attr2|...(ifused"ALL");$var=1filehasspecifiedattributes;$var=0filehasnospecifiedattributes

Note:-Errorflagissetiffiledoesn'texist

Example:

Section ${GetFileAttributes}"C:\MSDOS.SYS""ALL"$R0 ;$R0=READONLY|HIDDEN|SYSTEM|ARCHIVE

${GetFileAttributes}"C:\MSDOS.SYS""SYSTEM|HIDDEN"$R0 ;$R0=1

${GetFileAttributes}"C:\MSDOS.SYS""NORMAL"$R0 ;$R0=0SectionEnd

E.1.8GetFileVersion

Getversioninformationfromexecutablefile.

Syntax:

${GetFileVersion}"[Executable]"$var

"[Executable]";Executablefile(*.exe*.dll...)$var;Result:Versionnumber

Note:

-Errorflagiffiledoesn'texist-Errorflagiffiledoesn'tcontainversioninformation

Example:

${GetFileVersion}"C:\ftp\program.exe"$R0;$R0="1.1.0.12"

E.1.9GetExeName

Getinstallerfilename(withvalidcaseforWindows98/Me).

Syntax:

${GetExeName}$var

Example:

${GetExeName}$R0;$R0="C:\ftp\program.exe"

E.1.10GetExePath

Getinstallerpathname($EXEDIRwithvalidcaseforWindows98/Me).

Syntax:

${GetExePath}$var

Example:

${GetExePath}$R0;$R0="C:\ftp"

E.1.11GetParameters

Getcommandlineparameters.

Syntax:

${GetParameters}$var

Example:

${GetParameters}$R0;$R0="[parameters]"

E.1.12GetOptions

Getoptionsfromcommandlineparameters.

Syntax:

${GetOptions}"[Parameters]""[Option]"$var

"[Parameters]";commandlineparameters;"[Option]";optionname;$var;Result:optionstring

Note:-Theerrorflagissetiftheoptionisnotfound-Thefirstcharacterintheoptionstringistreatedasaparameterdelimiter

Example1:

Section ${GetOptions}"/S/T""/T"$R0

IfErrors0+2 MessageBoxMB_OK"Notfound"IDOK+2 MessageBoxMB_OK"Found"SectionEnd

Example2:

Section ${GetOptions}"-INSTDIR=C:\ProgramFiles\CommonFiles-SILENT=yes""-INSTDIR="$R0 ;$R0=C:\ProgramFiles\CommonFilesSectionEnd

Example3:

Section ${GetOptions}'/SILENT=yes/INSTDIR="C:/ProgramFiles/CommonFiles"/ADMIN=password'"/INSTDIR="$R0 ;$R0=C:/ProgramFiles/CommonFilesSectionEnd

Example4:

Section ${GetOptions}`-SILENT=yes-INSTDIR='"C:/ProgramFiles/CommonFiles"'-ADMIN=password`"-INSTDIR="$R0 ;$R0="C:/ProgramFiles/CommonFiles"SectionEnd

E.1.13GetOptionsS

SameasGetOptions,butcasesensitive.

E.1.14GetRoot

Getrootdirectory.

Syntax:

${GetRoot}"[FullPath]"$var

Examples:

${GetRoot}"C:\ProgramFiles\NSIS"$R0;$R0="C:"${GetRoot}"\\SuperPimp\NSIS\Source\exehead\Ui.c"$R0;$R0="\\SuperPimp\NSIS"

E.1.15GetParent

Getparentdirectory.

Syntax:

${GetParent}"[PathString]"$var

Example:

${GetParent}"C:\ProgramFiles\Winamp\uninstwa.exe"$R0;$R0="C:\ProgramFiles\Winamp"

E.1.16GetFileName

Getlastpartfromdirectorypath.

Syntax:

${GetFileName}"[PathString]"$var

Example:

${GetFileName}"C:\ProgramFiles\Winamp\uninstwa.exe"$R0;$R0="uninstwa.exe"

E.1.17GetBaseName

Getfilenamewithoutextension.

Syntax:

${GetBaseName}"[FileString]"$var

Example:

${GetBaseName}"C:\ftp\program.exe"$R0;$R0="program"

E.1.18GetFileExt

Getextensionoffile.

Syntax:

${GetFileExt}"[FileString]"$var

Example:

${GetFileExt}"C:\ftp\program.exe"$R0;$R0="exe"

E.1.19BannerTrimPath

Trimstringpathforbanner.

Syntax:

${BannerTrimPath}"[PathString]""[Option]"$var

"[PathString]";;"[Option]";[Length][A|B|C|D];;Length-Maximumstringlength;A-Trimcenterpath(default);(C:\root\...\thirdpath);IfAmodenotpossibleThenwillbeusedBmode;B-Trimrightpath;(C:\root\secondpath\...);IfBmodenotpossibleThenwillbeusedCmode;C-Trimrightstring;(C:\root\secondpath\thirdp...);D-Trimrightstring+filename;(C:\root\secondp...\thirdpath);IfDmodenotpossibleThenwillbeusedCmode;$var;Result:Trimmedpath

Example:

Section ${BannerTrimPath}"C:\Server\Documents\Terminal\license.htm""35A"$R0 ;$R0=C:\Server\...\Terminal\license.htmSectionEnd

Example(Bannerplugin):

!include"WinMessages.nsh"!include"FileFunc.nsh"

Section Banner::show"Starting..." Banner::getWindow Pop$R1 ${Locate}"$WINDIR""/L=F/M=*.*/B=1""LocateCallback" Banner::destroySectionEnd

FunctionLocateCallback StrCmp$R0$R8code StrCpy$R0$R8 ${BannerTrimPath}"$R8""38B"$R8 GetDlgItem$1$R11030 SendMessage$1${WM_SETTEXT}0"STR:$R8"

code: StrCmp$R9''end ;...

end: Push$0FunctionEnd

Example(NxSplugin):

!include"FileFunc.nsh"

Section nxs::Show/NOUNLOAD`$(^Name)Setup`\ /top`Setupsearchingsomething$\nPleasewait$\nIfyoucan...`\ /h1/can1/end ${Locate}"$WINDIR""/L=F/M=*.*/B=1""LocateCallback" nxs::DestroySectionEnd

FunctionLocateCallback

StrCmp$R0$R8abortcheck StrCpy$R0$R8 ${BannerTrimPath}"$R8""55A"$R8 nxs::Update/NOUNLOAD/sub"$R8"/pos78/end

abortcheck: nxs::HasUserAborted/NOUNLOAD Pop$0 StrCmp$010+2 StrCpy$0StopLocate

StrCmp$R9''end ;...

end: Push$0FunctionEnd

E.1.20DirState

Checkdirectoryfull,emptyornotexist.

Syntax:

${DirState}"[path]"$var

"[path]";Directory$var;Result:;$var=0(empty);$var=1(full);$var=-1(directorynotfound)

Example:

${DirState}"$TEMP"$R0;$R0="1"(directoryisfull)

E.1.21RefreshShellIcons

Afterchangingfileassociations,youcancallthisfunctiontorefreshtheshellimmediately.

Syntax:

${RefreshShellIcons}

Example:

Section WriteRegStrHKCR"Winamp.File\DefaultIcon""""$INSTDIR\WINAMP.EXE,2" ${RefreshShellIcons}SectionEnd

Previous|Contents|Next

Previous|Contents|Next

E.2TextFunctionsHeader

E.2.1Introduction

Includeheader:

!include"TextFunc.nsh"

Callfunctions:

SectionInstall ${LineRead}"C:\a.log""-1"$R0 ;$R0="Lastline$\r$\n"SectionEnd

Sectionun.Install ${TrimNewLines}"Lastline$\r$\n"$R0 ;$R0="Lastline"SectionEnd

E.2.2LineFind

Findspecifiedlinesintextfile,andeditorviewtheselinesincallbackfunction.

Syntax:

${LineFind}"[File1]""[File2|/NUL]""[LineNumbers]""Function"

"[File1]";Inputtextfile;"[File2|/NUL]";[File2];Outputtextfile;IfemptythenFile2=File1;[/NUL];Nooutputtextfile(onlyreadFile1);

"[LineNumbers]";[No|-No|No:No|{No}|{-No}|{No:No}];1:-1alllinestochange(default);2secondlinefromstart;-3thirdlinefromend;5:9rangeoflinesfrom5to9;{2}onlysecondlinefromstarttooutput;{-3}onlythirdlinefromendtooutput;{5:9}onlyrangeoflinesfrom5to9tooutput;"Function";Callbackfunctionforspecifiedlines

Function"Function" ;$R9currentline ;$R8currentlinenumber ;$R7currentlinenegativenumber ;$R6currentrangeoflines ;$R5handleofafileopenedtoread ;$R4handleofafileopenedtowrite($R4=""if"/NUL")

;youcanuseanystringfunctions ;$R0-$R3arenotused(savedatainthem). ;...

Push$var;If$var="StopLineFind"Thenexitfromfunction ;If$var="SkipWrite"Thenskipcurrentline(ignoredif"/NUL")FunctionEnd

Note:-Errorflagifinputfiledoesn'texist-Errorflagifoutputfilepathdoesn'texist-Rangesmustbespecifiedongrowth(24:59:-8-5:-4-2:-1)-Outputfilewillnotbeupdatedifnochangesmade.

Example1(deletefirsttwosymbols):

Section ${LineFind}"C:\a.log""C:\a-edited.log""3:-1""Example1" IfErrors0+2 MessageBoxMB_OK"Error"

SectionEnd

FunctionExample1 ${TrimNewLines}'$R9'$R9 StrCpy$R9$R9''2 StrCpy$R9'$R9$\r$\n' ;startfrom3lineanddeletefirsttwosymbols

Push$0FunctionEnd

Example2(showchangedlines):

Section ${LineFind}"C:\a.log""a.log""{5:1215-6:-5-1}""Example2" IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

FunctionExample2 ${TrimNewLines}'$R9'$R9 StrCpy$R9"$R9~Changedline($R8)~$\r$\n"

Push$0FunctionEnd

Example3(deletelines):

Section ${LineFind}"C:\a.log""\logs\a.log""2:310:-5-3:-2""Example3" IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

FunctionExample3 StrCpy$0SkipWrite

Push$0

FunctionEnd

Example4(insertlines):

Section ${LineFind}"C:\a.log""""10""Example4 IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

FunctionExample4 FileWrite$R4"---FirstLine---$\r$\n" FileWrite$R4"---SecondLine...---$\r$\n"

Push$0FunctionEnd

Example5(replaceinfilewithcountofchanges-"WordFunc.nsh"required):

!include"WordFunc.nsh"

Section StrCpy$R00 ${LineFind}"C:\a.log""C:\logs\a.log""1:-1""Example5" IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2 MessageBoxMB_OK"Changedlines=$R0"SectionEnd

FunctionExample5 StrCpy$1$R9

${WordReplace}'$R9''''_''+*'$R9

StrCmp$1$R9+2 IntOp$R0$R0+1 ;$R0countofchangedlines

Push$0FunctionEnd

Example6(linestringtocutordelete):

Section ${LineFind}"\a.log""C:\logs\a.log""""Example6" IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2 MessageBoxMB_OK"Processedlines=$R1:$R2"SectionEnd

FunctionExample6 ;(Cutlinesfromalinetoanotherline(alsoincludingthatline)) StrCmp$R0finishstop StrCmp$R0startfinish StrCmp$R9'StartLine$\r$\n'0skip StrCpy$R0start StrCpy$R1$R8 gotocode finish: StrCmp$R9'FinishLine$\r$\n'0code StrCpy$R0finish StrCpy$R2$R8 gotocode skip: StrCpy$0SkipWrite gotooutput stop: StrCpy$0StopLineFind gotooutput

;;(Deletelinesfromalinetoanotherline(alsoincludingthatline)) ;StrCmp$R0finishcode ;StrCmp$R0startfinish ;StrCmp$R9'StartLine$\r$\n'0code

;StrCpy$R0start ;StrCpy$R1$R8 ;gotoskip ;finish: ;StrCmp$R9'FinishLine$\r$\n'0skip ;StrCpy$R0finish ;StrCpy$R2$R8 ;skip: ;StrCpy$0SkipWrite ;gotooutput

code: ;...

output: Push$0FunctionEnd

Example7(readlines):

Section ${LineFind}"C:\a.log""/NUL""1:-1""Example7" IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

FunctionExample7 MessageBoxMB_OKCANCEL'$$R9"Line"=[$R9]$\n$$R8"#"=[$R8]'IDOK+2 StrCpy$0StopLineFind

Push$0FunctionEnd

E.2.3LineRead

Getlineinfilespecifiedwithnumber.

Syntax:

${LineRead}"[File]""[LineNumber]"$var

"[File]";Inputtextfile;"[LineNumber]";[No|-No];3linenumberfromstart;-5linenumberfromend;$var;Result:Line

Note:-Errorflagifinputfiledoesn'texist-Errorflagiflinenumbernotfound

Example:

Section ${LineRead}"C:\a.log""-1"$R0 ;$R0="Lastline$\r$\n"SectionEnd

E.2.4FileReadFromEnd

Readtextfilefromendlinebyline.

Syntax:

${FileReadFromEnd}"[File]""Function"

"[File]";Inputtextfile"Function";Callbackfunction

Function"Function" ;$9currentline ;$8currentlinenumber ;$7currentlinenegativenumber

;$R0-$R9arenotused(savedatainthem). ;...

Push$var;If$var="StopFileReadFromEnd"ThenexitfromfunctionFunctionEnd

Note:-Errorflagifinputfiledoesn'texist

Example1:

Section ${FileReadFromEnd}"C:\a.log""Example1"

IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

FunctionExample1 MessageBoxMB_OKCANCEL'"Line"=[$9]$\n"#"=[$8]$\n"-#"=[$7]'IDOK+2 StrCpy$0StopFileReadFromEnd

Push$0FunctionEnd

Example2(Reversetextfile):

Section GetTempFileName$R0 FileOpen$R1$R0w ${FileReadFromEnd}"C:\a.log""Example2" FileClose$R1

IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2 Exec'"notepad.exe""$R0"'SectionEnd

FunctionExample2 StrCmp$7-10+5 StrCpy$1$91-1 StrCmp$1'$\n'+3 StrCmp$1'$\r'+2 StrCpy$9'$9$\r$\n'

FileWrite$R1"$9"

Push$0FunctionEnd

E.2.5LineSum

Getsumoflinesintextfile.

Syntax:

${LineSum}"[File]"$var

"[File]";Inputfile$var;Result:Sumoflines

Note:-Errorflagifinputfiledoesn'texist

Example:

Section ${LineSum}"C:\a.log"$R0 ;$R0="54"SectionEnd

E.2.6FileJoin

Jointwofilesinone(File1+File2=File3).

Syntax:

${FileJoin}"[File1]""[File2]""[File3]"

"[File1]";InputFile1"[File2]";InputFile2"[File3]";OutputFile3;If[File3]=""Thenadd[File2]to[File1]

Note:-Errorflagifinputfilesdon'texist-Errorflagifoutputfilepathdoesn'texist

Example1(Join:a.log+b.log=Z.log):

Section ${FileJoin}"C:\a.log""C:\logs\b.log""C:\Z.log"SectionEnd

Example2(Add:a.log+b.log=a.log):

Section ${FileJoin}"C:\a.log""C:\logs\b.log""C:\a.log"SectionEnd

E.2.7TextCompare

Comparetwotextfiles.

Syntax:

${TextCompare}"[File1]""[File2]""[Option]""Function"

"[File1]";File1Comparetheselines"[File2]";File2Comparewiththeselines"[Options]";(line-by-line):;FastDiffComparelineN(File1)withlineN(File2);CallfunctionifDifferentlinesfound;FastEqualComparelineN(File1)withlineN(File2);CallfunctionifEquallinesfound

;(linenumberindependent):;SlowDiffComparelineN(File1)withalllines(File2);CallfunctioniflineN(File1)Different;SlowEqualComparelineN(File1)withalllines(File2);CallfunctioniflineN(File1)Equal"Function";Callbackfunction

Function"Function" ;$9"LineFile1" ;$8"Linenumber" ;$7"LineFile2"(emptyifSlowDiff) ;$6"Linenumber"(emptyifSlowDiff)

;$R0-$R9arenotused(savedatainthem). ;...

Push$var;If$var="StopTextCompare"ThenexitfromfunctionFunctionEnd

Note:-ErrorflagifFile1orFile2doesn'texist-Errorflagifsyntaxerror

Example(DifferentorEqual):

Section StrCpy$R0'' ${TextCompare}"C:\1.txt""C:\2.txt""FastDiff""Example1" IfErrors0+2 MessageBoxMB_OK"Error"IDOK+4

StrCmp$R0NotEqual0+2 MessageBoxMB_OK"Filesdiffer"IDOK+2 MessageBoxMB_OK"Filesidentical"SectionEnd

FunctionExample1 StrCpy$R0NotEqual

StrCpy$0StopTextCompare

Push$0FunctionEnd

Example(Compareline-by-line-Different):

Section StrCpy$R0'Text1.txt' StrCpy$R1'Text2.txt'

GetTempFileName$R2 FileOpen$R3$R2w FileWrite$R3"$R0|$R1$\r$\n" ${TextCompare}"$R0""$R1""FastDiff""Example2" IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2

Exec"notepad.exe$R2"FunctionEnd

FunctionExample2 FileWrite$R3'$8=$9' FileWrite$R3'$6=$7$\r$\n'

Push$0FunctionEnd

Example(Compareline-by-line-Equal):

Section StrCpy$R0'Text1.txt' StrCpy$R1'Text2.txt'

GetTempFileName$R2 FileOpen$R3$R2w FileWrite$R3"$R0|$R1$\r$\n" ${TextCompare}"$R0""$R1""FastEqual""Example3"

IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2

Exec"notepad.exe$R2"FunctionEnd

FunctionExample3 FileWrite$R3'$8|$6=$9'

Push$0FunctionEnd

Example(Comparealllines-Different):

Section StrCpy$R0'Text1.txt' StrCpy$R1'Text2.txt'

GetTempFileName$R2 FileOpen$R3$R2w FileWrite$R3"$R0|$R1$\r$\n" ${TextCompare}"$R0""$R1""SlowDiff""Example4" IfErrors0+2 MessageBoxMB_OK"Error"IDOKend

FileWrite$R3"$\r$\n$R1|$R0$\r$\n" ${TextCompare}"$R1""$R0""SlowDiff""Example4" FileClose$R3 IfErrors0+2 MessageBoxMB_OK"Error"IDOKend

Exec"notepad.exe$R2"

end:FunctionEnd

FunctionExample4

FileWrite$R3'$8=$9'

Push$0FunctionEnd

Example(Comparealllines-Equal):

Section StrCpy$R0'Text1.txt' StrCpy$R1'Text2.txt'

GetTempFileName$R2 FileOpen$R3$R2w FileWrite$R3"$R0|$R1$\r$\n" ${TextCompare}"$R0""$R1""SlowEqual""Example5" IfErrors0+2 MessageBoxMB_OK"Error"IDOK+2

Exec"notepad.exe$R2"FunctionEnd

FunctionExample5 FileWrite$R3'$8|$6=$9'

Push$0FunctionEnd

Example(Showvariables):

Section ${TextCompare}"C:\1.txt""C:\2.txt""FastDiff""Example6"

IfErrors0+2 MessageBoxMB_OK"Error"SectionEnd

FunctionExample6 MessageBoxMB_OKCANCEL'\

$$9"LineFile1"=[$9]$\n\ $$8"Line#"=[$8]$\n\ $$7"LineFile2"=[$7]$\n\ $$6"Line#"=[$6]'\ IDOK+2 StrCpy$0StopTextCompare

Push$0FunctionEnd

E.2.8TextCompareS

SameasTextCompare,butcasesensitive.

E.2.9ConfigRead

Readvaluefromentrynameinconfigfile.

Syntax:

${ConfigRead}"[File]""[Entry]"$var

"[File]";configfile;"[Entry]";entryname;$var;Result:Value

Note:-Errorflagifentrynotfound-Errorflagiffiledoesn'texist

Example1:

Section ${ConfigRead}"C:\AUTOEXEC.BAT""SETwinbootdir="$R0 ;$R0=C:\WINDOWSSectionEnd

Example2:

Section ${ConfigRead}"C:\apache\conf\httpd.conf""Timeout"$R0 ;$R0=30SectionEnd

E.2.10ConfigReadS

SameasConfigRead,butcasesensitive.

E.2.11ConfigWrite

Writevaluefromentrynameinconfigfile.

Syntax:

${ConfigWrite}"[File]""[Entry]""[Value]"$var

"[File]";configfile;"[Entry]";entryname;"[Value]";valuename;if""thendeleteEntry;$var;Result:;$var=CHANGEDValueiswritten;$var=DELETEDEntryisdeleted;$var=ADDEDEntryandValueareadded;$var=SAMEEntryandValuealreadyexist

Note:-Errorflagiffiledoesn'texist-Errorflagiffilecan'tbeopened

Example1:

Section ${ConfigWrite}"C:\AUTOEXEC.BAT""SETwinbootdir=""D:\WINDOWS"$R0 ;$R0=CHANGEDSectionEnd

Example2:

Section ${ConfigWrite}"C:\apache\conf\httpd.conf""Timeout""30"$R0 ;$R0=SAMESectionEnd

Example3:

Section ${ConfigWrite}"C:\apache\conf\httpd.conf""Timeout"""$R0 ;$R0=DELETEDSectionEnd

E.2.12ConfigWriteS

SameasConfigWrite,butcasesensitive.

E.2.13FileRecode

RecodetextfilefromDOStoWindowsformatandvice-versa.

Syntax:

${FileRecode}"[File]""[Format]"

"[File]";;"[Format]";OemToChar-fromDOStoWindows;CharToOem-fromWindowstoDOS

Note:-Errorflagiffiledoesn'texist

-Errorflagifsyntaxerror

Example:

Section ${FileRecode}"C:\SCANDISK.LOG""CharToOem"SectionEnd

E.2.14TrimNewLines

Trimnewlinesinastring.

Syntax:

${TrimNewLines}"[string]"$var

"[string]";Inputstring$var;Result:Stringwithout'$\r'and'$\n'attheend

Example:

Section ${TrimNewLines}"Textline$\r$\n"$R0 ;$R0="Textline"SectionEnd

Previous|Contents|Next

Previous|Contents|Next

E.3WordFunctionsHeader

E.3.1Introduction

Includeheader:

!include"WordFunc.nsh"

Callfunctions:

SectionInstall ${WordFind}"A--H---S""-""+2"$R0 ;$R0="H"SectionEnd

Sectionun.Install ${WordReplace}"A--H---S""-""x""+3*"$R0 ;$R0="A--HxS"SectionEnd

E.3.2WordFind

Multi-featuresstringfunction.

Strings:"[word+1][delimiter][word+2][delimiter][word+3]...""[delimiter][word+1][delimiter][word+2][delimiter]...""[delimiter][delimiter][word+1][delimiter][delimiter][delimiter]...""...[word-3][delimiter][word-2][delimiter][word-1]""...[delimiter][word-2][delimiter][word-1][delimiter]""...[delimiter][delimiter][word-1][delimiter][delimiter][delimiter]"

Syntax:

${WordFind}"[string]""[delimiter]""[E][options]"$var

"[string]";[string]

;inputstring"[delimiter]";[delimiter];oneorseveralsymbols"[E][options]";[options];+number:wordnumberfromstart;-number:wordnumberfromend;+number}:delimiternumberfromstart;allspaceafterthis;delimitertooutput;+number{:delimiternumberfromstart;allspacebeforethis;delimitertooutput;+number}}:wordnumberfromstart;allspaceafterthisword;tooutput;+number{{:wordnumberfromstart;allspacebeforethisword;tooutput;+number{}:wordnumberfromstart;allspacebeforeandafter;thisword(wordexclude);+number*}:wordnumberfromstart;allspaceafterthis;wordtooutputwithword;+number{*:wordnumberfromstart;allspacebeforethis;wordtooutputwithword;#:sumofwordstooutput;*:sumofdelimiterstooutput;/word:numberofwordtooutput;;[E];witherrorleveloutput;IfErrors:;$var=1delimiternotfound;$var=2nosuchwordnumber;$var=3syntaxerror(Use:+1,-1},#,*,/word,...)

;[];noerrorleveloutput(default);Ifsomeerrorsfoundthen(result=inputstring);$var;output(result)

Note:-Acceptednumbers1,01,001,...

Example(Findwordbynumber):

Section ${WordFind}"C:\io.sysC:\ProgramFilesC:\WINDOWS""C:\""-02"$R0 ;$R0="ProgramFiles"SectionEnd

Example(Delimiterexclude):

Section ${WordFind}"C:\io.sysC:\logo.sysC:\WINDOWS""sys""-2}"$R0 ;$R0="C:\logo.sysC:\WINDOWS"SectionEnd

Example(Sumofwords):

Section ${WordFind}"C:\io.sysC:\logo.sysC:\WINDOWS""C:\""#"$R0 ;$R0="3"SectionEnd

Example(Sumofdelimiters):

Section ${WordFind}"C:\io.sysC:\logo.sysC:\WINDOWS""sys""*"$R0 ;$R0="2"SectionEnd

Example(Findwordnumber):

Section

${WordFind}"C:\io.sysC:\ProgramFilesC:\WINDOWS""""/Files"$R0 ;$R0="3"SectionEnd

Example(}}):

Section ${WordFind}"C:\io.sysC:\logo.sysC:\WINDOWS""""+2}}"$R0 ;$R0="C:\WINDOWS"SectionEnd

Example({}):

Section ${WordFind}"C:\io.sysC:\logo.sysC:\WINDOWS""""+2{}"$R0 ;$R0="C:\io.sysC:\WINDOWS"SectionEnd

Example(*}):

Section ${WordFind}"C:\io.sysC:\logo.sysC:\WINDOWS""""+2*}"$R0 ;$R0="C:\logo.sysC:\WINDOWS"SectionEnd

Example(Getparentdirectory):

Section StrCpy$R0"C:\ProgramFiles\NSIS\NSIS.chm"; "C:\ProgramFiles\NSIS\Include\"; "C:\\ProgramFiles\\NSIS\\NSIS.chm"

${WordFind}"$R0""\""-2{*"$R0 ;$R0="C:\ProgramFiles\NSIS" ;"C:\\ProgramFiles\\NSIS"SectionEnd

Example(Coordinates):

Section ${WordFind}"C:\io.sysC:\logo.sysC:\WINDOWS"":\lo""E+1{"$R0 ;$R0="C:\io.sysC" IfErrorsend

StrLen$0$R0;$0=Startpositionofword(11) StrLen$1':\lo';$1=Wordlength(4) ;StrCpy$R0$R1$1$0;$R0=:\lo

end:SectionEnd

Example(Witherrorleveloutput):

Section ${WordFind}"[string]""[delimiter]""E[options]"$R0

IfErrors0end StrCmp$R010+2;errorlevel1? MessageBoxMB_OK'delimiternotfound'IDOKend StrCmp$R020+2;errorlevel2? MessageBoxMB_OK'nosuchwordnumber'IDOKend StrCmp$R030+2;errorlevel3? MessageBoxMB_OK'syntaxerror'

end:SectionEnd

Example(Withouterrorleveloutput):

Section ${WordFind}"C:\io.sysC:\logo.sys""_""+1"$R0

;$R0="C:\io.sysC:\logo.sys"(error:delimiter"_"notfound)SectionEnd

Example(Iffound):

Section ${WordFind}"C:\io.sysC:\logo.sys"":\lo""E+1{"$R0

IfErrorsnotfoundfound found: MessageBoxMB_OK'Found'IDOKend notfound: MessageBoxMB_OK'Notfound'

end:SectionEnd

Example(Iffound2):

Section ${WordFind}"C:\io.sysC:\logo.sys"":\lo""+1{"$R0

StrCmp$R0"C:\io.sysC:\logo.sys"notfoundfound;error? found: MessageBoxMB_OK'Found'IDOKend notfound: MessageBoxMB_OK'Notfound'

end:SectionEnd

Example(Toacceptonewordinstringifdelimiternotfound):

Section StrCpy$0'OneWord' StrCpy$11

loop: ${WordFind}"$0""""E+$1"$R0 IfErrors0code StrCmp$1$R0110error StrCpy$R0$0 gotoend

code: ;... IntOp$1$1+1 gotoloop

error: StrCpy$1'' StrCpy$R0''

end: ;$R0="OneWord"SectionEnd

E.3.3WordFindS

SameasWordFind,butcasesensitive.

E.3.4WordFind2X

Findwordbetweentwodelimiters.

Strings:"[delimiter1][word+1][delimiter2][delimiter1][word+2][delimiter2]...""[text][delimiter1][text][delimiter1][word+1][delimiter2][text]...""...[delimiter1][word-2][delimiter2][delimiter1][word-1][delimiter2]""...[text][delimiter1][text][delimiter1][word-1][delimiter2][text]"

Syntax:

${WordFind2X}"[string]""[delimiter1]""[delimiter2]""[E][options]"$var

"[string]";[string];inputstring"[delimiter1]";[delimiter1];firstdelimiter"[delimiter2]";[delimiter2];seconddelimiter

"[E][options]";[options];+number:wordnumberfromstart;-number:wordnumberfromend;+number}}:wordnumberfromstartallspace;afterthiswordtooutput;+number{{:wordnumberfromendallspace;beforethiswordtooutput;+number{}:wordnumberfromstart;allspacebeforeandafter;thisword(wordexclude);+number*}:wordnumberfromstart;allspaceafterthis;wordtooutputwithword;+number{*:wordnumberfromstart;allspacebeforethis;wordtooutputwithword;#:sumofwordstooutput;/word:numberofwordtooutput;;[E];witherrorleveloutput;IfErrors:;$var=1nowordsfound;$var=2nosuchwordnumber;$var=3syntaxerror(Use:+1,-1,#);[];noerrorleveloutput(default);Ifsomeerrorsfoundthen(result=inputstring);$var;output(result)

Example(1):

Section ${WordFind2X}"[C:\io.sys];[C:\logo.sys];[C:\WINDOWS]""[C:\""];""+2"$R0 ;$R0="logo.sys"SectionEnd

Example(2):

Section ${WordFind2X}"C:\WINDOWSC:\io.sysC:\logo.sys""\"".""-1"$R0 ;$R0="logo"SectionEnd

Example(3):

Section ${WordFind2X}"C:\WINDOWSC:\io.sysC:\logo.sys""\"".""-1{{"$R0 ;$R0="C:\WINDOWSC:\io.sysC:"SectionEnd

Example(4):

Section ${WordFind2X}"C:\WINDOWSC:\io.sysC:\logo.sys""\"".""-1{}"$R0 ;$R0="C:\WINDOWSC:\io.sysC:sys"SectionEnd

Example(5):

Section ${WordFind2X}"C:\WINDOWSC:\io.sysC:\logo.sys""\"".""-1{*"$R0 ;$R0="C:\WINDOWSC:\io.sysC:\logo."SectionEnd

Example(6):

Section ${WordFind2X}"C:\WINDOWSC:\io.sysC:\logo.sys""\"".""/logo"$R0 ;$R0="2"SectionEnd

Example(Witherrorleveloutput):

Section ${WordFind2X}"[io.sys];[C:\logo.sys]""\""];""E+1"$R0

;$R0="1"("\...];"notfound)

IfErrors0noerrors MessageBoxMB_OK'Errorlevel=$R0'IDOKend

noerrors: MessageBoxMB_OK'Noerrors'

end:SectionEnd

E.3.5WordFind2XS

SameasWordFind2X,butcasesensitive.

E.3.6WordFind3X

Findawordthatcontainsastring,betweentwodelimiters.

Syntax:

${WordFind3X}"[string]""[delimiter1]""[center]""[delimiter2]""[E][options]"$var

"[string]";[string];inputstring"[delimiter1]";[delimiter1];firstdelimiter"[center]";[center];centerstring"[delimiter2]";[delimiter2];seconddelimiter"[E][options]";[options];+number:wordnumberfromstart;-number:wordnumberfromend;+number}}:wordnumberfromstartallspace;afterthiswordtooutput;+number{{:wordnumberfromendallspace

;beforethiswordtooutput;+number{}:wordnumberfromstart;allspacebeforeandafter;thisword(wordexclude);+number*}:wordnumberfromstart;allspaceafterthis;wordtooutputwithword;+number{*:wordnumberfromstart;allspacebeforethis;wordtooutputwithword;#:sumofwordstooutput;/word:numberofwordtooutput;;[E];witherrorleveloutput;IfErrors:;$var=1nowordsfound;$var=2nosuchwordnumber;$var=3syntaxerror(Use:+1,-1,#);[];noerrorleveloutput(default);Ifsomeerrorsfoundthen(result=inputstring);$var;output(result)

Example(1):

Section ${WordFind3X}"[1.AAB];[2.BAA];[3.BBB];""[""AA""];""+1"$R0 ;$R0="1.AAB"SectionEnd

Example(2):

Section ${WordFind3X}"[1.AAB];[2.BAA];[3.BBB];""[""AA""];""-1"$R0 ;$R0="2.BAA"SectionEnd

Example(3):

Section ${WordFind3X}"[1.AAB];[2.BAA];[3.BBB];""[""AA""];""-1{{"$R0 ;$R0="[1.AAB];"SectionEnd

Example(4):

Section ${WordFind3X}"[1.AAB];[2.BAA];[3.BBB];""[""AA""];""-1{}"$R0 ;$R0="[1.AAB];[3.BBB];"SectionEnd

Example(5):

Section ${WordFind3X}"[1.AAB];[2.BAA];[3.BBB];""[""AA""];""-1{*"$R0 ;$R0="[1.AAB];[2.BAA];"SectionEnd

Example(6):

Section ${WordFind3X}"[1.AAB];[2.BAA];[3.BBB];""[""AA""];""/2.BAA"$R0 ;$R0="2"SectionEnd

Example(Witherrorleveloutput):

Section ${WordFind3X}"[1.AAB];[2.BAA];[3.BBB];""[""XX""];""E+1"$R0 ;$R0="1"("[...XX...];"notfound)

IfErrors0noerrors MessageBoxMB_OK'Errorlevel=$R0'IDOKend

noerrors:

MessageBoxMB_OK'Noerrors'

end:SectionEnd

E.3.7WordFind3XS

SameasWordFind3X,butcasesensitive.

E.3.8WordReplace

Replaceordeletewordfromstring.

Syntax:

${WordReplace}"[string]""[word1]""[word2]""[E][options]"$var

"[string]";[string];inputstring"[word1]";[word1];wordtoreplaceordelete"[word2]";[word2];replacewith(ifemptydelete)"[E][options]";[options];+number:wordnumberfromstart;-number:wordnumberfromend;+number*:wordnumberfromstartmultiple-replace;-number*:wordnumberfromendmultiple-replace;+:replaceallresults;+*:multiple-replaceallresults;{:ifexistsreplacealldelimiters;fromleftedge;}:ifexistsreplacealldelimiters;fromrightedge;{}:ifexistsreplacealldelimiters;fromedges;{*:ifexistsmultiple-replaceall

;delimitersfromleftedge;}*:ifexistsmultiple-replaceall;delimitersfromrightedge;{}*:ifexistsmultiple-replaceall;delimitersfromedges;;[E];witherrorleveloutput;IfErrors:;$var=1wordtoreplacenotfound;$var=2nosuchwordnumber;$var=3syntaxerror(Use:+1,-1,+1*,-1*,+,+*,{},{}*);[];noerrorleveloutput(default);Ifsomeerrorsfoundthen(result=inputstring);$var;output(result)

Example(replace):

Section ${WordReplace}"C:\io.sysC:\logo.sysC:\WINDOWS""SYS""bmp""+2"$R0 ;$R0="C:\io.sysC:\logo.bmpC:\WINDOWS"SectionEnd

Example(delete):

Section ${WordReplace}"C:\io.sysC:\logo.sysC:\WINDOWS""SYS""""+"$R0 ;$R0="C:\io.C:\logo.C:\WINDOWS"SectionEnd

Example(multiple-replace1):

Section ${WordReplace}"C:\io.sysC:\logo.sysC:\WINDOWS""""""+1*"$R0 ;+1*or+2*or+3*or+4*or+5*or+6* ;$R0="C:\io.sysC:\logo.sysC:\WINDOWS"

SectionEnd

Example(multiple-replace2):

Section ${WordReplace}"C:\io.sysC:\logo.sysSYSsysC:\WINDOWS""sys""bmp""+*"$R0 ;$R0="C:\io.bmpC:\logo.bmpC:\WINDOWS"SectionEnd

Example(multiple-replace3):

Section ${WordReplace}"sysSYSsysC:\io.sysC:\logo.sysC:\WINDOWSsysSYSsys""sys""|""{}*"$R0 ;$R0="|C:\io.sysC:\logo.sysC:\WINDOWS|"SectionEnd

Example(Witherrorleveloutput):

Section ${WordReplace}"C:\io.sysC:\logo.sys""sys""bmp""E+3"$R0 ;$R0="2"(nosuchwordnumber"+3")

IfErrors0noerrors MessageBoxMB_OK'Errorlevel=$R0'IDOKend

noerrors: MessageBoxMB_OK'Noerrors'

end:SectionEnd

E.3.9WordReplaceS

SameasWordReplace,butcasesensitive.

E.3.10WordAdd

Addwordstostring1fromstring2ifnotexistordeletewordsifexist.

Syntax:

${WordAdd}"[string1]""[delimiter]""[E][options]"$var

"[string1]";[string1];stringforadditionorremoving"[delimiter]";[delimiter];oneorseveralsymbols"[E][options]";[options];+string2:wordstoadd;-string2:wordstodelete;;[E];witherrorleveloutput;IfErrors:;$var=1delimiterisempty;$var=3syntaxerror(use:+text,-text);[];noerrorleveloutput(default);Ifsomeerrorsfoundthen(result=inputstring);$var;output(result)

Example(add):

Section ${WordAdd}"C:\io.sysC:\WINDOWS""""+C:\WINDOWSC:\config.sys"$R0 ;$R0="C:\io.sysC:\WINDOWSC:\config.sys"SectionEnd

Example(delete):

Section ${WordAdd}"C:\io.sysC:\logo.sysC:\WINDOWS""""-C:\WINDOWSC:\config.sysC:\IO.SYS"$R0 ;$R0="C:\logo.sys"SectionEnd

Example(addtoone):

Section ${WordAdd}"C:\io.sys""""+C:\WINDOWSC:\config.sysC:\IO.SYS"$R0 ;$R0="C:\io.sysC:\WINDOWSC:\config.sys"SectionEnd

Example(deleteone):

Section ${WordAdd}"C:\io.sysC:\logo.sysC:\WINDOWS""""-C:\WINDOWS"$R0 ;$R0="C:\io.sysC:\logo.sys"SectionEnd

Example(Nonewwordsfound):

Section ${WordAdd}"C:\io.sysC:\logo.sys""""+C:\logo.sys"$R0 StrCmp$R0"C:\io.sysC:\logo.sys"0+2 MessageBoxMB_OK"Nonewwordsfoundtoadd"SectionEnd

Example(Nowordsdeleted):

Section ${WordAdd}"C:\io.sysC:\logo.sys""""-C:\config.sys"$R0 StrCmp$R0"C:\io.sysC:\logo.sys"0+2 MessageBoxMB_OK"Nowordsfoundtodelete"SectionEnd

Example(Witherrorleveloutput):

Section ${WordAdd}"C:\io.sysC:\logo.sys""""E-C:\logo.sys"$R0 ;$R0="1"(delimiterisempty"")

IfErrors0noerrors MessageBoxMB_OK'Errorlevel=$R0'IDOKend

noerrors:

MessageBoxMB_OK'Noerrors'

end:SectionEnd

E.3.11WordAddS

SameasWordAdd,butcasesensitive.

E.3.12WordInsert

Insertwordinstring.

Syntax:

${WordInsert}"[string]""[delimiter]""[word]""[E][options]"$var

"[string]";[string];inputstring"[delimiter]";[delimiter];oneorseveralsymbols"[word]";[word];wordtoinsert"[E][options]";[options];+number:wordnumberfromstart;-number:wordnumberfromend;;[E];witherrorleveloutput;IfErrors:;$var=1delimiterisempty;$var=2wrongwordnumber;$var=3syntaxerror(Use:+1,-1);[];noerrorleveloutput(default);Ifsomeerrorsfoundthen(result=inputstring);

$var;output(result)

Example(1):

Section ${WordInsert}"C:\io.sysC:\WINDOWS""""C:\logo.sys""-2"$R0 ;$R0="C:\io.sysC:\logo.sysC:\WINDOWS"SectionEnd

Example(2):

Section ${WordInsert}"C:\io.sys""""C:\WINDOWS""+2"$R0 ;$R0="C:\io.sysC:\WINDOWS"SectionEnd

Example(3):

Section ${WordInsert}"""""C:\WINDOWS""+1"$R0 ;$R0="C:\WINDOWS"SectionEnd

Example(Witherrorleveloutput):

Section ${WordInsert}"C:\io.sysC:\logo.sys""""C:\logo.sys""E+4"$R0 ;$R0="2"(wrongwordnumber"+4")

IfErrors0noerrors MessageBoxMB_OK'Errorlevel=$R0'IDOKend

noerrors: MessageBoxMB_OK'Noerrors'

end:SectionEnd

E.3.13WordInsertS

SameasWordInsert,butcasesensitive.

E.3.14StrFilter

Convertstringtouppercaseorlowercase.Setsymbolfilter.

Syntax:

${StrFilter}"[string]""[options]""[symbols1]""[symbols2]"$var

"[string]";[string];inputstring;"[options]";[+|-][1|2|3|12|23|31][eng|rus];+:convertstringtouppercase;-:convertstringtolowercase;1:onlyDigits;2:onlyLetters;3:onlySpecial;12:onlyDigits+Letters;23:onlyLetters+Special;31:onlySpecial+Digits;eng:Englishsymbols(default);rus:Russiansymbols;"[symbols1]";[symbols1];symbolsinclude(notchangeable);"[symbols2]";[symbols2];symbolsexclude;$var;output(result)

Note:-Errorflagifsyntaxerror

-Samesymboltoinclude&toexclude=toexclude

Example(UpperCase):

Section ${StrFilter}"123abc456DEF7890|%#""+"""""$R0 ;$R0="123ABC456DEF7890|%#"SectionEnd

Example(LowerCase):

Section ${StrFilter}"123abc456DEF7890|%#""-""ef"""$R0 ;$R0="123abc456dEF7890|%#"SectionEnd

Example(Filter1):

Section ${StrFilter}"123abc456DEF7890|%#""2""|%"""$R0 ;$R0="abcDEF|%";onlyLetters+|%SectionEnd

Example(Filter2):

Section ${StrFilter}"123abc456DEF7890|%#""13""af""4590"$R0 ;$R0="123a6F78|%#";onlyDigits+Special+af-4590SectionEnd

Example(Filter3):

Section ${StrFilter}"123abc456DEF7890|%#""+12""b""def"$R0 ;$R0="123AbC4567890";onlyDigits+Letters+b-defSectionEnd

Example(Filter4):

Section ${StrFilter}"123abcÀÁÂ456DEFãäå7890|%#""+12rus""ä""ãå"$R0 ;$R0="123ÀÁÂ456ä7890";onlyDigits+Letters+ä-ãåSectionEnd

Example(English+RussianLetters):

Section ${StrFilter}"123abcÀÁÂ456DEFãäå7890|%#""2rus"""""$R0 ;$R0="ÀÁÂãäå";onlyRussianLetters ${StrFilter}"123abcÀÁÂ456DEFãäå7890|%#""2""$R0"""$R0 ;$R0="abcÀÁÂDEFãäå";onlyEnglish+RussianLettersSectionEnd

Example(WordCapitalize):

Section Push"_01-PERPETUOUS_DREAMER__-__THE_SOUND_OF_GOODBYE_(ORIG._MIX).MP3_" CallCapitalize Pop$R0 ;$R0="_01-Perpetuous_Dreamer__-__The_Sound_Of_Goodbye_(Orig._Mix).mp3_"

${WordReplace}"$R0""_""""+*"$R0 ;$R0="01-PerpetuousDreamer-TheSoundOfGoodbye(Orig.Mix).mp3"

${WordReplace}"$R0""""""{}"$R0 ;$R0="01-PerpetuousDreamer-TheSoundOfGoodbye(Orig.Mix).mp3"SectionEnd

FunctionCapitalize Exch$R0 Push$0 Push$1 Push$2

${StrFilter}'$R0''-eng'''''$R0 ${StrFilter}'$R0''-rus'''''$R0

StrCpy$00

loop: IntOp$0$0+1 StrCpy$1$R01$0 StrCmp$1''end StrCmp$1''+5 StrCmp$1'_'+4 StrCmp$1'-'+3 StrCmp$1'('+2 StrCmp$1'['0loop IntOp$0$0+1 StrCpy$1$R01$0 StrCmp$1''end

${StrFilter}'$1''+eng'''''$1 ${StrFilter}'$1''+rus'''''$1

StrCpy$2$R0$0 IntOp$0$0+1 StrCpy$R0$R0''$0 IntOp$0$0-2 StrCpy$R0'$2$1$R0' gotoloop

end: Pop$2 Pop$1 Pop$0 Exch$R0FunctionEnd

E.3.15StrFilterS

SameasStrFilter,butcasesensitive.

E.3.16VersionCompare

Compareversionnumbers.

Syntax:

${VersionCompare}"[Version1]""[Version2]"$var

"[Version1]";Firstversion"[Version2]";Secondversion$var;Result:;$var=0Versionsareequal;$var=1Version1isnewer;$var=2Version2isnewer

Example:

Section ${VersionCompare}"1.1.1.9""1.1.1.01"$R0 ;$R0="1"SectionEnd

E.3.17VersionConvert

Convertversioninthenumericalformatwhichcanbecompared.

Syntax:

${VersionConvert}"[Version]""[CharList]"$var

"[Version]";Version;"[CharList]";Listofcharacters,whichwillbereplacedbynumbers;"abcdefghijklmnopqrstuvwxyz"(default);$var;Result:convertedversion

Note:-Convertedlettersareseparatedwithdot-Ifcharacterisnon-digitandnotinlistthenitwillbeconvertedtodot

Example1:

Section ${VersionConvert}"9.0a"""$R0 ;$R0="9.0.01"

${VersionConvert}"9.0c"""$R1 ;$R1="9.0.03"

${VersionCompare}"$R0""$R1"$R2 ;$R2="2"version2isnewerSectionEnd

Example2:

Section ${VersionConvert}"0.15c-9m"""$R0 ;$R0="0.15.03.9.13"

${VersionConvert}"0.15c-1n"""$R1 ;$R1="0.15.03.1.14"

${VersionCompare}"$R0""$R1"$R2 ;$R2="1"version1isnewerSectionEnd

Example3:

Section ${VersionConvert}"0.15c+""abcdefghijklmnopqrstuvwxyz+"$R0 ;$R0="0.15.0327"

${VersionConvert}"0.15c""abcdefghijklmnopqrstuvwxyz+"$R1 ;$R1="0.15.03"

${VersionCompare}"$R0""$R1"$R2 ;$R2="1"version1isnewerSectionEnd

Previous|Contents|Next

Previous|Contents|Next

AppendixF:ChangelogandReleaseNotes3.02

Changelog3.01

Changelog3.0

ReleaseNotesChangelog

3.0ReleaseCandidate2Changelog

3.0ReleaseCandidate1Changelog

3.0Beta3Changelog

3.0Beta2Changelog

3.0Beta1ReleaseNotesChangelog

3.0Beta0ReleaseNotesChangelog

3.0Alpha2ReleaseNotesChangelog

3.0Alpha1ReleaseNotesChangelog

3.0Alpha0ReleaseNotesChangelog

2.51Changelog

2.50Changelog

2.49Changelog

2.48Changelog

2.47ReleaseNotesChangelog

2.46Changelog

2.45ReleaseNotesChangelog

2.44Changelog

2.43ReleaseNotesChangelog

2.42ReleaseNotesChangelog

2.41Changelog

2.40Changelog

2.39Changelog

2.38Changelog

2.37Changelog

2.36ReleaseNotesChangelog

2.35Changelog

2.34ReleaseNotesChangelog

2.33ReleaseNotesChangelog

2.32ReleaseNotesChangelog

2.31ReleaseNotesChangelog

2.30ReleaseNotesChangelog

2.29ReleaseNotesChangelog

2.28Changelog

2.27ReleaseNotesChangelog

2.26ReleaseNotesChangelog

2.25Changelog

2.24Changelog

2.23Changelog

2.22ReleaseNotesChangelog

2.21Changelog

2.20Changelog

2.19Changelog

2.18Changelog

2.17Changelog

2.16ReleaseNotesChangelog

2.15Changelog

2.14ReleaseNotesChangelog

2.13ReleaseNotesChangelog

2.12Changelog

2.11ReleaseNotesChangelog

2.10Changelog

2.09Changelog

2.08ReleaseNotesChangelog

2.07ReleaseNotesChangelog

2.06Changelog

2.05ReleaseNotesChangelog

2.04Changelog

2.03ReleaseNotesChangelog

2.02Changelog

2.01

ReleaseNotesChangelog

2.0ReleaseNotesChangelog

2.0ReleaseCandidate4Changelog

2.0ReleaseCandidate3Changelog

2.0ReleaseCandidate2Changelog

2.0ReleaseCandidate1ReleaseNotesChangelog

2.0Beta4ReleaseNotesChangelog

2.0Beta32.0Beta22.0Beta12.0Beta02.0Alpha72.0Alpha62.0Alpha52.0Alpha42.0Alpha32.0Alpha22.0Alpha12.0Alpha0OlderVersions

Previous|Contents|Next

Previous|Contents|Next

F.13.02ReleasedonJuly23rd,2017

F.1.1Changelog

F.1.1.1MajorChanges

FixedNSIS3RegToolWin9xbugAddedtheHKCR32,HKCR64,HKCU32,HKCU64,HKLM32andHKLM64rootkeysUnsupportedSetRegViewmodenowfailsallregistryoperationsAddedExecShellWaitAddedWriteRegMultiStr(RFE#382,patch#219)andWriteRegNoneAdded!pragmawarning(patch#267)$LocalAppDatanowresolvestotheProgramDatafolderintheSetShellVarContextallcontext

F.1.1.2MinorChanges

VariablesusedinCaptioncannowbesetin.onGUIInit(RFE#539)MultiUsernowsupports$ProgramFiles64(bug#843)AddedsupportforMUI_UNCONFIRMPAGE_VARIABLE(RFE#511)andMUI_PAGE_CUSTOMFUNCTION_DESTROYEDUnicodensExecnowsupportsthe/OEMswitch(bug#1171)

F.1.1.3Translations

Chinese(Traditional)updatesbyWalterCheukMinorFrenchimprovements(patch#221)

Previous|Contents|Next

Previous|Contents|Next

F.23.01ReleasedonDecember11th,2016

F.2.1Changelog

F.2.1.1MajorChanges

ErrormessagesarenowwrittentostderrbydefaultNewiconsbyJanT.Sott

F.2.1.2MinorChanges

SetCtlColorsnowsupportsWindowscolorconstantvaluesStrCpy""maxlenhandling(bug#1122)Fixedbuffersizebuginwinchar.cpp(patch#271)

F.2.1.3Translations

AddedCorsican(patch#268)PortugueseBRfixes(patch#276)UpdatedDanishtranslation(bug#1164)Arabic,Norwegian,Portuguese,UkrainianandSwedishMultiUserfixes(patch#278,patch#279,patch#274,patch#275&patch#277)

Previous|Contents|Next

Previous|Contents|Next

F.33.0ReleasedonJuly24th,2016

F.3.1ReleaseNotes

Long-awaitedversion3ofNSISisfinallyready.ItcomeswithoptionalUnicodesupport,stillworksonallthesameversionsofWindows,supportsWindows10,andaddsalotofothersmallfeaturesandfixes.HugethanksgoesouttoAndersandWizouformakingthishappenandJimParkfortheoriginalpatch.

F.3.2Changelog

F.3.2.1MinorChanges

!finalizecommandnowsupportsthesamecompareoperatorsas!system(bug#1148)

F.3.2.2Translations

PortugueseBRfixes(bug#1149)

Previous|Contents|Next

Previous|Contents|Next

F.43.0ReleaseCandidate2ReleasedonJuly8th,2016

F.4.1Changelog

F.4.1.1MajorChanges

FixedLogicLibnested${Select}bug!makensiscommandmustforceUnicodeoutputtobeUTF-8(bug#1147)

F.4.1.2MinorChanges

Zip2Exeabortsifthezipfileisencrypted(bug#1141)AddedLogicLib&operatorNSISMenuPOSIXfixes(bug#1144)

F.4.1.3Translations

PortugueseBRfixes(deguix)MinortweakstoDanish.nlf(scootergrisen)(bug#1140)

Previous|Contents|Next

Previous|Contents|Next

F.53.0ReleaseCandidate1ReleasedonApril3nd,2016

F.5.1Changelog

F.5.1.1MajorChanges

Fixed!appendfileonPOSIXandLogicLib${Switch}Moresecurityhardeningtopreventdllhijacking

F.5.1.2MinorChanges

DocumentationimprovementsThenameoftheuninstallercreatedin%TEMP%\~nsu.tmphaschangedfrom%UNIQUE%u_.exetoUn_%UNIQUE%.exeVariouswarninganderrorimprovments

F.5.1.3Translations

AddedmissingMULTIUSER_*entriestoJapanese.nsh(patch#266)

Previous|Contents|Next

Previous|Contents|Next

F.63.0Beta3ReleasedonDecember26th,2015

F.6.1Changelog

F.6.1.1MajorChanges

RequestExecutionLevelnowdefaultstoadminLoadLibrarysecurityhardeningtopreventdllhijacking(bug#1125)FileReadUTF16LEnowskipstheoptionalBOMatthestartofafile

F.6.1.2MinorChanges

FixedSystempluginGUIDtypeoutputbugonWin98FileWriteUTF16LEcanaddaBOMwiththe/BOMswitchCreateShortcuticonindexcannowbelargerthan255(bug#1123)!systemand!executenowprovideanemptyStdInpipetoworkaroundbugsinsomeWindowsutilitiesAddedsupportfor0ooctalradixprefixonnumberliteralsinthepreprocessorThesingleparameterversionof!ifnowalsosupportsfloatsPreprocessornowwarnswheninvalidfloatingpointnumbersareusedinmathoperationsMakeNSISWnowusesWinInetwhencheckingforupdates

F.6.1.3Translations

BrazilianPortugueseupdated(Felipe)(patch#263)Polishupdated(PawełPorwisz)

Previous|Contents|Next

Previous|Contents|Next

F.73.0Beta2ReleasedonAugust4th,2015

F.7.1Changelog

F.7.1.1MajorChanges

PreliminaryWindows10support

F.7.1.2MinorChanges

Added!appendfile/RawNLswitchAddedPESubsysVerattributeExec[Wait]setstheCREATE_DEFAULT_ERROR_MODEflagwhencreatingaprocessFixed4+TiBfreespacecalculationbug(bug#1115)FixedCreateShortcut/NoWorkingDirparsingbug(bug#1110)FixedminorissuesinthePascalNSISplug-inSDKandremovedtheextrapglobalvariablensDialogsandInstallOptionsnowusethesystemlinkcolor

F.7.1.3BuildSystem

Linuxstdcallwarningfix(patch#261)Linuxtest-scriptsfix(patch#260)Win64fixes(includingpatch#258,bug#1105)VisualC2012fixes

Previous|Contents|Next

Previous|Contents|Next

F.83.0Beta1ReleasedonOctober6th,2014

F.8.1ReleaseNotes

Thisreleaseaddressesalotofbuildissues,reintroducesthenightlybuildsandaddsautomaticnightlytestexecution

F.8.2Changelog

F.8.2.1MajorChanges

!insertmacroallowsmacrorecursion(RFE#497)Added!makensiscommandAddednewMUI2bitmapstretchmodes,*_NOSTRETCHisnowdeprecated(RFE#521)InitiateShutdown()isusedtorebootthemachineifavailable(patch#247)AddedPPOandSafePPOpreprocess-onlycompilerswitchesMakeNSISWM_COPYDATAmessagesnowusetheQH_OUTPUTCHARSETencodingwithCP_ACPasthedefaultforcompatibilitywitholdIDEs.

F.8.2.2MinorChanges

AddedIsWow64tox64.nshAddedPEDllCharacteristicsattributeAddedSystem::Calldirectregistermemoryaccesstype.(patch#249)AddedWXcompilerswitchAllowskippingExDLLbuildwithSKIPPLUGINS((patch#254))ChangeddefaultDllCharacteristicstoTS_AWARE+NO_SEH+NX_COMPAT+DYNAMIC_BASEFixedMacOSXbuilds(patch#253andbug#1085)

FixedPOSIX!searchparsebug(patch#251)Fixed!macroundefFixedtest-codebuildtargetonPOSIXandenableditinnightlybuilds(bug#1098)FixedVisualStudio2012builds

F.8.2.3Translations

AddedArmenian(HrantOhanyan)

Previous|Contents|Next

Previous|Contents|Next

F.93.0Beta0ReleasedonMay11th,2014

F.9.1ReleaseNotes

POSIXbuildsworkagain!Pleaseletusknowifyourfavoriteplatformisstillhavingbuildissues.WemainlytestonLinux.

F.9.2Changelog

F.9.2.1MajorChanges

BasicAMD64System::CallsupportFixedPOSIXbuilds

F.9.2.2MinorChanges

AddedCreateShortcut/NoWorkingDirparameterAddedInt<32|64|Ptr><Op|Cmp[U]>helpermacrostoUtil.nshAddedP<,P<=,P=,P<>,P>=andP>LogicLibptrdiff_ttestsTryhardertofindduplicatestringsinstringblock(bug#1088)!systemwilldecodechildoutputasOEMCPifGetConsoleOutputCP()==GetOEMCP()!systemand!executecanstoretheexitcodeinadefine!executesupportscomparingtheexitcodewiththesamesyntaxas!systemPreprocessorsupports0nand0bradixprefixonnumberliterals

Previous|Contents|Next

Previous|Contents|Next

F.103.0Alpha2ReleasedonDecember24th,2013

F.10.1ReleaseNotes

It'stheholidaygiftyou'vebeenwaitingfor!

F.10.1.1KnownIssues

ThePOSIXbuildisgettingmuchcloser,butstillcurrentlybrokenLangDLLdoesn'tdisplaylocalizedlanguagenamewithUnicodefalse

F.10.2Changelog

F.10.2.1MajorChanges

!includedefaultstoUTF-8afterUnicodeTruePreprocessordoesnotparseallbranchesandwillnotvalidatecodethatisneverexecuted(bug#1086)

F.10.2.2MinorChanges

FileReadinUnicodeinstallerscanhandleDBCS,conversionoutputislimitedtoUCS-2.FileReadinUnicodeinstallersnowusestheUnicodereplacementcharacter(U+FFFD)forinvalidcharactersandnot'?'.FileReadBytenolongerperformsaUnicodeconversiononnon-ASCIIcharactersWindows8.1&2012R2supportinWinVer.nshFixed!defineUnicodenullterminatorbug(bug#1079)UnicodestubscreateWCHARricheditcontrols(bug#1080)FixedMakeNSISWdefaultpushbuttonandtaborderFixedincorrectpagecountincompilerstatistics

Previous|Contents|Next

Previous|Contents|Next

F.113.0Alpha1ReleasedonJuly14th,2013

F.11.1ReleaseNotes

F.11.1.1KnownIssues

ThePOSIXbuildiscurrentlybrokenLangDLLdoesn'tdisplaylocalizedlanguagenamewithUnicodefalseFileReadmayreturn'?'forMBCSletterswithUnicodetrue

F.11.2Changelog

F.11.2.1MajorChanges

Defaultverbosityis/V3withoutlogo,MakeNSISWstilluses/V4.ManifestSupportedOSaddedsupportfortheWindows8.1GUIDanditissetbydefaulttoavoidGetVersionExcompatibilitybehavior.

F.11.2.2MinorChanges

Fixed!finalize%1Fixed!searchparse(bug#1073)Madeinstallersalwaysrespect/Soncommandline,evenwheninstallerfilecan'tberead(bug#1076)MinorMakeNSISWfixesandtweaksAddedZip2ExeUnicodecheckbox

Previous|Contents|Next

Previous|Contents|Next

F.123.0Alpha0ReleasedonMay19th,2013

F.12.1ReleaseNotes

MakeNSIScannowgenerateANSIandUnicodeinstallers.SourcefilescanbeUTF8SIG,UTF16BOMortraditionalMBCStextfiles(whichareconvertedtoUnicodewithACPunlessyouspecifyadifferentcodepage).Thedefaultpluginsarenowstoredinsub-foldersbasedontheirCPUtargetandcharactersetencoding.

F.12.1.1KnownIssues

ThePOSIXbuildiscurrentlybrokenLangDLLdoesn'tdisplaylocalizedlanguagenamewithUnicodefalseFileReadmayreturn'?'forMBCSletterswithUnicodetrue

F.12.2Changelog

F.12.2.1MajorChanges

AddedtheUnicodeattribute(RFE#1238132,patch#1795257)AddedsupportforWindows8andWindowsServer2012MakeNSIScanreadUTF8SIGandUTF16BOMscriptfiles(RFE#2026892)AllNLFandNSHlanguagefilesarestoredasUTF-16LE(RFE#1879642)ScriptscancontroltheSupportedOSlistintheapplicationmanifestusingManifestSupportedOS(bug#2725883,RFE#3020103)InstallerscanclaimDPI-awarenesswithManifestDPIAware(bug#2897169)Theindexofthechangedsectionisstoredin$0during.onSelChangecallbacks(RFE#1634936)

${U+1}...${U+10FFFF}aretreatedasaUnicodecharacterunlessthereisalreadyadefinewiththatname(RFE#2084797)

F.12.2.2MinorChanges

Added!getdllversion(bug#2809308)Added!appendfile/CHARSETparameterAdded!ifsupportfor/fileexists,casesensitivecomparisons,hexandfloatAddedmoredefinitionstoWinMessages.nsh%temp%\Lowwillbeusediftheinstallercannotwriteto%temp%nor%windir%\Temp(bug#2909242,patch#2912824)Added${NSIS_PACKEDVERSION},theNSISversionpackedasahexnumber(patch#2680832)Added${__MACRO__}and${__COUNTER__}predefinesAddedUnsafeStrCpyinstruction,itcanwritetospecialvariableslike$PLUGINSDIRAddedVIFileVersionAdded!finalizeforpost-buildcommands(likesigningtheinstaller)Pluginsin${NSISDIR}\PluginshavetobereservedwithReserveFile/plugin

MakeNSIS/NOTIFYHWNDusesa(optional)neweventnametoabortcompilation,seebuild.cpp/hfordetails.Reduced!include/!insertmacrorecursionstackusage(bug#3067954)FixedminorMakeNSISleaks(bug#3474662)FixedMUI_FINISHPAGE_TITLE_3LINESpaddingwhenrebootisrequired(bug#3400067,bug#3408407)FixedremovalofreadonlyattributeevenifDeleteorRMDirfails(bug#3072159)Fixed${__SECTION__}inhiddensections(RFE#1787648)Variousdocumentationfixes(bug#3063566,bug#3567313,patch#3307144)Lotsofothersmallfixes...

F.12.2.3Translations

ChangedLANGFILEmacroinLangFile.nshWarningsarenowdisplayedformissingstrings(LANGFILE_INCLUDE_WITHDEFAULT)AddedGeorgian(DavidHuriev)AddedPashto(Pakhtosoft)AddedScottishGaelic(GunChleoc)FixedKoreanMUI_[UN]TEXT_FINISH_INFO_*(bug#3541515)

Previous|Contents|Next

Previous|Contents|Next

F.132.51ReleasedonApril1st,2016

F.13.1Changelog

F.13.1.1MinorChanges

MoresecurityhardeningtopreventdllhijackingBackportedsupportforsystem'p'typeandlogiclibPandZtests

F.13.1.2Translations

AddedmissingMULTIUSER_*entriestoJapanese.nsh(patch#266)

Previous|Contents|Next

Previous|Contents|Next

F.142.50ReleasedonDecember26th,2015

F.14.1Changelog

F.14.1.1MajorChanges

RequestExecutionLevelnowdefaultstoadmin

F.14.1.2MinorChanges

Preloadcertainsystemlibrariestopreventdllhijacking(bug#1125)

Previous|Contents|Next

Previous|Contents|Next

F.152.49ReleasedonDecember16th,2015

F.15.1Changelog

FixedCreateShortcutfailureonVistacausedbysecuritychangesin2.47

Previous|Contents|Next

Previous|Contents|Next

F.162.48ReleasedonDecember10th,2015

F.16.1Changelog

FixedCHM(bug#1129)

Previous|Contents|Next

Previous|Contents|Next

F.172.47ReleasedonDecember8th,2015

F.17.1ReleaseNotes

Thisisamaintenanceandsecurityrelease

F.17.2Changelog

F.17.2.1MajorChanges

LoadLibrarysecurityhardeningtopreventdllhijacking(bug#1125)InitiateShutdown()isusedtorebootthemachineifavailable(patch#247)

F.17.2.2MinorChanges

Fixed4+TiBfreespacecalculationbug(bug#1115)Windows8&2012supportinWinVer.nsh

Previous|Contents|Next

Previous|Contents|Next

F.182.46ReleasedonDecember6th,2009

F.18.1Changelog

F.18.1.1MinorChanges

Fixed!searchparse(bug#2803622)FixedVistaerrormessagewhencancelinguninstaller(bug#2803097)ResolvewarningforLogicLib'sendlessDo..Loop(bug#2849872)StartMenu:fixedrandomnumberprefixeswhenclickingonanemptyspot(bug#2810188)UpdatestoNSIS.pasforplug-indevelopment(patch#2802794)

F.18.1.2Translations

PortugueseBRtypo(patch#2826598)RemoveddoublespacesinItalian(bug#2873598)

F.18.1.3BuildSystem

FixedmingwbuildsofMathplug-in(patch#2835731)

Previous|Contents|Next

Previous|Contents|Next

F.192.45ReleasedonJune6th,2009

F.19.1ReleaseNotes

SupportforMicrosoft'supcomingreleaseofWindows7hasbeenaddedbasedonRC1testinganddocumentation.Pleasereportanyrelatedissuesanddon'tforgettouseRequestExecutionLevel.

F.19.2Changelog

F.19.2.1MajorChanges

AddedsupportforWindows7installers-useRequestExecutionLevel,justlikewithVista(bug#2725883)AddedWinVer.nshWindows7andWindows2008R2supportInstallersnowidentifyasTerminalServicesaware(IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE)so$WINDIRwillnolongerbeundertheuser'sprofilewheninstallingonTerminalServicesLessUACannoyanceinAdd/Removecontrolpanel(bug#2697027)

F.19.2.2MinorChanges

Addedwildcardand/nonfatalsupportfor!delfile(RFE#1505425)Fixed!searchparse(bug#2680110)FixedinputvalidationforCreateFont(bug#2801024)FixedNSISMenuhandlingofworkingdirectory(bug#2781948)FixedVistaissueswithshellfolders($DOCUMENTS,$PROFILE,etc.)onrootdirectories(bug#2138075)Minordocumentationimprovements(includingbug#2705878,bug#2606525)UseSW_SHOWDEFAULTforExecShellbydefault(bug#2796189)

F.19.2.3ModernUI

Callfinishpageshowfunctiononlyafterthepageisfullyinitialized(bug#2720968)Fixedtranslationofuninstallerdirectorypage(bug#2690112)Fixedinstallationtypetextpositionincomponentspage(patch#2801317)FixedmissingMUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE(bug#2788620)

F.19.2.4Translations

UpdatedIndonesian(patch#2790571)UpdatedPortugueseBR(patch#2642542)

F.19.2.5BuildSystem

FixedsomeGCCwarnings

Previous|Contents|Next

Previous|Contents|Next

F.202.44ReleasedonFebruary21st,2009

F.20.1Changelog

F.20.1.1MajorChanges

Fixedabugintroducedin2.43causingscriptbuildissueswithsomeicons(bug#2572035)

F.20.1.2MinorChanges

FixednsDialogsCreateTimerdocumentation(bug#2595565)Globallabelsdidn'tworkwhendeclaredinunusedfunctions(bug#2593369)

Previous|Contents|Next

Previous|Contents|Next

F.212.43ReleasedonFebruary5th,2009

F.21.1ReleaseNotes

Afewminorchangesweremadetothenewplug-inAPIthatbreakbackwardcompatibility.HeaderandlibrarypathswerechangedandRegisterPluginCallbackhaschangeditsreturnvalue.

F.21.2Changelog

F.21.2.1MinorChanges

AddedWinCore.nsh,WinDef.nsh,WinError.nsh,WinNT.nshandWinUser.nshformoreusefulWindowsdefinitionsFixedacrashcausedby!packhdrcompressingresources(bug#2533431)Minordocumentationimprovements(includingbug#2564005)ModernUI2:FixedMUI_DIRECTORYPAGE_BGCOLOR(bug#2494528)

F.21.2.2UtilitiesandPlug-ins

Banner:FixedinstallershowingonthebackgroundwhenBannerwasusedin.onInitMakeNSISW:AddedCtrl+Khotkeyforbuildcancelation(RFE#2557392)nsDialogs:AddedNSD_SetIcon(patch#2500960)

F.21.2.3Translations

AddedEsperantoBulgarianfixes

F.21.2.4Plug-inAPI

AddedVS2008projectfilesBetterinstallationofheaderandlibraryfilesunderPOSIX-seeINSTALLfileformoreinformationHeaderandlibraryfilesweremovedtoasubdirectorynamednsistopreventcollisionsRegisterPluginCallbacknowreturnsintinsteadofBOOLforawiderrangeoferrorreporting

F.21.2.5BuildSystem

Addedfink'smingwprefixes(bug#2495138)FixedBOOLbuildissueonOSX(bug#2497290)FixediconvdependencydetectiononOSX(bug#2494539)FixedSolarisbuilds(patch#2497172)

Previous|Contents|Next

Previous|Contents|Next

F.222.42ReleasedonDecember20th,2008

F.22.1ReleaseNotes

MerryChristmasandahappyHanukkah!Plug-indevelopersshouldcheckoutthenewplug-inAPIinExamples\Pluginandconverttheirplug-ins,especiallyincasetheyrequirestayingloaded.

F.22.2Changelog

F.22.2.1MajorChanges

Deprecated/NOUNLOADandSetPluginsUnloadtomakescriptssimplerandsafer(patch#1912699)UsefulheaderfunctionsnolongerrequireusagedeclarationanddifferentsyntaxforuninstallerfunctionsRevampedplug-inAPInowcomesintheformofpluginapi.lib,APIversioninformationandmorecommonfunctions(patch#2359978)

F.22.2.2MinorChanges

Added!searchreplacepreprocessorcommandforcompiletimetextsearch/replacesAddedsupportforregistrationofEXECOMservers(RFE#2315740)Minordocumentationimprovements(includingbug#2386821)nsDialogs:Addedtimersupport(patch#2135855)nsDialogs:AddedprogressbarsupportWinVer.nsh:AddedIsServer,IsWin2003R2,IsStarterEdition,OSHasMediaCenterandOSHasTabletSupportWinVer.nsh:Fixed95/NT4ambiguity(bug#2053642)WinVer.nsh:ProperWindowsXPx64detection(bug#2053700)WinVer.nsh:Windows2008detectionsupport(RFE#1949260)

F.22.2.3Translations

MinorEnglishgrammarimprovements(bug#2323452)

F.22.2.4BuildSystem

FullSystemcompatibilitywithGCC(patch#2193442)

Previous|Contents|Next

Previous|Contents|Next

F.232.41ReleasedonNovember20th,2008

F.23.1Changelog

F.23.1.1MinorChanges

FixedLangDLLmemoryleaksforinvalidinput(bug#1939573)Fixeduninstallergenerationonbig-endiansystems(bug#2166401,bug#2167958)

F.23.1.2Translations

BrazilianPortuguesecorrectionsConsistencyfixesforSimpleChinese(patch#2189117)

F.23.1.3BuildSystem

AddedsupportforSCons1.1.0FixeddirectoryandcomponentspagetextissuesonVC8builds(patch#1982084)System'sResource.dllnowbuiltfromsource

Previous|Contents|Next

Previous|Contents|Next

F.242.40ReleasedonOctober10th,2008

F.24.1Changelog

F.24.1.1MajorChanges

ServicepackmacrosaddedtoWinVerinversion2.39nowwork(bug#2070708,patch#2095363)

F.24.1.2MinorChanges

AddedinitialfolderselectionoptionfornsDialogs::SelectFileDialog(patch#2016003)FixedGetParametershandlingofMBCScharacters(bug#2067946)Fixedincorrect${NSD_OnBack}documentation(bug#2059651)ModernUI2:Setfocustocheckboxesonthefinishpage(bug#2110357)

F.24.1.3Translations

Portuguesecorrections(bug#2086988)SimplifiedChinesecorrections(patch#2056906)

Previous|Contents|Next

Previous|Contents|Next

F.252.39ReleasedonAugust16th,2008

F.25.1Changelog

F.25.1.1MajorChanges

Added!define/fileand!searchparse(patch#2016254)Addedservicepackmacros(AtLeastServicePack,IsServicePack,AtMostServicePack)toWinVer.nsh(patch#2036802)

F.25.1.2MinorChanges

AddedmorensDialogslistboxhandlingmacros(patch#2041919)AddedUnicodeversioncompatibleSystemstringtype(patch#2025721,RFE#1961307)FixednsDialogsatomleak(bug#2053522)MinordocumentationimprovementsShowhandcursorfornsDialogslinks(patch#2004129)

Previous|Contents|Next

Previous|Contents|Next

F.262.38ReleasedonJuly12th,2008

F.26.1Changelog

F.26.1.1MajorChanges

FixedabuginnsDialogsthatcausedittopollutethestackifcallbacksarenotsetforeachcontrol(bug#2013317)

F.26.1.2MinorChanges

AddedIfNotThensupportforLogicLib(patch#1990761)AddedsupportforNTFSmountspointsonthedirectorypage(bug#1946112)FixedbrandingimagecontroldetectiononDebian,duetoimproperidentificationofstaticcontrols(bug#1951417)Logactualcreationofdirectoriesandnotjustfailuresandfinaldirectory(patch#1992325)MadelogclosewhenLogSetoffisused(patch#1986692)Minordocumentationimprovements(includingbug#1990955)MultiUser:FixedMULTIUSER_INSTALLMODE_INSTDIRhandlingfortheuninstaller

F.26.1.3ModernUI

Documentpageleavecallbackfunction(bug#1964719)FixedMUI_FINISHPAGE_CANCEL_ENABLEDFixedwastedvariablewarnings(bug#1995024)

F.26.1.4Translations

FixedFrenchtranslationofMUI_UNTEXT_FINISH_INFO_REBOOT

(patch#1967032)Removednon-ANSIcharactersfromFrenchdisplayname(bug#1979491)UpdatedSlovenian(patch#2014106)

Previous|Contents|Next

Previous|Contents|Next

F.272.37ReleasedonMay3rd,2008

F.27.1Changelog

F.27.1.1MajorChanges

Fixedabugintroducedin2.32thatcausedblurryiconsonWindowsversionspriortoXP(bug#1956350)Use$PROGRAMFILESasadefaultfor$PROGRAMFILES64insteadof"C:\ProgramFiles"(bug#1947702)

F.27.1.2MinorChanges

Automaticallyselectlanguageincasethereisonlyoneavailablechoice(bug#1939571)MultiUser:FixedbuilderrorswithmanualinclusionofStrFunc.nshSupportforcompressionoffilesupto2GB(patch#1948700)

F.27.1.3UtilitiesandPlug-ins

Fixed${NSD_OnBack}(bug#1947388)FixednsDialogs::SelectFileDialogreturnvalueforusercancelation(bug#1955803)FixedpossibleBgImagecrashwhencallingBgImage::Destroymorethanonce(patch#1951248)Minordocumentationimprovements

F.27.1.4Translation

BrazilianPortugueseupdatesPolishupdates(patch#1927421)Slovakupdates(patch#1939669)

Spanishupdates

F.27.1.5BuildSystem

SConsrequirementupgradedto0.98

Previous|Contents|Next

Previous|Contents|Next

F.282.36ReleasedonMarch29th,2008

F.28.1ReleaseNotes

nsDialogsispickingupitspaceandofferslotsofnewmacrosinthisrelease.Keepthepatchesandrequestscoming!

F.28.2Changelog

F.28.2.1MajorChanges

nsExec:Supportforx64disabledredirection(RFE#1778973,bug#1889317)

F.28.2.2ModernUI

AddedmissingMUI_UNFUNCTION_DESCRIPTION_BEGINandMUI_UNFUNCTION_DESCRIPTION_ENDFixedstartmenupagesettingtheerrorflag(bug#1891106)

F.28.2.3nsDialogs

NSD_AddStyleandNSD_AddExStyleforeasycustomization(patch#1900588)NSD_CB_AddString,NSD_CB_SelectString,NSD_LB_AddStringandNSD_LB_SelectStringforeasierhandlingofcomboandlistboxesNSD_CreateNumberandNSD_SetTextLimitforlimitedinputfieldsNSD_SetImage,NSD_SetStretchedImage,NSD_ClearImageandNSD_FreeImageforimagehandlingNSD_SetState,NSD_GetState,NSD_CheckandNSD_Uncheckforhandlingofcheckboxesandradiobuttons(patch#1900588)NSD_SetTextforeasilysettingcontrol'stext

OnClicksupportforlabels(bug#1908732)Supportforeditboxchangenotificationincombobox

F.28.2.4MinorChanges

FixedexceptionhandlingofUPXcompressedicons(bug#1896500)FixedInstallDirRegKeyexampleinbigtest.nsiFixedMemento'sdocumentationtoinclude${MementoSectionDone}Fixedraredecompressionerrorwith0x4001bytesofcompresseddata(bug#1874297)LangFile.nsh:AddedLANGFILE_INCLUDE_WITHDEFAULTtoloadlanguagefilewithdefaultsbeingobtainedfromadefaultfile.ThisreplacestheLANGFILE_DEFAULTsettingandmakesiteasiertouseLangFile.nshformultiplesetsoflanguagesfilewithouthavingtocareaboutthedifferentLANGFILE_DEFAULTsettings.Minordocumentationimprovements(includingbug#1891266,bug#1894033,bug#1896803)MultiUser:FixederrorwhenacustominstallationmodeinitializationfunctionisusedonlyfortheinstallerMultiUser:Fixeddefaultinstallationmodebasedonregistrykey(bug#1913029)MultiUser:Fixednouninstallerhandling(MULTIUSER_NOUNINSTALL)

F.28.2.5UtilitiesandPlug-ins

MakeNSISW:Avoidopeningexecutableswithidenticalfoldernameswhenopeningscript'sfolder(bug#1891066)nsExec:Fixedreturncodehandlingso259won'tcauseaninfiniteloop(bug#1909458)VPatch:AddedMD5functions(RFE#1900226)

F.28.2.6Translation

Albanianupdates(patch#1919360)Frenchfixes(patch#1916564)

Polishupdates(patch#1894983)

F.28.2.7BuildSystem

FixedbuildofNSISMenuwithwxGTK(bug#1900233)UseCRLFforDSWandDSPfilestoavoidcorruptionmessagesVariousbuildfixesforGCC4.3,amd64andLinuxingeneral

Previous|Contents|Next

Previous|Contents|Next

F.292.35ReleasedonFebruary8th,2008

F.29.1Changelog

F.29.1.1MajorChanges

AddedMultiUser-installerconfigurationformulti-userWindowsenvironmentsMoreuserfriendlycorruptedinstallermessage(RFE#1795426)SwitchedallexamplestoModernUI2

F.29.1.2MinorChanges

Fixeduninitializedmemoryleakingintoresources(bug#1874297)Minordocumentationimprovements(includingbug#1861941,bug#1883917)ModernUI2:Fitimagesinwelcome/finishpagebydefaultandfixsupportforMUI_(UN)WELCOMEFINISHPAGE_BITMAP_NOSTRETCH(bug#1875945)ModernUI2:Fixeddefaultfinishpagerebootselection(bug#1864690)ModernUI2:FixedMUI_STARTMENU_GETFOLDER(bug#1864507)ModernUI2:Fixedunreferencedmui.StartMenuPage.Createwarning(bug#1861944)NewsimplifiedcodeforinstallationofVisualBasic6runtimeSimplifiedNSISMenuprovidingeasieraccesstoalldocumentation

F.29.1.3UtilitiesandPlug-ins

AddedkeyboardcuessupportforLINKcontrolsinnsDialogs(patch#1871856)

FixedararensDialogscrashonWindows98withnon-standardbuildsofnsDialogs(bug#1889720)

Previous|Contents|Next

Previous|Contents|Next

F.302.34ReleasedonDecember24th,2007

F.30.1ReleaseNotes

ThankstouserinputonModernUI2,itisnowreadyformassconsumptionatnobettertimethantheholidayseason.TheinstallerforNSISitselfnowexploitsthewondersofMUI2andnsDialogsandsoshouldyou.

F.30.2Changelog

F.30.2.1MajorChanges

ModernUI2:Simplercode,easiertoextendandmakesuseofthefasternsDialogs

F.30.2.2MinorChanges

AddedIfNotsupportforLogicLib(patch#1846785)AddedsomedeprecationmessagesinMUI2(bug#1784470)AllowoverwriteofLANGFILE_*_NAMEdefinesinnewLangFile.nsh(bug#1848952)BetterRTLsupportininstfilesandcomponentspage(bug#1841573)Don'twarnofcommentscontainingline-continuationcharacterwhenithasnoeffect(bug#1701051,RFE#1686589)Fixeddeletionoffileswithrelativepaths,a.k.atheEVEbug(bug#1851273)FixedinputverificationofGetCurInstTypeandGetFullPathNameFixedWordFindhandlingofMBCScharacters(bug#1852141)Minordocumentationimprovements(includingbug#1842326)UseCRLFinexamples(bug#1835866)

F.30.2.3UtilitiesandPlug-ins

AddedmissingstackhandlinginnsDialogsexamplesAddedNSD_GetStateforcheckboxesandradiobuttons,NSD_SetFocus,NSD_CreatePasswordandNSD_CreateDropList(patch#1848940)FixeddocumentationofnsDialogs::SelectFolderDialog(bug#1841120)FixedNSD_CreateComboBoxsoit'dworklikeInstallOptions(bug#1851136)

F.30.2.4Translations

BulgarianupdatesGermanfixes

F.30.2.5BuildSystem

FixedbuildissuesonMacOS(bug#1851365)Fixedendianityissuesintroducedinversion2.32(bug#1851365)

Previous|Contents|Next

Previous|Contents|Next

F.312.33ReleasedonNovember17th,2007

F.31.1ReleaseNotes

Thisisaquickfixreleaseforabug,introducedin2.32,thatpreventedthewelcomepagetodisplayproperlyonWindows9x.TheproblemwascausedbythemovefromCVStoSubversionthatmessedwiththeline-breaksformatoftheINIfiles.

F.31.2Changelog

F.31.2.1MajorChanges

ModernUI:Fixedabug,introducedin2.32,thatcauseddisplayproblemsforthewelcomeandfinishpagesonWindows9x(bug#1831677)

F.31.2.2MinorChanges

ModernUI:AllowMUI_LANGDLL_ALLLANGUAGEStobedefinedafterinsertionofMUI_LANGUAGEmacro

F.31.2.3UtilitiesandPlug-ins

MadensExec'sinternalprocessalwaysexitcleanlytoavoidfalsereturnvaluesanddelays(reportedintheforum)nsDialogs:AddedOnClicksupportforstaticcontrolsVPatch:FixedVPatchFilemacropathhandling(bug#1829540)

F.31.2.4Translations

Spanishupdates

F.31.2.5BuildSystem

Separatestripoptionsforwin32andcross-platformbinaries

Previous|Contents|Next

Previous|Contents|Next

F.322.32ReleasedonNovember9th,2007

F.32.1ReleaseNotes

VistaPNGiconsarenowsupportedwithouttheneedforanyspecialtricks.

F.32.2Changelog

F.32.2.1MajorChanges

AddedsupportformismatchinginstalleranduninstallericonsNSISsourcecodeisnowhostedonSubversioninsteadofCVS

F.32.2.2MinorChanges

Fixedsynchronizationthatcouldallowtheusertocauseextractionerrorsinrarecases(reportedintheforum)FixedsyntaxvalidationofVarMinordocumentationimprovements(includingbug#1811876,bug#1819946)ModernUI2beta:Fixed3-linetitleonwelcome/finishpageModernUI2beta:FixedcomponentspagedescriptionandlockModernUI2beta:FixeddefaultlanguageselectionfromregistryModernUI2beta:FixedMUI_DIRECTORYPAGE_BGCOLOR

F.32.2.3UtilitiesandPlug-ins

nsDialogs:Addedlinksupport

F.32.2.4Translations

BulgariancorrectionsFixedJapaneseandNorwegianNynorskMUIlinebreaks(bug#1817289)

F.32.2.5BuildSystem

Checkcompiler's-m32flagbeforethelinker'stoavoidgccsegfault

Previous|Contents|Next

Previous|Contents|Next

F.332.31ReleasedonSeptember29th,2007

F.33.1ReleaseNotes

PleasecontinuetoreportanyissuesandsuggestionsregardingModernUI2.InputforthepreviousversionwasveryhelpfulinimprovingMUI2.

F.33.2Changelog

F.33.2.1MinorChanges

AddedBST_*definitionstoWinMessages.nsh(bug#1792422)AddedSetRegViewlastusedMinordocumentationimprovementsLibrarywillnowrevertregistryviewsettings(SetRegView)afterit'sfinishedModernUI:FixedemptywelcomepagewithChinese(bug#1786899)ModernUI:Fixedfinishbuttontext(bug#1789492)ModernUI:Fixeduninstallercomportmentspagetext(bug#1793811)ModernUI:FixedunusedfunctionwarningsModernUI2beta:Fixedheaderbitmapissues,includingNOSTRETCHandcompilationerrorsModernUI2beta:FixedlanguageselectiondialogModernUI2beta:FixedrebootfinishpageModernUI2beta:FixedunloadingofnsDialogsonfinishpageModernUI2beta:Fixedunusedvariablewarnings

F.33.2.2UtilitiesandPlug-ins

MakeNSISW:Fixedcommandlineparsingerror(bug#1796053)

F.33.2.3Translations

KoreancorrectionsPersianimprovements(patch#1776386)Romanianimprovements(patch#1783853)

F.33.2.4BuildSystem

FixedbuildfailureswithMinGW'sGCC4(bug#1800834)

Previous|Contents|Next

Previous|Contents|Next

F.342.30ReleasedonAugust25th,2007

F.34.1ReleaseNotes

ThisreleaseincludesabetaofModernUI2.Pleasereportanyissuesandsuggestions.TheformatofModernUIlanguagefileshasbeenmodifiedtobettersupportexternalstrings.Privatelanguagefilesshouldbeconverted(andsubmittedasapatchinthespiritofopensource).

F.34.2Changelog

F.34.2.1MajorChanges

Fixedabugintroducedinversion2.29thatcausedinvalid$SMPROGRAMSvalueonWindows98(bug#1766268)ModernUI2beta:Simplercode,easiertoextendandmakesuseofnsDialogs

F.34.2.2MinorChanges

AddedInstallOptions.nshwithrelevantusagemacros,basedontheoldModernUImacrosAddedLangFile.nshallowingcreationoflangaugefilesthatcanbeincludedwithasinglecommandwithdefaultsformissingstrings(whenLANGFILE_DEFAULTisset)AddedLB_ERRandCB_ERRtoWinMessages.nsh(bug#1771644)FixedCreateDirectorylogging(patch#1768584)Fixedescapingofquoteswith$\inmacros(bug#1713708)MinordocumentationimprovementsModernUI1.80:NewlanguagefilesstructurebasedonLangFile.nshModernUI1.80:MUI_LANGDLL_DISPLAYnowreadsprevioussettingsonsilentinstallationsaswell

ModernUI1.80:AddedMUI_CUSTOMFUNCTION_MOUSEOVERSECTION(patch#1762003)

F.34.2.3UtilitiesandPlug-ins

VariousnsDialogsimprovementsincludingRTLsupport,moremacrosinnsDialogs.nshandinitialdocumentation

F.34.2.4Translations

CatalanreturnsDanishcorrectionsSlovakcorrections(patch#1762627)

F.34.2.5BuildSystem

MoreHPUXfixes(bug#1755148,bug#1753063,bug#1758873,patch#1758863)IgnoreknownfailingtestsbydefaultonPOSIX

Previous|Contents|Next

Previous|Contents|Next

F.352.29ReleasedonJuly14th,2007

F.35.1ReleaseNotes

ThemostnotableadditioninthisreleaseisnsDialogs-afasterandfarmorecapablereplacementforInstallOptions.ItallowscreatingcontrolsofanytypedirectlyfromthescriptandremovestheneedtomesswithslowINIfiles.Itintegratesdirectlyintothescriptbycallingfunctionsfornotification,includingchangenotificationforeditboxes.Speakupifyouhaveanysuggestions/comments/patchesforit.

F.35.2Changelog

F.35.2.1MajorChanges

AddednsDialogs-areplacementforInstallOptions

F.35.2.2MinorChanges

DisableWindowserrormessagesfortheentireinstallerandnotjustforanincompletelistoffail-points(bug#1741061)FixedincorrectlargeversionhandlingofGetFileVersion(bug#1742255,patch#1742562)FixedtheReverseSectionmacroinSections.nsh(bug#1742793)MinordocumentationimprovementsSimplifiedREG_MULTI_SZreaderUseSHGetFolderPathwhereavailabletobettersupportallusers'folders

F.35.2.3UtilitiesandPlug-ins

Banner:Avoidpossiblehangswhencalledfrompagecallbacks(bug#1743801)

NSISdl:added/TRANSLATE2formore"translator-friendly"strings(patch#1656076)NSISdl:supportdownloadsover2gb(patch#1723131)

F.35.2.4Translations

AddedInternationalSpanish

F.35.2.5BuildSystem

AddedsupportforHPUX(patch#1714416)

Previous|Contents|Next

Previous|Contents|Next

F.362.28ReleasedonJune8th,2007

F.36.1Changelog

F.36.1.1MajorChanges

AddedaworkaroundforaWindows2000bugthatcausedinfiniteloopswhenhittingakeyontheinstfilespage(bug#1733692)

F.36.1.2MinorChanges

Improvedcompilererrorstrings(patch#1722147)ModernUI:addedMUI_STARTMENUPAGE_BGCOLORandMUI_DIRECTORYPAGE_BGCOLOR(patch#1706187)ModernUI:addedMUI_LANGDLL_ALLLANGUAGESthatforcesthelanguageselectiondialogtodisplayalllanguages(patch#1724876)

F.36.1.3UtilitiesandPlug-ins

InstallOptions:correcteddocumentationofTxtColor(bug#1716614)NSISdl:addedcompatibilitywithsomebuggyserversthatdon'tclosetheconnection(bug#1713562)NSISdl:fixed100%CPUusageduringdomainresolution(bug#1713560)

F.36.1.4Translations

ValencianandCatalanarenolongerinstalled(patch#1558822)

F.36.1.5BuildSystem

AddedIGNORETESTSforignoringcertaintestfilesAddedwxWidgetstotherequirementlistSystemnowbuildswithGCC,butwithoutSystem::GetandSystem::Call(patch#1711089)

Previous|Contents|Next

Previous|Contents|Next

F.372.27ReleasedonMay5th,2007

F.37.1ReleaseNotes

Thisisaquick-fixreleasethataddressesabugintroducedinthelastversion,2.26,thatcaused$PROGRAMFILESand$COMMONFILEStotranslateintorandomstringsintheuninstaller.

F.37.2Changelog

F.37.2.1MajorChanges

Fixedabugintroducedin2.26thatmade$PROGRAMFILESand$COMMONFILESunavailableintheuninstaller

F.37.2.2MinorChanges

DisabletheXbuttononInstallOptionspageswhenCancelEnabledis0FixedincompleteMessageBoxusageline(bug#1709460)

F.37.2.3BuildSystem

AddedTOOLSEToptiontoallowselectionofspecificbuildtools(e.g.sconsTOOLSET=mingw)

Previous|Contents|Next

Previous|Contents|Next

F.382.26ReleasedonApril27th,2007

F.38.1ReleaseNotes

Installationonx64systemsisnowfullysupportedwith$PROGRAMFILES64,SetRegViewandLibrary'sLIBRARY_X64option.

F.38.2Changelog

F.38.2.1MajorChanges

AddedLIBRARY_X64optionforInstallLibandUnInstallLibforinstallinganduninstallingx64librariesAdded$PROGRAMFILES32,$PROGRAMFILES64,$COMMONFILES32and$COMMONFILES64

F.38.2.2MinorChanges

Added$EXEPATHand$EXEFILEAdded$(^Language)languagestringwhichholdsthelanguagename(RFE#1235616)AddedLIBRARY_IGNORE_VERSIONoptionforInstallLib(patch#1699435)AddedVXDsupportforGetDLLVersionLocalonWindowsNT4/2000/XP/Vista(patch#1706624)AvoidLibrarywarningwhenUnInstallLibisunused(bug#1692761)FixederrorhandlingofCopyFilesonWindowsNT4(bug#774966)Fixedfontnameencodingbrokensince2.24FixedLogicLibduplicatelabelsacrossincludedfilesFixedpreservationoffolderattributeswithFile/a(bug#1699474)Improvedunusedvariablewarning(bug#1701050)LibrarymacrosnolongerrequireversioninformationforDLLfileson

POSIXMinordocumentationimprovements(includingRFE#971467)ModernUI:addedMUI_FINISHPAGE_CANCEL_ENABLEDModernUI:addedMUI_FINISHPAGE_REBOOTLATER_DEFAULT(RFE#1143843)ModernUI:blockunsupportedlanguagesinthelanguageselectiondialog(RFE#1564986)ModernUI:disableCancelbuttononthefinishpage(bug#1267491)ModernUI:reduceflickercausedbyMUI_HEADER_TRANSPARENT_TEXT(patch#1696610)SupportQuitinshowpagefunctions

F.38.2.3New/ChangedCommands

AddedSetRegViewtoallowaccesstothex64registryviewInstallericonsupportforMessageBoxusingMB_USERICON(patch#1682748,RFE#1530388)

F.38.2.4UtilitiesandPlug-ins

InstallOptions2.47:linebreakssupportinLinkcontrols(patch#1683186,RFE#1495949),addedHLineandVLinecontrols(patch#1683189)MakeNSISW:fixedbrokencommandlineparameterhandlingintroducedinthelastversion(bug#1696534)UserInfo:returneffectiveusergrouponVista,addedGetOriginalAccountType(patch#1687456,bug#1684777)

F.38.2.5Translations

AddedAfrikaanstranslation(patch#1699558)Frenchcorrections(patch#1676101)Germancorrections

F.38.2.6BuildSystem

AddedSKIPTESTSoptionAvoidalotofcodewarnings(bug#1676243)DetectwxWidgetsinsteadofassumingitsexistenceonPOSIX(bug#1672315)Fixedbig-endianplatformsupportbrokensince2.24

Previous|Contents|Next

Previous|Contents|Next

F.392.25ReleasedonMarch31st,2007

F.39.1Changelog

F.39.1.1MajorChanges

AddedMemento.nshforeasypersistencyofuserselectionsacrossdifferentrunsoftheinstaller(RFE#1677624)Fixedabugintroducedin2.24thatallowedthelicensepagetobeskippedevenwithagreementcheckboxorradiobuttons(bug#1664428)

F.39.1.2MinorChanges

AddedVistamanifesttoStartMenu.nsiexampletoavoidbackwardcompatibilitymodethatmovesshortcuts(bug#1664957)Bothdashesandslashesaresupportedasswitchprefixesonmakensis.exe(bug#1661503)Deleteuninstallertemporarydirectoryonreboot(patch#1660626)DistributePlug-inexamplewiththeNSISpackageandnotonlywiththesourcecodeFixedlossyUnicodeconversionofdialogtemplatestrings(bug#1662190)FixedSections.nshmacrossupportfor$0asinput(bug#1664648)Fixeduninstallerssupportforthe/D=commandlineswitchImprovedloggingofWriteRegcommandsMinordocumentationupdatesandfixes(includingpatch#1662419)

F.39.1.3New/ChangedCommands

Addedbitwiseoperatorssupportfor!define/math(RFE#1669513)__PAGEEX__containsthepagetype(patch#1644712)

F.39.1.4UtilitiesandPlug-ins

InstallOptions2.46:Useinstaller'snameformessageboxes(bug#1661677)MakeNSISW:UseEscapebuttontoclose(RFE#1666501)Math:Removedmathcrt.libStartMenu:Refuseemptypaths(bug#1684751)

F.39.1.5Translations

FixedGalicianlanguagefiles(bug#1663795)

F.39.1.6BuildSystem

AddedAPPEND_LIBPATHandAPPEND_CPPATHinsteadofthemalfunctioningCPPPATHandLIBPATHAddedChangeLogtosourcecodepackage(patch#1680508)AvoidsomewarningsonVS2005(patch#1667950)FixedlzmatestsegfaultonPOSIX(bug#1666873)Morestrict-aliasingcompatibility(bug#1635841)NSISMenufinallybuiltfromsource

Previous|Contents|Next

Previous|Contents|Next

F.402.24ReleasedonFebruary17th,2007

F.40.1Changelog

F.40.1.1MajorChanges

Libraryuninstall-reinstall-rebootproblemsworkaround(bug#1097642)MinimizednumberofcaseswhereanerrormessageappearsinsilentmodeNewcompilerpredefinesforcodescope(patch#1644712)

F.40.1.2MinorChanges

Added/Pcommandlineoptionforsettingprocesspriorityofmakensis(patch#1638974)Addedsupportfor64-bitPEonPOSIXtoGetDLLVersionLocal(patch#1643633)AppendlastpartofInstallDironlyto$INSTDIRondirectorypages(bug#1174184)AvoidpermissionschangeofoutputfilesforLineFindandFileJoin(bug#1631773)Fixederroneouswarningsonuninstallsections(bug#1631889)FixedlossyUnicodeconversioninresourceeditor(bug#1083492)IgnoreinvalidpreprocessorcommandsinignoredblockorcommentsMadeVIAddVersionKeyonlyquerylanguagetablesinsteadofcreatingthemandgeneratingwarnings(bug#1626504)Minordocumentationupdatesandfixes(includingbug#1642107,patch#1649187)Warnwhencontinuingacommentlineusingbackslash(bug#1554178)

F.40.1.3New/ChangedCommands

RegDLLandUnregDLLnowuseLOAD_WITH_ALTERED_SEARCH_PATH,sothere'snoneedtouseSetOutPathtosettheworkingdirectory(bug#1638191)

F.40.1.4UtilitiesandPlug-ins

InstallOptions2.45:AddedFOCUSflag(patch#1634704)andfixedpastewithONLY_NUMBERSflag(bug#1652075)MakeNSISW:settingsinHKCUinsteadofHKLM(bug#1411970)andMRUmenuaccelerators

F.40.1.5Translations

AddedGaliciantranslation(patch#1631765)

F.40.1.6BuildSystem

Addedaworkaroundforbuildingonx64POSIXplatforms(bug#1646170)Addedaworkaroundforstrict-aliasingcompatibility(bug#1635841)AddedcompressiontestsAddedSTRIP,APPEND_CCFLAGSandAPPEND_LINKFLAGSbuildoptionsFixedSCons0.96.94compatibility

Previous|Contents|Next

Previous|Contents|Next

F.412.23ReleasedonJanuary13th,2007

F.41.1Changelog

F.41.1.1MinorChanges

FixedcompilercrashonMacOSX(patch#1611866)FixeddeletionofstartmenuiconsinNSISinstalleronVista(bug#1611251)

F.41.1.2UtilitiesandPlug-ins

FixedincorrectnsExecmessagehandlinginsilentmode(bug#1605581)FixedSystemcrashwhenSystem::Storeiscalledonanemptyprivatestack(bug#1620178)FixedSystemcrashwithparenthesisinfilename(bug#1616267)MinorVPatchdocumentationenhancements(patch#1624292)

F.41.1.3BuildSystem

Fixedbuildfailuresonmingw32(bug#1610773)FixedbuildproblemswithMSTOOLKIT=yes

Previous|Contents|Next

Previous|Contents|Next

F.422.22ReleasedonNovember27th,2006

F.42.1ReleaseNotes

Somechangeshavebeenmadetothecreditandlicensefilesinordertoavoidcopyrightsandlicenserelatedconfusions.ThisdoesnotchangeinanywayhowNSISshouldorcouldbeused.NSISitselfisstilllicensedwiththepermissiveBSD-likezliblicense.UpgradeisrecommendedforearlyadoptersofWinVer.nsh,duetoabuginWindows98andMEdetection.

F.42.2Changelog

F.42.2.1MinorChanges

Fixedcontextmenunotdisappearingwhenmovingfrominstfilespage(bug#1115825)FixedWinVer.nsh'sdetectionofWindows98andME(reportedontheforum)FixedWriteUninstallerfailuretooverwriteread-onlyuninstallers(bug#1542530)LicensedlzmaunderCPLwithaspecialexception,insteadofLGPLMinordocumentationupdatesandfixes(includingbug#1584618,bug#1589877)UpdatedcommentsinMUIexamples(bug#1595500)

F.42.2.2New/ChangedCommands

Added`highest`optionforRequestExecutionLevel

F.42.2.3Translations

AddedUzbektranslation

FixedcorruptioninLithuanian(bug#1602673)MinorBretonfixesSloveniancorrections(patch#1590108)

F.42.2.4BuildSystem

AddedMicrosoftVisualC++2005ExpresssupportSConsrequirementupgradedto0.96.93

Previous|Contents|Next

Previous|Contents|Next

F.432.21ReleasedonOctober20th,2006

F.43.1Changelog

F.43.1.1MajorChanges

AddedWinVer.nshforeasyWindowsversioncomparisonsUpgradedtolzmasdk4.43forfastercompression

F.43.1.2MinorChanges

AddedVistasupporttoGetWindowsVersionAddedx64.nshincludingafewsimplemacrosforhandlingx64installationsFixedahandleleakinLocateMinordocumentationupdatesandfixesModernUI1.76:AddedMUI_ABORTWARNING_CANCEL_DEFAULT(RFE#1547844)

F.43.1.3New/ChangedCommands

AddedRequestExecutionLevel(RFE#1524709)

F.43.1.4Translations

AddedValenciantranslation(patch#1558822)BulgariancorrectionsSloveniancorrections

F.43.1.5BuildSystem

SConsrequirementupgradedto0.96.92

Previous|Contents|Next

Previous|Contents|Next

F.442.20ReleasedonSeptember9th,2006

F.44.1Changelog

F.44.1.1MinorChanges

BetterLogicLiberrors(bug#1537976)Fixedincompleteplug-incallerrormessages(bug#1535995)Fixedincorrectfiletimestampqueryingonbig-endianplatforms(bug#1536377)Minordocumentationupdatesandfixes

F.44.1.2Translations

Danishcorrections(bug#1548190)FixedincorrectlyencodedTurkishtranslation(bug#1542765)FrenchcorrectionsItaliancorrections(bug#1546183)SpanishcorrectionsSwedishcorrections(bug#1542680)Ukrainiancorrections

F.44.1.3BuildSystem

FixedNSIS_CONFIG_CONST_DATA_PATHbeingignoredonPOSIXplatforms(bug#1515592)

Previous|Contents|Next

Previous|Contents|Next

F.452.19ReleasedonAugust6th,2006

F.45.1Changelog

F.45.1.1MinorChanges

Fixed!systemand!packhdrfailurewithquotedlongfilenames(bug#1509909)Fixedbuildproblemson64bitplatforms(bug#1504772)Fixednegativetotalsizefordatalargerthan2GBinscriptcompilationsummary(bug#1468852)MinordocumentationupdatesandfixesReplacedIsDotNETInstalledwithasimplerandbetterversion

F.45.1.2New/ChangedCommands

Made!ifcomparestringscaseinsensitively,likeStrCmpand!ifdef

F.45.1.3Plug-ins

NSISdl:fixedrandomDNSerrors(reportedintheforums)System:fixedabugthatcausedstackcorruptionandstoppedtheinstallerfromdeletingSystem.dllwhenafunctionwithnoargumentswascalled(bug#1535005)System:fixedwrongreturnvaluesforfunctionsthatreturnshortorchar(bug#1535007)

F.45.1.4Translations

AddedNorwegianNynorsktranslation(patch#1503208)FixedtyposintheFrenchtranslation(bug#1531874)

Previous|Contents|Next

Previous|Contents|Next

F.462.18ReleasedonJuly1st,2006

F.46.1Changelog

F.46.1.1MinorChanges

CRC32implementationusedpotentiallynon-32bittypes(bug#1504758)FixederrorsonmultipleinclusionofusefulheadersFixedGetFileAttributesFixedincorrecttextonbrowsedialogwith.onVerifyInstDir(bug#1504297)FixedLibrary'simplementationonPOSIXMinordocumentationupdatesandfixes

F.46.1.2Translations

AddedIrishtranslation(patch#1503639)Catalancorrections(bug#1504104)DutchcorrectionsFinnishcorrections(Mozillabug#341643)FixedSerbiangrammarandtyposItaliancorrections(Mozillabug#340450)Polishcorrections(Mozillabug#224532)Portuguese(Brazil)corrections(Mozillabug#340885)Romaniancorrections(Mozillabug#340645)ThaicorrectionsTurkishcorrections(Mozillabug#340511)

Previous|Contents|Next

Previous|Contents|Next

F.472.17ReleasedonMay19th,2006

F.47.1Changelog

F.47.1.1MinorChanges

FixedbuildfailuresandsegfaultsonPowerPCMacOSX(bug#1474597,bug#1481044)FixedLibrary'sTLBversioninterpretation(bug#1471341)FixedpossiblestackcorruptionwhenusingTypeLib.dllonaninvalidTLBFixedRMDirdeletionfailureofread-onlyfolders(bug#1481664)MakeNSISW:Fixedtoolbarcompressorselectionmenu,brokeninthepreviousversion(bug#1466486)Minordocumentationimprovementsandfixes(includingbug#1469306,bug#1491616)

F.47.1.2Translations

AddedmissingBasqueandWelshfiles(bug#1469471)BrazilianPortugueseupdatesBulgarianfixesFixedatypoinHebrewtranslation(bug#1474587)Icelandicfixesandimprovements

Previous|Contents|Next

Previous|Contents|Next

F.482.16ReleasedonApril7th,2006

F.48.1ReleaseNotes

Thescriptcompiler,makensis,buildsandworksonbig-endianplatforms.ThischangeenlargestheportabilityrangeofNSIStotheoreticallyeveryPOSIXplatform.Pleasereportanyincompatibilitywithspecificplatformsorbuild-tools.Theinternalchangesmadetosupportbig-endianplatformsalsopavetheroadtox64installers.Thereisnowacentralfunctionwhichwritesdatatodisk.Thisfunctioncurrentlyonlyconvertstheendianityofintegers,butitcanbechangedtoselectivelywrite64-bitintegers.Hopefully,there'llsoonbeasimplemethodofcompilingascripttobothx86andx64installers.ChangingSource/exehead/fileform.htoaltertheinternalstructureofinstallersisnolongerenough.ThecompilerhasitsowndefinitionsofthestructureswhichmustalsobechangedinSource/fileform.cpp.Inthefuture,fileform.cppshouldbeautomaticallygeneratedfromfileform.h,butfornow,thesynchronizationmustbedonemanually.

F.48.2Changelog

F.48.2.1MajorChanges

Big-endianplatformsarenowfullysupportedbymakensisLibrarynowavailableonnon-Windowsplatformsaswell,althoughitrequirestheinstalledDLLtohaveversioninformationMakeNSISW2.1:added"Cancelcompilation"menuitem

F.48.2.2New/ChangedCommands

Added/utcdateswitchto!defineforUTCdates(RFE#1459210)

F.48.2.3MinorChanges

Addedanoptionaltimestampinthelog-NSIS_CONFIG_LOG_TIMESTAMPbuildsetting(RFE#1460586)AddedNSIS_WIN32_MAKENSISdefine,definedonlywhencompilingonWindowsExportedvalidate_filenametoplug-insFixedacrashinCResourceEditorwhenaddingresourcestoaPEthatalreadycontainsnamedresourcesFixedasmallresourceleakintheTypeLib::GetLibVersionplug-infunctionFixedCResourceEditorinputsanitychecksFixedincorrectFileOpeninputvalidation(bug#1459789)FixedLibraryfailurewithDLLsmarkedasread-onlyFixedlzma'sPOSIXimplementionthreadsynchronizationissuesandresourceleaksFixedmakensisself-pathdetectiononnon-Windowsplatforms(NSIS_CONFIG_CONST_DATA_PATH=no)Fixedreplace_iconandgenerate_uninstall_icon_dataiconvalidationMadeexternalCHMlinkssafertoscriptexceptions(bug#1449879)Minordocumentationimprovementsandfixes(includingbug#1077439,bug#1448374,RFE#1464446)ModernUI1.75:addedshowfunctionforthestartmenupage(RFE#1448176),addedMUI_HEADER_TRANSPARENT_TEXTfortransparentheadertexts(RFE#1447766)NSISdl:betterheaderdetectionforbettercompatibilitywithproxieslikeWinProxy(bug#1445735),failifnoheadersaresent,fasterdownloads(patch#1465378)StartMenu:validateuserinput(bug#1440636)

F.48.2.4Translations

AddedBasquetranslationMinorSlovenianfixes

F.48.2.5BuildSystem

AddedcodetestsforCResourceEditorandCDialogTemplateAutomaticallypassbuildsettingstoscript,eliminatingtheneedtoeditbuild.cppfornewsettingsFixed$PREFIXexpansionduringinstallationonPOSIXplatforms(bug#1456943)FixedCHMdependenciesFixedcompatibilityissuewithEclipseNSIS(versionwasn'tprefixedwith'v')FixedGCC4.1compatibility(patch#1456861)Testfor-Wl,-Mapavailability

Previous|Contents|Next

Previous|Contents|Next

F.492.15ReleasedonMarch4th,2006

F.49.1Changelog

F.49.1.1New/ChangedCommands

Added!ifformorecomplexcompile-timeflowcontrol(patch#1412982)Added/mathswitchto!defineforsimplecompile-timemathematicaloperations(patch#1372561)

F.49.1.2MinorChanges

AddedmorereplacementoptionstoWordReplaceAddedNSIS_CONFIG_LOG_STDOUTconfigurationoptionforloggingtostdoutAddedpathtranslationfor!addincludedir(bug#1431958)ConfigReadnowsetstheerrorflag,iftheentrywasn'tfoundDocumentedNopEditboxintheinstallationdirectoryselectionpageisnowalwaysLTR,evenforRTLlanguagesFixedimproperiteratorusageindir_reader(bug#1431593)FixedMessageBoxMB_TOPMOSTnotshowingup,ifusedasthefirstsections'instruction(bug#1400995)FixedRMDirskippingfileswithnamesstartingwithtwodots(bug#1420657)GetOptionsnowsetstheerrorflag,iftheoptionwasn'tfoundMade!includestopsearchingtheincludedirectoriesafteramatchisfound(bug#1441877)Madeheaderfunctionsuse/NOUNLOADforfasterplug-incallsMinordocumentationimprovementsandfixes(includingbug#1420352,bug#1432423)MoreinformativeIconerrormessages(bug#1174742)

Newcase-sensitivefunctionsinheaders:WordFindS,WordFind2XS,WordFind3XS,WordReplaceS,WordAddS,WordInsertS,StrFilterS,TextCompareS,ConfigReadS,ConfigWriteS,GetOptionsS

F.49.1.3Translations

AddedproperlanguageidentifierforBretonBretontranslationimprovementsBulgariantranslationimprovementsFixedCzechgrammarmistakes(patch#1427189)FixedItaliantypo(patch#1416988)UpdatedMongolian

F.49.1.4BuildSystem

Fixed__BIG_ENDIAN__definitionFixedimproperhandlingofpathspassedtothecompiler(bug#1434215)ImprovedGCC4.2compatibility(patch#1434174)MovedNSIS_VARS_SECTIONfromconfig.htosconsWriteallconfigurationtosconf.hinsteadofpassingitonthecommandline

Previous|Contents|Next

Previous|Contents|Next

F.502.14ReleasedonJanuary24th,2006

F.50.1ReleaseNotes

Thisreleasefixesacriticalbugthatcausedinstallersusingplug-instofailloadingonWindows9xandNT.Upgradingfrom2.13ishighlyrecommended.

F.50.2Changelog

F.50.2.1MajorChanges

Fixedabugthatcorrupted$TEMPunderWindows9xandNTandcausedInitPluginsDirtofail(bug#1412159)

F.50.2.2MinorChanges

Fixedapossiblebufferoverflowcausedbylongvaluesof$0,whenusinglargeNSIS_MAX_STRLENbuilds(above4096)

Previous|Contents|Next

Previous|Contents|Next

F.512.13ReleasedonJanuary21st,2006

F.51.1ReleaseNotes

Languagedetectionhaschanged.Thedefaultlanguageisnowsettotheuser'suser-interfacelanguageinsteadofthelocalelanguage,assuggestedbyMSDN.Torestoretheoldbehavior,useSystem::Call"kernel32::GetUserDefaultLangID()i.a"in.onInit.

F.51.2Changelog

F.51.2.1MajorChanges

Default$LANGUAGEvalueisnowbasedonuser'sUIlanguageinsteadoflocale(bug#1324734)

F.51.2.2New/ChangedCommands

AddedStrCmpSforcasesensitivestringcomparison(patch#1381929)

F.51.2.3MinorChanges

AddedsystemtimesupporttoGetTimeFixedcomponentspagecheckboxredrawproblemunderWindows95(bug#1397031)FixedconstantmaximumstringlengthinFileRead(changedfrom1024toNSIS_MAX_STRLEN)Fixedempty$INSTDIRvalueindirectorypageshowcallbackfunction(bug#1209843)FixedrelativejumpsignoringFile/nonfatal(bug#1299100)FixedtypoinNSISMenu(bug#1387748)IssueawarningwhenBrandingText/TRIM*actuallyexpandsthe

label(bug#1362443)MadeRMDir/rremoveUnicodepathsaswellusingshortnames(bug#1378785)Minordocumentationimprovementsandfixes

F.51.2.4UtilitiesandPlug-ins

FixedSystemplug-indocumentationofcallbackfunctions(bug#1403608)FixedSystemplug-inheapcorruption(bug#1403601)

F.51.2.5Translations

Mongoliantranslationimprovements

F.51.2.6BuildSystem

BetterinstallationunderPOSIXwithproper${NSISDIR}detectionandappropriatedirectorypaths(/usr/bin,/usr/share/doc,etc.)

Previous|Contents|Next

Previous|Contents|Next

F.522.12ReleasedonDecember17th,2005

F.52.1Changelog

F.52.1.1MajorChanges

Fixedcompile-timeassertionfailureforbiguninstallers(bug#1380447)Tutorialenhancements(includingbug#1366431)

F.52.1.2New/ChangedCommands

Added/NONFATALswitchto!include(patch#1372048)

F.52.1.3MinorChanges

Clearererrormessagefordoublelabeldefinition(patch#1374675)Fixedbrowsednetworkrootdirectorynotbeingaccepted(bug#1331292)FixedincorrectCompletedTextparsing(bug#1349810)Fixedsdbarker_tiny.exe'scompatibilitywithNSIS_CONFIG_LOG(bug#1365869)Implementednicerregistrycommandslog(patch#1340255)Minordocumentationimprovementsandfixes(includingpatch#1355653,bug#1349810)Multi-linecommentsarenolongerignoredinside!ifdef'dblock

F.52.1.4UtilitiesandPlug-ins

Addeddrag&dropsupportforzip2exeBetterdrag&droperrorhandlinginMakeNSISwFixedMathplug-inarrayissues(bug#1235875)

F.52.1.5Translations

AddedbrowsebuttonDanishtranslationBretontranslationfixesandimprovementsFixedfinishbuttonSwedishtranslation

F.52.1.6BuildSystem

FixedendianessdetectionproblemonPOSIXplatforms(bug#1370179)Generatedinstallersusensis-VERSION-setup.exetemplate

Previous|Contents|Next

Previous|Contents|Next

F.532.11ReleasedonNovember12th,2005

F.53.1ReleaseNotes

RebuildingexistinginstallersthatuseSetOverwriteifdiff,mightfalselyoverwritefilesonce

F.53.2Changelog

F.53.2.1MajorChanges

Addedaworkaroundforabugthatpreventeddetectionofsomespecialfolders(e.g.$DESKTOPforallusers)onWindows9x(bug#1008632)Fixedacrashcausedbycopyingverylongdetailstoclipboardintheinstallationlogpage(bug#1314004)

F.53.2.2New/ChangedCommands

Added!tempfile,!delfileand!appendfileforcross-platformhandlingoftextfilesduringcompilationFixedChangeUIinputhandling(patch#1348473)SectionInROisnolongercasesensitive

F.53.2.3MinorChanges

AddedsupportURLtotheNSISpackageentryintheAdd/Removecontrolpanel(RFE#1349867)Fixedcommenthandling(patch#1324898)FixedduplicateRegTooltestinLibraryFixedinvalidlanguageselectionaccordingto$LANGUAGEin.onInitwhenonlyprimarylanguagematchisfound(bug#1328629)FixedmissingRegToolerrorafterinstall-reboot-install-reboot

sequencewithLibraryFixedportabilityissueswithLogicLib(bug#1320297,patch#1248336)FixedSetOverwriteifdiffalwaysoverwritingonFATfilesystem(bug#1338423)Fixedwrongsizeofred.bmpcheckboximageLargerbrowsebuttonforlocalizedtexts(bug#1314682)Minordocumentationimprovementsandfixes(includingbug#1349810)SortlanguagenamesinlanguageselectiondialogUsethetemporarydirectoryforLibrarytemporaryfiles,insteadofthepossiblywrite-protectedinstallationdirectory

F.53.2.4UtilitiesandPlug-ins

Added/OEMswitchforOEMtoANSIconversioninnsExec(patch#1346737)Added/PROXYswitchformanualproxyconfigurationinNSISdl(patch#1334166)Addedsolidcompressioncheckboxtozip2exe(patch#1334155)AddedstdininMakeNSISwtoallowxcopytorunAddedtimestamphandlingtozip2exe(bug#1349853)FixedinputvalidationofnsExecInstallOptions2.44:AddedHWNDandHWND2entriestotheINIfiletoavoidmessycalculationsofthecorrectcontrolid

F.53.2.5Translations

Sloveniantranslationfixesandimprovements

F.53.2.6BuildSystem

AddedaworkaroundforlinkingerrorscausedbyabadlibraryincludedinrecentPlatformSDKversionsCheckforanduse-pthreadlinkerflagImprovedFreeBSDportability

NicererrormessageforSConsversionolderthan0.96.90

Previous|Contents|Next

Previous|Contents|Next

F.542.10ReleasedonOctober4th,2005

F.54.1Changelog

F.54.1.1MajorChanges

AddedautocompletiontothedirectorypageFixedabug,introducedin2.09,thatcausedAllowRootDirInstalltofailFixedathreadleakinthePOSIXimplementationofLZMAVPatch3.1:MD5checksums,betterperformance,andsomebugfixes(includingbug#1219806)

F.54.1.2MinorChanges

Addedroundingofrequiredandavailablesizeonthedirectorypage(1.59=>1.6insteadof1.5)AddedWS_EX_LEFTSCROLLBARstyleinRTLmode(bug#1283528)FixedalterationoftheworkingdirectorybyFileRequestinInstallOptions(bug#1287731)FixedbadmnemonickeyinMakeNSISwmenu(bug#1288159)FixednegativesizevaluesshowingupafterthedecimalpointinthedirectorypageforverybigsizesMinordocumentationimprovementsandfixesModernUI1.74:Fixedcompileerrorwhencheckboxesareusedonmultiplefinishpages

F.54.1.3Translations

FixedabuginSloveniantranslationthatcausedlotsofmissinglanguagestringwarningsFixedtyposinSerbiantranslation

FixedtyposinThaitranslationUpdatedSimpleChinesetranslation

F.54.1.4BuildSystem

AutomaticfixforVC6SP6compileerrorMovedmostoftheconfigurationfromconfig.htothebuildsystemRemovedalloptimizationsandsymbolstrippingindebugmodeSConsrequirementupdatedto0.96.91VPatchcanbebuiltonPOSIXaswell

Previous|Contents|Next

Previous|Contents|Next

F.552.09ReleasedonAugust26th,2005

F.55.1Changelog

F.55.1.1MajorChanges

Fixedabugintroducedin2.08,thatpreventeduninstallersfromdeleting$INSTDIRFixedabugthatcaused"C:\"tobeconsideredavalidinstallationdirectory,evenwithoutAllowRootDirInstall

F.55.1.2New/ChangedCommands

Varcannowbeusedinsectionsandfunctions,butonlywiththe/GLOBALflag

F.55.1.3MinorChanges

Appliedpatch#1248335forgreaterportabilityofexamplesFileFunc:workaroundforGetLongPathNamewhichisnotavailableonWindows95(Instructor)FixedanunusedlabelwarninginLibraryFixedduplicatelabelerrorsinLogicLibandLibrarywhenusedindifferentfiles(bug#1243865)ModernUI1.73:fixedcheckboxesonuninstallerfinishpageormultiplefinishpagesWordFunc:fixedincorrectreplacementoffirstwordinWordReplace,undersomeconditions(Instructor)

F.55.1.4Translations

RenamedMalaysiantoMalay

UpdateThaitranslationtothelatestversionUpdatedKurdishMUItranslationtothelatestversion

F.55.1.5BuildSystem

FixedanumberofbuildproblemsonPOSIXplatformswhichcausedplug-instomalfunctionandinstallerstocrash

Previous|Contents|Next

Previous|Contents|Next

F.562.08ReleasedonJuly23rd,2005

F.56.1ReleaseNotes

TheArchivehasbeenreplacedwithaWiki.ThenewWikiallowseveryonetoeditallpagessothere'snolongerneedtohuntfortheoriginalauthor.Italsoallowseveryonetouploadplug-insandnotjustadministrators.Andasifthat'snotenough,itlooksbetterandprovideseasierandmorefeature-richsyntax.

F.56.2Changelog

F.56.2.1MajorChanges

AddedInstructor'sheaderfilesofusefulfunctionsLibraryimprovements:orderedregistrationafterreboot,smallerRegToolandseparateprocessforeachregistrationtoavoidconflicts(thanksstb)

F.56.2.2MinorChanges

AddedBosnianandKurdishtranslationsAddedper-usernsisconf.nshfilein%APPDATA%or$HOME,dependingontheplatform(patch#1223041)Documentationimprovementsandfixes(includingbug#1202495,bug#1227610,bug#1238686,patch#1225167,RFE#1240601)Fixed_?=beingignored,iftheuninstallerpathisnotquotedandisseparatedwithonlyspacefrom_?=FixedLibraryfailingonpathswithspaces(bug#1234283)FixedUpgradeDLLcompilationerror(bug#1230336)ImprovedFrench,UkrainianandLuxembourgishtranslationMadeRMDirsettheerrorflag,ifpassedaninvaliddirectorypath(bug#1227553)

MadeuninstallerscopythemselvesintoasubdirectoryofthetemporarydirectorytoavoidDLLsleftinthetemporarydirectoryfrombeingloadedbytheuninstaller(patch#1214319)MissingLangStringwarningnowusesthelanguagename,ifpossiblezip2exe:fixedrestrictionofextractionpathlengthandupdatedtozlib1.2.3(bug#1226381)

F.56.2.3BuildSystem

AddedlinkerscripttoassurecorrectorderofsectionswhenbuildingusingGNUtoolsAddedtesttargetUIsarenowbuiltfromsource

Previous|Contents|Next

Previous|Contents|Next

F.572.07ReleasedonJune20th,2005

F.57.1ReleaseNotes

NSISUpdatewasremovedandtheupdatecheckwasmovedbacktoMakeNSISw(Help->NSISUpdate).UsethenightlybuildstogetthelatestcompiledbinariesfromCVS.Solidcompressionisnolongerthedefaultforbzip2andlzma,useSetCompressor/SOLIDbzip2orSetCompressor/SOLIDlzmaforsolidcompression.Sourcecodeisnolongersuppliedwiththeinstallerpackage.SourcecodecanbedownloadedfromCVSorfromthedownloadpage.Thedirectorystructureoftheinstallationhasbeenchanged.AlldocumentationisnowintheDocsfolderandallexamplesareintheExamplesfolder.

F.57.2Changelog

F.57.2.1MajorChanges

Added/SOLIDswitchforSetCompressorNewbuildsystem(seeappendixG)Stubs(exeheads)arenolongercompiledintomakensis.exe,butkeptintheStubsfolder

F.57.2.2New/ChangedCommands

EnumRegValuesetstheerrorflag,iftheenumerationindexisoutofrange(bug#1178756)ExpandEnvStringsnowsetstheerrorflagasthedocumentationstatesMadeFile/onamethrowanerrorifthefirstcharacterisaquote

F.57.2.3MinorChanges

Added$LOCALAPPDATA(RFE#1172123)ChangedMUIdialogscharsetfromANSI_CHARSETtoDEFAULT_CHARSET(bug#1193736,bug#1201712)Fixed$INSTDIRchanging,evenifuserclickedCancelinbrowsedialogFixedacrashinmakensiswhenusingWindowIconoff(bug#1123353)FixedCall:labelinuninstallcodeFixedcompilationerrorwithoutNSIS_CONFIG_COMPONENTPAGEFixedcompilationerrorsonvariousplatforms(includingpatch#1179116,patch#1193692)FixedCreateDirectorysettingtheerrorflagfordirectorieswithtwoconsecutivebackslashes(bug#1119442)FixedInstallLibsettingtheerrorflagfornewsharedlibraries(bug#1181951)Fixedletterscaseinexamples(patch#1184571)Fixedloggingstatebeingresetafterthedirectorypage(bug#1168711)Fixedoverlappingiconinwelcomepage(bug#1221772)FixedRMDir/REBOOTOKsettingtherebootflagwhentryingtodeletenon-existentdirectory(bug#1073792)Minordocumentationfixesandimprovements(includingbug#1220940)RemovedNSISUpdate,MakeNSISwchecksfornewversionsagain

F.57.2.4IncludeFiles

MoremessagesinWinMessages.nsh(ShengaltsAleksander)SomemoreusefulmacrosinColors.nsh(Joel)

F.57.2.5UtilitiesandPlug-ins

FixedhalibutsegfaultsonPowerPC(patch#1180886)Math:Fixedmemoryleak(brainsucker)zip2exe:upgradedtozlib1.2.2

F.57.2.6Translations

AddedMalaysiantranslation(Azwa)AddedWelshtranslation(RhoslynPrys)FixedBretonNLFfile(creditsweren'tcommented)FixedduplicateacceleratorinFrenchtranslation(bug#1168652)ImprovedFrenchtranslation(bug#1220277)UpdatedRussiantranslation(Dmitry)Updatedtranslationcredits(patch#1223362)

Previous|Contents|Next

Previous|Contents|Next

F.582.06ReleasedonMarch19th,2005

F.58.1Changelog

F.58.1.1MajorChanges

Fixedabug,introducedin2.05,thatmadecomponentsselectionnotfunctionproperlyifthefirstsectioninthescriptwasasectiongroupFixedabug,introducedin2.05,thatcorruptedthestateofsectiongroupsinsidesectiongroups(bug#1155836)

F.58.1.2New/ChangedCommands

AddedMB_RTLREADINGstyletoMessageBox(RFE#1159701)AllregistryinstructionsnowacceptSHCTXwhichisreplacedwithHKLMorHKCUatruntimeaccordingtoSetShellVarContext(RFE#1124901)

F.58.1.3MinorChanges

AddedBelarusianandIcelandiclanguagefilesAddedcomponents.ctotheMakefile(patch#1123154)AddedmissingClearErrorsinGetWindowsVersion(bug#1155588)Fixedabugininstall.shthatmadeittrytoinstallanonexistingdirectoryFixedabugintheRussianlanguagefiledistributedwith2.05FixedabugthatcausedSetFonttonotfunctionproperlywithRTLlanguagesonWindows9x(bug#1159700)Fixedabug,introducedin2.05,thatcausedproblemswithInstType/COMPONENTSONLYONCUSTOM(bug#1155060)Fixedacrashcausedbycompilinglargeuninstallers(bug#1144763)FixedcompileerrorwithoutNSIS_CONFIG_CRC_SUPPORTFixedcompileerrorsofMinGWonPOSIXforsourcecodeunder

Contrib(patch#1164307)Fixedplug-insdirectoryinitializationforextremelyrestrictedguestuserswithnodirectorylistingaccesstothetemporarydirectoryMadeinstall.shnotuse$(tempfile)andinstallfilesunder/usr/shareinsteadof/lib(patch#1120399)MinordocumentationupdatesandfixesUpdatedSlovenian,SerbianandSerbianLatinlanguagefiles

F.58.1.4UtilitiesandPlug-ins

AdvSplash:Fixedasmallmemoryleak(ThanksTakhir)StartMenu:AddedsupportforSetCtlColors(RFE#711900)

Previous|Contents|Next

Previous|Contents|Next

F.592.05ReleasedonFebruary4th,2005

F.59.1ReleaseNotes

Alotofchangesweremadetothebehaviorofsections/componentsandrelatedinstructions.Thechangeswerethoroughlytested,butmaystillcauseminorincompatibilitieswitholdscripts.Pleaseletusknowifyourscriptnolongerfunctionsasexpectedwiththesechanges.

F.59.2Changelog

F.59.2.1New/ChangedCommands

RenamedSubSectionandSubSectionEndtoSectionGroupandSectionGroupEndSectionSetFlags,whenusedonasectiongroup,togglesitschildrentooSectionSetTextworksbetterwithvariables(parsesimmediatelyandtreatsanemptyvariableasanemptystring)SetCurInstTypeworkswithoutthecomponentspage

F.59.2.2MinorChanges

AddedBretontranslationAdvSplash:FixeddoubledelaytimeinsomecasesDocumentationfixesandenhancements(includingpatch#1098454)FixedcasesensitivenamecomparisonwithFile/x,whennotusingwildcardsFixedextractionstatusendingpriorto100%Fixednegativevaluesofavailablespaceinthedirectorypage(bug#1114876)Fixedsystem.nsiexamplecrash(bug#1102255)

FixedunusedlabelwarningswithLibrarymacrosImprovedsomeerrormessagesInstallOptions2.42:Addedanimagedisplayingexample,addedTRANSPARENTflagforBITMAPfields(RFE#1079715-fundedbyChrisMorgan)Invisiblesectionsweren'talwaysaffectedbyachangeoftheinstallationtype(bug#1045722)LanguagefilefixesMadepagesrefreshafteranabortedleavefunctionPartiallyselectedsectiongroupscannowbetoggled

Previous|Contents|Next

Previous|Contents|Next

F.602.04ReleasedonJanuary7th,2005

F.60.1Changelog

F.60.1.1MajorChanges

Fixed$0changedbyFile/rFixedemptydirectorynotincludedbyFile/rFixedinvaliddirectorycreationbyFile/ronPOSIXFixedUnicodeconversionproblemsonPOSIX

F.60.1.2MinorChanges

Addednewtestfordir_reader::matchesFixedLibraryLocalfailurewithUNCpathsFixedVC7.1andGCC3.4compileerrorsLanguagefilefixes

Previous|Contents|Next

Previous|Contents|Next

F.612.03ReleasedonDecember3rd,2004

F.61.1ReleaseNotes

Ifyou'reusingFile/rfolderinyourscript,it'srecommendedyoureplaceitwithFile/rfolder\*forfastercompilationandsonootherfoldersnamedfolderwillbeincludedCommandlineswitchesprefixonPOSIXhaschangedtoadashTheplug-inAPIchangeisbackwardcompatible

F.61.2Changelog

F.61.2.1MajorChanges

Addedanotherparametertoplug-infunctionswithapointertoexec_flagsandExecuteCodeSegmentFixedhandlingofabsolutepathsonPOSIXMadeRegDLLloadandunloadaDLLexactlyoncetofixcrasheswithCOMDLLsregistration

F.61.2.2New/ChangedCommands

Added/dateswitchto!definefordefinitionofdateandtimeconstantsAdded/xswitchforFileandReserveFiletoexcludefilesanddirectoriesMadeFile's/rswitchalwayssearchinsubdirectories,evenifthegivenpathpointstoanexistingdirectory

F.61.2.3MinorChanges

AddedLIBRARY_SHELL_EXTENSIONandLIBRARY_COMtoLibrary

Addedmissing#includeAddedNSIS_LZMA_COMPRESS_WHOLEtothescriptdefinelistDocumentationfixesandimprovementsFixedanaccessviolationincaseofascriptjumpbeyondthelastentryFixedkeyboardnavigationintheinstfilespagewhileinstallingFixedunpackingwindownotshowingwhenBGGradientisusedFixedunusedlabelwarninginLibrary.nshLanguagefilefixesModernUI1.72:FixedstateofCancelbuttononFinishpagewhenusedininstalleranduninstaller,addedastringforNSIS_CONFIG_COMPONENTPAGE_ALTERNATIVEnsisconf.nshwasnotalwaysparsedwhencompilingusingMakeNSISw

Previous|Contents|Next

Previous|Contents|Next

F.622.02ReleasedonOctober23rd,2004

F.62.1Changelog

F.62.1.1MajorChanges

AddedlotsofsmallusageexamplestothedocumentationMaderelativejumpsworkwithinstructionsthataddmultipleentriesMadethedatablockoptimizermuchfasterMadetheinstallerdenyrebootswhilerunning(WM_QUERYENDSESSION)MadetheRebootcommandfirstquitandthenrebootsoeverythingisalwayscleaned-up

F.62.1.2New/ChangedCommands

Added<<and>>toIntOpAddedGetErrorLevelandSetErrorLevelFixedCopyFilesusagecheckingproblemMadeRebootcall.onRebootFailedandquitonfailureinsteadofsettingtheerrorflag

F.62.1.3MinorChanges

AddedAlbanianlanguagefilesAddedNSIS_CONFIG_COMPONENTPAGE_ALTERNATIVEconfigurationoptionwhichmakescomponentsonlybetoggledwhentheuserclicksonthecheckboxandmakes.onMouseOverSectiononlybecalledwhentheuserselectsacomponentAddedsomeCppUnittestsBoth_?=and/D=nowrequireaspacebeforethemsotheycansafelyremovethespacefrom$CMDLINEFixedabugthatcausedtheuninstallerCRC-checktofailif!packhdr

createdanon-512-bytes-alignedexeheadFixedacompilercrashcausedbyusingGetCurrentAddressFixederrorswhenusing'File/r.'onWindowsFixedgcc3.4compileerrorsFixedinconsistenciesbetweenerrorlevelsandthedocumentationFixedsomeminormemoryleaksLanguagefilefixesMakefileimprovementsModernUI1.71:MadetheselectedlanguageonlybesavediftheinstallationwassuccessfulSomecoderefactoringStrFunc:RewroteStrSortandfixedStrStrAdv.Seethereadmeforacompletechangelog

F.62.1.4UtilitiesandPlug-ins

Banner:Fixedsomecaseswherethebannerwouldnotshowontheforeground

Previous|Contents|Next

Previous|Contents|Next

F.632.01ReleasedonSeptember24th,2004

F.63.1ReleaseNotes

SeeCompilingNSISSourcesforinformationaboutcompilingmakensisonPOSIXplatformsNSISdoesn'tcreateinstallersforLinux/MacOSXetc.,butyoucancompileWindowsinstallersontheseplatformsUpgradeDLLisstillprovidedinUpgradeDLL.nshforbackwardscompatibility

F.63.2Changelog

F.63.2.1MajorChanges

Compiler(makensis)supportsPOSIXplatforms(Linux,*BSD,MacOSX,etc.)NewsystemforDLL/TLBlibrarysetup

F.63.2.2New/ChangedCommands

AddedBGFontthatallowssettingthebackgroundtextfontAddedSW_HIDEtoExecShell'sacceptedshowmodesRMDircannowbeusedwithboth/rand/REBOOTOKatthesametimeExtendedmaximumbinarydataforWriteRegBinto3*NSIS_MAX_STRLENAdded!execute

F.63.2.3MinorChanges

LZMAexeheadisnow34KBandshouldalsodecompressfasterWindows95(OSR2)/98/MEnolongerseedrivefreespacecapped

to2GBModernUserInterface:NeworangethemebyMoNKiSpeedupbackgroundgradientpaintingLogicLib2.5:AddedAndIf,AndUnless,OrIf,OrUnless.Avoidsunusedvariablewarningsbyrequiring!definesbeforeusingcertainfeatures.StrFunc:Addedsupportforuninstaller,somefixesandimprovements.SeethereadmeforacompletechangelogTheplug-insfolderisproperlyremovedwhenthesystemisrebootedSetOutPath"-"worksagainFixedabugwhichmadeplug-insthatdidn'thavelowercaseextensionnotbefoundFixedabugthatcauseddirectorieswithdrivesthathadtheircurrentdirectorysettoaninvaliddirectorytonotbeacceptedinthedirectoryselectionpageFixedacrashinmakensiscausedbydefiningamacroinafileincludedbyanothermacromakensisshowsmeaningfulerrorsforcompressionerrorsinsteadofjustmagicnumbersFixedabugwithAllowRootDirInstallusedalongwithInstallDirRegKeythatcausedthedirectoryintheregistrytobeignoredFixedFileReadsettingtheerrorflagwhenanullcharacteristhefirstcharacteritreadsFixedabugwhichcausedthebackgroundgradienttopaintslowlyFilepathsrelativetotherootfolderworkagainAddedColors.nshMadeTimesNewRomandefaultfontforthebackgroundtextbecauseitshouldalwayshavesupportforthelocale'slanguageFixedcompilationofNSISdlunderVS.NETSetCtlColors/BRANDINGwasn'tworkingright,ifjustoneofthebackgroundortextcolorwerespecifiedLanguagefilefixesandimprovements

F.63.2.4UtilitiesandPlug-ins

System:New,hopefullymoreinformative,documentation;fixedsomebugs

Banner:AddedgetWindowtoallowgreatercontroloverthebannerwindowInstallOptions2.41:Bitmapsarenowautomaticallycentered,fixedabugwhichpreventedenablingthenextbuttonfromtheleavefunctionofInstallOptionspages,fixedararefreezeZip2Exe0.32:FixedcodepageproblemsnsExec:Alwayscreateavalidinputhandle,fixedaproblemwhencalledfromapathwithspacesVPatch:CloseallopenfilehandleswhenoneofthemfailtoopenNSISdl:Added/NOIEPROXY(basedonmemph'scode)

Previous|Contents|Next

Previous|Contents|Next

F.642.0ReleasedonFebruary7th,2004

F.64.1ReleaseNotes

Finnish,BulgarianandThailanguagefilesareoutdatedanddonotcontainallneededtranslations

F.64.2Changelog

F.64.2.1Changesfrom1.98

Multiplelanguagesinoneinstallersupport(withRTLsupport)Easierplug-insystemModernUserInterface(optional)LZMAcompressionwhichprovidesinstallers20%smallerthanbzip2Easierpagingsystem(nomore.onNextPage,.onPrevPage)ComponentsarepresentedasatreewhichallowssubcomponentsUservariables($VARNAME)IconandUninstallIconsupportanycolordepthandsizes,notjust32x32x16CheckBitmapsupportsanycolordepthImprovedlargefileshandlingLicensedatacanbeRTFCHMdocumentationforeasybrowsingBettersilentsupportNewincludefilesforeasierscripting:LogicLib,StrFuncandSectionsImprovedplug-ins:InstallOptions,NSISdlandSplashNewplug-ins:AdvSplash,Banner,BgImage,Dialer,LangDLL,Math,nsExec,StartMenu,System,UserInfoandVPatchNewandimprovedutilities:MakeNSISw,NSISMenu(NSIS.exe),NSISUpdate(Bin\NSISUpdate.exe)andzip2exe(Bin\zip2exe.exe)Newcommands:!addplugindir,!echo,!ifmacrodef,!ifmacrondef,!verbose,AddBrandingImage,AllowSkipFiles,ChangeUI,CheckBitmap,CreateFont,DirVar,DirVerify,EnableWindow,

FileBufSize,FlushINI,GetCurInstType,GetDlgItem,GetInstDirError,IfAbort,IfSilent,InitPluginsDir,InstTypeGetText,InstTypeSetText,LangString,LicenseBkColor,LicenseForceSelection,LicenseLangString,LoadLanguageFile,LockWindow,Page,PageEx,ReserveFile,SectionGetInstTypes,SectionGetSize,SectionSetInstTypes,SectionSetSize,SetBrandingImage,SetCompressionLevel,SetCompressor,SetCompressorDictSize,SetCtlColors,SetCurInstType,SetPluginUnload,SetSilent,ShowWindow,SubSection(replacedbySectionGroup),SubSectionEnd(replacedbySectionGroupEnd),Var,VIAddVersionKey,VIProductVersionandXPStyleRemovedcommands:DirShow,DisabledBitmap,EnabledBitmapandSectionDividerAllthisandasmalleroverhead!=)Alotmore...Seebelowformoreinformation

F.64.2.2ChangesfromRC4

CommandlineparserignoredanyswitchesaftertokensthatarenotswitchesLastpartofthepathspecifiedinInstallDirwasappendedevenifselectedfoldernamewasthesameModernUI1.70:Improveddocumentation,newInitcustomfunctionforWelcomeandFinishpageAddedStrFuncbydeguixUpdatedandfixedlanguagefilesUpdated,fixedandimproveddocumentation

Previous|Contents|Next

Previous|Contents|Next

F.652.0ReleaseCandidate4ReleasedonFebruary2nd,2004

F.65.1Changelog

F.65.1.1MajorChanges

FixedMBCSmishandlinginexehead,InstallOptionsandnsExec

F.65.1.2MinorChanges

LanguagefilesupdatesandfixesFixedlogging(NSIS_CONFIG_LOG)Fixedcompileerrorscausedbyremovingsomeconfig.hoptionsNSIScompileswithoutPSDKagainDocumentationfixes

F.65.1.3UtilitiesandPlug-ins

NSISdl:AllpotentialandrarecrashesshouldbecompletelyfixednowInstallOptions:FixedararecrashrelatedtoListItemsandasmallmemoryleakwhenusingValidateText

Previous|Contents|Next

Previous|Contents|Next

F.662.0ReleaseCandidate3ReleasedonJanuary26th,2004

F.66.1Changelog

F.66.1.1MinorChanges

FixedsomebugswithLZMA/bzip2andnon-solidcompressionFixedabugthatcausedescapingnottobeignoredonextended!definelinesLanguagefilesupdatesandfixesFixedinstallercrashwhencertainlanguagestringswerenotreferencedinalllanguagesSomenewandimprovedgraphicsMadeCreateShortcutcaseinsensitivewhenparsinghotkeySomedocumentationimprovementsandfix-upsModernUI1.69:Madealluninstallerpagesworkwithoutinstallerpagesandfixedtoptextonuninstallerlicensepage

F.66.1.2UtilitiesandPlug-ins

MakeNSISW:Fixedresizebug,fixedsomeUIissuesinthesettingsdialogNSISUpdate:ImprovedUIInstallOptions:FixedminorproblemswiththenewNOTIFYflag

Previous|Contents|Next

Previous|Contents|Next

F.672.0ReleaseCandidate2ReleasedonJanuary5th,2004

F.67.1Changelog

F.67.1.1MinorChanges

Setfocustothemaincontrolineachpagetoeasekeyboardcontrol(plug-instoo)LangStringsanduservariableslimitisnow16383andisenforcedFixedcontrolcolorssetusingSetCtlColorsnotchangingwhenthesystemcolorswerechangedLogwindownowrespondstothecontextmenukeyFixedabugwhichcausedbeepingwhenthespacekeyishitonthecomponentstreeAddedcodetopreventweirdusageofWM_COMMANDwhichcancauseweirdbehaviorFixedcompileerrorswhenNSIS_CONFIG_COMPONENTPAGE,NSIS_CONFIG_PLUGIN_SUPPORTorNSIS_SUPPORT_HWNDSarenotdefinedMorelanguagefilesupdatedtothelatestversionFixedCHM'sscripterrorsDocumentationimprovements

F.67.1.2UtilitiesandPlug-ins

InstallOptions2.4:NOTIFYforlink,droplistandlistbox;UIfixesandimprovements.SeeIO'schangelogforacompletelistMakeNSISW:Improveduserinterface,addedsupportfornamedsymbolsetsandfixedbestcompressorselector

Previous|Contents|Next

Previous|Contents|Next

F.682.0ReleaseCandidate1ReleasedonDecember27th,2003

F.68.1ReleaseNotes

TryingtheLZMAcompressionmethodforyourinstallerisrecommended.Itoftengivesa20%bettercompressionratio.ModernUI1.68:ThesettingtochangethetitlesizeontheWelcomepageandFinishpagehasbeenchanged

F.68.2Changelog

F.68.2.1MajorChanges

LZMAcompressionsupport.AddedSetCompresssorDictSize.ModernUI1.68:NewsettingsforextraspacefortitleandtextonWelcomepageandFinishpage,improvedhandlingofverbosesettings,languagefilestringforuninstallerrebootinformation,moreShellfoldersarenowdetectedusingshellAPIfunctionsandnottheregistry.ThisistherecommendedmethodbyMicrosoft.Newconstantshavebeenaddedintheprocess($FONTS,$SENDTOandmore...).Seesection4.2.3formoredetails.AddedLogicLibtodistribution(easierconditionalexecutionetc.)AddedDirVerifyandGetInstDirErrortoallowcustomerrorcheckingwhentheinstallationdirectoryisinvalidorthedrivedoesnothaveenoughspaceSupportforreadingenvironmentalvariablesatcompiletime:$%envVarName%Added/SDparameterforMessageBox.Allowstosetdefaultforsilentinstallers.Newconditionalcompilationoptions:!ifmacrodefand!ifmacrondef.NewsectionsmacrosformutuallyexclusivesectionselectionImprovedRTLsupportbyaddingWS_EX_RTLREADINGwhereverpossible

F.68.2.2UtilitiesandPlug-ins

InstallOptions2.3:Addednewcontroltype"Button",addednewflag"NOTIFY",addednewflag"NOWORDWRAP"formulti-linetextboxes,reducedsizedownto12KMakeNSISW:MoreoptionstosetthecompressionmethodZip2Exe0.31:Fixedcompressionsetting,LZMAcompressionsupportVPatch2.1:BettererrorhandlingandexitcodeforGenPat

Previous|Contents|Next

Previous|Contents|Next

F.692.0Beta4ReleasedonNovember19th,2003

F.69.1ReleaseNotes

The/LANGparameterisnolongeravailableforanytextsettinginstructions.YoumustuseaLangStringifyouwanttomakeacertaintextmultilingual.Thismeansyoucanalsosetonetextforalllanguages.TomakethelicensedatamultilingualyoushoulduseLicenseLangString.ModernUI1.67:Becauseofthenewsyntaxforpages,renamingofsettingsandvariablenamesetc.,youhavetomakesomechangestoyourscripts,seetheModernUIReadmefordetails.CustomPagesnowhavealeavefunction.Asthisparameterisplacedbeforethecaptionyouhavetoaddanother""emptystringforthetitletowork..onSelChangeisnolongercalledwhenthecomponentspageiscreated.TheiconsfolderhasbeenrenamedtoGraphicsandwasreorganized.IfyouwereusinganyfilesfromContrib\Iconsinyourscript,youshouldupdateittopointtothenewimageoriconpath.UpgradeDLLhasbeenchanged,it'shighlyrecommendthatyouincludethenewversioninyourscriptusing!include"UpgradeDLL.nsh"insteadoftheoldone.

F.69.2Changelog

F.69.2.1MajorChanges

CHMdocumentation-searchableandcomeswithanindexUservariables($VARNAME)thatcanbedeclaredwiththeVarcommandSupportforallpagesinbothinstalleranduninstaller.Components,directoryandlicensepagescanbeusedfortheuninstallerImprovedlargefileshandling(waylowerrequirementstocompilea

2GBinstallernow)FullsupportforRTLlanguages,includingsupportforLTRandRTLlanguagesinoneinstallerModernUI1.67:Newsystem&syntaxforpages,settings(supportformultiplepagesofthesametype,pagespecificsettings,morecustomizationoptionsetc.),Welcome/Finishpagesforuninstaller,LicenseForceSelectionsupport,newoptionsforFinishpage/languageselectiondialog,fixes,moreExtractionprogressNomoreunprocessedstrings,variablescanbeusedeverywhereLeavefunctionforcustompages:InputonInstallOptionspagescanbevalidatedusingscriptcodeInterfaceimprovements:BetterClearTypesupport,nomoreflickeringOnMouseOvertextisonlydisplayedwhenmouseoversectionNLFlanguagefiles(v6):languagespecificfonts,RTLandmorestringsInnerLangStringscanbeusedinthescriptNomore/LANG,onlyLangStrings-easiertosetonestringtoalllanguagesLangStringsarenolongerinstaller/uninstallerspecific(noun.)

F.69.2.2New/ChangedCommands

AddedPageEx,PageCallbacksandDirVar-it'snowaloteasiertoaddthesamepagetypetwiceAddedFileBufSizeAddedVIAddVersionKey:addversioninformationresourcetotheinstallerAddedAllowSkipFiles:setwhethertheusershouldbeabletoskipafilewhenoverwritingfailedAddedLicenseForceSelection:checkboxorradiobuttonsonlicensepagetoletuseragreewithlicenseornotAddedSectionSetSize,SectionGetSize,SetCurInstTypeandGetCurInstTypeReplacedSetBkColorwithSetCtlColorswhichcansettextcolortooAddedIfSilentandSetSilenttoallowbetter/SinteractionAddedsupportforstandardpredefines:${__DATE__},${__TIME__},

${__TIMESTAMP__},${__FILE__},${__LINE__}AddedifdiffandlastusdforSetOverwrite/oSwitchforSectionprovidesabilitytounselectthesectionbydefaultNewparameterforDirTexttosetthebrowsedialogtextAddedRMDir/REBOOTOK:removefoldersonrebootInstType/NOCUSTOMand/COMPONENTSONLYONCUSTOMworktogetherAddedbase_dirforGetTempFileName

F.69.2.3MinorChanges

ROsectionscannowbeinInstTypestoo(defaultstooldbehavior)IncreasedlimitofInstTypesto32Improvedmacros&functions:UpgradeDLL,GetParent,GetParameters.Usingthenewversionsisrecommended.FixedSetOutPathnotsettingcurrentdirectoryifthedirectorydidn'texistbeforeComponentstree:fixedproblemswithsub-sectionswithROsectionsaschildren,SF_EXPANDnowrefreshesthecomponentstreeandaddedSF_PSELECTEDforpartiallyselectedsub-sectionsImprovedAddBrandingImage:doesn'tdependontheUI,cansetimageonthebottomandontheright,supportforcustompaddingvalueBetterinstallationdirectoryverificationFixedallknownproblemswithtemporaryfilesanddirectoriesDocumentationfixesMinorbugfixesCodeclean-upsandsomemorecommentsMore...

F.69.2.4UtilitiesandPlug-ins

MakeNSISW2.0:UItodefinesymbols,easyaccesstorecentscripts,toolbarandmoreZip2Exe0.3:basedonheaderfiles,improvedinterface,ModernUIsupport,newscriptcode,improvedfolderdetection

InstallOptions2.2:addedLINKcontrol,addedEXTENDEDSELECTflagforlistboxeswhichreplacesMULTISELECTthatnowactsexactlyastherealstyleflag([double]clickturnsonoroffselection),fixesBgImageplug-instabilityfixesAddedvPatch:patchgeneratorandplug-inthatappliesthepatchesBannerplug-inimprovements:respondstomessagesandsomenew/settricksbybrainsuckerAdvSpalshplug-inimprovements:smaller,bettertransparencysupportandapossiblebugfixSystemplug-inimprovements:Unicode,GUIDandCOMsupportnsExecplug-inimprovments:abilitytorun16bitcodeandtabstospacesconversionMathplug-inDelphiunitforNSISplug-ins

Previous|Contents|Next

Previous|Contents|Next

F.702.0Beta3ReleasedonMarch16th,2003

ModernUI1.63:Headerbitmapsupport,newdefinestochangethedescriptionarea,singlemacroforlanguageselectiondialog,more!Newtutorialinthedocumentationdefine_if_lastinPagecommandalsoworkswhenadefinehasnotbeenspecifiedforallPagecommands.ThisfixestheproblemwiththeModernUI"ClickNext"/"ClickInstall"texts.AddedSectionSetInstTypesandSectionGetInstTypesRebootcommanddoesnotforcearebootanymore(allowstheusertosavework)!if[n]def/!elsefixesLogSetonnowreallystartsloggingCancelbuttonavailableonallpagesaftertheinstfilespagebutthelastpageunless/ENABLECANCELwasusedinitsPagecommandLicensepage:NomorelimitonRTFsizeLangDLL:Optiontoauto-countnumberoflanguages,shellfontsupportPageandUninstPagecannotbeusedinsidesections/functionsCreateDirectorynowusestheerrorflagEnumRegKey/Valueoutput_varcheckfixedUpdatedtranslationsDreadedBSODafterplug-insenumerationfinallybanishedMinimizebuttonandBGGradientandBGImagecompatibilityfixesWriteINIStrwithemptyvalueworksagainAddedFlushINI

Previous|Contents|Next

Previous|Contents|Next

F.712.0Beta2ReleasedonFebruary26th,2003

NSISMenu:linkstoallNSISutilities,documentationandwebsitesNSISUpdate:checkfornewreleases,downloadlatestdevelopmentfilesDialerplugintoconnecttotheinternetImprovedfilenamevalidationVC7compilercompatibilityissuesfixedCreateDirectorysetserrorflagInstallOptions:INIFileStatevaluefixedUpdatedtranslationsMinorfixes

Previous|Contents|Next

Previous|Contents|Next

F.722.0Beta1ReleasedonFebruary9th,2003

Userinterfaceimprovements:betterorder/groupingofcontrols,buttonselectionproblemsfixed,addedminimizebox,transparentBrandingTextLangStringimprovements:canbeusedbeforetheyhavebeendefined,warningifnotpresentinalllanguagetablesNewversionoftheModernUserInterfacewithUIimprovements,bugfixesandsomesmallnewfeaturesInstallOptions2.0withsupportforcustomfontandDPIsettings,groupboxes,groupedcontrols,lotsofbugfixesetc.NomorerandomcompressionratiosSetOutPathnowsetstheworkingdirectoryFilenamesarevalidated,directorygivenbytheuserwillnowalwayswork$QUICKLAUNCHnowworkswithSetShellVarContextallAutomaticallyappendeddirectorynameinthedirectoryselectiondialogwillnolongercontainsquaresifnotallcharactersareASCII.Fixedabugwithremotedrivesandavailablespace(\\remote\drive)Plug-infunction'snamesarenowcaseinsensitiveFixedabugwithspecifyingIcontwiceIncludedirs(!addincludedir)OnleavefunctionforpagesInstallerscannowreallycontainmorethanonebrandingimageAll!if/!else/!endifproblemsshouldbesolvednowSetFont"MSShellDlg"addstheDS_SHELLFONTstyleWin9xrenameonrebootnowalsoworkswhenthedestinationfiledoesnotexistDeleteRegKeyworksondefaultvaluensExeccanbecalledfromaninstallerexecutedbyCreateProcessWriteUninstallersetserrorcodeBanner.dllcompatiblewithModernUIFixedfocusproblemsinMakeNSISwUpdatedandnewtranslationsSomenewbitmapsfortheMUIbyVirtlink

FasterandbetterMakeNSISwintegrationNew.NETFrameworkdetectionfunctionMinorbugfixesCodeclean-ups(compilesonVC7)

Previous|Contents|Next

Previous|Contents|Next

F.732.0Beta0ReleasedonDecember6th,2002

NewpagingsystemAddedPageandUninstPageRemoved.onNextPage,.onPrevPage,.onInitDialogNeweasierversionoftheModernUserInterfacewithbettermultilanguagesupport,InstallOptionsintegration,welcomeandfinishpageetc.CustompagesnolongerflickerwhencreatedAddedacceleratorkeysAddedLangStringandLangStringUPforuserdefinedmultilingualstringsAddedsupportfortransparentcheckmarksAddedInitPluginsDirRenamednsisconf.nsitonsisconf.nshAddedCreateShortcutcomment/descriptionparameterSplash.exeisnowaplugin(splash.dll)Addednewplugins:System,AdvSplash,nsExec,UserInfo,BgImage,BannerandStartMenu!ifdefandfriendscannowbeusedinmacrosSendMessagecansendstrings(putSTR:beforeaparam)andsupportstimeoutsRightmousebutton"Copytoclipboard"contextmenufortheDetailswindowPluginsyntaxnowrequiresdllname,e.g.dll::funcnotjustfuncLicencetextreceivesinitialfocus(pageup&downworkimmediately,returnkeystillworks)Madewin9xmove/deleteonrebootsupportproperandfunctionlikeonwin2kNowalwaysloadsRichEditv2ifpresent(linksworkonWin9x)DeleteRegKeynowcomplainsifgivenathirdparameter(otherthan/ifempty)RegDLLnowworkswithDLLsdependentonDLLsfromthesamedirectory${LANG_langName}definedasthelanguageidwhenloadingaNLF

FixedafewbugsthatcausedtheinstallertoloadslowerthanbeforeUninstallcannowgetcommandlineparameterstooAddedReserveFileAddedExDLL.hIncludedmakensisw1.9(lotsofchanges)UpdatedInstallOptionsUpdatedZIP2EXEUpdatedHTTPdownloadplugin,NSIS-dl(timeoutadded,betterproxydetection)AlotofnewlanguagefilesAlotofnewiconsandcheckmarksChangedsectionflagsvaluesSectionSetFlagscannowsetboldtooSectionSetFlagsnowworksinsilentinstallerstooSectionSetNameforsubsectionsdoesn'tneed'-'infrontofthenameAddedSetPluginUnloadHiddensectioncannowuseSectionIntooFile/nonfatalswitchaddedPluginsnolongeraddsizetotheircontainingsectionDefinescannowbeusedinsidedefinenames(${bla${blo}})Newdocsformat(WOOHA!)EXEheadersizealotsmaller,33.5KBforbzip2and34KBforzlibLotsofotherbugsfixed...

Previous|Contents|Next

Previous|Contents|Next

F.742.0Alpha7ReleasedonAugust29th,2002

Cannowselectthelanguagefrom.onInit($LANGUAGEisavariable)AddedCreateFontAdded.onMouseOverSectionAdded.onInitDialogandun.onInitDialogAddedSetStaticBkColorDisabledUseOuterUIItemSendMessageWM_SETTEXTtreatslParamasastringandnotanumberCopyFilesscriptmessagenolongeralwaysprints(silent)CustominstalltypetextcannowbechangedChangeUIcannowchangeIDD_VERIFYDefaultlicensecolornowfitstheusersystemSummaryreportstherightnumberofrequiredsectionsCheckboxisonlyrequiredinIDD_DIRifloggingisenabledNotusing/LANGnowreallycausesthescriptcompilertousethelastusedlanguageFixedabugwithMBCSandtheuninstallertextMBCStoUnicodeandUnicodetoMBCSconversionbugsfixedFixedabugthatcausedRTFnottoshowonWindows9xAddedadialogthatshowsupifcompresswholeisusedandinitialdecompressinglastslongerthanasecondUpdatedtoInstallOptions1.3MakeNSISw1.7includedAddedmodernUIbyJoostVerburg(Examples\ModernUI)Addednewfullcoloriconsbyadni18AddedDutch,Korean,Russian,SwedishandTraditionalChineselanguagefilesUpdatedSpanishlanguagefileversion(thankstoLsMoNKi)Added/TRIM(LEFT|RIGHT|CENTER)forBrandingTextEXEheadersizedownto36.5KBAddedyi-pixel.icoandyi-pixel-uninstall.icobyJanT.SottFixedabugwithmacrosattheendofthefile

Sub-sectionscannowhavedefinednamestooAddedLangDLL.dllpluginCallInstDLL/NOUNLOADadded(worksonplugincallstoo)

Previous|Contents|Next

Previous|Contents|Next

F.752.0Alpha6ReleasedonAugust10th,2002

Fixedtwobugswiththeplug-inmechanismFixedinfiniteloopbug

Previous|Contents|Next

Previous|Contents|Next

F.762.0Alpha5ReleasedonAugust9th,2002

AddedUseOuterUIItemEnhancedChangeUIEnhancedSetDlgItemTextAddedone-section.nsiexamplefileOptimizedXimon'scodeforplug-inDLLs(backto37KB)Ifdefaultuserlanguagedoesn'tfitexactly,willtrytofindprimarylanguagematchFixedsomestringsthatgotreplaced(spaceavailableandrequiredetc.)CompileswithoutMSPlatformSDKIncludedSpanish.nlfIncludedMagicLime.exebysnowchyld

Previous|Contents|Next

Previous|Contents|Next

F.772.0Alpha4ReleasedonAugust5th,2002

Addedautomaticdetection,packing,unpackinganddeletionofplugindllsAddedsimplifiedcallingsyntaxforplugindllsAddedPluginDir

Previous|Contents|Next

Previous|Contents|Next

F.782.0Alpha3ReleasedonAugust4th,2002

AddedLoadLanguageFileAdded$LANGUAGEAdded/LANGoptiontostringsetters(Name,Caption,etc.)'LogSeton'nowbuildsalogfileifnotalreadycreated

Previous|Contents|Next

Previous|Contents|Next

F.792.0Alpha2ReleasedonJuly31st,2002

Added${NSISDIR}AddedXPStyleAddedSetFontAddedChangeUIAddedAddBrandingImage,andSetBrandingImageAddedSetCompressor(nomoremakensis-bz2.exe)AddedLicenseBkColor'SpaceTextsnone'nowcausesnospacetextstoappearIconandUninstallIconnowsupporticonsofanytypeCheckBitmapnowsupportbitmapswithanycolortable/depthUnusedresourcesareremovedbeforewritingouttheinstallerDocumented!errorand!warningAdded!echoand!verboseAddedforceoptionforCRCCheckUpdatedtoMakensisw1.6UpdatedtoInstallOptions1.2InstallercannowbecompressedusingUPXAhintisshownifalineislongerthanthedetailwindowModernstylefolderselectdialogLicensedatacannowbeRTFWindowIconisnowhandledinthecompilerRemoveddebugversion(itneverworkedanyway)Fastercompiletime(WIN32_LEAN_AND_MEAN)

Previous|Contents|Next

Previous|Contents|Next

F.802.0Alpha1ReleasedonJuly9th,2002

AddedexpandnodeoptiontoSectionandSubSectionAddedpreservefileattributeoptiontoFilecommandCopy-AllbugfixinMakensiswAddedNSISDIRtothedefinelistReorganizedNSISdirectorystructure

Previous|Contents|Next

Previous|Contents|Next

F.812.0Alpha0ReleasedonMay22nd,2002

TreeViewcomponentlist(careofJeffDoozan)NomoreSectionDivider,butSubSectionandSubSectionEnd.NomoreEnabledBitmap/DisabledBitmap,justCheckBitmap.(withtonsofbuttonstates)Bugfixesofbrokenness.Added!forSection/SubSectiontomakebold.Madeconfig.hhavehacksforeasierbuildingforme.:)

Previous|Contents|Next

Previous|Contents|Next

F.82OlderVersionsNSIS1.xversionhistory

Previous|Contents|Next

Previous|Contents|Next

AppendixG:BuildingNSISNSISversion2.07introducedanewbuildsystem,basedonSCons.ThebuildsystemcanbuildtheentireNSISpackagesoyounolongerneedtobuilditprojectbyproject.Itallowsbuildingusingseveralsimultaneousjobs,installationwithoutaninstalleronbothWindowsandPOSIXandeasycompilationwithdebuggingsymbols.

TheofficialreleaseisbuiltwithMSVC6ServicePack5(Mirror)withtheProcessorPackandtheFebruary2003PlatformSDK(5.2.3790.0).

BuildinginGeneralBuildingonWindowsBuildingonPOSIXNightlyBuilds

Previous|Contents|Next

Previous|Contents|Next

G.1BuildinginGeneralSourcecodeisavailableinSVNandasaseparatepackagewitheveryNSISdistribution.

TobuildNSIS,PythonandSConsmustbeinstalled.Currently,thesupportedversionofSConsisversion1.2.0andabove.AnyversionofPythonabove1.6issupported.

NSISusesthezlibcompressionlibrary.Asaconsequencetheheaderandlibraryfilesofzlibmustbeinstalled.

Incasethesezlibdevelopmentfilesaren'tpresentthentheycouldbeinstalledviaapackagemanager(apt-get,aptitude,rpm,yum)onPOSIXplatforms.Anotheroptionistobuildzlibfromscratchandinstallit.

ForWindowsitisrecommendedtodownloadzlibfromhttp://nsis.sf.net/Zlib.Extractthecontentsofthisziparchivetoafolderofyourchoice,e.g.C:\dev\zlib-1.2.7andsetanenvironmentvariablenamedZLIB_W32containingthispath.

C:\>setZLIB_W32=C:\dev\zlib-1.2.7

AlternativelythecommandlineoptionZLIB_W32specifyingthepathcanbepassedtosconsinsteadoftheenvironmentvariable.

C:\dev\nsis>sconsZLIB_W32=C:\dev\zlib-1.2.7

Theheaderandlibraryfilesareassumedtobein%ZLIB_W32%.Inadditionsconschecksforzlibheaderfilesin%ZLIB_W32%\include,theimportlibraryzdll.libin%ZLIB_W32%\libandthedynamiclinklibraryzlib1.dllin%ZLIB_W32%respectively%ZLIB_W32%\lib.

Tobuild,openaconsole,changetheworkingdirectorytotherootdirectoryofNSISandtypescons.That'sit.Forexample:

C:\>cddev\nsisC:\dev\nsis>scons

scons:ReadingSConscriptfiles...UsingMicrosofttoolsconfigurationCheckingformain()inClibrarygdi32...(cached)yesCheckingformain()inClibraryuser32...(cached)yesCheckingformain()inClibraryversion...(cached)yesCheckingformain()inClibrarypthread...(cached)noCheckingformain()inClibrarystdc++...(cached)noCheckingformain()inClibraryiconv...(cached)noCheckingformain()inClibrarylibiconv...(cached)noscons:donereadingSConscriptfiles.scons:Buildingtargets......

Toinstallthebuiltfiles,type:

sconsPREFIX="C:\ProgramFiles\NSIS"install

Tocreateaninstaller(onlyonWindows),type:

sconsdist-installer

Tocreateadistributionzipfile,type:

sconsdist-zip

Tocreateboth,type:

sconsdist

Togetacompletelistofoptionsthatthebuildsystemhastooffer,type:

scons-h

TogetacompletelistofoptionsSConshastooffer,type:

scons-H

Previous|Contents|Next

Previous|Contents|Next

G.2BuildingonWindowsSConswillautomaticallydetectMicrosoftVisualC++.IfyouarelookingforafreecompilertocompileNSIS,werecommendMicrosoftVisualC++2005ExpressEdition.

WhenusingtheMicrosoftVisualC++Toolkit2003,addMSTOOLKIT=yestothebuildcommandline:

sconsMSTOOLKIT=yes

IncaseoferrorsaboutthecompilerorthePlatformSDKnotbeingfound,use:

setMSSDK=C:\Path\To\PlatformSDKsetVCToolkitInstallDir=C:\Path\To\VCToolkitsconsMSTOOLKIT=yes

Theopen-sourceMinGWcanalsobeusedtoforbuildingbutthisresultsinnoticeablylargerinstallers.BorlandC++orOpenWatcomC/C++mightalsowork,buthaven'tbeentested.

TocompilethedocumentationasaCHMfile,hhc.exemustbeinthePATH.ItisavailableaspartofHTMLHelpWorkshop.

TobuildNSISMenu,installwxWidgets2.8,createanenvironmentvariablenamedWXWINcontainingthepathtotheinstallationdirectoryofwxWidgets,runContrib\NSISMenu\wx\wxbuild.batandbuildNSISasusual.

ImportantnotesforMicrosoftVisualC++6.0users:The2003PlatformSDKmustbeinstalledbeforebuilding,youcandownloadithereororderitonCD.BecauseofflawsinthelibrariesdistributedwithMicrosoftVisualC++6.0,notinstallingthePlatformSDKwillresultincrasheswhenusingtheCopyFilescommand.Seethisforumtopicformoreinformation.InstallingtheProcessorPackishighlyrecommendedtodecreasethesizeoftheinstalleroverhead.

ImportantnoteforMicrosoftVisualC++2012users:InstallersgeneratedusingthisreleaseandbeyondwillnotbeabletorunonWindows9xorWindows2000.Theminimumrequirementfor2012isWindowsXP.

Previous|Contents|Next

Previous|Contents|Next

G.3BuildingonPOSIXAsofNSIS2.01,thecompiler,makensis,alsocompilesonPOSIXplatforms.POSIXplatformsincludeLinux,*BSD,MacOSXandothers.SincethegeneratedinstallerwilleventuallyrunonWindows,across-compilerisneededinordertocompilethem.

ThecommandlineoptionXGCC_W32_PREFIXcouldbeusedtoexplicitlyselectaspecificwin32targetedcrosscompiler.ThevalueofXGCC_W32_PREFIXhastobetheprefixofthetoolchain.ForexampleXGCC_W32_PREFIX=i686-w64-mingw32-woulddeploythewin32targetedMinGW-w64crosscompilerifitisavailableonthebuildsystem.

Ifnocross-compilerisavailable,usethefollowing:

sconsSKIPSTUBS=allSKIPPLUGINS=allSKIPUTILS=allSKIPMISC=allNSIS_CONFIG_CONST_DATA_PATH=noPREFIX=/path/to/extracted/zipinstall-compiler

sconsNSIS_CONFIG_CONST_DATA_PATH=noPREFIX=/path/to/extracted/zip/path/to/extracted/zip/LibraryLocal

Thisshouldonlybuildmakensisandinstallittothedirectorywhereaprecompiledpackage,suchasthenightlybuildorazippedreleaseversion(nsis-x.xx.zip),isextracted.Notethattheinorderforthistowork,theprecompiledpackagemustbecompiledusingtheexactsamesourcesasmakensis.Inparticular,Source\exehead\config.h,theoptionspassedtosconsandSource\exehead\fileform.hmustbeidentical.Nightlybuildsandzippedreleaseversionsarebuiltwiththedefaultoptions.

TobuildanativeversionofNSISMenu,installwxWidgets2.8andbuildasusual.wx-configmustbeinthepath.

Previous|Contents|Next

Previous|Contents|Next

G.4NightlyBuildsThereisnoneedtomanuallybuildthelatestSVNversionforWindows.Anightlybuildisavailable.Thenightlybuildisautomaticallygeneratedeverynight,usingthelatestversionofthesourcecodefromSVN.Thereisnoofficialnightlybuildforotherplatforms.

Previous|Contents|Next

Previous|Contents|Next

AppendixH:CreditsProgrammersTestersDesignersTranslatorsWriters

Previous|Contents|Next

Previous|Contents|Next

H.1ProgrammersJustinFrankelaka0xDEADBEEF

CreatingtheallmightyNSIS

Amir"makemestop"SzekelyakaKiCHiK

MultilingualNSISRTFlicensetextThenewpagingsystemFullcolorsupportforiconsandbitmapsBrandingimageCustomizableUIOnemakensis.exeforbothzlibandbzip2

JoostVerburg

ModernUserInterfaceNSISwebsiteNSISMenuSystemforDLL/TLBlibrarysetupNSISUpdateforNSISdistribution(originalversionbyNathanPurciful)

RobertRainwater

MakeNSISWNewdocumentationformatEnhancingtheTreeViewReorganizingNSISdirectorystructure

Dave"bit-by-bit"Laundonakaeccles

Massiveoptimizing

XimonEighteenakaSunjammer

Thenewplug-inssystem

"Copytoclipboard"contextmenufortheDetailswindowLicensetextinitialfocus

RamonakaRamon18

VersioninformationresourcecommandsNameduservariablesLotsofUIfixesInstallOptionsimprovements

JimPark

Unicodesupport

OlivierMarcouxakaWizou

Unicodemerge

nnop@newmail.ru

RyanGeiss

AndrasVarga

DrewDavidson

PeterWindridge

YaroslavFaybishenko

JeffDoozan

NSIS2'snewTreeView

Nike(nike@sendmail.ru)

HTMLHelpsupportforHalibut

DiegoPedrosoakadeguix

NewNSISWiki

ShengaltsAleksanderakaInstructor

StuartWelchakaAfrowUK

DavidWeissakaComm@nder21

AndersKjersem

NSIS3patronsaint64-bitsupportUnicodemerge&supportNSIS3POSIXsupport

Previous|Contents|Next

Previous|Contents|Next

H.2TestersJasonRossakaJasonFriday13

NSIS3POSIXsupport

Previous|Contents|Next

Previous|Contents|Next

H.3DesignersNikosAdamamas

Thenewmodernicons

JanT.Sott/whyEye.org

Lotsoficonsandcheckmarks

Previous|Contents|Next

Previous|Contents|Next

H.4TranslatorsAlbanian-BesnikBleta

Afrikaans-FriedelWolff

Arabic-asdfuae,RamiKattan

Armenian-HrantOhanyan

Asturian-Marcos(marcoscostales@gmail.com)

Basque-IñakiSanVicente

Belarusian-SitnikovVjacheslav

Bosnian-SalihCAVKIC

Breton-KorvigelloùAnDrouizig

Bulgarian-AsparouhKalyandjiev,PlamenPenkov

Catalan-falanko

Chinese(Simplified)-KiiAli

Chinese(Traditional)-KiiAli,WalterCheuk

Corsican-PatriccolludiSantaMariaèSichè

Croatian-IgorOstriz,Vedran"RIV@NVX"Miletic

Czech-T.V.Zuggy,SELiCE

Danish-Christopher,CasperBergenstoff,ClausFuttrup

Dutch-HendriAdriaens,JoostVerburg

Esperanto-FelipeCastro

Estonian-izzo

Farsi-MasoudAlinaqian,FzerorubigD,ElnazSarbar

Finnish-AKX,Eclipser

French-veekee,SebastienDelahaye,JeromeCharaoui

Galician-RamonFlores

Georgian-DavidHuriev

German-L.King,K.Windszus,R.Bisswanger,M.Simmack,TimKosse

Greek-MakidisN.Michael

Hebrew-AmirSzekely(akaKiCHiK),YaronShahrabani

Hungarian-Soft-TransBt.,JozsefTamasHerczeg,LajosMolnar(Orfanik)

Icelandic-GretarOrriKristinsson

Indonesian-ariel825010106

Italian-Orfanik,sanface,AlessandroStaltari,LorenzoBevilacqua

Japanese-Dnanako,TakahiroYoshimura

Khmer-yisophally

Korean-dTomoyo,linak,koder

Kurdish-ErdalRonahi

Latvian-ValdisGriíis,KristapsMeòìelis

Lithuanian-NorCis,VytautasKrivickas,DanieliusScepanskis

Luxembourgish-JoHoeser

Macedonian-SaskoZdravkin

Mongolian-BayarsaikhanEnkhtaivan

Norwegian-JonasChristofferLindstrom,JanIvarBeddari

NorwegianNynorsk-VebjørnSture

Pashto-Pakhtosoft

Polish-PiotrMurawski,RafałLampe,cube,SYSTEMsoftGroup,MarekStępień,MateuszGola,PawełPorwisz

Portuguese-DragonSoull,Dre',Ramon

PortugueseBrasil-LayoutdoBrasil,deguix

Romanian-SorinSbarnea,CristianPirvu,GeorgeRadu,VladRusu

Russian-Sergey`Timon`Kusnetsov,NikMedved,Scam,THRaSH,DmitryYerokhin

Serbian-SrdjanObucina

SerbianLatin-SrdjanObucina,VladanObradovic

Slovak-trace,Kypec,MariánHikaník

Slovenian-JanezDolinar,MartinSebotnjak

Spanish-MoNKi,LoboLunar,DarwinRodrigoToledoCáceres

Swedish-PeterGustafsson,MagnusBonnevier,RickardAngbratt

Thai-SoKoOLz,TuW@nNu(asdfuae)

Turkish-BertanKodamanoglu,CagatayDilsiz,FatihBOY

Ukrainian-YuriHolubow,Nash-Soft

Uzbek-EmilGaripov(emil.garipov@gmail.com)

Valencian-BernardoArlandisMañó

Vietnamese-ClytieSiddall

Welsh-RhoslynPrys,Meddal.com

Previous|Contents|Next

Previous|Contents|Next

H.5WritersSebastianArmbrustakaflizebogen

Tutorial

Previous|Contents|Next

Previous|Contents|Next

AppendixI:LicenseCopyrightApplicablelicenseszlib/libpnglicensebzip2licenseCommonPublicLicenseversion1.0SpecialexceptionforLZMAcompressionmodule

Previous|Contents|Next

Previous|Contents|Next

I.1CopyrightCopyright(C)1999-2017Contributors

Moredetailedcopyrightinformationcanbefoundintheindividualsourcecodefiles.

Previous|Contents|Next

Previous|Contents|Next

I.2ApplicablelicensesAllNSISsourcecode,plug-ins,documentation,examples,headerfilesandgraphics,withtheexceptionofthecompressionmodulesandwhereotherwisenoted,arelicensedunderthezlib/libpnglicense.ThezlibcompressionmoduleforNSISislicensedunderthezlib/libpnglicense.Thebzip2compressionmoduleforNSISislicensedunderthebzip2license.ThelzmacompressionmoduleforNSISislicensedundertheCommonPublicLicenseversion1.0.

Previous|Contents|Next

Previous|Contents|Next

I.3zlib/libpnglicenseThissoftwareisprovided'as-is',withoutanyexpressorimpliedwarranty.Innoeventwilltheauthorsbeheldliableforanydamagesarisingfromtheuseofthissoftware.

Permissionisgrantedtoanyonetousethissoftwareforanypurpose,includingcommercialapplications,andtoalteritandredistributeitfreely,subjecttothefollowingrestrictions:

1. Theoriginofthissoftwaremustnotbemisrepresented;youmustnotclaimthatyouwrotetheoriginalsoftware.Ifyouusethissoftwareinaproduct,anacknowledgmentintheproductdocumentationwouldbeappreciatedbutisnotrequired.

2. Alteredsourceversionsmustbeplainlymarkedassuch,andmustnotbemisrepresentedasbeingtheoriginalsoftware.

3. Thisnoticemaynotberemovedoralteredfromanysourcedistribution.

Previous|Contents|Next

Previous|Contents|Next

I.4bzip2licenseRedistributionanduseinsourceandbinaryforms,withorwithoutmodification,arepermittedprovidedthatthefollowingconditionsaremet:

1. Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistofconditionsandthefollowingdisclaimer.

2. Theoriginofthissoftwaremustnotbemisrepresented;youmustnotclaimthatyouwrotetheoriginalsoftware.Ifyouusethissoftwareinaproduct,anacknowledgmentintheproductdocumentationwouldbeappreciatedbutisnotrequired.

3. Alteredsourceversionsmustbeplainlymarkedassuch,andmustnotbemisrepresentedasbeingtheoriginalsoftware.

4. Thenameoftheauthormaynotbeusedtoendorseorpromoteproductsderivedfromthissoftwarewithoutspecificpriorwrittenpermission.

THISSOFTWAREISPROVIDEDBYTHEAUTHOR``ASIS''ANDANYEXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALLTHEAUTHORBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENTOFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHISSOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

JulianSeward,Cambridge,UK.

jseward@acm.org

Previous|Contents|Next

Previous|Contents|Next

I.5CommonPublicLicenseversion1.0THEACCOMPANYINGPROGRAMISPROVIDEDUNDERTHETERMSOFTHISCOMMONPUBLICLICENSE("AGREEMENT").ANYUSE,REPRODUCTIONORDISTRIBUTIONOFTHEPROGRAMCONSTITUTESRECIPIENT'SACCEPTANCEOFTHISAGREEMENT.

1.DEFINITIONS

"Contribution"means:

a)inthecaseoftheinitialContributor,theinitialcodeanddocumentationdistributedunderthisAgreement,andb)inthecaseofeachsubsequentContributor:

i)changestotheProgram,and

ii)additionstotheProgram;

wheresuchchangesand/oradditionstotheProgramoriginatefromandaredistributedbythatparticularContributor.AContribution'originates'fromaContributorifitwasaddedtotheProgrambysuchContributoritselforanyoneactingonsuchContributor'sbehalf.ContributionsdonotincludeadditionstotheProgramwhich:(i)areseparatemodulesofsoftwaredistributedinconjunctionwiththeProgramundertheirownlicenseagreement,and(ii)arenotderivativeworksoftheProgram.

"Contributor"meansanypersonorentitythatdistributestheProgram.

"LicensedPatents"meanpatentclaimslicensablebyaContributorwhicharenecessarilyinfringedbytheuseorsaleofitsContributionaloneorwhencombinedwiththeProgram.

"Program"meanstheContributionsdistributedinaccordancewiththisAgreement.

"Recipient"meansanyonewhoreceivestheProgramunderthisAgreement,includingallContributors.

2.GRANTOFRIGHTS

a)SubjecttothetermsofthisAgreement,eachContributorherebygrantsRecipientanon-exclusive,worldwide,royalty-freecopyrightlicensetoreproduce,preparederivativeworksof,publiclydisplay,publiclyperform,distributeandsublicensetheContributionofsuchContributor,ifany,andsuchderivativeworks,insourcecodeandobjectcodeform.

b)SubjecttothetermsofthisAgreement,eachContributorherebygrantsRecipientanon-exclusive,worldwide,royalty-freepatentlicenseunderLicensedPatentstomake,use,sell,offertosell,importandotherwisetransfertheContributionofsuchContributor,ifany,insourcecodeandobjectcodeform.ThispatentlicenseshallapplytothecombinationoftheContributionandtheProgramif,atthetimetheContributionisaddedbytheContributor,suchadditionoftheContributioncausessuchcombinationtobecoveredbytheLicensedPatents.ThepatentlicenseshallnotapplytoanyothercombinationswhichincludetheContribution.Nohardwareperseislicensedhereunder.

c)RecipientunderstandsthatalthougheachContributorgrantsthelicensestoitsContributionssetforthherein,noassurancesareprovidedbyanyContributorthattheProgramdoesnotinfringethepatentorotherintellectualpropertyrightsofanyotherentity.EachContributordisclaimsanyliabilitytoRecipientforclaimsbroughtbyanyotherentitybasedoninfringementofintellectualpropertyrightsorotherwise.Asaconditiontoexercisingtherightsandlicensesgrantedhereunder,eachRecipientherebyassumessoleresponsibilitytosecureanyotherintellectualpropertyrightsneeded,ifany.Forexample,ifathirdpartypatentlicenseisrequiredtoallowRecipienttodistributetheProgram,itisRecipient'sresponsibilitytoacquirethatlicensebeforedistributingtheProgram.

d)EachContributorrepresentsthattoitsknowledgeithassufficientcopyrightrightsinitsContribution,ifany,tograntthecopyrightlicensesetforthinthisAgreement.

3.REQUIREMENTS

AContributormaychoosetodistributethePrograminobjectcodeformunderitsownlicenseagreement,providedthat:

a)itcomplieswiththetermsandconditionsofthisAgreement;and

b)itslicenseagreement:

i)effectivelydisclaimsonbehalfofallContributorsallwarrantiesandconditions,expressandimplied,includingwarrantiesorconditionsoftitleandnon-infringement,andimpliedwarrantiesorconditionsofmerchantabilityandfitnessforaparticularpurpose;

ii)effectivelyexcludesonbehalfofallContributorsallliabilityfordamages,includingdirect,indirect,special,incidentalandconsequentialdamages,suchaslostprofits;

iii)statesthatanyprovisionswhichdifferfromthisAgreementareofferedbythatContributoraloneandnotbyanyotherparty;and

iv)statesthatsourcecodefortheProgramisavailablefromsuchContributor,andinformslicenseeshowtoobtainitinareasonablemanneronorthroughamediumcustomarilyusedforsoftwareexchange.

WhentheProgramismadeavailableinsourcecodeform:

a)itmustbemadeavailableunderthisAgreement;and

b)acopyofthisAgreementmustbeincludedwitheachcopyoftheProgram.

ContributorsmaynotremoveoralteranycopyrightnoticescontainedwithintheProgram.

EachContributormustidentifyitselfastheoriginatorofitsContribution,ifany,inamannerthatreasonablyallowssubsequentRecipientstoidentifytheoriginatoroftheContribution.

4.COMMERCIALDISTRIBUTION

Commercialdistributorsofsoftwaremayacceptcertainresponsibilitieswithrespecttoendusers,businesspartnersandthelike.WhilethislicenseisintendedtofacilitatethecommercialuseoftheProgram,theContributorwhoincludesthePrograminacommercialproductoffering

shoulddosoinamannerwhichdoesnotcreatepotentialliabilityforotherContributors.Therefore,ifaContributorincludesthePrograminacommercialproductoffering,suchContributor("CommercialContributor")herebyagreestodefendandindemnifyeveryotherContributor("IndemnifiedContributor")againstanylosses,damagesandcosts(collectively"Losses")arisingfromclaims,lawsuitsandotherlegalactionsbroughtbyathirdpartyagainsttheIndemnifiedContributortotheextentcausedbytheactsoromissionsofsuchCommercialContributorinconnectionwithitsdistributionofthePrograminacommercialproductoffering.TheobligationsinthissectiondonotapplytoanyclaimsorLossesrelatingtoanyactualorallegedintellectualpropertyinfringement.Inordertoqualify,anIndemnifiedContributormust:a)promptlynotifytheCommercialContributorinwritingofsuchclaim,andb)allowtheCommercialContributortocontrol,andcooperatewiththeCommercialContributorin,thedefenseandanyrelatedsettlementnegotiations.TheIndemnifiedContributormayparticipateinanysuchclaimatitsownexpense.

Forexample,aContributormightincludethePrograminacommercialproductoffering,ProductX.ThatContributoristhenaCommercialContributor.IfthatCommercialContributorthenmakesperformanceclaims,orofferswarrantiesrelatedtoProductX,thoseperformanceclaimsandwarrantiesaresuchCommercialContributor'sresponsibilityalone.Underthissection,theCommercialContributorwouldhavetodefendclaimsagainsttheotherContributorsrelatedtothoseperformanceclaimsandwarranties,andifacourtrequiresanyotherContributortopayanydamagesasaresult,theCommercialContributormustpaythosedamages.

5.NOWARRANTY

EXCEPTASEXPRESSLYSETFORTHINTHISAGREEMENT,THEPROGRAMISPROVIDEDONAN"ASIS"BASIS,WITHOUTWARRANTIESORCONDITIONSOFANYKIND,EITHEREXPRESSORIMPLIEDINCLUDING,WITHOUTLIMITATION,ANYWARRANTIESORCONDITIONSOFTITLE,NON-INFRINGEMENT,MERCHANTABILITYORFITNESSFORAPARTICULARPURPOSE.EachRecipientissolelyresponsiblefordeterminingtheappropriatenessofusinganddistributingtheProgramandassumesallrisksassociated

withitsexerciseofrightsunderthisAgreement,includingbutnotlimitedtotherisksandcostsofprogramerrors,compliancewithapplicablelaws,damagetoorlossofdata,programsorequipment,andunavailabilityorinterruptionofoperations.

6.DISCLAIMEROFLIABILITY

EXCEPTASEXPRESSLYSETFORTHINTHISAGREEMENT,NEITHERRECIPIENTNORANYCONTRIBUTORSSHALLHAVEANYLIABILITYFORANYDIRECT,INDIRECT,INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDINGWITHOUTLIMITATIONLOSTPROFITS),HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEORDISTRIBUTIONOFTHEPROGRAMORTHEEXERCISEOFANYRIGHTSGRANTEDHEREUNDER,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES.

7.GENERAL

IfanyprovisionofthisAgreementisinvalidorunenforceableunderapplicablelaw,itshallnotaffectthevalidityorenforceabilityoftheremainderofthetermsofthisAgreement,andwithoutfurtheractionbythepartieshereto,suchprovisionshallbereformedtotheminimumextentnecessarytomakesuchprovisionvalidandenforceable.

IfRecipientinstitutespatentlitigationagainstaContributorwithrespecttoapatentapplicabletosoftware(includingacross-claimorcounterclaiminalawsuit),thenanypatentlicensesgrantedbythatContributortosuchRecipientunderthisAgreementshallterminateasofthedatesuchlitigationisfiled.Inaddition,ifRecipientinstitutespatentlitigationagainstanyentity(includingacross-claimorcounterclaiminalawsuit)allegingthattheProgramitself(excludingcombinationsoftheProgramwithothersoftwareorhardware)infringessuchRecipient'spatent(s),thensuchRecipient'srightsgrantedunderSection2(b)shallterminateasofthedatesuchlitigationisfiled.

AllRecipient'srightsunderthisAgreementshallterminateifitfailsto

complywithanyofthematerialtermsorconditionsofthisAgreementanddoesnotcuresuchfailureinareasonableperiodoftimeafterbecomingawareofsuchnoncompliance.IfallRecipient'srightsunderthisAgreementterminate,RecipientagreestoceaseuseanddistributionoftheProgramassoonasreasonablypracticable.However,Recipient'sobligationsunderthisAgreementandanylicensesgrantedbyRecipientrelatingtotheProgramshallcontinueandsurvive.

EveryoneispermittedtocopyanddistributecopiesofthisAgreement,butinordertoavoidinconsistencytheAgreementiscopyrightedandmayonlybemodifiedinthefollowingmanner.TheAgreementStewardreservestherighttopublishnewversions(includingrevisions)ofthisAgreementfromtimetotime.NooneotherthantheAgreementStewardhastherighttomodifythisAgreement.IBMistheinitialAgreementSteward.IBMmayassigntheresponsibilitytoserveastheAgreementStewardtoasuitableseparateentity.EachnewversionoftheAgreementwillbegivenadistinguishingversionnumber.TheProgram(includingContributions)mayalwaysbedistributedsubjecttotheversionoftheAgreementunderwhichitwasreceived.Inaddition,afteranewversionoftheAgreementispublished,ContributormayelecttodistributetheProgram(includingitsContributions)underthenewversion.ExceptasexpresslystatedinSections2(a)and2(b)above,RecipientreceivesnorightsorlicensestotheintellectualpropertyofanyContributorunderthisAgreement,whetherexpressly,byimplication,estoppelorotherwise.AllrightsintheProgramnotexpresslygrantedunderthisAgreementarereserved.

ThisAgreementisgovernedbythelawsoftheStateofNewYorkandtheintellectualpropertylawsoftheUnitedStatesofAmerica.NopartytothisAgreementwillbringalegalactionunderthisAgreementmorethanoneyearafterthecauseofactionarose.Eachpartywaivesitsrightstoajurytrialinanyresultinglitigation.

Previous|Contents|Next

Previous|Contents|Next

I.6SpecialexceptionforLZMAcompressionmoduleIgorPavlovandAmirSzekely,theauthorsoftheLZMAcompressionmoduleforNSIS,expresslypermityoutostaticallyordynamicallylinkyourcode(orbindbyname)tothefilesfromtheLZMAcompressionmoduleforNSISwithoutsubjectingyourlinkedcodetothetermsoftheCommonPubliclicenseversion1.0.AnymodificationsoradditionstofilesfromtheLZMAcompressionmoduleforNSIS,however,aresubjecttothetermsoftheCommonPublicLicenseversion1.0.

Previous|Contents|Next

Previous|Contents|Next

Previous|Contents|Next