summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2018-03-31 20:38:44 +0200
committerDidier Raboud <odyx@debian.org>2018-03-31 20:38:44 +0200
commitfe5eccc476c65971449791086ac97473549b95d2 (patch)
tree4dfab9d147fb270850bc6c7f77670bff7ac6a72c
parente4d2f9992bc72368b0b1f439b32c169142209b0b (diff)
Import Upstream version 3.02.1
-rwxr-xr-x.travis.yml27
-rwxr-xr-xCOPYING2
-rwxr-xr-xChangeLog837
-rwxr-xr-xContrib/ExDLL/nsis_tchar.h2
-rwxr-xr-xContrib/InstallOptions/Readme.html2
-rwxr-xr-xContrib/LangDLL/LangDLL.c30
-rwxr-xr-xContrib/Language files/Afrikaans.nlf8
-rwxr-xr-xContrib/Language files/Albanian.nlf8
-rwxr-xr-xContrib/Language files/Arabic.nlf8
-rwxr-xr-xContrib/Language files/Armenian.nlf2
-rwxr-xr-xContrib/Language files/Asturian.nlf8
-rwxr-xr-xContrib/Language files/Basque.nlf8
-rwxr-xr-xContrib/Language files/Basque.nsh8
-rwxr-xr-xContrib/Language files/Belarusian.nlf8
-rwxr-xr-xContrib/Language files/Bosnian.nlf8
-rwxr-xr-xContrib/Language files/Breton.nlf8
-rwxr-xr-xContrib/Language files/Bulgarian.nlf2
-rwxr-xr-xContrib/Language files/Catalan.nlf8
-rwxr-xr-xContrib/Language files/Cibemba.nlf8
-rwxr-xr-xContrib/Language files/Corsican.nlf8
-rwxr-xr-xContrib/Language files/Croatian.nlf8
-rwxr-xr-xContrib/Language files/Czech.nlf10
-rwxr-xr-xContrib/Language files/Danish.nlf8
-rwxr-xr-xContrib/Language files/Dutch.nlf8
-rwxr-xr-xContrib/Language files/Efik.nlf10
-rwxr-xr-xContrib/Language files/English.nlf8
-rwxr-xr-xContrib/Language files/Esperanto.nlf10
-rwxr-xr-xContrib/Language files/Estonian.nlf8
-rwxr-xr-xContrib/Language files/Farsi.nlf2
-rwxr-xr-xContrib/Language files/Finnish.nlf8
-rwxr-xr-xContrib/Language files/French.nlf8
-rwxr-xr-xContrib/Language files/French.nsh4
-rwxr-xr-xContrib/Language files/Galician.nlf8
-rwxr-xr-xContrib/Language files/Georgian.nlf8
-rwxr-xr-xContrib/Language files/German.nlf8
-rwxr-xr-xContrib/Language files/Greek.nlf8
-rwxr-xr-xContrib/Language files/Hebrew.nlf2
-rwxr-xr-xContrib/Language files/Hungarian.nlf8
-rwxr-xr-xContrib/Language files/Icelandic.nlf8
-rwxr-xr-xContrib/Language files/Igbo.nlf8
-rwxr-xr-xContrib/Language files/Indonesian.nlf16
-rwxr-xr-xContrib/Language files/Irish.nlf8
-rwxr-xr-xContrib/Language files/Italian.nlf8
-rwxr-xr-xContrib/Language files/Japanese.nlf8
-rwxr-xr-xContrib/Language files/Khmer.nlf8
-rwxr-xr-xContrib/Language files/Korean.nlf8
-rwxr-xr-xContrib/Language files/Kurdish.nlf8
-rwxr-xr-xContrib/Language files/Latvian.nlf8
-rwxr-xr-xContrib/Language files/Lithuanian.nlf8
-rwxr-xr-xContrib/Language files/Luxembourgish.nlf8
-rwxr-xr-xContrib/Language files/Macedonian.nlf8
-rwxr-xr-xContrib/Language files/Malagasy.nlf8
-rwxr-xr-xContrib/Language files/Malay.nlf10
-rwxr-xr-xContrib/Language files/Mongolian.nlf8
-rwxr-xr-xContrib/Language files/Norwegian.nlf8
-rwxr-xr-xContrib/Language files/NorwegianNynorsk.nlf8
-rwxr-xr-xContrib/Language files/Pashto.nlf8
-rwxr-xr-xContrib/Language files/Pashto.nsh5
-rwxr-xr-xContrib/Language files/Polish.nlf8
-rwxr-xr-xContrib/Language files/Portuguese.nlf8
-rwxr-xr-xContrib/Language files/PortugueseBR.nlf8
-rwxr-xr-xContrib/Language files/Romanian.nlf8
-rwxr-xr-xContrib/Language files/Romanian.nsh5
-rwxr-xr-xContrib/Language files/Russian.nlf2
-rwxr-xr-xContrib/Language files/ScotsGaelic.nlf8
-rwxr-xr-xContrib/Language files/ScotsGaelic.nsh2
-rwxr-xr-xContrib/Language files/Serbian.nlf8
-rwxr-xr-xContrib/Language files/SerbianLatin.nlf8
-rwxr-xr-xContrib/Language files/SimpChinese.nlf11
-rwxr-xr-xContrib/Language files/SimpChinese.nsh4
-rwxr-xr-xContrib/Language files/Slovak.nlf8
-rwxr-xr-xContrib/Language files/Slovenian.nlf8
-rwxr-xr-xContrib/Language files/Spanish.nlf9
-rwxr-xr-xContrib/Language files/SpanishInternational.nlf8
-rwxr-xr-xContrib/Language files/Swahili.nlf10
-rwxr-xr-xContrib/Language files/Swedish.nlf8
-rwxr-xr-xContrib/Language files/Thai.nlf8
-rwxr-xr-xContrib/Language files/TradChinese.nlf100
-rwxr-xr-xContrib/Language files/TradChinese.nsh89
-rwxr-xr-xContrib/Language files/Turkish.nlf8
-rwxr-xr-xContrib/Language files/Ukrainian.nlf8
-rwxr-xr-xContrib/Language files/Uzbek.nlf2
-rwxr-xr-xContrib/Language files/Valencian.nlf8
-rwxr-xr-xContrib/Language files/Vietnamese.nlf8
-rwxr-xr-xContrib/Language files/Welsh.nlf10
-rwxr-xr-xContrib/Language files/Yoruba.nlf8
-rwxr-xr-xContrib/Library/LibraryLocal/LibraryLocal.cpp4
-rwxr-xr-xContrib/Library/RegTool/RegTool.c382
-rwxr-xr-xContrib/Library/RegTool/RegTool.cpp422
-rwxr-xr-xContrib/Library/RegTool/SConscript8
-rwxr-xr-xContrib/MakeLangId/MakeLangId.cpp8
-rwxr-xr-xContrib/Modern UI 2/License.txt2
-rwxr-xr-xContrib/Modern UI 2/MUI2.nsh15
-rwxr-xr-xContrib/Modern UI 2/Pages/Finish.nsh1
-rwxr-xr-xContrib/Modern UI 2/Pages/StartMenu.nsh2
-rwxr-xr-xContrib/Modern UI 2/Pages/UninstallConfirm.nsh4
-rwxr-xr-xContrib/Modern UI 2/Pages/Welcome.nsh1
-rwxr-xr-xContrib/Modern UI 2/Readme.html13
-rwxr-xr-xContrib/Modern UI/License.txt2
-rwxr-xr-xContrib/Modern UI/Readme.html6
-rwxr-xr-xContrib/Modern UI/System.nsh13
-rwxr-xr-xContrib/MultiUser/MultiUser.nsh11
-rwxr-xr-xContrib/MultiUser/Readme.html8
-rwxr-xr-xContrib/NSISdl/ReadMe.txt3
-rwxr-xr-xContrib/SubStart/substart.c2
-rwxr-xr-xContrib/System/Source/Call-amd64.S2
-rwxr-xr-xContrib/System/Source/Call.S2
-rwxr-xr-xContrib/System/Source/System.c2
-rwxr-xr-xContrib/System/System.html4
-rwxr-xr-xContrib/nsDialogs/example.nsi1
-rwxr-xr-xContrib/nsDialogs/timer.nsi1
-rwxr-xr-xContrib/nsExec/nsexec.c8
-rwxr-xr-xDocs/src/SConscript18
-rwxr-xr-xDocs/src/attributes.but2
-rwxr-xr-xDocs/src/basic.but29
-rwxr-xr-xDocs/src/compiler.but10
-rwxr-xr-xDocs/src/compilerflags.but4
-rwxr-xr-xDocs/src/config.but2
-rwxr-xr-xDocs/src/credits.but8
-rwxr-xr-xDocs/src/flowcontrol.but2
-rwxr-xr-xDocs/src/history.but54
-rwxr-xr-xDocs/src/langs.but2
-rwxr-xr-xDocs/src/misc.but2
-rwxr-xr-xDocs/src/registry.but37
-rwxr-xr-xDocs/src/tutorial.but2
-rwxr-xr-xDocs/src/ui.but2
-rwxr-xr-xDocs/src/usefulinfos.but2
-rwxr-xr-xDocs/src/var.but4
-rwxr-xr-xExamples/Modern UI/MultiLanguage.nsi2
-rwxr-xr-xExamples/bigtest.nsi1
-rwxr-xr-xExamples/makensis.nsi29
-rwxr-xr-xInclude/LangFile.nsh2
-rwxr-xr-xInclude/Library.nsh6
-rwxr-xr-xInclude/UpgradeDLL.nsh18
-rwxr-xr-xInclude/VB6RunTime.nsh2
-rwxr-xr-xInclude/Win/COM.nsh34
-rwxr-xr-xInclude/WinVer.nsh3
-rwxr-xr-xMenu/images/header.gifbin20045 -> 20119 bytes
-rwxr-xr-xREADME.md11
-rwxr-xr-xSConstruct16
-rwxr-xr-xSource/7zip/7zGuids.cpp2
-rwxr-xr-xSource/7zip/7zip/Common/InBuffer.cpp2
-rwxr-xr-xSource/7zip/7zip/Common/InBuffer.h2
-rwxr-xr-xSource/7zip/7zip/Common/OutBuffer.cpp2
-rwxr-xr-xSource/7zip/7zip/Common/OutBuffer.h2
-rwxr-xr-xSource/7zip/7zip/Common/StreamUtils.cpp2
-rwxr-xr-xSource/7zip/7zip/Common/StreamUtils.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTree.h4
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTree2.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTree3.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTree3Z.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTree3ZMain.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTree4.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTree4b.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTreeMF.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTreeMFMain.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/BinTree/BinTreeMain.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/IMatchFinder.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/LZInWindow.cpp2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/LZInWindow.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/LZOutWindow.cpp2
-rwxr-xr-xSource/7zip/7zip/Compress/LZ/LZOutWindow.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZMA/LZMA.h2
-rwxr-xr-xSource/7zip/7zip/Compress/LZMA/LZMAEncoder.cpp2
-rwxr-xr-xSource/7zip/7zip/Compress/LZMA/LZMAEncoder.h2
-rwxr-xr-xSource/7zip/7zip/Compress/RangeCoder/RangeCoder.h2
-rwxr-xr-xSource/7zip/7zip/Compress/RangeCoder/RangeCoderBit.cpp2
-rwxr-xr-xSource/7zip/7zip/Compress/RangeCoder/RangeCoderBit.h2
-rwxr-xr-xSource/7zip/7zip/Compress/RangeCoder/RangeCoderBitTree.h2
-rwxr-xr-xSource/7zip/7zip/Compress/RangeCoder/RangeCoderOpt.h2
-rwxr-xr-xSource/7zip/7zip/ICoder.h2
-rwxr-xr-xSource/7zip/7zip/IStream.h2
-rwxr-xr-xSource/7zip/Common/Alloc.cpp2
-rwxr-xr-xSource/7zip/Common/Alloc.h2
-rwxr-xr-xSource/7zip/Common/CRC.cpp2
-rwxr-xr-xSource/7zip/Common/CRC.h2
-rwxr-xr-xSource/7zip/Common/Defs.h2
-rwxr-xr-xSource/7zip/Common/MyCom.h2
-rwxr-xr-xSource/7zip/Common/MyGuidDef.h2
-rwxr-xr-xSource/7zip/Common/MyUnknown.h2
-rwxr-xr-xSource/7zip/Common/MyWindows.h2
-rwxr-xr-xSource/7zip/Common/StdAfx.h2
-rwxr-xr-xSource/7zip/Common/Types.h2
-rwxr-xr-xSource/7zip/LZMADecode.c2
-rwxr-xr-xSource/7zip/LZMADecode.h2
-rwxr-xr-xSource/DialogTemplate.cpp2
-rwxr-xr-xSource/DialogTemplate.h2
-rwxr-xr-xSource/Platform.h17
-rwxr-xr-xSource/Plugins.cpp2
-rwxr-xr-xSource/Plugins.h2
-rwxr-xr-xSource/ResourceEditor.cpp2
-rwxr-xr-xSource/ResourceEditor.h2
-rwxr-xr-xSource/ResourceVersionInfo.cpp2
-rwxr-xr-xSource/ResourceVersionInfo.h2
-rwxr-xr-xSource/SConscript1
-rwxr-xr-xSource/ShConstants.cpp2
-rwxr-xr-xSource/ShConstants.h2
-rwxr-xr-xSource/afxres.h2
-rwxr-xr-xSource/build.cpp188
-rwxr-xr-xSource/build.h116
-rwxr-xr-xSource/bzip2/blocksort.c2
-rwxr-xr-xSource/bzip2/bzlib.c2
-rwxr-xr-xSource/bzip2/bzlib.h2
-rwxr-xr-xSource/bzip2/compress.c2
-rwxr-xr-xSource/bzip2/decompress.c2
-rwxr-xr-xSource/bzip2/huffman.c2
-rwxr-xr-xSource/cbzip2.h2
-rwxr-xr-xSource/clzma.cpp2
-rwxr-xr-xSource/clzma.h2
-rwxr-xr-xSource/compressor.h2
-rwxr-xr-xSource/crc32.c2
-rwxr-xr-xSource/crc32.h2
-rwxr-xr-xSource/czlib.h2
-rwxr-xr-xSource/dirreader.cpp2
-rwxr-xr-xSource/dirreader.h2
-rwxr-xr-xSource/exehead/Main.c28
-rwxr-xr-xSource/exehead/Ui.c34
-rwxr-xr-xSource/exehead/afxres.h2
-rwxr-xr-xSource/exehead/api.h37
-rwxr-xr-xSource/exehead/bgbg.c2
-rwxr-xr-xSource/exehead/components.c2
-rwxr-xr-xSource/exehead/components.h2
-rwxr-xr-xSource/exehead/config.h2
-rwxr-xr-xSource/exehead/exec.c157
-rwxr-xr-xSource/exehead/exec.h2
-rwxr-xr-xSource/exehead/fileform.c2
-rwxr-xr-xSource/exehead/fileform.h37
-rwxr-xr-xSource/exehead/lang.h2
-rwxr-xr-xSource/exehead/plugin.c2
-rwxr-xr-xSource/exehead/plugin.h2
-rwxr-xr-xSource/exehead/state.h2
-rwxr-xr-xSource/exehead/ui.h2
-rwxr-xr-xSource/exehead/util.c141
-rwxr-xr-xSource/exehead/util.h32
-rwxr-xr-xSource/fileform.cpp2
-rwxr-xr-xSource/fileform.h2
-rwxr-xr-xSource/growbuf.cpp2
-rwxr-xr-xSource/growbuf.h2
-rwxr-xr-xSource/icon.cpp2
-rwxr-xr-xSource/icon.h2
-rwxr-xr-xSource/lang.cpp24
-rwxr-xr-xSource/lang.h2
-rwxr-xr-xSource/lineparse.cpp29
-rwxr-xr-xSource/lineparse.h3
-rwxr-xr-xSource/makenssi.cpp20
-rwxr-xr-xSource/manifest.cpp9
-rwxr-xr-xSource/manifest.h4
-rwxr-xr-xSource/mmap.cpp2
-rwxr-xr-xSource/mmap.h2
-rwxr-xr-xSource/script.cpp1793
-rwxr-xr-xSource/scriptpp.cpp1233
-rwxr-xr-xSource/strlist.cpp2
-rwxr-xr-xSource/strlist.h2
-rwxr-xr-xSource/tchar.h2
-rwxr-xr-xSource/tokens.cpp50
-rwxr-xr-xSource/tokens.h6
-rwxr-xr-xSource/tstring.cpp2
-rwxr-xr-xSource/tstring.h2
-rwxr-xr-xSource/uservars.h2
-rwxr-xr-xSource/utf.cpp8
-rwxr-xr-xSource/utf.h2
-rwxr-xr-xSource/util.cpp30
-rwxr-xr-xSource/util.h16
-rwxr-xr-xSource/validateunicode.cpp2
-rwxr-xr-xSource/validateunicode.h2
-rwxr-xr-xSource/winchar.cpp2
-rwxr-xr-xSource/winchar.h2
-rwxr-xr-xSource/writer.cpp2
-rwxr-xr-xSource/writer.h2
-rwxr-xr-xSource/zlib/INFBLOCK.C2
-rwxr-xr-xSource/zlib/ZCONF.H2
-rwxr-xr-xSource/zlib/ZLIB.H2
-rwxr-xr-xSource/zlib/ZUTIL.H3
273 files changed, 4324 insertions, 2822 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100755
index 0000000..803e644
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,27 @@
+language: cpp
+compiler:
+- gcc
+os:
+- linux
+- osx
+before_install:
+- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get install scons mingw32 mingw32-binutils zlib1g-dev libcppunit-dev; fi
+- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi
+- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install https://sourceforge.net/p/nsis/code/HEAD/tree/web-scripts/trunk/cppunit.rb?format=raw; fi
+- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install scons mingw-w64 zlib; fi
+install:
+- wget -O /tmp/zlib.zip "https://downloads.sourceforge.net/project/libpng/zlib/1.2.8/zlib128-dll.zip?r=&ts=1403402496&use_mirror=hivelocity"
+- mkdir /tmp/zlib
+- unzip /tmp/zlib.zip -d /tmp/zlib
+script:
+- scons ZLIB_W32=/tmp/zlib SKIPUTILS="NSIS Menu" NSIS_CONFIG_LOG=$CFG_LOG test dist-zip
+env:
+- CFG_LOG=yes
+- CFG_LOG=no
+deploy:
+ provider: script
+ script: echo this is where we will deploy to SF
+ on:
+ branch: master
+notifications:
+ slack: $SLACK_TOKEN
diff --git a/COPYING b/COPYING
index 07cda7a..7eaa663 100755
--- a/COPYING
+++ b/COPYING
@@ -1,7 +1,7 @@
COPYRIGHT
---------
-Copyright (C) 1999-2016 Contributors
+Copyright (C) 1999-2017 Contributors
More detailed copyright information can be found in the individual source code files.
diff --git a/ChangeLog b/ChangeLog
index 8c720a4..e9d6db7 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,840 @@
+2017-08-01 00:29 kichik
+
+ * /NSIS/tags/v3021: Tagging for release 3.02.1
+
+2017-08-01 00:29 kichik
+
+ * /NSIS/trunk/Menu/images/header.gif: 3.02.1
+
+2017-08-01 00:26 kichik
+
+ * /NSIS/trunk/Docs/src/history.but: 3.02.1
+
+2017-08-01 00:04 kichik
+
+ * /NSIS/trunk/Examples/Modern UI/MultiLanguage.nsi: include welcome
+ and finish pages to catch more errors
+
+2017-08-01 00:02 kichik
+
+ * /NSIS/trunk/Contrib/Language files/ScotsGaelic.nsh: escape quotes
+
+2017-07-31 17:44 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/TradChinese.nsh,
+ /NSIS/trunk/Docs/src/history.but: Fix Chinese (Traditional) (Bug
+ #1191)
+
+2017-07-24 21:38 anders_k
+
+ * /NSIS/trunk/Examples/makensis.nsi,
+ /NSIS/trunk/Source/scriptpp.cpp: Make sure we always install the
+ "native" RegTool binary.
+
+2017-07-24 11:38 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/Pashto.nsh,
+ /NSIS/trunk/Contrib/Language files/Romanian.nsh,
+ /NSIS/trunk/Contrib/Language files/TradChinese.nsh,
+ /NSIS/trunk/Docs/src/history.but: Fix translation files:
+ Romanian.nsh, TradChinese.nsh (bug #1189)
+
+2017-07-24 06:31 kichik
+
+ * /NSIS/tags/v302: Tagging for release 3.02
+
+2017-07-24 00:30 kichik
+
+ * /NSIS/tags/v302: rerelease 3.02 due to another vc6 issue...
+
+2017-07-24 00:28 kichik
+
+ * /NSIS/trunk/Source/exehead/exec.c: more vc6 weirdness
+
+2017-07-23 23:50 kichik
+
+ * /NSIS/tags/v302: Tagging for release 3.02
+
+2017-07-23 23:48 kichik
+
+ * /NSIS/trunk/Menu/images/header.gif: 3.02
+
+2017-07-23 23:45 kichik
+
+ * /NSIS/trunk/Examples/makensis.nsi: fix regtool path
+
+2017-07-23 23:38 kichik
+
+ * /NSIS/trunk/Docs/src/SConscript: improve hhc workaround
+
+2017-07-23 19:53 kichik
+
+ * /NSIS/trunk/Source/build.cpp, /NSIS/trunk/Source/build.h,
+ /NSIS/trunk/Source/script.cpp: vc6 build errors
+
+2017-07-23 19:11 kichik
+
+ * /NSIS/trunk/Docs/src/history.but: 3.02
+
+2017-07-17 21:44 anders_k
+
+ * /NSIS/trunk/Docs/src/compilerflags.but,
+ /NSIS/trunk/Source/tokens.cpp: Minor documentation fixes
+
+2017-06-24 19:28 anders_k
+
+ * /NSIS/trunk/Docs/src/ui.but,
+ /NSIS/trunk/Docs/src/usefulinfos.but: Removed outdated tidbits
+ from the documentation
+
+2017-06-23 12:59 anders_k
+
+ * /NSIS/trunk/Source/build.cpp, /NSIS/trunk/Source/exehead/api.h,
+ /NSIS/trunk/Source/exehead/exec.c: Logging build now prints
+ EW_SETFLAG changes
+
+2017-06-23 01:11 anders_k
+
+ * /NSIS/trunk/Docs/src/history.but, /NSIS/trunk/Docs/src/misc.but,
+ /NSIS/trunk/Docs/src/var.but, /NSIS/trunk/Source/build.cpp,
+ /NSIS/trunk/Source/exehead/util.c,
+ /NSIS/trunk/Source/manifest.cpp: $LocalAppData now resolves to
+ the ProgramData folder in the "SetShellVarContext all" context
+
+2017-06-19 22:01 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/Czech.nlf,
+ /NSIS/trunk/Docs/src/flowcontrol.but: Minor Czech translation fix
+ from the forum
+
+2017-06-15 18:58 anders_k
+
+ * /NSIS/trunk/Contrib/LangDLL/LangDLL.c,
+ /NSIS/trunk/Docs/src/var.but: Display English and German in
+ LangDLL if the codepage is 1250 (Bug #1185)
+
+2017-06-07 21:51 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/SimpChinese.nsh: Fixed minor
+ error in SimpChinese.nsh (Patch #283)
+
+2017-06-06 19:51 anders_k
+
+ * /NSIS/trunk/Contrib/System/Source/System.c,
+ /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Docs/src/registry.but,
+ /NSIS/trunk/Source/exehead/exec.c,
+ /NSIS/trunk/Source/exehead/fileform.h,
+ /NSIS/trunk/Source/exehead/util.c,
+ /NSIS/trunk/Source/exehead/util.h, /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/tokens.cpp: Added the HKCR32, HKCR64, HKCU32,
+ HKCU64, HKLM32 and HKLM64 root keys and the experimental HK*ANY
+ root keys.
+
+2017-06-06 02:03 anders_k
+
+ * /NSIS/branches/nsis2/Contrib/AdvSplash/advsplash.txt,
+ /NSIS/branches/nsis2/Contrib/ExDLL/exdll.c,
+ /NSIS/branches/nsis2/Contrib/InstallOptions/Readme.html,
+ /NSIS/branches/nsis2/Contrib/InstallOptions/test.ini,
+ /NSIS/branches/nsis2/Contrib/InstallOptions/testnotify.ini,
+ /NSIS/branches/nsis2/Contrib/Language files/Afrikaans.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Albanian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Arabic.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Arabic.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/Basque.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Basque.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/Belarusian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Bosnian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Breton.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Bulgarian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Catalan.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Croatian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Czech.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Danish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Danish.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/Dutch.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/English.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Esperanto.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Estonian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Farsi.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Finnish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/French.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Galician.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/German.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Greek.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Hebrew.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Hungarian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Icelandic.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Indonesian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Irish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Italian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Japanese.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Korean.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Kurdish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Latvian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Lithuanian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Luxembourgish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Macedonian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Malay.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Mongolian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Norwegian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Norwegian.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/NorwegianNynorsk.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/NorwegianNynorsk.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/Polish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Portuguese.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Portuguese.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/PortugueseBR.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/PortugueseBR.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/Romanian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Russian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Serbian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/SerbianLatin.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/SimpChinese.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Slovak.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Slovenian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Spanish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language
+ files/SpanishInternational.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Swedish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Swedish.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/Thai.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/TradChinese.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Turkish.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Ukrainian.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Ukrainian.nsh,
+ /NSIS/branches/nsis2/Contrib/Language files/Uzbek.nlf,
+ /NSIS/branches/nsis2/Contrib/Language files/Welsh.nlf,
+ /NSIS/branches/nsis2/Contrib/Math/Math.txt,
+ /NSIS/branches/nsis2/Contrib/Modern UI 2/Localization.nsh,
+ /NSIS/branches/nsis2/Contrib/Modern UI
+ 2/Pages/UninstallConfirm.nsh, /NSIS/branches/nsis2/Contrib/Modern
+ UI/System.nsh,
+ /NSIS/branches/nsis2/Contrib/MultiUser/MultiUser.nsh,
+ /NSIS/branches/nsis2/Contrib/MultiUser/Readme.html,
+ /NSIS/branches/nsis2/Contrib/NSIS Menu/nsismenu/nslinks.cpp,
+ /NSIS/branches/nsis2/Contrib/NSIS Menu/SConscript,
+ /NSIS/branches/nsis2/Contrib/NSISdl/ReadMe.txt,
+ /NSIS/branches/nsis2/Contrib/NSISdl/SConscript,
+ /NSIS/branches/nsis2/Contrib/Splash/splash.txt,
+ /NSIS/branches/nsis2/Contrib/StartMenu/Example.nsi,
+ /NSIS/branches/nsis2/Contrib/System/System.html,
+ /NSIS/branches/nsis2/Contrib/zip2exe/main.cpp,
+ /NSIS/branches/nsis2/Contrib/zip2exe/res.rc,
+ /NSIS/branches/nsis2/Docs/src/attributes.but,
+ /NSIS/branches/nsis2/Docs/src/basic.but,
+ /NSIS/branches/nsis2/Docs/src/callback.but,
+ /NSIS/branches/nsis2/Docs/src/compiler.but,
+ /NSIS/branches/nsis2/Docs/src/credits.but,
+ /NSIS/branches/nsis2/Docs/src/generalpurpose.but,
+ /NSIS/branches/nsis2/Docs/src/history.but,
+ /NSIS/branches/nsis2/Docs/src/langs.but,
+ /NSIS/branches/nsis2/Docs/src/misc.but,
+ /NSIS/branches/nsis2/Docs/src/script.but,
+ /NSIS/branches/nsis2/Docs/src/tutorial.but,
+ /NSIS/branches/nsis2/Docs/src/var.but,
+ /NSIS/branches/nsis2/Examples/bigtest.nsi,
+ /NSIS/branches/nsis2/Examples/example2.nsi,
+ /NSIS/branches/nsis2/Examples/makensis.nsi,
+ /NSIS/branches/nsis2/Examples/Modern UI/StartMenu.nsi,
+ /NSIS/branches/nsis2/Include/LogicLib.nsh,
+ /NSIS/branches/nsis2/Include/StrFunc.nsh,
+ /NSIS/branches/nsis2/Include/UpgradeDLL.nsh,
+ /NSIS/branches/nsis2/SCons/config.py,
+ /NSIS/branches/nsis2/SCons/Config/gnu,
+ /NSIS/branches/nsis2/SCons/Tools/crossmingw.py,
+ /NSIS/branches/nsis2/Scripts/release.py,
+ /NSIS/branches/nsis2/Source/7zip/7zip/Compress/LZ/BinTree/BinTree.h,
+ /NSIS/branches/nsis2/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.cpp,
+ /NSIS/branches/nsis2/Source/exehead/api.h,
+ /NSIS/branches/nsis2/Source/exehead/exec.c,
+ /NSIS/branches/nsis2/Source/exehead/fileform.c,
+ /NSIS/branches/nsis2/Source/exehead/fileform.h,
+ /NSIS/branches/nsis2/Source/exehead/Main.c,
+ /NSIS/branches/nsis2/Source/exehead/Ui.c,
+ /NSIS/branches/nsis2/Source/exehead/util.c,
+ /NSIS/branches/nsis2/Source/lang.cpp,
+ /NSIS/branches/nsis2/Source/makenssi.cpp,
+ /NSIS/branches/nsis2/Source/script.cpp,
+ /NSIS/branches/nsis2/Source/Tests/compression.cpp,
+ /NSIS/branches/nsis2/Source/tokens.cpp,
+ /NSIS/branches/nsis2/Source/tokens.h,
+ /NSIS/branches/nsis2/Source/util.cpp,
+ /NSIS/branches/nsis2/Source/util.h,
+ /NSIS/branches/nsis2/Source/zlib/ZUTIL.H,
+ /NSIS/branches/nsis2/TODO.txt: Backported some bugfixes from NSIS
+ 3
+
+2017-06-05 21:43 anders_k
+
+ * /NSIS/trunk/Source/exehead/util.c: Bring back optimized
+ mystrcpy(tmpbuf, _T("NUL")) from NSIS2
+
+2017-06-05 20:20 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/Afrikaans.nlf,
+ /NSIS/trunk/Contrib/Language files/Albanian.nlf,
+ /NSIS/trunk/Contrib/Language files/Arabic.nlf,
+ /NSIS/trunk/Contrib/Language files/Asturian.nlf,
+ /NSIS/trunk/Contrib/Language files/Basque.nlf,
+ /NSIS/trunk/Contrib/Language files/Belarusian.nlf,
+ /NSIS/trunk/Contrib/Language files/Bosnian.nlf,
+ /NSIS/trunk/Contrib/Language files/Breton.nlf,
+ /NSIS/trunk/Contrib/Language files/Catalan.nlf,
+ /NSIS/trunk/Contrib/Language files/Cibemba.nlf,
+ /NSIS/trunk/Contrib/Language files/Corsican.nlf,
+ /NSIS/trunk/Contrib/Language files/Croatian.nlf,
+ /NSIS/trunk/Contrib/Language files/Czech.nlf,
+ /NSIS/trunk/Contrib/Language files/Danish.nlf,
+ /NSIS/trunk/Contrib/Language files/Dutch.nlf,
+ /NSIS/trunk/Contrib/Language files/Efik.nlf,
+ /NSIS/trunk/Contrib/Language files/English.nlf,
+ /NSIS/trunk/Contrib/Language files/Esperanto.nlf,
+ /NSIS/trunk/Contrib/Language files/Estonian.nlf,
+ /NSIS/trunk/Contrib/Language files/Finnish.nlf,
+ /NSIS/trunk/Contrib/Language files/French.nlf,
+ /NSIS/trunk/Contrib/Language files/Galician.nlf,
+ /NSIS/trunk/Contrib/Language files/Georgian.nlf,
+ /NSIS/trunk/Contrib/Language files/German.nlf,
+ /NSIS/trunk/Contrib/Language files/Greek.nlf,
+ /NSIS/trunk/Contrib/Language files/Hungarian.nlf,
+ /NSIS/trunk/Contrib/Language files/Icelandic.nlf,
+ /NSIS/trunk/Contrib/Language files/Igbo.nlf,
+ /NSIS/trunk/Contrib/Language files/Indonesian.nlf,
+ /NSIS/trunk/Contrib/Language files/Irish.nlf,
+ /NSIS/trunk/Contrib/Language files/Italian.nlf,
+ /NSIS/trunk/Contrib/Language files/Japanese.nlf,
+ /NSIS/trunk/Contrib/Language files/Khmer.nlf,
+ /NSIS/trunk/Contrib/Language files/Korean.nlf,
+ /NSIS/trunk/Contrib/Language files/Kurdish.nlf,
+ /NSIS/trunk/Contrib/Language files/Latvian.nlf,
+ /NSIS/trunk/Contrib/Language files/Lithuanian.nlf,
+ /NSIS/trunk/Contrib/Language files/Luxembourgish.nlf,
+ /NSIS/trunk/Contrib/Language files/Macedonian.nlf,
+ /NSIS/trunk/Contrib/Language files/Malagasy.nlf,
+ /NSIS/trunk/Contrib/Language files/Malay.nlf,
+ /NSIS/trunk/Contrib/Language files/Mongolian.nlf,
+ /NSIS/trunk/Contrib/Language files/Norwegian.nlf,
+ /NSIS/trunk/Contrib/Language files/NorwegianNynorsk.nlf,
+ /NSIS/trunk/Contrib/Language files/Pashto.nlf,
+ /NSIS/trunk/Contrib/Language files/Polish.nlf,
+ /NSIS/trunk/Contrib/Language files/Portuguese.nlf,
+ /NSIS/trunk/Contrib/Language files/PortugueseBR.nlf,
+ /NSIS/trunk/Contrib/Language files/Romanian.nlf,
+ /NSIS/trunk/Contrib/Language files/ScotsGaelic.nlf,
+ /NSIS/trunk/Contrib/Language files/Serbian.nlf,
+ /NSIS/trunk/Contrib/Language files/SerbianLatin.nlf,
+ /NSIS/trunk/Contrib/Language files/SimpChinese.nlf,
+ /NSIS/trunk/Contrib/Language files/Slovak.nlf,
+ /NSIS/trunk/Contrib/Language files/Slovenian.nlf,
+ /NSIS/trunk/Contrib/Language files/Spanish.nlf,
+ /NSIS/trunk/Contrib/Language files/SpanishInternational.nlf,
+ /NSIS/trunk/Contrib/Language files/Swahili.nlf,
+ /NSIS/trunk/Contrib/Language files/Swedish.nlf,
+ /NSIS/trunk/Contrib/Language files/Thai.nlf,
+ /NSIS/trunk/Contrib/Language files/TradChinese.nlf,
+ /NSIS/trunk/Contrib/Language files/Turkish.nlf,
+ /NSIS/trunk/Contrib/Language files/Ukrainian.nlf,
+ /NSIS/trunk/Contrib/Language files/Valencian.nlf,
+ /NSIS/trunk/Contrib/Language files/Vietnamese.nlf,
+ /NSIS/trunk/Contrib/Language files/Welsh.nlf,
+ /NSIS/trunk/Contrib/Language files/Yoruba.nlf,
+ /NSIS/trunk/Source/lang.cpp: Add space between disk space value
+ and unit (Bug #1132)
+
+2017-06-05 01:01 anders_k
+
+ * /NSIS/trunk/Source/exehead/exec.c,
+ /NSIS/trunk/Source/exehead/Ui.c,
+ /NSIS/trunk/Source/exehead/util.c,
+ /NSIS/trunk/Source/exehead/util.h: Don't use ShellExecute, only
+ ShellExecuteEx
+
+2017-06-05 00:34 kichik
+
+ * /NSIS/trunk/README.md: add readme with build status
+ partly https://github.com/kichik/nsis/pull/1
+
+2017-06-04 22:48 anders_k
+
+ * /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Docs/src/tutorial.but, /NSIS/trunk/Source/build.cpp,
+ /NSIS/trunk/Source/exehead/api.h,
+ /NSIS/trunk/Source/exehead/exec.c,
+ /NSIS/trunk/Source/exehead/fileform.h,
+ /NSIS/trunk/Source/exehead/Main.c,
+ /NSIS/trunk/Source/exehead/util.c,
+ /NSIS/trunk/Source/exehead/util.h,
+ /NSIS/trunk/Source/makenssi.cpp, /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/tokens.cpp: Unsupported SetRegView mode must
+ fail all registry operations
+
+2017-06-03 02:56 anders_k
+
+ * /NSIS/trunk/.travis.yml, /NSIS/trunk/Source/makenssi.cpp,
+ /NSIS/trunk/Source/script.cpp, /NSIS/trunk/Source/utf.cpp,
+ /web-scripts/trunk/cppunit.rb: TravisCI OSX instance needs
+ cppunit v1.13.2
+
+2017-05-29 16:25 anders_k
+
+ * /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Source/exehead/exec.c, /NSIS/trunk/Source/Platform.h,
+ /NSIS/trunk/Source/script.cpp, /NSIS/trunk/Source/tokens.cpp,
+ /NSIS/trunk/Source/tokens.h: Added WriteRegNone
+
+2017-05-29 13:12 anders_k
+
+ * /NSIS/trunk/Source/script.cpp: SendMessage /TIMEOUT= parameter
+ should not be case-sensitive.
+
+2017-05-27 01:21 anders_k
+
+ * /NSIS/trunk/Include/Win/COM.nsh: Added IGameExplorer to COM.nsh
+
+2017-05-22 18:10 anders_k
+
+ * /NSIS/trunk/Docs/src/attributes.but,
+ /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Source/exehead/api.h,
+ /NSIS/trunk/Source/exehead/Main.c,
+ /NSIS/trunk/Source/exehead/Ui.c,
+ /NSIS/trunk/Source/exehead/util.c: Variables used in Caption can
+ now be set in .onGuiInit (RFE #539)
+
+2017-05-14 16:16 anders_k
+
+ * /NSIS/trunk/Contrib/Library/RegTool/RegTool.cpp,
+ /NSIS/trunk/Contrib/Library/RegTool/SConscript,
+ /NSIS/trunk/Include/Library.nsh,
+ /NSIS/trunk/Include/UpgradeDLL.nsh, /NSIS/trunk/SConstruct,
+ /NSIS/trunk/Source/build.cpp, /NSIS/trunk/Source/util.h: Include
+ CPU architecture in the RegTool filename so Library.nsh always
+ picks the correct version
+
+2017-05-12 00:19 anders_k
+
+ * /NSIS/trunk/Contrib/Library/RegTool/RegTool.c,
+ /NSIS/trunk/Contrib/Library/RegTool/RegTool.cpp,
+ /NSIS/trunk/Contrib/Library/RegTool/SConscript,
+ /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Include/Library.nsh,
+ /NSIS/trunk/Include/UpgradeDLL.nsh: TCHAR cannot be used in
+ RegTool because it must be able to run on Win9x.
+
+ RegTool now implements A and W functions in the same binary.
+ Bitness mixing is still problematic.
+
+2017-05-03 22:31 kichik
+
+ * /NSIS/trunk/.travis.yml: notify slack
+
+2017-05-03 21:17 anders_k
+
+ * /NSIS/trunk/Include/UpgradeDLL.nsh: UpgradeDLL needs to use the
+ correct RegTool version key
+
+2017-05-03 12:08 anders_k
+
+ * /NSIS/trunk/Examples/bigtest.nsi,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree.h,
+ /NSIS/trunk/Source/build.cpp, /NSIS/trunk/Source/build.h,
+ /NSIS/trunk/Source/lineparse.cpp,
+ /NSIS/trunk/Source/makenssi.cpp, /NSIS/trunk/Source/manifest.cpp,
+ /NSIS/trunk/Source/manifest.h, /NSIS/trunk/Source/Platform.h,
+ /NSIS/trunk/Source/SConscript, /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/scriptpp.cpp, /NSIS/trunk/Source/util.cpp,
+ /NSIS/trunk/Source/util.h: Refactored preprocessor instructions
+ to separate source file
+
+2017-04-26 19:40 kichik
+
+ * /NSIS/trunk/.travis.yml: build osx on travis
+
+2017-04-25 13:58 anders_k
+
+ * /NSIS/trunk/Examples/makensis.nsi, /NSIS/trunk/Source/build.cpp,
+ /NSIS/trunk/Source/script.cpp: Use a internal command to detect
+ the CHM header because the !searchparse hack fails with a
+ encoding error if the ACP codepage is 936.
+
+2017-04-25 13:09 anders_k
+
+ * /NSIS/trunk/Contrib/nsDialogs/example.nsi,
+ /NSIS/trunk/Contrib/nsDialogs/timer.nsi,
+ /NSIS/trunk/Docs/src/compiler.but,
+ /NSIS/trunk/Docs/src/history.but, /NSIS/trunk/Source/build.cpp,
+ /NSIS/trunk/Source/build.h, /NSIS/trunk/Source/lang.cpp,
+ /NSIS/trunk/Source/makenssi.cpp, /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/tokens.cpp, /NSIS/trunk/Source/tokens.h,
+ /NSIS/trunk/Source/util.cpp, /NSIS/trunk/Source/util.h: Added
+ !pragma warning (patch #267)
+
+2017-04-18 19:21 kichik
+
+ * /NSIS/trunk/Source/exehead/exec.c: log build fix for anders
+
+2017-04-18 08:20 kichik
+
+ * /NSIS/trunk/.travis.yml: test log build
+
+2017-04-14 21:48 anders_k
+
+ * /NSIS/trunk/Contrib/Library/LibraryLocal/LibraryLocal.cpp,
+ /NSIS/trunk/Source/zlib/ZUTIL.H: Fixed two GCC POSIX warnings
+
+2017-04-14 14:17 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/Afrikaans.nlf,
+ /NSIS/trunk/Contrib/Language files/Albanian.nlf,
+ /NSIS/trunk/Contrib/Language files/Arabic.nlf,
+ /NSIS/trunk/Contrib/Language files/Armenian.nlf,
+ /NSIS/trunk/Contrib/Language files/Asturian.nlf,
+ /NSIS/trunk/Contrib/Language files/Basque.nlf,
+ /NSIS/trunk/Contrib/Language files/Belarusian.nlf,
+ /NSIS/trunk/Contrib/Language files/Bosnian.nlf,
+ /NSIS/trunk/Contrib/Language files/Breton.nlf,
+ /NSIS/trunk/Contrib/Language files/Bulgarian.nlf,
+ /NSIS/trunk/Contrib/Language files/Catalan.nlf,
+ /NSIS/trunk/Contrib/Language files/Cibemba.nlf,
+ /NSIS/trunk/Contrib/Language files/Corsican.nlf,
+ /NSIS/trunk/Contrib/Language files/Croatian.nlf,
+ /NSIS/trunk/Contrib/Language files/Czech.nlf,
+ /NSIS/trunk/Contrib/Language files/Danish.nlf,
+ /NSIS/trunk/Contrib/Language files/Dutch.nlf,
+ /NSIS/trunk/Contrib/Language files/Efik.nlf,
+ /NSIS/trunk/Contrib/Language files/English.nlf,
+ /NSIS/trunk/Contrib/Language files/Esperanto.nlf,
+ /NSIS/trunk/Contrib/Language files/Estonian.nlf,
+ /NSIS/trunk/Contrib/Language files/Farsi.nlf,
+ /NSIS/trunk/Contrib/Language files/Finnish.nlf,
+ /NSIS/trunk/Contrib/Language files/French.nlf,
+ /NSIS/trunk/Contrib/Language files/Galician.nlf,
+ /NSIS/trunk/Contrib/Language files/Georgian.nlf,
+ /NSIS/trunk/Contrib/Language files/German.nlf,
+ /NSIS/trunk/Contrib/Language files/Greek.nlf,
+ /NSIS/trunk/Contrib/Language files/Hebrew.nlf,
+ /NSIS/trunk/Contrib/Language files/Hungarian.nlf,
+ /NSIS/trunk/Contrib/Language files/Icelandic.nlf,
+ /NSIS/trunk/Contrib/Language files/Igbo.nlf,
+ /NSIS/trunk/Contrib/Language files/Indonesian.nlf,
+ /NSIS/trunk/Contrib/Language files/Irish.nlf,
+ /NSIS/trunk/Contrib/Language files/Italian.nlf,
+ /NSIS/trunk/Contrib/Language files/Japanese.nlf,
+ /NSIS/trunk/Contrib/Language files/Khmer.nlf,
+ /NSIS/trunk/Contrib/Language files/Korean.nlf,
+ /NSIS/trunk/Contrib/Language files/Kurdish.nlf,
+ /NSIS/trunk/Contrib/Language files/Latvian.nlf,
+ /NSIS/trunk/Contrib/Language files/Lithuanian.nlf,
+ /NSIS/trunk/Contrib/Language files/Luxembourgish.nlf,
+ /NSIS/trunk/Contrib/Language files/Macedonian.nlf,
+ /NSIS/trunk/Contrib/Language files/Malagasy.nlf,
+ /NSIS/trunk/Contrib/Language files/Malay.nlf,
+ /NSIS/trunk/Contrib/Language files/Mongolian.nlf,
+ /NSIS/trunk/Contrib/Language files/Norwegian.nlf,
+ /NSIS/trunk/Contrib/Language files/NorwegianNynorsk.nlf,
+ /NSIS/trunk/Contrib/Language files/Pashto.nlf,
+ /NSIS/trunk/Contrib/Language files/Polish.nlf,
+ /NSIS/trunk/Contrib/Language files/Portuguese.nlf,
+ /NSIS/trunk/Contrib/Language files/PortugueseBR.nlf,
+ /NSIS/trunk/Contrib/Language files/Romanian.nlf,
+ /NSIS/trunk/Contrib/Language files/Russian.nlf,
+ /NSIS/trunk/Contrib/Language files/ScotsGaelic.nlf,
+ /NSIS/trunk/Contrib/Language files/Serbian.nlf,
+ /NSIS/trunk/Contrib/Language files/SerbianLatin.nlf,
+ /NSIS/trunk/Contrib/Language files/SimpChinese.nlf,
+ /NSIS/trunk/Contrib/Language files/Slovak.nlf,
+ /NSIS/trunk/Contrib/Language files/Slovenian.nlf,
+ /NSIS/trunk/Contrib/Language files/Spanish.nlf,
+ /NSIS/trunk/Contrib/Language files/SpanishInternational.nlf,
+ /NSIS/trunk/Contrib/Language files/Swahili.nlf,
+ /NSIS/trunk/Contrib/Language files/Swedish.nlf,
+ /NSIS/trunk/Contrib/Language files/Thai.nlf,
+ /NSIS/trunk/Contrib/Language files/TradChinese.nlf,
+ /NSIS/trunk/Contrib/Language files/Turkish.nlf,
+ /NSIS/trunk/Contrib/Language files/Ukrainian.nlf,
+ /NSIS/trunk/Contrib/Language files/Uzbek.nlf,
+ /NSIS/trunk/Contrib/Language files/Valencian.nlf,
+ /NSIS/trunk/Contrib/Language files/Vietnamese.nlf,
+ /NSIS/trunk/Contrib/Language files/Welsh.nlf,
+ /NSIS/trunk/Contrib/Language files/Yoruba.nlf,
+ /NSIS/trunk/Source/lang.cpp, /NSIS/trunk/Source/util.cpp,
+ /NSIS/trunk/Source/util.h: Default language file codepage is only
+ ASCII compatible (Bug #1180)
+
+2017-04-13 21:00 kichik
+
+ * /NSIS/trunk/.travis.yml: drone.io is dead so use travis-ci.org
+ instead
+
+2017-04-13 14:42 anders_k
+
+ * /NSIS/trunk/Source/Platform.h, /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/util.h: Fix POSIX error
+
+2017-04-06 18:07 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/Indonesian.nlf,
+ /NSIS/trunk/Contrib/Language files/SimpChinese.nlf,
+ /NSIS/trunk/Contrib/Language files/SimpChinese.nsh,
+ /NSIS/trunk/Contrib/Language files/TradChinese.nlf,
+ /NSIS/trunk/Contrib/Language files/TradChinese.nsh,
+ /NSIS/trunk/Docs/src/credits.but,
+ /NSIS/trunk/Docs/src/history.but: Chinese (Traditional) updates
+ by Walter Cheuk (Forum)
+
+2017-04-03 17:35 anders_k
+
+ * /NSIS/trunk/Contrib/Modern UI 2/MUI2.nsh,
+ /NSIS/trunk/Contrib/Modern UI 2/Pages/Finish.nsh,
+ /NSIS/trunk/Contrib/Modern UI 2/Pages/StartMenu.nsh,
+ /NSIS/trunk/Contrib/Modern UI 2/Pages/Welcome.nsh,
+ /NSIS/trunk/Contrib/Modern UI 2/Readme.html,
+ /NSIS/trunk/Contrib/Modern UI/System.nsh,
+ /NSIS/trunk/Contrib/MultiUser/MultiUser.nsh,
+ /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Source/exehead/fileform.h: Added
+ MUI_PAGE_CUSTOMFUNCTION_DESTROYED so custom image handles can be
+ cleaned up
+
+2017-03-22 15:05 anders_k
+
+ * /NSIS/trunk/Examples/makensis.nsi: Fix MUI dependencies check
+ when Languages or Graphics are not installed
+
+2017-03-22 00:46 anders_k
+
+ * /NSIS/trunk/Docs/src/registry.but, /NSIS/trunk/Source/build.cpp,
+ /NSIS/trunk/Source/exehead/util.c,
+ /NSIS/trunk/Source/exehead/util.h, /NSIS/trunk/Source/Platform.h,
+ /NSIS/trunk/Source/script.cpp, /NSIS/trunk/Source/tokens.cpp:
+ Fixed SetRegView and $ProgramFiles[32|64] in 64-bit installers
+
+2017-03-21 22:12 anders_k
+
+ * /NSIS/trunk/Include/WinVer.nsh: WinVer server 2016 support (patch
+ #282)
+
+2017-03-21 22:04 anders_k
+
+ * /NSIS/trunk/Docs/src/basic.but, /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Source/exehead/exec.c,
+ /NSIS/trunk/Source/exehead/fileform.h,
+ /NSIS/trunk/Source/exehead/util.c,
+ /NSIS/trunk/Source/exehead/util.h, /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/tokens.cpp, /NSIS/trunk/Source/tokens.h: Added
+ ExecShellWait
+
+2017-01-30 20:04 anders_k
+
+ * /NSIS/trunk/Contrib/NSISdl/ReadMe.txt: Added note about not
+ supporting HTTPS in NSISdl
+
+2017-01-28 18:49 anders_k
+
+ * /NSIS/trunk/Docs/src/basic.but: Added note about /REBOOTOK not
+ working without admin. rights for bug #1174
+
+2017-01-20 21:15 anders_k
+
+ * /NSIS/trunk/Contrib/Modern UI/System.nsh,
+ /NSIS/trunk/Source/exehead/Main.c: Fixed unbalanced push/pop in
+ MUI_UNGETLANGUAGE (MUI v1)
+
+2017-01-15 15:20 anders_k
+
+ * /NSIS/trunk/Contrib/nsExec/nsexec.c,
+ /NSIS/trunk/Docs/src/history.but: Unicode nsExec now supports the
+ /OEM switch (bug #1171)
+
+2017-01-02 03:51 anders_k
+
+ * /NSIS/trunk/Contrib/ExDLL/nsis_tchar.h,
+ /NSIS/trunk/Contrib/InstallOptions/Readme.html,
+ /NSIS/trunk/Contrib/Modern UI 2/License.txt,
+ /NSIS/trunk/Contrib/Modern UI 2/MUI2.nsh,
+ /NSIS/trunk/Contrib/Modern UI 2/Readme.html,
+ /NSIS/trunk/Contrib/Modern UI/License.txt,
+ /NSIS/trunk/Contrib/Modern UI/Readme.html,
+ /NSIS/trunk/Contrib/Modern UI/System.nsh,
+ /NSIS/trunk/Contrib/MultiUser/MultiUser.nsh,
+ /NSIS/trunk/Contrib/SubStart/substart.c,
+ /NSIS/trunk/Contrib/System/Source/Call.S,
+ /NSIS/trunk/Contrib/System/Source/Call-amd64.S,
+ /NSIS/trunk/Contrib/System/System.html, /NSIS/trunk/COPYING,
+ /NSIS/trunk/Docs/src/config.but,
+ /NSIS/trunk/Include/LangFile.nsh,
+ /NSIS/trunk/Include/VB6RunTime.nsh,
+ /NSIS/trunk/Source/7zip/7zGuids.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Common/InBuffer.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Common/InBuffer.h,
+ /NSIS/trunk/Source/7zip/7zip/Common/OutBuffer.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Common/OutBuffer.h,
+ /NSIS/trunk/Source/7zip/7zip/Common/StreamUtils.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Common/StreamUtils.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree2.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3Z.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3ZMain.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4b.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMain.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMF.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMFMain.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/IMatchFinder.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/LZInWindow.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/LZInWindow.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/LZOutWindow.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZ/LZOutWindow.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZMA/LZMA.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/RangeCoder/RangeCoder.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.cpp,
+ /NSIS/trunk/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBitTree.h,
+ /NSIS/trunk/Source/7zip/7zip/Compress/RangeCoder/RangeCoderOpt.h,
+ /NSIS/trunk/Source/7zip/7zip/ICoder.h,
+ /NSIS/trunk/Source/7zip/7zip/IStream.h,
+ /NSIS/trunk/Source/7zip/Common/Alloc.cpp,
+ /NSIS/trunk/Source/7zip/Common/Alloc.h,
+ /NSIS/trunk/Source/7zip/Common/CRC.cpp,
+ /NSIS/trunk/Source/7zip/Common/CRC.h,
+ /NSIS/trunk/Source/7zip/Common/Defs.h,
+ /NSIS/trunk/Source/7zip/Common/MyCom.h,
+ /NSIS/trunk/Source/7zip/Common/MyGuidDef.h,
+ /NSIS/trunk/Source/7zip/Common/MyUnknown.h,
+ /NSIS/trunk/Source/7zip/Common/MyWindows.h,
+ /NSIS/trunk/Source/7zip/Common/StdAfx.h,
+ /NSIS/trunk/Source/7zip/Common/Types.h,
+ /NSIS/trunk/Source/7zip/LZMADecode.c,
+ /NSIS/trunk/Source/7zip/LZMADecode.h,
+ /NSIS/trunk/Source/afxres.h, /NSIS/trunk/Source/build.cpp,
+ /NSIS/trunk/Source/build.h, /NSIS/trunk/Source/bzip2/blocksort.c,
+ /NSIS/trunk/Source/bzip2/bzlib.c,
+ /NSIS/trunk/Source/bzip2/bzlib.h,
+ /NSIS/trunk/Source/bzip2/compress.c,
+ /NSIS/trunk/Source/bzip2/decompress.c,
+ /NSIS/trunk/Source/bzip2/huffman.c, /NSIS/trunk/Source/cbzip2.h,
+ /NSIS/trunk/Source/clzma.cpp, /NSIS/trunk/Source/clzma.h,
+ /NSIS/trunk/Source/compressor.h, /NSIS/trunk/Source/crc32.c,
+ /NSIS/trunk/Source/crc32.h, /NSIS/trunk/Source/czlib.h,
+ /NSIS/trunk/Source/DialogTemplate.cpp,
+ /NSIS/trunk/Source/DialogTemplate.h,
+ /NSIS/trunk/Source/dirreader.cpp, /NSIS/trunk/Source/dirreader.h,
+ /NSIS/trunk/Source/exehead/afxres.h,
+ /NSIS/trunk/Source/exehead/api.h,
+ /NSIS/trunk/Source/exehead/bgbg.c,
+ /NSIS/trunk/Source/exehead/components.c,
+ /NSIS/trunk/Source/exehead/components.h,
+ /NSIS/trunk/Source/exehead/config.h,
+ /NSIS/trunk/Source/exehead/exec.c,
+ /NSIS/trunk/Source/exehead/exec.h,
+ /NSIS/trunk/Source/exehead/fileform.c,
+ /NSIS/trunk/Source/exehead/fileform.h,
+ /NSIS/trunk/Source/exehead/lang.h,
+ /NSIS/trunk/Source/exehead/Main.c,
+ /NSIS/trunk/Source/exehead/plugin.c,
+ /NSIS/trunk/Source/exehead/plugin.h,
+ /NSIS/trunk/Source/exehead/state.h,
+ /NSIS/trunk/Source/exehead/Ui.c, /NSIS/trunk/Source/exehead/ui.h,
+ /NSIS/trunk/Source/exehead/util.c,
+ /NSIS/trunk/Source/exehead/util.h,
+ /NSIS/trunk/Source/fileform.cpp, /NSIS/trunk/Source/fileform.h,
+ /NSIS/trunk/Source/growbuf.cpp, /NSIS/trunk/Source/growbuf.h,
+ /NSIS/trunk/Source/icon.cpp, /NSIS/trunk/Source/icon.h,
+ /NSIS/trunk/Source/lang.cpp, /NSIS/trunk/Source/lang.h,
+ /NSIS/trunk/Source/lineparse.cpp, /NSIS/trunk/Source/lineparse.h,
+ /NSIS/trunk/Source/makenssi.cpp, /NSIS/trunk/Source/manifest.cpp,
+ /NSIS/trunk/Source/manifest.h, /NSIS/trunk/Source/mmap.cpp,
+ /NSIS/trunk/Source/mmap.h, /NSIS/trunk/Source/Platform.h,
+ /NSIS/trunk/Source/Plugins.cpp, /NSIS/trunk/Source/Plugins.h,
+ /NSIS/trunk/Source/ResourceEditor.cpp,
+ /NSIS/trunk/Source/ResourceEditor.h,
+ /NSIS/trunk/Source/ResourceVersionInfo.cpp,
+ /NSIS/trunk/Source/ResourceVersionInfo.h,
+ /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/ShConstants.cpp,
+ /NSIS/trunk/Source/ShConstants.h, /NSIS/trunk/Source/strlist.cpp,
+ /NSIS/trunk/Source/strlist.h, /NSIS/trunk/Source/tchar.h,
+ /NSIS/trunk/Source/tokens.cpp, /NSIS/trunk/Source/tokens.h,
+ /NSIS/trunk/Source/tstring.cpp, /NSIS/trunk/Source/tstring.h,
+ /NSIS/trunk/Source/uservars.h, /NSIS/trunk/Source/utf.cpp,
+ /NSIS/trunk/Source/utf.h, /NSIS/trunk/Source/util.cpp,
+ /NSIS/trunk/Source/util.h,
+ /NSIS/trunk/Source/validateunicode.cpp,
+ /NSIS/trunk/Source/validateunicode.h,
+ /NSIS/trunk/Source/winchar.cpp, /NSIS/trunk/Source/winchar.h,
+ /NSIS/trunk/Source/writer.cpp, /NSIS/trunk/Source/writer.h,
+ /NSIS/trunk/Source/zlib/INFBLOCK.C,
+ /NSIS/trunk/Source/zlib/ZCONF.H, /NSIS/trunk/Source/zlib/ZLIB.H,
+ /NSIS/trunk/Source/zlib/ZUTIL.H: (C) 2017
+
+2016-12-30 00:52 anders_k
+
+ * /NSIS/trunk/Docs/src/basic.but: Minor documentation fix (bug
+ #919)
+
+2016-12-30 00:39 anders_k
+
+ * /NSIS/trunk/Contrib/MultiUser/MultiUser.nsh: Taller
+ MULTIUSER_INSTALLMODEPAGE_TEXT_TOP label (bug #916)
+
+2016-12-30 00:00 anders_k
+
+ * /NSIS/trunk/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh,
+ /NSIS/trunk/Contrib/Modern UI 2/Readme.html,
+ /NSIS/trunk/Contrib/Modern UI/Readme.html,
+ /NSIS/trunk/Contrib/Modern UI/System.nsh,
+ /NSIS/trunk/Docs/src/history.but: Added support for
+ MUI_UNCONFIRMPAGE_VARIABLE (RFE #511)
+
+2016-12-29 22:11 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/French.nsh,
+ /NSIS/trunk/Docs/src/history.but: Minor French improvements
+ (patch #221)
+
+2016-12-29 21:59 anders_k
+
+ * /NSIS/trunk/Docs/src/history.but,
+ /NSIS/trunk/Docs/src/registry.but,
+ /NSIS/trunk/Source/exehead/exec.c,
+ /NSIS/trunk/Source/lineparse.cpp, /NSIS/trunk/Source/lineparse.h,
+ /NSIS/trunk/Source/Platform.h, /NSIS/trunk/Source/script.cpp,
+ /NSIS/trunk/Source/tokens.cpp, /NSIS/trunk/Source/tokens.h: Added
+ basic WriteRegMultiStr support (RFE #382, patch #219)
+
+2016-12-29 19:25 anders_k
+
+ * /NSIS/trunk/Contrib/MakeLangId/MakeLangId.cpp: Fixed minor 64-bit
+ warnings (Bug #1170)
+
+2016-12-26 23:52 anders_k
+
+ * /NSIS/trunk/Contrib/System/System.html: Minor documentation fix
+ (Patch #231)
+
+2016-12-26 23:48 anders_k
+
+ * /NSIS/trunk/Contrib/Language files/Basque.nsh: Added MultiUser
+ text from patch #246. Still undecided if we should merge the rest
+ of the patch...
+
+2016-12-26 23:23 anders_k
+
+ * /NSIS/trunk/Docs/src/langs.but: Add link to translations forum
+ (Bug #1167)
+
+2016-12-26 23:01 anders_k
+
+ * /NSIS/trunk/Contrib/MultiUser/MultiUser.nsh,
+ /NSIS/trunk/Contrib/MultiUser/Readme.html,
+ /NSIS/trunk/Docs/src/basic.but, /NSIS/trunk/Docs/src/history.but:
+ MultiUser now supports $ProgramFiles64 (Bug #843)
+
2016-12-11 21:47 kichik
* /NSIS/tags/v301: Tagging for release 3.01
diff --git a/Contrib/ExDLL/nsis_tchar.h b/Contrib/ExDLL/nsis_tchar.h
index a734b91..ba05b13 100755
--- a/Contrib/ExDLL/nsis_tchar.h
+++ b/Contrib/ExDLL/nsis_tchar.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* This software is provided 'as-is', without any express or implied
* warranty.
diff --git a/Contrib/InstallOptions/Readme.html b/Contrib/InstallOptions/Readme.html
index e1f1e31..e7f5dfe 100755
--- a/Contrib/InstallOptions/Readme.html
+++ b/Contrib/InstallOptions/Readme.html
@@ -883,7 +883,7 @@ FunctionEnd
<pre>
Original version Copyright &copy; 2001 Michael Bishop
DLL version 1 Copyright &copy; 2001-2002 Nullsoft, Inc., ORTIM
-DLL version 2 Copyright &copy; 2003-2016 Amir Szekely, Joost Verburg, Dave Laundon
+DLL version 2 Copyright &copy; 2003-2017 Amir Szekely, Joost Verburg, Dave Laundon
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/Contrib/LangDLL/LangDLL.c b/Contrib/LangDLL/LangDLL.c
index 17a9739..5af0017 100755
--- a/Contrib/LangDLL/LangDLL.c
+++ b/Contrib/LangDLL/LangDLL.c
@@ -4,11 +4,11 @@
// JF> updated usage
// call like this:
-// LangDLL:LangDialog "Window Title" "Window subtext" <number of languages>[F] language_text language_id ... [font_size font_face]
+// LangDLL:LangDialog "Window Title" "Window subtext" <number of languages|"A">[C][F] language_text language_id [codepage] ... [font_size font_face]
// ex:
-// LangDLL:LangDialog "Language Selection" "Choose a language" 2 French 1036 English 1033
+// LangDLL:LangDialog "Language Selection" "Choose a language" "2" French 1036 English 1033
// or (the F after the 2 means we're supplying font information)
-// LangDLL:LangDialog "Language Selection" "Choose a language" 2F French 1036 English 1033 12 Garamond
+// LangDLL:LangDialog "Language Selection" "Choose a language" "2F" French 1036 English 1033 12 Garamond
//
// Unicode support added by Jim Park -- 07/27/2007
@@ -33,6 +33,26 @@ struct lang {
UINT cp;
} *langs;
+#ifndef UNICODE
+static UINT AllowLang(struct lang*pL)
+{
+ UINT acp = GetACP(), lcp = pL->cp, allow = lcp == acp;
+ /*
+ ** Workaround for bug #1185:
+ ** English and German can be displayed in cp1250
+ */
+ if (acp == 1250 && lcp == 1252)
+ {
+ const UINT lid = myatou(pL->id);
+ if (lid == 1033 // English
+ || lid == 1031 // German
+ )
+ ++allow;
+ }
+ return allow;
+}
+#endif
+
INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
INT_PTR i;
@@ -194,10 +214,10 @@ void NSIS_DECLSPEC_DLLEXPORT LangDialog(HWND hwndParent, int string_size,
}
// If Unicode, show everything.
-#ifdef _UNICODE
+#ifdef UNICODE
visible_langs_num++;
#else
- if (!docp || langs[visible_langs_num].cp == GetACP() || langs[visible_langs_num].cp == 0)
+ if (!docp || AllowLang(&langs[visible_langs_num]) || langs[visible_langs_num].cp == 0)
{
visible_langs_num++;
}
diff --git a/Contrib/Language files/Afrikaans.nlf b/Contrib/Language files/Afrikaans.nlf
index 43224b5..922ef48 100755
--- a/Contrib/Language files/Afrikaans.nlf
+++ b/Contrib/Language files/Afrikaans.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Boekstaaf die installasieproses
# ^Byte
G
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Albanian.nlf b/Contrib/Language files/Albanian.nlf
index c54124a..acb0e87 100755
--- a/Contrib/Language files/Albanian.nlf
+++ b/Contrib/Language files/Albanian.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Regjistro procesin e instalimit
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Arabic.nlf b/Contrib/Language files/Arabic.nlf
index 7756db2..9b876df 100755
--- a/Contrib/Language files/Arabic.nlf
+++ b/Contrib/Language files/Arabic.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1256
# RTL - anything else than RTL means LTR
RTL
@@ -183,8 +183,8 @@ RTL
# ^Byte
بايت
# ^Kilo
-كيلو
+ كيلو
# ^Mega
-ميغا
+ ميغا
# ^Giga
-جيغا \ No newline at end of file
+ جيغا
diff --git a/Contrib/Language files/Armenian.nlf b/Contrib/Language files/Armenian.nlf
index 35bd1f2..0831fa2 100755
--- a/Contrib/Language files/Armenian.nlf
+++ b/Contrib/Language files/Armenian.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1200
# RTL - anything else than RTL means LTR
-
diff --git a/Contrib/Language files/Asturian.nlf b/Contrib/Language files/Asturian.nlf
index 0294e2a..4d5b1ae 100755
--- a/Contrib/Language files/Asturian.nlf
+++ b/Contrib/Language files/Asturian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Rexistrar procesu d'instalación
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Basque.nlf b/Contrib/Language files/Basque.nlf
index 6340b32..b299b54 100755
--- a/Contrib/Language files/Basque.nlf
+++ b/Contrib/Language files/Basque.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Instalazio prozesuaren erregistroa gorde
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Basque.nsh b/Contrib/Language files/Basque.nsh
index 9136833..182a116 100755
--- a/Contrib/Language files/Basque.nsh
+++ b/Contrib/Language files/Basque.nsh
@@ -119,3 +119,11 @@
!ifdef MUI_UNABORTWARNING
${LangFileString} MUI_UNTEXT_ABORTWARNING "Ziur zaude $(^Name)-ren ezabaketa laguntzailetik irten nahi duzula?"
!endif
+
+!ifdef MULTIUSER_INSTALLMODEPAGE
+ ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "Hautatu Erabiltzaileak"
+ ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "Hautatu zein erabiltzailerentzat ezartzea nahi duzun $(^NameDA)."
+ ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "Hautatu norentzat ezartzea nahi duzun $(^NameDA) zuretzat bakarrik edo ordenagailu honetako erabiltzaile guztientzat. $(^ClickNext)"
+ ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "Ezarri ordenagailu hau erabiltzen duen edonorentzat"
+ ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "Ezarri niretzat bakarrik"
+!endif
diff --git a/Contrib/Language files/Belarusian.nlf b/Contrib/Language files/Belarusian.nlf
index e7c3919..5bc936a 100755
--- a/Contrib/Language files/Belarusian.nlf
+++ b/Contrib/Language files/Belarusian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1251
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Nullsoft Install System %s
# byte
Б
# kilo
-К
+ К
# mega
-М
+ М
# giga
-Г \ No newline at end of file
+ Г
diff --git a/Contrib/Language files/Bosnian.nlf b/Contrib/Language files/Bosnian.nlf
index f7094ef..dfb4218 100755
--- a/Contrib/Language files/Bosnian.nlf
+++ b/Contrib/Language files/Bosnian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -183,9 +183,9 @@ Logiraj zapisnik procesa instalacije
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Breton.nlf b/Contrib/Language files/Breton.nlf
index 37e6ad1..43251f3 100755
--- a/Contrib/Language files/Breton.nlf
+++ b/Contrib/Language files/Breton.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Tresañ an argerzh staliañ
# ^Byte
E
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Bulgarian.nlf b/Contrib/Language files/Bulgarian.nlf
index d69fba9..7803a14 100755
--- a/Contrib/Language files/Bulgarian.nlf
+++ b/Contrib/Language files/Bulgarian.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1251
# RTL - anything else than RTL means LTR
-
diff --git a/Contrib/Language files/Catalan.nlf b/Contrib/Language files/Catalan.nlf
index bc42fe7..cfd3368 100755
--- a/Contrib/Language files/Catalan.nlf
+++ b/Contrib/Language files/Catalan.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Registra el procés d'instal·lació
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Cibemba.nlf b/Contrib/Language files/Cibemba.nlf
index 445b0f4..f92f9f6 100755
--- a/Contrib/Language files/Cibemba.nlf
+++ b/Contrib/Language files/Cibemba.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
-
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Log install process
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Corsican.nlf b/Contrib/Language files/Corsican.nlf
index 2155121..029b672 100755
--- a/Contrib/Language files/Corsican.nlf
+++ b/Contrib/Language files/Corsican.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything other than RTL means LTR
-
@@ -185,8 +185,8 @@ Arregistrà u ghjurnale d'installazione
# ^Byte
o
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Croatian.nlf b/Contrib/Language files/Croatian.nlf
index 62fd5ff..c26571a 100755
--- a/Contrib/Language files/Croatian.nlf
+++ b/Contrib/Language files/Croatian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Logiraj instalacijski proces
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Czech.nlf b/Contrib/Language files/Czech.nlf
index def2358..d524925 100755
--- a/Contrib/Language files/Czech.nlf
+++ b/Contrib/Language files/Czech.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -128,7 +128,7 @@ Soubor nelze otevřít pro zápis: \r\n\t"$0"\r\nKliknÄ›te na tlaÄítko Opakova
# ^CopyFailed
Kopírování se nezdařilo.
# ^CopyTo
-"Zkopírovat do "
+"Kopírování do "
# ^Registering
"Registrace: "
# ^Unregistering
@@ -184,8 +184,8 @@ Protokolovat proces instalace
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Danish.nlf b/Contrib/Language files/Danish.nlf
index 2116857..82b0863 100755
--- a/Contrib/Language files/Danish.nlf
+++ b/Contrib/Language files/Danish.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Log installationsproces
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Dutch.nlf b/Contrib/Language files/Dutch.nlf
index ba3aeee..86ced7f 100755
--- a/Contrib/Language files/Dutch.nlf
+++ b/Contrib/Language files/Dutch.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Gegevens over installatie bewaren
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Efik.nlf b/Contrib/Language files/Efik.nlf
index f5da26d..400b775 100755
--- a/Contrib/Language files/Efik.nlf
+++ b/Contrib/Language files/Efik.nlf
@@ -6,8 +6,8 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
--
+# Codepage - dash (-) means ASCII code page (I don't know the correct codepage, forcing Unicode for now)
+1200
# RTL - anything else than RTL means LTR
-
# Translation by ..... (any credits should go here)
@@ -184,8 +184,8 @@ Ntọt ndutịm edisịn n̄kpọ
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/English.nlf b/Contrib/Language files/English.nlf
index d41bc17..feb69cb 100755
--- a/Contrib/Language files/English.nlf
+++ b/Contrib/Language files/English.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
-
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Log install process
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Esperanto.nlf b/Contrib/Language files/Esperanto.nlf
index 84d1e6d..3e14264 100755
--- a/Contrib/Language files/Esperanto.nlf
+++ b/Contrib/Language files/Esperanto.nlf
@@ -1,12 +1,12 @@
# Header, don't edit
NLF v6
# Start editing here
-# Language ID (none exists for Kurdish at the moment)
+# Language ID (none exists for Esperanto at the moment)
9998
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
-
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Registri instalad-procezo
# ^Byte
B
# ^Kilo
-k
+ k
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Estonian.nlf b/Contrib/Language files/Estonian.nlf
index 52ac09b..d43f259 100755
--- a/Contrib/Language files/Estonian.nlf
+++ b/Contrib/Language files/Estonian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1257
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Logi paigaldusprotsess
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Farsi.nlf b/Contrib/Language files/Farsi.nlf
index 635e941..6c04648 100755
--- a/Contrib/Language files/Farsi.nlf
+++ b/Contrib/Language files/Farsi.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1256
# RTL - anything else than RTL means LTR
RTL
diff --git a/Contrib/Language files/Finnish.nlf b/Contrib/Language files/Finnish.nlf
index 5b3d0b2..e395fbb 100755
--- a/Contrib/Language files/Finnish.nlf
+++ b/Contrib/Language files/Finnish.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -186,8 +186,8 @@ Tallenna asennusloki
# ^Byte
t
# ^Kilo
-k
+ k
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/French.nlf b/Contrib/Language files/French.nlf
index 20c4aaa..e30d2a6 100755
--- a/Contrib/Language files/French.nlf
+++ b/Contrib/Language files/French.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Enregistrer le déroulement de l'installation
# ^Byte
o
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/French.nsh b/Contrib/Language files/French.nsh
index f66bd5d..d390e84 100755
--- a/Contrib/Language files/French.nsh
+++ b/Contrib/Language files/French.nsh
@@ -64,7 +64,7 @@
!ifdef MUI_INSTFILESPAGE
${LangFileString} MUI_TEXT_INSTALLING_TITLE "Installation en cours"
- ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Veuillez patienter pendant que $(^NameDA) est en train d'être installé."
+ ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "Veuillez patienter pendant l'installation de $(^NameDA)."
${LangFileString} MUI_TEXT_FINISH_TITLE "Installation terminée"
${LangFileString} MUI_TEXT_FINISH_SUBTITLE "L'installation s'est terminée avec succès."
${LangFileString} MUI_TEXT_ABORT_TITLE "Installation interrompue"
@@ -73,7 +73,7 @@
!ifdef MUI_UNINSTFILESPAGE
${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "Désinstallation en cours"
- ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Veuillez patienter pendant que $(^NameDA) est en train d'être supprimé de votre ordinateur."
+ ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "Veuillez patienter pendant la désinstallation de $(^NameDA)."
${LangFileString} MUI_UNTEXT_FINISH_TITLE "Désinstallation terminée"
${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "La désinstallation s'est terminée avec succès."
${LangFileString} MUI_UNTEXT_ABORT_TITLE "Désinstallation interrompue"
diff --git a/Contrib/Language files/Galician.nlf b/Contrib/Language files/Galician.nlf
index b46b0c4..3c2bc86 100755
--- a/Contrib/Language files/Galician.nlf
+++ b/Contrib/Language files/Galician.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Rexistar proceso de instalación
# ^Byte
B
# kilo
-K
+ K
# mega
-M
+ M
# giga
-G
+ G
diff --git a/Contrib/Language files/Georgian.nlf b/Contrib/Language files/Georgian.nlf
index a0ad265..7292aa3 100755
--- a/Contrib/Language files/Georgian.nlf
+++ b/Contrib/Language files/Georgian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1200
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ $(^Name)–ის წáƒáƒ¨áƒšáƒ
# byte
B
# kilo
-K
+ K
# mega
-M
+ M
# giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/German.nlf b/Contrib/Language files/German.nlf
index 54cbf93..4d4c77e 100755
--- a/Contrib/Language files/German.nlf
+++ b/Contrib/Language files/German.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Installationsverlauf protokollieren
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Greek.nlf b/Contrib/Language files/Greek.nlf
index f458266..84f3988 100755
--- a/Contrib/Language files/Greek.nlf
+++ b/Contrib/Language files/Greek.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1253
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Nullsoft Install System %s
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Hebrew.nlf b/Contrib/Language files/Hebrew.nlf
index e71c523..cf0af87 100755
--- a/Contrib/Language files/Hebrew.nlf
+++ b/Contrib/Language files/Hebrew.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1255
# RTL - anything else than RTL means LTR
RTL
diff --git a/Contrib/Language files/Hungarian.nlf b/Contrib/Language files/Hungarian.nlf
index 0fb06ac..f234a6d 100755
--- a/Contrib/Language files/Hungarian.nlf
+++ b/Contrib/Language files/Hungarian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Telepítő ellenőrzőlista
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Icelandic.nlf b/Contrib/Language files/Icelandic.nlf
index be83a3e..1352784 100755
--- a/Contrib/Language files/Icelandic.nlf
+++ b/Contrib/Language files/Icelandic.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Skrá uppsetningarferli
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Igbo.nlf b/Contrib/Language files/Igbo.nlf
index 2b4c3fb..48e086d 100755
--- a/Contrib/Language files/Igbo.nlf
+++ b/Contrib/Language files/Igbo.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1200
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Ndepụta otú e si tinye ya
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Indonesian.nlf b/Contrib/Language files/Indonesian.nlf
index bedb67b..8a9d5a9 100755
--- a/Contrib/Language files/Indonesian.nlf
+++ b/Contrib/Language files/Indonesian.nlf
@@ -5,11 +5,15 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
--
+# Codepage - dash (-) means ASCII code page
+1252
# RTL - anything else than RTL means LTR
-
-# Translation ariel825010106@yahoo.com modified and completed by was.uthm@gmail.com in April 2009
+# Revision date: 2009 April
+# Translators:
+## Ariel <ariel825010106@yahoo.com>, <www.ariel106.cjb.net>
+## was.uthm@gmail.com
+#
# ^Branding
Nullsoft Install System %s
# ^SetupCaption
@@ -183,8 +187,8 @@ Catat proses instalasi
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Irish.nlf b/Contrib/Language files/Irish.nlf
index f540cb9..fba63cd 100755
--- a/Contrib/Language files/Irish.nlf
+++ b/Contrib/Language files/Irish.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Logáil an próiseas suiteála
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Italian.nlf b/Contrib/Language files/Italian.nlf
index 56f9272..4c58bb6 100755
--- a/Contrib/Language files/Italian.nlf
+++ b/Contrib/Language files/Italian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -185,8 +185,8 @@ Log del processo di installazione
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Japanese.nlf b/Contrib/Language files/Japanese.nlf
index 6c0e493..8fb6640 100755
--- a/Contrib/Language files/Japanese.nlf
+++ b/Contrib/Language files/Japanese.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
MS Pゴシック
9
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
932
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ OLEãŒã‚ã‚Šã¾ã›ã‚“:
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Khmer.nlf b/Contrib/Language files/Khmer.nlf
index 0dd3e13..983e8d7 100755
--- a/Contrib/Language files/Khmer.nlf
+++ b/Contrib/Language files/Khmer.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1200
# RTL - anything else than RTL means LTR
-
@@ -188,8 +188,8 @@ $(^NameDA) នឹង​ážáŸ’រូវ​បាន​លុប​ចáŸáž‰â€‹áž–
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Korean.nlf b/Contrib/Language files/Korean.nlf
index 6a9072b..42f0180 100755
--- a/Contrib/Language files/Korean.nlf
+++ b/Contrib/Language files/Korean.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
굴림
9
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
949
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ DLL ë“±ë¡ ì‹¤íŒ¨
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Kurdish.nlf b/Contrib/Language files/Kurdish.nlf
index 67c277a..2790dee 100755
--- a/Contrib/Language files/Kurdish.nlf
+++ b/Contrib/Language files/Kurdish.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1254
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Pêkanîna sazkirinê li lênûska rewşê binivîse
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Latvian.nlf b/Contrib/Language files/Latvian.nlf
index 51e9f54..179fb73 100755
--- a/Contrib/Language files/Latvian.nlf
+++ b/Contrib/Language files/Latvian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1257
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ IerakstÄ«t žurnÄla failÄ uzstÄdÄ«Å¡anas procesu
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Lithuanian.nlf b/Contrib/Language files/Lithuanian.nlf
index ad6cdeb..19dac52 100755
--- a/Contrib/Language files/Lithuanian.nlf
+++ b/Contrib/Language files/Lithuanian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1257
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Kopijuoti detales į atmintį
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Luxembourgish.nlf b/Contrib/Language files/Luxembourgish.nlf
index 68ab4d6..1b59a15 100755
--- a/Contrib/Language files/Luxembourgish.nlf
+++ b/Contrib/Language files/Luxembourgish.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Installatioun protokolléieren
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Macedonian.nlf b/Contrib/Language files/Macedonian.nlf
index 6cd6823..8baef13 100755
--- a/Contrib/Language files/Macedonian.nlf
+++ b/Contrib/Language files/Macedonian.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1251
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ $(^NameDA) ќе биде деинÑталиран од Ñледниов дире
# ^Byte
б
# ^Kilo
-К
+ К
# ^Mega
-М
+ М
# ^Giga
-Г \ No newline at end of file
+ Г
diff --git a/Contrib/Language files/Malagasy.nlf b/Contrib/Language files/Malagasy.nlf
index 5fc7c83..c2237c4 100755
--- a/Contrib/Language files/Malagasy.nlf
+++ b/Contrib/Language files/Malagasy.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
-
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Log install process
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Malay.nlf b/Contrib/Language files/Malay.nlf
index 5d04010..6bf0a81 100755
--- a/Contrib/Language files/Malay.nlf
+++ b/Contrib/Language files/Malay.nlf
@@ -5,8 +5,8 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
--
+# Codepage - dash (-) means ASCII code page
+1252
# RTL - anything else than RTL means LTR
-
# Translation muhammadazwa@yahoo.com
@@ -183,8 +183,8 @@ Catat proses kemasukan
# ^Byte
Bait
# ^Kilo
-Kilo
+ Kilo
# ^Mega
-Mega
+ Mega
# ^Giga
-Giga \ No newline at end of file
+ Giga
diff --git a/Contrib/Language files/Mongolian.nlf b/Contrib/Language files/Mongolian.nlf
index 1f9859c..afabcbc 100755
--- a/Contrib/Language files/Mongolian.nlf
+++ b/Contrib/Language files/Mongolian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1251
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ DLL бїртгїїлÑÑ…Ñд алдлаа
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Norwegian.nlf b/Contrib/Language files/Norwegian.nlf
index 0f733fc..a4d6930 100755
--- a/Contrib/Language files/Norwegian.nlf
+++ b/Contrib/Language files/Norwegian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Loggfør installasjonsprosessen
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/NorwegianNynorsk.nlf b/Contrib/Language files/NorwegianNynorsk.nlf
index a04bd2f..f2a52d9 100755
--- a/Contrib/Language files/NorwegianNynorsk.nlf
+++ b/Contrib/Language files/NorwegianNynorsk.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,9 +183,9 @@ Loggfør installasjonsprosessen
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Pashto.nlf b/Contrib/Language files/Pashto.nlf
index 3414dca..bb4fbda 100755
--- a/Contrib/Language files/Pashto.nlf
+++ b/Contrib/Language files/Pashto.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1256
# RTL - anything else than RTL means LTR
RTL
@@ -184,8 +184,8 @@ $_CLICK .به د Ù„Ø§Ù†Ø¯Û Ù¾ÙˆÚšÛ Ù†Ù‡ ونالګول شي $(^NameDA)
# ^Byte
ب
# ^Kilo
-Ú©
+ Ú©
# ^Mega
-Ù…
+ Ù…
# ^Giga
-Ú« \ No newline at end of file
+ Ú«
diff --git a/Contrib/Language files/Pashto.nsh b/Contrib/Language files/Pashto.nsh
index a558bf6..d1055c1 100755
--- a/Contrib/Language files/Pashto.nsh
+++ b/Contrib/Language files/Pashto.nsh
@@ -13,10 +13,6 @@
${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT ".Ù†Ø§Ù„Ú«ÙˆÙ†Û ØªÙ‡ يوسي $(^NameDA) دا اسانګر به ØªØ§Ø³Û Ø¯$\r$\n$\r$\n.نه وي پرانيستل شوی $(^NameDA) د نالګاو د Ù¾Ûلولو نه مخکښÛØŒ Úان ډاډمن کړﺉ Ú†Û$\r$\n$\r$\n$_CLICK"
!endif
-!ifdef MUI_WELCOMEPAGE | MUI_UNWELCOMEPAGE
- ${LangFileString} MUI_BUTTONTEXT_FINISH "&پای"
-!endif
-
!ifdef MUI_LICENSEPAGE
${LangFileString} MUI_TEXT_LICENSE_TITLE "منښتليک تړون"
${LangFileString} MUI_TEXT_LICENSE_SUBTITLE ".لګولو نه Ù…Ø®Ú©ÚšÛ Ù…Ù†ÚšØªÙ„ÙŠÚ© توکي وګورﺉ $(^NameDA) د"
@@ -101,6 +97,7 @@
${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "وروسته زه پخپله بياپÛلون کول غواړم"
${LangFileString} MUI_TEXT_FINISH_RUN "&پرانيستل $(^NameDA)"
${LangFileString} MUI_TEXT_FINISH_SHOWREADME "&ماولوله ښودل"
+ ${LangFileString} MUI_BUTTONTEXT_FINISH "&پای"
!endif
!ifdef MUI_STARTMENUPAGE
diff --git a/Contrib/Language files/Polish.nlf b/Contrib/Language files/Polish.nlf
index bb182ca..1a34dcb 100755
--- a/Contrib/Language files/Polish.nlf
+++ b/Contrib/Language files/Polish.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -188,8 +188,8 @@ Rejestruj przebieg instalacji
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Portuguese.nlf b/Contrib/Language files/Portuguese.nlf
index 195ec07..64bafa9 100755
--- a/Contrib/Language files/Portuguese.nlf
+++ b/Contrib/Language files/Portuguese.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Registar processo de instalação
# ^Byte
B
# kilo
-K
+ K
# mega
-M
+ M
# giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/PortugueseBR.nlf b/Contrib/Language files/PortugueseBR.nlf
index 11cc3ec..88c3fc0 100755
--- a/Contrib/Language files/PortugueseBR.nlf
+++ b/Contrib/Language files/PortugueseBR.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Registrar o processo de instalação
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G \ No newline at end of file
diff --git a/Contrib/Language files/Romanian.nlf b/Contrib/Language files/Romanian.nlf
index 0e5c2c0..93fccdf 100755
--- a/Contrib/Language files/Romanian.nlf
+++ b/Contrib/Language files/Romanian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -195,8 +195,8 @@ Jurnal proces instalare
# ^Byte
O
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Romanian.nsh b/Contrib/Language files/Romanian.nsh
index a6fd212..a0f2220 100755
--- a/Contrib/Language files/Romanian.nsh
+++ b/Contrib/Language files/Romanian.nsh
@@ -20,10 +20,6 @@
${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "Această aplicaţie va dezinstala $(^NameDA).$\r$\n$\r$\nEste recomandat să închideţi toate aplicaţiile înainte de începerea procesului de dezinstalare. Acest lucru vă poate asigura un proces de dezinstalare fără erori sau situaţii neprevăzute.$\r$\n$\r$\n$_CLICK"
!endif
-!ifdef MUI_WELCOMEPAGE | MUI_UNWELCOMEPAGE
- ${LangFileString} MUI_BUTTONTEXT_FINISH "&Terminare"
-!endif
-
!ifdef MUI_LICENSEPAGE
${LangFileString} MUI_TEXT_LICENSE_TITLE "Contract de licenţă"
${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "Citiţi cu atenţie termenii contractului de licenţă înainte de a instala $(^NameDA)."
@@ -108,6 +104,7 @@
${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "Repornesc eu mai târziu"
${LangFileString} MUI_TEXT_FINISH_RUN "Executare $(^NameDA)"
${LangFileString} MUI_TEXT_FINISH_SHOWREADME "Afişare fişier readme (citeşte-mă)."
+ ${LangFileString} MUI_BUTTONTEXT_FINISH "&Terminare"
!endif
!ifdef MUI_STARTMENUPAGE
diff --git a/Contrib/Language files/Russian.nlf b/Contrib/Language files/Russian.nlf
index e7d44dc..1636e16 100755
--- a/Contrib/Language files/Russian.nlf
+++ b/Contrib/Language files/Russian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1251
# RTL - anything else than RTL means LTR
-
diff --git a/Contrib/Language files/ScotsGaelic.nlf b/Contrib/Language files/ScotsGaelic.nlf
index 237ec65..ea3a470 100755
--- a/Contrib/Language files/ScotsGaelic.nlf
+++ b/Contrib/Language files/ScotsGaelic.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Dèan loga air an stàladh
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/ScotsGaelic.nsh b/Contrib/Language files/ScotsGaelic.nsh
index 902e824..a2fa54d 100755
--- a/Contrib/Language files/ScotsGaelic.nsh
+++ b/Contrib/Language files/ScotsGaelic.nsh
@@ -82,7 +82,7 @@
!ifdef MUI_FINISHPAGE
${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "A' coileanadh an draoidh stàlaidh aig $(^NameDA)"
- ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Chaidh $(^NameDA) a stàladh air a' choimpiutair agad.$\r$\n$\r$\nBriog air "Crìochnaich" gus an draoidh seo a dhùnadh."
+ ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "Chaidh $(^NameDA) a stàladh air a' choimpiutair agad.$\r$\n$\r$\nBriog air $\"Crìochnaich$\" gus an draoidh seo a dhùnadh."
${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "Tha ath-thòiseachadh a dhìth air a' choimpiutair agad gus an stàladh aig $(^NameDA) a choileanadh. A bheil thu airson ath-thòiseachadh an-dràsta?"
!endif
diff --git a/Contrib/Language files/Serbian.nlf b/Contrib/Language files/Serbian.nlf
index 30d3278..30786b2 100755
--- a/Contrib/Language files/Serbian.nlf
+++ b/Contrib/Language files/Serbian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1251
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ $(^Name) ДеинÑталација
# ^Byte
B
# ^Kilo
-k
+ k
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/SerbianLatin.nlf b/Contrib/Language files/SerbianLatin.nlf
index 98a924a..1d009fc 100755
--- a/Contrib/Language files/SerbianLatin.nlf
+++ b/Contrib/Language files/SerbianLatin.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Vodi zapisnik o procesu instalacije
# ^Byte
B
# ^Kilo
-k
+ k
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/SimpChinese.nlf b/Contrib/Language files/SimpChinese.nlf
index c8a9804..2756873 100755
--- a/Contrib/Language files/SimpChinese.nlf
+++ b/Contrib/Language files/SimpChinese.nlf
@@ -5,11 +5,12 @@ NLF v6
# Font and size - dash (-) means default 字体å称与大å°
宋体
9
-# Codepage - dash (-) means ANSI code page ANSI å­—ç é¡µ
+# Codepage - dash (-) means ASCII code page ASCII å­—ç é¡µ
936
# RTL - anything else than RTL means LTR ç”±å³è‡³å·¦ä¹¦å†™
-
-# Translator: Kii Ali <kiiali@cpatch.org>,<kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>; Revision date: 2010-09-28
+# Revision date: 2010-09-28
+# Translator: Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>
# ^Branding
Nullsoft Install System %s
# ^SetupCaption
@@ -183,8 +184,8 @@ Setup 将自下列文件夹解除安装 $(^NameDA) 。è¦è§£é™¤å®‰è£…到ä¸åŒæ–
# byte
B
# kilo
-K
+ K
# mega
-M
+ M
# giga
-G
+ G
diff --git a/Contrib/Language files/SimpChinese.nsh b/Contrib/Language files/SimpChinese.nsh
index 22cf102..0fb71c8 100755
--- a/Contrib/Language files/SimpChinese.nsh
+++ b/Contrib/Language files/SimpChinese.nsh
@@ -1,5 +1,5 @@
;Language: 'Chinese (Simplified)' (2052)
-;Translator: Kii Ali <kiiali@cpatch.org>,<kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>
+;Translator: Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>
;Revision date: 2010-09-28
!insertmacro LANGFILE "SimpChinese" "Chinese (Simplified)" "中文(简体)" "Hanyu (Jiantizi)"
@@ -11,7 +11,7 @@
!ifdef MUI_UNWELCOMEPAGE
${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "欢迎使用 $(^NameDA) 解除安装å‘导"
- ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "这个å‘导将全程指引你 $(^NameDA) 的解除安装进程。$\r$\n$\r$\n在开始解除安装之å‰ï¼Œç¡®æ‡§ $(^NameDA) 并未è¿è¡Œå½“中。$\r$\n$\r$\n$_CLICK"
+ ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "这个å‘导将全程指引你 $(^NameDA) 的解除安装进程。$\r$\n$\r$\n在开始解除安装之å‰ï¼Œç¡®è®¤ $(^NameDA) 并未è¿è¡Œå½“中。$\r$\n$\r$\n$_CLICK"
!endif
!ifdef MUI_LICENSEPAGE
diff --git a/Contrib/Language files/Slovak.nlf b/Contrib/Language files/Slovak.nlf
index 8ec7e15..aea0bec 100755
--- a/Contrib/Language files/Slovak.nlf
+++ b/Contrib/Language files/Slovak.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Zaznamenať priebeh inštalácie
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Slovenian.nlf b/Contrib/Language files/Slovenian.nlf
index 4746d6b..b85f628 100755
--- a/Contrib/Language files/Slovenian.nlf
+++ b/Contrib/Language files/Slovenian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1250
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Shrani potek namestitve
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Spanish.nlf b/Contrib/Language files/Spanish.nlf
index c3b2e5b..4f6e309 100755
--- a/Contrib/Language files/Spanish.nlf
+++ b/Contrib/Language files/Spanish.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,9 +184,8 @@ Registrar proceso de instalación
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
-
+ G
diff --git a/Contrib/Language files/SpanishInternational.nlf b/Contrib/Language files/SpanishInternational.nlf
index e3e6316..281c576 100755
--- a/Contrib/Language files/SpanishInternational.nlf
+++ b/Contrib/Language files/SpanishInternational.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ Registrar proceso de instalación
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Swahili.nlf b/Contrib/Language files/Swahili.nlf
index 02ad4bf..3700254 100755
--- a/Contrib/Language files/Swahili.nlf
+++ b/Contrib/Language files/Swahili.nlf
@@ -6,8 +6,8 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
--
+# Codepage - dash (-) means ASCII code page
+1252
# RTL - anything else than RTL means LTR
-
# Translation by MK, Kenya Branch
@@ -184,8 +184,8 @@ Unda batli ya mchakato wa kusakinisha
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Swedish.nlf b/Contrib/Language files/Swedish.nlf
index e76cad7..87b9122 100755
--- a/Contrib/Language files/Swedish.nlf
+++ b/Contrib/Language files/Swedish.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Logga installationsförfarandet
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Thai.nlf b/Contrib/Language files/Thai.nlf
index 01b55c8..d866de3 100755
--- a/Contrib/Language files/Thai.nlf
+++ b/Contrib/Language files/Thai.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
874
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ $(^NameDA) จะถูà¸à¸¢à¸à¹€à¸¥à¸´à¸à¸à¸²à¸£à¸•à¸´à¸”ตั้งจา
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/TradChinese.nlf b/Contrib/Language files/TradChinese.nlf
index c03e16e..81ce2b5 100755
--- a/Contrib/Language files/TradChinese.nlf
+++ b/Contrib/Language files/TradChinese.nlf
@@ -5,11 +5,15 @@ NLF v6
# Font and size - dash (-) means default å­—åž‹å稱與大å°
新細明體
9
-# Codepage - dash (-) means ANSI code page ANSI 字碼é 
+# Codepage - dash (-) means ASCII code page ASCII 字碼é 
950
# RTL - anything else than RTL means LTR ç”±å³è‡³å·¦æ›¸å¯«
-
-# Translator: Kii Ali <kiiali@cpatch.org>,<kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>; Revision date: 2010-09-28
+# Revision date: 2017-03-17
+# Translators:
+## Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>
+## Walter Cheuk <wwycheuk@gamil.com>
+#
# ^Branding
Nullsoft Install System %s
# ^SetupCaption
@@ -37,91 +41,91 @@ $(^Name) 解除安è£
# ^UnCompletedSubCaption
: 完æˆ
# ^BackBtn
-< 上一步(&P)
+< 上一步(&B)
# ^NextBtn
下一步(&N) >
# ^AgreeBtn
-我接å—(&I)
+我åŒæ„(&A)
# ^AcceptBtn
-我接å—「授權å”è­°ã€ä¸­çš„æ¢æ¬¾(&A)
+我接å—「授權å”è­°ã€çš„æ¢æ¬¾(&A)
# ^DontAcceptBtn
-我ä¸æŽ¥å—「授權å”è­°ã€ä¸­çš„æ¢æ¬¾(&N)
+我ä¸æŽ¥å—「授權å”è­°ã€çš„æ¢æ¬¾(&D)
# ^InstallBtn
安è£(&I)
# ^UninstallBtn
解除安è£(&U)
# ^CancelBtn
-å–消(&C)
+å–消
# ^CloseBtn
-關閉(&L)
+關閉(&C)
# ^BrowseBtn
-ç€è¦½(&B)...
+ç€è¦½(&R)...
# ^ShowDetailsBtn
顯示細節(&D)
# ^ClickNext
-按一下 [下一步(N)] 繼續。
+按「下一步(N)ã€ç¹¼çºŒã€‚
# ^ClickInstall
-按一下 [安è£(I)] 開始安è£é€²ç¨‹ã€‚
+按「安è£(I)ã€é–‹å§‹å®‰è£ã€‚
# ^ClickUninstall
-按一下 [解除安è£(U)] 開始解除安è£é€²ç¨‹ã€‚
+按「解除安è£(U)ã€é–‹å§‹è§£é™¤å®‰è£ã€‚
# ^Name
å稱
# ^Completed
已完æˆ
# ^LicenseText
-åœ¨å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果你接å—å”議中所有æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ [我åŒæ„(I)] 。
+åœ¨å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果接å—å”議所有æ¢æ¬¾ï¼ŒæŒ‰ã€Œæˆ‘åŒæ„(A)ã€ã€‚
# ^LicenseTextCB
-åœ¨å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果你接å—å”議中所有æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ä¸‹æ–¹çš„勾é¸æ¡†ã€‚ $_CLICK
+åœ¨å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果接å—å”議所有æ¢æ¬¾ï¼ŒæŒ‰ä¸‹æ–¹çš„勾é¸æ¡†ã€‚ $_CLICK
# ^LicenseTextRB
-åœ¨å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果你接å—å”議中所有æ¢æ¬¾ï¼Œé¸æ“‡ä¸‹æ–¹çš„第一個é¸é …。 $_CLICK
+åœ¨å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果接å—å”議所有æ¢æ¬¾ï¼Œé¸æ“‡ä¸‹æ–¹çš„第一個é¸é …。 $_CLICK
# ^UnLicenseText
-åœ¨è§£é™¤å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果你接å—å”議中所有æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ [我åŒæ„(I)] 。
+åœ¨è§£é™¤å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果接å—å”議中所有æ¢æ¬¾ï¼ŒæŒ‰ã€Œæˆ‘åŒæ„(A)ã€ã€‚
# ^UnLicenseTextCB
-åœ¨è§£é™¤å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果你接å—å”議中所有æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ä¸‹æ–¹çš„勾é¸æ¡†ã€‚ $_CLICK
+åœ¨è§£é™¤å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果接å—å”議中所有æ¢æ¬¾ï¼ŒæŒ‰ä¸‹æ–¹çš„勾é¸æ¡†ã€‚ $_CLICK
# ^UnLicenseTextRB
-åœ¨è§£é™¤å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果你接å—å”議中所有æ¢æ¬¾ï¼Œé¸æ“‡ä¸‹æ–¹çš„第一個é¸é …。 $_CLICK
+åœ¨è§£é™¤å®‰è£ $(^NameDA) 之å‰è«‹æª¢é–±æŽˆæ¬Šå”議。如果接å—å”議中所有æ¢æ¬¾ï¼Œé¸æ“‡çš„第一個é¸é …。 $_CLICK
# ^Custom
自訂
# ^ComponentsText
-勾é¸ä½ æƒ³è¦å®‰è£çš„元件,並解除勾é¸ä½ ä¸å¸Œæœ›å®‰è£çš„元件。 $_CLICK
+勾é¸æƒ³è¦å®‰è£çš„元件,並解除勾é¸ä¸æƒ³å®‰è£çš„元件。 $_CLICK
# ^ComponentsSubText1
é¸å–安è£çš„é¡žåž‹:
# ^ComponentsSubText2_NoInstTypes
é¸å–安è£çš„元件:
# ^ComponentsSubText2
-或者,自訂é¸å–想安è£çš„元件:
+åˆæˆ–者,自訂é¸å–想安è£çš„元件:
# ^UnComponentsText
-勾é¸ä½ æƒ³è¦è§£é™¤å®‰è£çš„元件,並解除勾é¸ä½ ä¸æƒ³è¦æœ›è§£é™¤å®‰è£çš„元件。 $_CLICK
+勾é¸æƒ³è¦è§£é™¤å®‰è£çš„元件,並解除勾é¸ä¸æƒ³è§£é™¤å®‰è£çš„元件。 $_CLICK
# ^UnComponentsSubText1
-é¸æ“‡è§£é™¤å®‰è£çš„é¡žåž‹:
+é¸å–解除安è£çš„é¡žåž‹:
# ^UnComponentsSubText2_NoInstTypes
-é¸æ“‡è¦è§£é™¤å®‰è£çš„元件:
+é¸å–è¦è§£é™¤å®‰è£çš„元件:
# ^UnComponentsSubText2
-或是,é¸æ“‡æƒ³è¦è§£é™¤å®‰è£çš„å¯é¸é …元件:
+åˆæˆ–者,é¸æ“‡æƒ³è¦è§£é™¤å®‰è£çš„å¯é¸é …元件:
# ^DirText
-Setup å°‡å®‰è£ $(^NameDA) 在下列資料夾。è¦å®‰è£åˆ°ä¸åŒè³‡æ–™å¤¾ï¼ŒæŒ‰ä¸€ä¸‹ [ç€è¦½(B)...] 並é¸æ“‡å…¶ä»–的資料夾。 $_CLICK
+安è£ç¨‹å¼æœƒå°‡ $(^NameDA) 安è£åœ¨ä»¥ä¸‹è³‡æ–™å¤¾ã€‚è¦å®‰è£åˆ°ä¸åŒçš„資料夾,按「ç€è¦½(B)...ã€ä¸¦é¸æ“‡å…¶ä»–資料夾。 $_CLICK
# ^DirSubText
目標資料夾
# ^DirBrowseText
-é¸æ“‡è¦å®‰è£ $(^NameDA) 的資料夾ä½ç½®:
+é¸å–è¦å®‰è£ $(^NameDA) 的資料夾:
# ^UnDirText
-Setup å°‡è‡ªä¸‹åˆ—è³‡æ–™å¤¾è§£é™¤å®‰è£ $(^NameDA) 。è¦è§£é™¤å®‰è£åˆ°ä¸åŒè³‡æ–™å¤¾ï¼ŒæŒ‰ä¸€ä¸‹ [ç€è¦½(B)...] 並é¸æ“‡å…¶ä»–的資料夾。 $_CLICK
+安è£ç¨‹å¼æœƒè‡ªä»¥ä¸‹è³‡æ–™å¤¾è§£é™¤å®‰è£ $(^NameDA) 。è¦è§£é™¤å®‰è£ä¸åŒçš„資料夾,按「ç€è¦½(B)...ã€ä¸¦é¸æ“‡å…¶ä»–資料夾。 $_CLICK
# ^UnDirSubText
""
# ^UnDirBrowseText
-é¸æ“‡è¦è§£é™¤å®‰è£ $(^NameDA) 的資料夾:
+é¸å–è¦è§£é™¤å®‰è£ $(^NameDA) 的資料夾:
# ^SpaceAvailable
"å¯ç”¨ç©ºé–“: "
# ^SpaceRequired
"所需空間: "
# ^UninstallingText
-這個精éˆå°‡å¾žä½ çš„é›»è…¦è§£é™¤å®‰è£ $(^NameDA) 。 $_CLICK
+æœƒè‡ªä»¥ä¸‹è³‡æ–™å¤¾è§£é™¤å®‰è£ $(^NameDA) 。 $_CLICK
# ^UninstallingSubText
解除安è£ç›®éŒ„:
# ^FileError
-無法開啟è¦å¯«å…¥çš„檔案: \r\n\t"$0"\r\n按一下 [Abort] åœæ­¢å®‰è£ï¼Œ\r\n [Retry] é‡æ–°å˜—試寫入檔案,或\r\n [Ignore] 忽略這個檔案。
+無法開啟è¦å¯«å…¥çš„檔案: \r\n\t"$0"\r\n按「中止ã€åœæ­¢å®‰è£ï¼Œ\r\n「é‡è©¦ã€é‡æ–°å˜—試寫入檔案,或\r\n「忽略ã€ç•¥éŽæ­¤æª”案。
# ^FileError_NoIgnore
-無法開啟è¦å¯«å…¥çš„檔案: \r\n\t"$0"\r\n按一下 [Retry] é‡æ–°å˜—試寫入檔案,或\r\n [Cancel] åœæ­¢å®‰è£ã€‚
+無法開啟è¦å¯«å…¥çš„檔案: \r\n\t"$0"\r\n按「é‡è©¦ã€é‡æ–°å˜—試寫入檔案,或\r\n「å–消ã€åœæ­¢å®‰è£ã€‚
# ^CantWrite
"無法寫入: "
# ^CopyFailed
@@ -145,15 +149,15 @@ Setup å°‡è‡ªä¸‹åˆ—è³‡æ–™å¤¾è§£é™¤å®‰è£ $(^NameDA) 。è¦è§£é™¤å®‰è£åˆ°ä¸åŒè³
# ^Delete
"刪除檔案: "
# ^DeleteOnReboot
-"é‡æ–°å•Ÿå‹•å¾Œåˆªé™¤: "
+"é‡æ–°é–‹æ©Ÿå¾Œåˆªé™¤: "
# ^ErrorCreatingShortcut
-"正在建立æ·å¾‘時發生錯誤: "
+"建立æ·å¾‘時發生錯誤: "
# ^ErrorCreating
-"正在建立時發生錯誤: "
+"建立時發生錯誤: "
# ^ErrorDecompressing
-"正在解壓縮資料發生錯誤ï¼å·²æ壞的安è£ç¨‹å¼ï¼Ÿ"
+"解壓縮資料發生錯誤ï¼å®‰è£ç¨‹å¼æ˜¯å¦å·²æ壞?"
# ^ErrorRegistering
-"正在註冊 DLL 時發生錯誤"
+"註冊 DLL 時發生錯誤"
# ^ExecShell
"執行殼層程å¼: "
# ^Exec
@@ -163,15 +167,15 @@ Setup å°‡è‡ªä¸‹åˆ—è³‡æ–™å¤¾è§£é™¤å®‰è£ $(^NameDA) 。è¦è§£é™¤å®‰è£åˆ°ä¸åŒè³
# ^ErrorWriting
"抽å–: 無法寫入檔案 "
# ^InvalidOpcode
-"安è£æ毀: 無效的作業代碼 "
+"安è£ç¨‹å¼æ毀: 無效的作業代碼 "
# ^NoOLE
"沒有 OLE 用於: "
# ^OutputFolder
-"輸出目錄: "
+"輸出資料夾: "
# ^RemoveFolder
-"移除目錄: "
+"移除資料夾: "
# ^RenameOnReboot
-"é‡æ–°å•Ÿå‹•å¾Œé‡æ–°å‘½å: "
+"é‡æ–°é–‹æ©Ÿå¾Œé‡æ–°å‘½å: "
# ^Rename
"é‡æ–°å‘½å: "
# ^Skipped
@@ -179,12 +183,12 @@ Setup å°‡è‡ªä¸‹åˆ—è³‡æ–™å¤¾è§£é™¤å®‰è£ $(^NameDA) 。è¦è§£é™¤å®‰è£åˆ°ä¸åŒè³
# ^CopyDetails
"複製細節到剪貼簿 "
# ^LogInstall
-"日誌安è£é€²ç¨‹"
-# byte
+"將安è£é€²ç¨‹è¨˜å…¥æ—¥èªŒ"
+# ^Byte
B
-# kilo
-K
-# mega
-M
-# giga
-G \ No newline at end of file
+# ^Kilo
+ K
+# ^Mega
+ M
+# ^Giga
+ G
diff --git a/Contrib/Language files/TradChinese.nsh b/Contrib/Language files/TradChinese.nsh
index 3d0f870..fd56fbc 100755
--- a/Contrib/Language files/TradChinese.nsh
+++ b/Contrib/Language files/TradChinese.nsh
@@ -1,33 +1,34 @@
;Language: 'Chinese (Traditional)' (1028)
-;Translator: Kii Ali <kiiali@cpatch.org>,<kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>
-;Revision date: 2010-09-28
+;Translator: Kii Ali <kiiali@cpatch.org>, <kiiali@ms1.url.com.tw>, <kiiali@pchome.com.tw>
+;Translator: Walter Cheuk <wwycheuk@gmail.com>
+;Revision date: 2017-03-17
!insertmacro LANGFILE "TradChinese" "Chinese (Traditional)" "中文(ç¹é«”)" "Hanyu (Fantizi)"
!ifdef MUI_WELCOMEPAGE
${LangFileString} MUI_TEXT_WELCOME_INFO_TITLE "歡迎使用 $(^NameDA) 安è£ç²¾éˆ"
- ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "這個精éˆå°‡æŒ‡å¼•ä½ å®Œæˆ $(^NameDA) 的安è£é€²ç¨‹ã€‚$\r$\n$\r$\n在開始安è£ä¹‹å‰ï¼Œå»ºè­°å…ˆé—œé–‰å…¶ä»–所有應用程å¼ã€‚這將å…許\「安è£ç¨‹å¼ã€æ›´æ–°æŒ‡å®šçš„系統檔案,而ä¸éœ€è¦é‡æ–°å•Ÿå‹•ä½ çš„電腦。$\r$\n$\r$\n$_CLICK"
+ ${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "本精éˆæœƒå¼•å°Žæ‚¨å®Œæˆå®‰è£ $(^NameDA)。$\r$\n$\r$\n在開始安è£ä¹‹å‰ï¼Œå»ºè­°å…ˆé—œé–‰å…¶ä»–所有應用程å¼ã€‚這將å…許安è£ç¨‹å¼æ›´æ–°ç›¸é—œçš„系統檔案,而ä¸éœ€è¦é‡æ–°å•Ÿå‹•é›»è…¦ã€‚$\r$\n$\r$\n$_CLICK"
!endif
!ifdef MUI_UNWELCOMEPAGE
${LangFileString} MUI_UNTEXT_WELCOME_INFO_TITLE "歡迎使用 $(^NameDA) 解除安è£ç²¾éˆ"
- ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "這個精éˆå°‡å…¨ç¨‹æŒ‡å¼•ä½  $(^NameDA) 的解除安è£é€²ç¨‹ã€‚$\r$\n$\r$\n在開始解除安è£ä¹‹å‰ï¼Œç¢ºèª $(^NameDA) 並未執行當中。$\r$\n$\r$\n$_CLICK"
+ ${LangFileString} MUI_UNTEXT_WELCOME_INFO_TEXT "本精éˆæœƒå¼•å°Žæ‚¨è§£é™¤å®‰è£ $(^NameDA)。$\r$\n$\r$\n在開始解除安è£ä¹‹å‰ï¼Œè«‹ç¢ºèª $(^NameDA) 並未有執行。$\r$\n$\r$\n$_CLICK"
!endif
!ifdef MUI_LICENSEPAGE
${LangFileString} MUI_TEXT_LICENSE_TITLE "授權å”è­°"
${LangFileString} MUI_TEXT_LICENSE_SUBTITLE "åœ¨å®‰è£ $(^NameDA) 之å‰ï¼Œè«‹æª¢é–±æŽˆæ¬Šæ¢æ¬¾ã€‚"
- ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "如果你接å—å”議中的æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ [我åŒæ„(I)] 繼續安è£ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½å®‰è£ $(^NameDA) 。"
- ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "如果你接å—å”議中的æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ä¸‹æ–¹çš„勾é¸æ¡†ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½å®‰è£ $(^NameDA)。$_CLICK"
- ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "如果你接å—å”議中的æ¢æ¬¾ï¼Œé¸æ“‡ä¸‹æ–¹ç¬¬ä¸€å€‹é¸é …。必須è¦æŽ¥å—å”è­°æ‰èƒ½å®‰è£ $(^NameDA)。$_CLICK"
+ ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM "如果接å—å”è­°çš„æ¢æ¬¾ï¼ŒæŒ‰ [我åŒæ„(A)] 繼續安è£ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½å®‰è£ $(^NameDA) 。"
+ ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_CHECKBOX "如果接å—å”è­°çš„æ¢æ¬¾ï¼ŒæŒ‰ä¸‹æ–¹çš„勾é¸æ¡†ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½å®‰è£ $(^NameDA)。$_CLICK"
+ ${LangFileString} MUI_INNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "如果接å—å”議中的æ¢æ¬¾ï¼Œé¸æ“‡ä¸‹æ–¹ç¬¬ä¸€å€‹é¸é …。必須è¦æŽ¥å—å”è­°æ‰èƒ½å®‰è£ $(^NameDA)。$_CLICK"
!endif
!ifdef MUI_UNLICENSEPAGE
${LangFileString} MUI_UNTEXT_LICENSE_TITLE "授權å”è­°"
${LangFileString} MUI_UNTEXT_LICENSE_SUBTITLE "åœ¨è§£é™¤å®‰è£ $(^NameDA) 之å‰ï¼Œè«‹æª¢é–±æŽˆæ¬Šæ¢æ¬¾ã€‚"
- ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "如果你接å—å”議中的æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ [我åŒæ„(I)] 繼續解除安è£ã€‚如果你é¸å– [å–消(C)] ,安è£ç¨‹å¼å°‡æœƒé—œé–‰ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½è§£é™¤å®‰è£ $(^NameDA) 。"
- ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "如果你接å—å”議中的æ¢æ¬¾ï¼ŒæŒ‰ä¸€ä¸‹ä¸‹æ–¹çš„勾é¸æ¡†ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½è§£é™¤å®‰è£ $(^NameDA)。$_CLICK"
- ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "如果你接å—å”議中的æ¢æ¬¾ï¼Œé¸æ“‡ä¸‹æ–¹ç¬¬ä¸€å€‹é¸é …。必須è¦æŽ¥å—å”è­°æ‰èƒ½è§£é™¤å®‰è£ $(^NameDA)。$_CLICK"
+ ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM "如果接å—å”è­°çš„æ¢æ¬¾ï¼ŒæŒ‰ [我åŒæ„(A)] 繼續解除安è£ã€‚如果é¸å– [å–消] ,安è£ç¨‹å¼æœƒé—œé–‰ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½è§£é™¤å®‰è£ $(^NameDA) 。"
+ ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_CHECKBOX "如果接å—å”è­°çš„æ¢æ¬¾ï¼ŒæŒ‰ä¸‹æ–¹çš„勾é¸æ¡†ã€‚å¿…é ˆè¦æŽ¥å—å”è­°æ‰èƒ½è§£é™¤å®‰è£ $(^NameDA)。$_CLICK"
+ ${LangFileString} MUI_UNINNERTEXT_LICENSE_BOTTOM_RADIOBUTTONS "如果接å—å”è­°çš„æ¢æ¬¾ï¼Œé¸æ“‡ä¸‹æ–¹ç¬¬ä¸€å€‹é¸é …。必須è¦æŽ¥å—å”è­°æ‰èƒ½è§£é™¤å®‰è£ $(^NameDA)。$_CLICK"
!endif
!ifdef MUI_LICENSEPAGE | MUI_UNLICENSEPAGE
@@ -36,20 +37,20 @@
!ifdef MUI_COMPONENTSPAGE
${LangFileString} MUI_TEXT_COMPONENTS_TITLE "é¸æ“‡å…ƒä»¶"
- ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "é¸æ“‡ä½ æƒ³è¦å®‰è£ $(^NameDA) 的那些功能。"
+ ${LangFileString} MUI_TEXT_COMPONENTS_SUBTITLE "é¸æ“‡æƒ³è¦å®‰è£ $(^NameDA) 的功能。"
!endif
!ifdef MUI_UNCOMPONENTSPAGE
${LangFileString} MUI_UNTEXT_COMPONENTS_TITLE "é¸å–元件"
- ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "é¸å– $(^NameDA) 當中你想è¦è§£é™¤å®‰è£çš„功能。"
+ ${LangFileString} MUI_UNTEXT_COMPONENTS_SUBTITLE "é¸å– $(^NameDA) 當中想è¦è§£é™¤çš„功能。"
!endif
!ifdef MUI_COMPONENTSPAGE | MUI_UNCOMPONENTSPAGE
- ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "æè¿°"
+ ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_TITLE "說明"
!ifndef NSIS_CONFIG_COMPONENTPAGE_ALTERNATIVE
- ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "åœæ‡¸ä½ çš„滑鼠指標到元件之上,便å¯è¦‹åˆ°å®ƒçš„æ述。"
+ ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "將滑鼠指標åœæ‡¸åˆ°å…ƒä»¶ä¹‹ä¸Šï¼Œå³å¯è¦‹åˆ°å…¶èªªæ˜Žã€‚"
!else
- ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "é¸æ“‡ä¸€å€‹å…ƒä»¶ï¼Œä¾¿å¯è¦‹åˆ°å®ƒçš„æ述。"
+ ${LangFileString} MUI_INNERTEXT_COMPONENTS_DESCRIPTION_INFO "é¸å–元件,å³å¯è¦‹åˆ°å…¶èªªæ˜Žã€‚"
!endif
!endif
@@ -64,40 +65,40 @@
!endif
!ifdef MUI_INSTFILESPAGE
- ${LangFileString} MUI_TEXT_INSTALLING_TITLE "正在安è£"
- ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "$(^NameDA) 正在安è£ï¼Œè«‹ç­‰å€™ã€‚"
- ${LangFileString} MUI_TEXT_FINISH_TITLE "安è£å®Œæˆ"
- ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "安è£ç¨‹å¼å·²æˆåŠŸåœ°åŸ·è¡Œå®Œæˆã€‚"
- ${LangFileString} MUI_TEXT_ABORT_TITLE "安è£å·±ä¸­æ­¢"
- ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "安è£ç¨‹å¼ä¸¦æœªæˆåŠŸåœ°åŸ·è¡Œå®Œæˆã€‚"
+ ${LangFileString} MUI_TEXT_INSTALLING_TITLE "安è£"
+ ${LangFileString} MUI_TEXT_INSTALLING_SUBTITLE "$(^NameDA) 正在安è£ï¼Œè«‹ç¨å€™ã€‚"
+ ${LangFileString} MUI_TEXT_FINISH_TITLE "完æˆå®‰è£"
+ ${LangFileString} MUI_TEXT_FINISH_SUBTITLE "安è£å·²å®Œæˆã€‚"
+ ${LangFileString} MUI_TEXT_ABORT_TITLE "已中止安è£"
+ ${LangFileString} MUI_TEXT_ABORT_SUBTITLE "安è£ä¸¦æœªå®Œæˆã€‚"
!endif
!ifdef MUI_UNINSTFILESPAGE
- ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "正在解除安è£"
- ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "$(^NameDA) 正在解除安è£ï¼Œè«‹ç­‰å€™ã€‚"
- ${LangFileString} MUI_UNTEXT_FINISH_TITLE "解除安è£å·²å®Œæˆ"
- ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "解除安è£ç¨‹å¼å·²æˆåŠŸåœ°åŸ·è¡Œå®Œæˆã€‚"
- ${LangFileString} MUI_UNTEXT_ABORT_TITLE "解除安è£å·²ä¸­æ­¢"
- ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "解除安è£ç¨‹å¼ä¸¦æœªæˆåŠŸåœ°åŸ·è¡Œå®Œæˆã€‚"
+ ${LangFileString} MUI_UNTEXT_UNINSTALLING_TITLE "解除安è£"
+ ${LangFileString} MUI_UNTEXT_UNINSTALLING_SUBTITLE "$(^NameDA) 正在解除安è£ï¼Œè«‹ç¨å€™ã€‚"
+ ${LangFileString} MUI_UNTEXT_FINISH_TITLE "完æˆè§£é™¤å®‰è£"
+ ${LangFileString} MUI_UNTEXT_FINISH_SUBTITLE "解除安è£å·²å®Œæˆã€‚"
+ ${LangFileString} MUI_UNTEXT_ABORT_TITLE "已中止解除安è£"
+ ${LangFileString} MUI_UNTEXT_ABORT_SUBTITLE "解除安è£ä¸¦æœªå®Œæˆã€‚"
!endif
!ifdef MUI_FINISHPAGE
- ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "æ­£åœ¨å®Œæˆ $(^NameDA) 安è£ç²¾éˆ"
- ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "$(^NameDA) 已安è£åœ¨ä½ çš„系統。$\r$\n按一下 [完æˆ(F)] 關閉此精éˆã€‚"
- ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "你的系統需è¦é‡æ–°å•Ÿå‹•ï¼Œä»¥ä¾¿å®Œæˆ $(^NameDA) 的安è£ã€‚ç¾åœ¨è¦é‡æ–°å•Ÿå‹•å—Žï¼Ÿ"
+ ${LangFileString} MUI_TEXT_FINISH_INFO_TITLE "å³å°‡å®Œæˆå®‰è£ $(^NameDA)"
+ ${LangFileString} MUI_TEXT_FINISH_INFO_TEXT "å·²åœ¨é›»è…¦å®‰è£ $(^NameDA) 。$\r$\n按 [完æˆ(F)] 關閉安è£ç¨‹å¼ã€‚"
+ ${LangFileString} MUI_TEXT_FINISH_INFO_REBOOT "電腦需è¦é‡æ–°é–‹æ©Ÿï¼Œæ‰èƒ½å®Œæˆå®‰è£ $(^NameDA) 。è¦é¦¬ä¸Šé‡æ–°é–‹æ©Ÿå—Žï¼Ÿ"
!endif
!ifdef MUI_UNFINISHPAGE
- ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "æ­£åœ¨å®Œæˆ $(^NameDA) 解除安è£ç²¾éˆ"
- ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "$(^NameDA) 已從你的電腦解除安è£ã€‚$\r$\n$\r$\n按一下 [完æˆ] 關閉這個精éˆã€‚"
- ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "電腦需è¦é‡æ–°å•Ÿå‹•ï¼Œä»¥ä¾¿å®Œæˆ $(^NameDA) 的解除安è£ã€‚ç¾åœ¨æƒ³è¦é‡æ–°å•Ÿå‹•å—Žï¼Ÿ"
+ ${LangFileString} MUI_UNTEXT_FINISH_INFO_TITLE "å³å°‡å®Œæˆè§£é™¤å®‰è£ $(^NameDA)"
+ ${LangFileString} MUI_UNTEXT_FINISH_INFO_TEXT "å·²è‡ªé›»è…¦è§£é™¤å®‰è£ $(^NameDA) 。$\r$\n$\r$\n按 [完æˆ(F)] 關閉安è£ç¨‹å¼ã€‚"
+ ${LangFileString} MUI_UNTEXT_FINISH_INFO_REBOOT "電腦需è¦é‡æ–°é–‹æ©Ÿï¼Œæ‰èƒ½å®Œæˆè§£é™¤å®‰è£ $(^NameDA) 。è¦é¦¬ä¸Šé‡æ–°é–‹æ©Ÿå—Žï¼Ÿ"
!endif
!ifdef MUI_FINISHPAGE | MUI_UNFINISHPAGE
- ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "是,ç¾åœ¨é‡æ–°å•Ÿå‹•(&Y)"
- ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "å¦ï¼Œæˆ‘ç¨å¾Œå†è‡ªè¡Œé‡æ–°å•Ÿå‹•(&N)"
+ ${LangFileString} MUI_TEXT_FINISH_REBOOTNOW "是,馬上é‡æ–°é–‹æ©Ÿ(&Y)"
+ ${LangFileString} MUI_TEXT_FINISH_REBOOTLATER "å¦ï¼Œæˆ‘ç¨å¾Œå†è‡ªè¡Œé‡æ–°é–‹æ©Ÿ(&N)"
${LangFileString} MUI_TEXT_FINISH_RUN "執行 $(^NameDA)(&R)"
- ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "顯示「讀我檔案ã€(&M)"
+ ${LangFileString} MUI_TEXT_FINISH_SHOWREADME "顯示「讀我檔案ã€(&S)"
${LangFileString} MUI_BUTTONTEXT_FINISH "完æˆ(&F)"
!endif
@@ -110,21 +111,21 @@
!ifdef MUI_UNCONFIRMPAGE
${LangFileString} MUI_UNTEXT_CONFIRM_TITLE "è§£é™¤å®‰è£ $(^NameDA)"
- ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "å¾žä½ çš„é›»è…¦è§£é™¤å®‰è£ $(^NameDA) 。"
+ ${LangFileString} MUI_UNTEXT_CONFIRM_SUBTITLE "è‡ªé›»è…¦è§£é™¤å®‰è£ $(^NameDA) 。"
!endif
!ifdef MUI_ABORTWARNING
- ${LangFileString} MUI_TEXT_ABORTWARNING "你確定è¦é›¢é–‹ $(^Name) 安è£ç¨‹å¼å—Žï¼Ÿ"
+ ${LangFileString} MUI_TEXT_ABORTWARNING "確定è¦çµæŸ $(^Name) 的安è£ç¨‹å¼å—Žï¼Ÿ"
!endif
!ifdef MUI_UNABORTWARNING
- ${LangFileString} MUI_UNTEXT_ABORTWARNING "你確定è¦é›¢é–‹ $(^Name) 解除安è£ç¨‹å¼å—Žï¼Ÿ"
+ ${LangFileString} MUI_UNTEXT_ABORTWARNING "確定è¦çµæŸ $(^Name) 的解除安è£ç¨‹å¼å—Žï¼Ÿ"
!endif
!ifdef MULTIUSER_INSTALLMODEPAGE
- ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "é¸å–使用者"
- ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "é¸å–你想è¦å®‰è£ $(^NameDA) 給那一個使用者。"
- ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "é¸æ“‡ä½ æƒ³è¦å®‰è£ $(^NameDA) 給自己使用,或此電腦的所有使用者。 $(^ClickNext)"
- ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "安è£çµ¦æ­¤é›»è…¦çš„所有使用者(&A)"
- ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "安è£çµ¦è‡ªå·±(&M)"
+ ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_TITLE "é¸æ“‡ä½¿ç”¨è€…"
+ ${LangFileString} MULTIUSER_TEXT_INSTALLMODE_SUBTITLE "é¸æ“‡è¦å°‡ $(^NameDA) 安è£çµ¦å“ªä½ä½¿ç”¨è€…。"
+ ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_TOP "é¸æ“‡åƒ…å°‡ $(^NameDA) 安è£çµ¦è‡ªå·±ä½¿ç”¨ï¼Œé‚„是此電腦的所有使用者皆å¯ä½¿ç”¨ã€‚ $(^ClickNext)"
+ ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_ALLUSERS "安è£çµ¦æ­¤é›»è…¦çš„所有使用者"
+ ${LangFileString} MULTIUSER_INNERTEXT_INSTALLMODE_CURRENTUSER "僅安è£çµ¦è‡ªå·±"
!endif
diff --git a/Contrib/Language files/Turkish.nlf b/Contrib/Language files/Turkish.nlf
index 675d10d..c959f2c 100755
--- a/Contrib/Language files/Turkish.nlf
+++ b/Contrib/Language files/Turkish.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1254
# RTL - anything else than RTL means LTR
-
@@ -185,8 +185,8 @@ Kurulum sürecinin kaydını tut
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G \ No newline at end of file
+ G
diff --git a/Contrib/Language files/Ukrainian.nlf b/Contrib/Language files/Ukrainian.nlf
index cf2e3d0..fae9195 100755
--- a/Contrib/Language files/Ukrainian.nlf
+++ b/Contrib/Language files/Ukrainian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1251
# RTL - anything else than RTL means LTR
-
@@ -185,8 +185,8 @@ $(^Name) ВидаленнÑ
# byte
б
# kilo
-К
+ К
# mega
-М
+ М
# giga
-Г
+ Г
diff --git a/Contrib/Language files/Uzbek.nlf b/Contrib/Language files/Uzbek.nlf
index 1310bb5..8d32284 100755
--- a/Contrib/Language files/Uzbek.nlf
+++ b/Contrib/Language files/Uzbek.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
diff --git a/Contrib/Language files/Valencian.nlf b/Contrib/Language files/Valencian.nlf
index c909551..9da5430 100755
--- a/Contrib/Language files/Valencian.nlf
+++ b/Contrib/Language files/Valencian.nlf
@@ -5,7 +5,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Registrar proces d'instalacio
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Vietnamese.nlf b/Contrib/Language files/Vietnamese.nlf
index 5370b7e..7eacb00 100755
--- a/Contrib/Language files/Vietnamese.nlf
+++ b/Contrib/Language files/Vietnamese.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1258
# RTL - anything else than RTL means LTR
-
@@ -184,8 +184,8 @@ LÆ°u kiÌ quaÌ triÌ€nh caÌ€i đặt
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Welsh.nlf b/Contrib/Language files/Welsh.nlf
index f737015..516e1e9 100755
--- a/Contrib/Language files/Welsh.nlf
+++ b/Contrib/Language files/Welsh.nlf
@@ -6,8 +6,8 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
--
+# Codepage - dash (-) means ASCII code page
+1252
# RTL - anything else than RTL means LTR
-
# Translation by Rhoslyn Prys, Meddal.com
@@ -184,8 +184,8 @@ Cofnodi'r brosed gosod
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Language files/Yoruba.nlf b/Contrib/Language files/Yoruba.nlf
index 141df29..9f339b3 100755
--- a/Contrib/Language files/Yoruba.nlf
+++ b/Contrib/Language files/Yoruba.nlf
@@ -6,7 +6,7 @@ NLF v6
# Font and size - dash (-) means default
-
-
-# Codepage - dash (-) means ANSI code page
+# Codepage - dash (-) means ASCII code page
1252
# RTL - anything else than RTL means LTR
-
@@ -183,8 +183,8 @@ Kọ gbogbo ìgbésẹ̀ sílẹ̀
# ^Byte
B
# ^Kilo
-K
+ K
# ^Mega
-M
+ M
# ^Giga
-G
+ G
diff --git a/Contrib/Library/LibraryLocal/LibraryLocal.cpp b/Contrib/Library/LibraryLocal/LibraryLocal.cpp
index 5b4cb7e..1151a15 100755
--- a/Contrib/Library/LibraryLocal/LibraryLocal.cpp
+++ b/Contrib/Library/LibraryLocal/LibraryLocal.cpp
@@ -150,8 +150,8 @@ int _tmain(int argc, TCHAR* argv[])
}
else
{
- fprintf(fHdr, "!define LIBRARY_VERSION_HIGH %lu\n", high);
- fprintf(fHdr, "!define LIBRARY_VERSION_LOW %lu\n", low);
+ fprintf(fHdr, "!define LIBRARY_VERSION_HIGH %lu\n", static_cast<unsigned long>(high));
+ fprintf(fHdr, "!define LIBRARY_VERSION_LOW %lu\n", static_cast<unsigned long>(low));
}
fclose(fHdr);
diff --git a/Contrib/Library/RegTool/RegTool.c b/Contrib/Library/RegTool/RegTool.c
deleted file mode 100755
index 450165b..0000000
--- a/Contrib/Library/RegTool/RegTool.c
+++ /dev/null
@@ -1,382 +0,0 @@
-// Unicode support by Jim Park & Olivier Marcoux
-
-#include "../../../Source/Platform.h"
-#include <windows.h>
-
-#ifndef _CRT_STRINGIZE
-#define __CRT_STRINGIZE(_Value) #_Value
-#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
-#endif /* _CRT_STRINGIZE */
-
-#define STR_SIZE 1024
-
-void RegFile(TCHAR cmd, TCHAR *file, int x64);
-void RegDll(TCHAR *file);
-void RegTypeLib(TCHAR *file);
-BOOL DeleteFileOnReboot(TCHAR *pszFile);
-
-NSIS_ENTRYPOINT_GUINOCRT
-EXTERN_C void NSISWinMainNOCRT()
-{
- TCHAR *cmdline;
- TCHAR seekchar = _T(' ');
-
- cmdline = GetCommandLine();
- if (*cmdline == _T('\"'))
- seekchar = *cmdline++;
-
- while (*cmdline && *cmdline != seekchar)
- cmdline = CharNext(cmdline);
- cmdline = CharNext(cmdline);
- while (*cmdline == _T(' '))
- cmdline++;
-
- if (*cmdline++ != _T('/'))
- {
- ExitProcess(1);
- }
-
- if (*cmdline == _T('S'))
- {
- HKEY rootkey;
- TCHAR *keyname, *file; // These are turned into heap memory to avoid _chkstk
- keyname = (TCHAR*) GlobalAlloc(GPTR, STR_SIZE*sizeof(TCHAR));
- file = (TCHAR*) GlobalAlloc(GPTR, STR_SIZE*sizeof(TCHAR));
-
- if (SUCCEEDED(RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\NSIS.Library.RegTool.v3"), 0, KEY_READ, &rootkey)))
- {
- while (RegEnumKey(rootkey, 0, keyname, STR_SIZE) == ERROR_SUCCESS)
- {
- HKEY key;
-
- if (SUCCEEDED(RegOpenKeyEx(rootkey, keyname, 0, KEY_READ, &key)))
- {
- DWORD t, count, l = sizeof(DWORD);
-
- if (SUCCEEDED(RegQueryValueEx(key, _T("count"), NULL, &t, (LPBYTE) &count, &l)) && t == REG_DWORD)
- {
- DWORD j;
- TCHAR valname[128], mode[3];
-
- for (j = 1; j <= count; j++)
- {
- wsprintf(valname, _T("%u.mode"), j);
- l = sizeof(mode);
- if (FAILED(RegQueryValueEx(key, valname, NULL, &t, (LPBYTE) mode, &l)) || t != REG_SZ)
- continue;
-
- wsprintf(valname, _T("%u.file"), j);
- l = STR_SIZE*sizeof(TCHAR);
- if (FAILED(RegQueryValueEx(key, valname, NULL, &t, (LPBYTE) file, &l)) || t != REG_SZ)
- continue;
-
- // JP: Note, if this mode[1] is used as anything but a boolean later on,
- // we'll need to consider the next line carefully.
- RegFile(mode[0], file, mode[1] == 'X');
- }
- }
-
- RegCloseKey(key);
- RegDeleteKey(rootkey, keyname);
- }
- }
-
- RegCloseKey(rootkey);
- RegDeleteKey(HKEY_LOCAL_MACHINE, _T("Software\\NSIS.Library.RegTool.v3"));
- }
-
- {
- if (GetModuleFileName(GetModuleHandle(NULL), file, STR_SIZE))
- {
- DeleteFileOnReboot(file);
- }
- }
- GlobalFree(keyname);
- GlobalFree(file);
- }
- else
- {
- SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
- OleInitialize(NULL);
-
- if (*cmdline == _T('D'))
- {
- RegDll(cmdline + 1);
- }
- else if (*cmdline == _T('T'))
- {
- RegTypeLib(cmdline + 1);
- }
-
- OleUninitialize();
- SetErrorMode(0);
- }
-
- ExitProcess(0);
-}
-
-void SafeWow64EnableWow64FsRedirection(BOOL Wow64FsEnableRedirection)
-{
- HMODULE kernel = GetModuleHandle(_T("kernel32"));
- if (kernel)
- {
- FARPROC proc = GetProcAddress(kernel, "Wow64EnableWow64FsRedirection");
- if (proc)
- {
- typedef BOOL (WINAPI *Wow64EnableWow64FsRedirectionPtr)(BOOL);
- Wow64EnableWow64FsRedirectionPtr Wow64EnableWow64FsRedirectionFunc =
- (Wow64EnableWow64FsRedirectionPtr) proc;
-
- Wow64EnableWow64FsRedirectionFunc(Wow64FsEnableRedirection);
- }
- }
-}
-
-void RegFile(TCHAR cmd, TCHAR *file, int x64)
-{
- TCHAR* self; // These are turned into heap memory to avoid _chkstk
- TCHAR* cmdline;
-
- int ready = 0;
-
- if (!*file || (cmd != _T('D') && cmd != _T('T') && cmd != _T('E')))
- return;
-
- self = (TCHAR*) GlobalAlloc(GPTR, sizeof(TCHAR)*STR_SIZE);
- cmdline = (TCHAR*) GlobalAlloc(GPTR, sizeof(TCHAR)*STR_SIZE);
-
- if (cmd == _T('E'))
- {
- wsprintf(cmdline, _T("\"%s\" /regserver"), file);
- ready++;
- }
- else if (!x64)
- {
- if (GetModuleFileName(GetModuleHandle(NULL), self, STR_SIZE))
- {
- wsprintf(cmdline, _T("\"%s\" /%c%s"), self, cmd, file);
- ready++;
- }
- }
- else
- {
- if (GetSystemDirectory(self, STR_SIZE))
- {
- wsprintf(cmdline, _T("\"%s\\regsvr32.exe\" /s \"%s\""), self, file);
- ready++;
-
- SafeWow64EnableWow64FsRedirection(FALSE);
- }
- }
-
- if (ready)
- {
- PROCESS_INFORMATION pi;
- STARTUPINFO si = { sizeof(STARTUPINFO) };
-
- if (CreateProcess(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
- {
- CloseHandle(pi.hThread);
-
- WaitForSingleObject(pi.hProcess, INFINITE);
-
- CloseHandle(pi.hProcess);
- }
-
- if (x64)
- {
- SafeWow64EnableWow64FsRedirection(TRUE);
- }
- }
-
- GlobalFree(self);
- GlobalFree(cmdline);
-}
-
-void RegDll(TCHAR *file)
-{
- HMODULE mod = LoadLibraryEx(file, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (mod)
- {
- FARPROC regfunc = GetProcAddress(mod, "DllRegisterServer");
- if (regfunc)
- regfunc();
- FreeLibrary(mod);
- }
-}
-
-void RegTypeLib(TCHAR *file)
-{
-#ifdef _UNICODE
- WCHAR* wfile = file;
-#else
- WCHAR wfile[STR_SIZE];
- if (MultiByteToWideChar(CP_ACP, 0, file, -1, wfile, STR_SIZE) == 0)
- return;
-#endif
- {
- ITypeLib* tlib;
- if (SUCCEEDED(LoadTypeLib(wfile, &tlib))) {
- RegisterTypeLib(tlib, wfile, NULL);
- tlib->lpVtbl->Release(tlib);
- }
- }
-}
-
-char *mystrstriA(char *a, const char *b)
-{
- int l = lstrlenA(b);
- while (lstrlenA(a) >= l)
- {
- char c = a[l];
- a[l] = 0;
- if (!lstrcmpiA(a, b))
- {
- a[l] = c;
- return a;
- }
- a[l] = c;
- a = CharNextA(a);
- }
- return NULL;
-}
-
-void mini_memcpy(void *out, const void *in, int len)
-{
- char *c_out=(char*)out;
- char *c_in=(char *)in;
- while (len-- > 0)
- {
- *c_out++=*c_in++;
- }
-}
-
-HANDLE myOpenFile(const TCHAR *fn, DWORD da, DWORD cd)
-{
- int attr = GetFileAttributes(fn);
- return CreateFile(
- fn,
- da,
- FILE_SHARE_READ,
- NULL,
- cd,
- attr == INVALID_FILE_ATTRIBUTES ? 0 : attr,
- NULL
- );
-}
-
-#ifndef _WIN64
-/** Modifies the wininit.ini file to rename / delete a file.
- *
- * @param prevName The previous / current name of the file.
- * @param newName The new name to move the file to. If NULL, the current file
- * will be deleted.
- */
-void RenameViaWininit(const TCHAR* prevName, const TCHAR* newName)
-{
- static char szRenameLine[1024];
- static TCHAR wininit[1024];
- static TCHAR tmpbuf[1024];
-
- int cchRenameLine;
- LPCSTR szRenameSec = "[Rename]\r\n"; // rename section marker
- HANDLE hfile;
- DWORD dwFileSize;
- DWORD dwBytes;
- DWORD dwRenameLinePos;
- char *pszWinInit; // Contains the file contents of wininit.ini
-
- int spn; // length of the short path name in TCHARs.
-
- lstrcpy(tmpbuf, _T("NUL"));
-
- if (newName) {
- // create the file if it's not already there to prevent GetShortPathName from failing
- CloseHandle(myOpenFile(newName,0,CREATE_NEW));
- spn = GetShortPathName(newName,tmpbuf,1024);
- if (!spn || spn > 1024)
- return;
- }
- // wininit is used as a temporary here
- spn = GetShortPathName(prevName,wininit,1024);
- if (!spn || spn > 1024)
- return;
-#ifdef _UNICODE
- cchRenameLine = wsprintfA(szRenameLine, "%ls=l%s\r\n", tmpbuf, wininit);
-#else
- cchRenameLine = wsprintfA(szRenameLine, "%s=%s\r\n", tmpbuf, wininit);
-#endif
- // Get the path to the wininit.ini file.
- GetWindowsDirectory(wininit, 1024-16);
- lstrcat(wininit, _T("\\wininit.ini"));
-
- hfile = myOpenFile(wininit, GENERIC_READ | GENERIC_WRITE, OPEN_ALWAYS);
-
- if (hfile != INVALID_HANDLE_VALUE)
- {
- // We are now working on the Windows wininit file
- dwFileSize = GetFileSize(hfile, NULL);
- pszWinInit = (char*) GlobalAlloc(GPTR, dwFileSize + cchRenameLine + 10);
-
- if (pszWinInit != NULL)
- {
- if (ReadFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL) && dwFileSize == dwBytes)
- {
- // Look for the rename section in the current file.
- LPSTR pszRenameSecInFile = mystrstriA(pszWinInit, szRenameSec);
- if (pszRenameSecInFile == NULL)
- {
- // No rename section. So we add it to the end of file.
- lstrcpyA(pszWinInit+dwFileSize, szRenameSec);
- dwFileSize += 10;
- dwRenameLinePos = dwFileSize;
- }
- else
- {
- // There is a rename section, but is there another section after it?
- char *pszFirstRenameLine = pszRenameSecInFile+10;
- char *pszNextSec = mystrstriA(pszFirstRenameLine,"\n[");
- if (pszNextSec)
- {
- char *p = pszWinInit + dwFileSize;
- char *pEnd = pszWinInit + dwFileSize + cchRenameLine;
-
- while (p > pszNextSec)
- {
- *pEnd-- = *p--;
- }
-
- dwRenameLinePos = BUGBUG64TRUNCATE(DWORD, pszNextSec - pszWinInit) + 1; // +1 for the \n
- }
- // rename section is last, stick item at end of file
- else dwRenameLinePos = dwFileSize;
- }
-
- mini_memcpy(&pszWinInit[dwRenameLinePos], szRenameLine, cchRenameLine);
- dwFileSize += cchRenameLine;
-
- SetFilePointer(hfile, 0, NULL, FILE_BEGIN);
- WriteFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL);
-
- GlobalFree(pszWinInit);
- }
- }
-
- CloseHandle(hfile);
- }
-}
-#endif
-
-BOOL DeleteFileOnReboot(TCHAR *pszFile)
-{
- BOOL fOk =
- MoveFileEx(pszFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
-#ifndef _WIN64
- if (!fOk)
- {
- RenameViaWininit(pszFile, NULL);
- fOk = TRUE; // BUGBUG: We just pretend everything is OK, nobody checks our return value anyway
- }
-#endif
- return fOk;
-}
diff --git a/Contrib/Library/RegTool/RegTool.cpp b/Contrib/Library/RegTool/RegTool.cpp
new file mode 100755
index 0000000..724ddcc
--- /dev/null
+++ b/Contrib/Library/RegTool/RegTool.cpp
@@ -0,0 +1,422 @@
+// RegTool v3
+// Unicode support by Jim Park & Olivier Marcoux
+
+#include "../../../Source/Platform.h"
+#include <windows.h>
+
+#define STR_SIZE 1024
+
+
+/*
+All A/W functions need this ugly hack so we can call them in template functions.
+Everything is implemented in template functions because the x86 version needs to
+call the W functions on NT and the A functions on 9x.
+The macros assume that "T" is a [W]CHAR type.
+*/
+#define MKSTR(str) ( sizeof(T) > 1 ? (const T*) L##str : (const T*) str )
+#ifdef UNICODE
+#define CALL(func) hack::func##W<T>
+#else
+#define CALL(func) hack::func##A<T>
+#endif
+#define CALL_wsprintf (sizeof(T) > 1 ? (int(*)(T*,const T*,...)) wsprintfW : (int(*)(T*,const T*,...)) wsprintfA)
+namespace hack {
+// Allow cast from [const] T* to [W]CHAR* but nothing else (losing constness is acceptable).
+inline WCHAR* WP(const WCHAR*p) { return (WCHAR*) p; }
+inline WCHAR* WP(const CHAR*p) { return (WCHAR*) p; }
+inline CHAR* NP(const WCHAR*p) { return (CHAR*) p; }
+inline CHAR* NP(const CHAR*p) { return (CHAR*) p; }
+// These function names rely on the C preprocessor & PSDK macros to append A/W to their name so they can be found by the CALL macro.
+template<class T> T* GetCommandLine() { return sizeof(T) > 1 ? (T*) ::GetCommandLineW() : (T*) ::GetCommandLineA(); }
+template<class T> T* CharNext(const T*p1) { return sizeof(T) > 1 ? (T*) ::CharNextW(WP(p1)) : (T*) ::CharNextA(NP(p1)); }
+template<class T> T* lstrcpy(T*p1,const T*p2) { return sizeof(T) > 1 ? (T*) ::lstrcpyW(WP(p1),WP(p2)) : (T*) ::lstrcpyA(NP(p1),NP(p2)); }
+template<class T> T* lstrcat(T*p1,const T*p2) { return sizeof(T) > 1 ? (T*) ::lstrcatW(WP(p1),WP(p2)) : (T*) ::lstrcatA(NP(p1),NP(p2)); }
+template<class T> LONG RegEnumKey(HKEY p1, DWORD p2, T*p3,DWORD p4) { return sizeof(T) > 1 ? ::RegEnumKeyW(p1,p2,WP(p3),p4) : ::RegEnumKeyA(p1,p2,NP(p3),p4); }
+template<class T> LONG RegOpenKeyEx(HKEY p1,const T*p2,DWORD p3,REGSAM p4,PHKEY p5) { return sizeof(T) > 1 ? ::RegOpenKeyExW(p1,WP(p2),p3,p4,p5) : ::RegOpenKeyExA(p1,NP(p2),p3,p4,p5); }
+template<class T> LONG RegQueryValueEx(HKEY p1,const T*p2,LPDWORD p3,LPDWORD p4,LPBYTE p5,LPDWORD p6) { return sizeof(T) > 1 ? ::RegQueryValueExW(p1,WP(p2),p3,p4,p5,p6) : ::RegQueryValueExA(p1,NP(p2),p3,p4,p5,p6); }
+template<class T> LONG RegDeleteKey(HKEY p1,const T*p2) { return sizeof(T) > 1 ? ::RegDeleteKeyW(p1,WP(p2)) : ::RegDeleteKeyA(p1,NP(p2)); }
+template<class T> DWORD GetModuleFileName(HMODULE p1,T*p2,DWORD p3) { return sizeof(T) > 1 ? ::GetModuleFileNameW(p1,WP(p2),p3) : ::GetModuleFileNameA(p1,NP(p2),p3); }
+template<class T> HMODULE LoadLibraryEx(const T*p1,void*p2,DWORD p3) { return sizeof(T) > 1 ? ::LoadLibraryExW(WP(p1),p2,p3) : ::LoadLibraryExA(NP(p1),p2,p3); }
+template<class T> UINT GetWindowsDirectory(const T*p1,UINT p2) { return sizeof(T) > 1 ? ::GetWindowsDirectoryW(WP(p1),p2) : ::GetWindowsDirectoryA(NP(p1),p2); }
+template<class T> UINT GetSystemDirectory(const T*p1,UINT p2) { return sizeof(T) > 1 ? ::GetSystemDirectoryW(WP(p1),p2) : ::GetSystemDirectoryA(NP(p1),p2); }
+template<class T> DWORD GetShortPathName(const T*p1,const T*p2,DWORD p3) { return sizeof(T) > 1 ? ::GetShortPathNameW(WP(p1),WP(p2),p3) : ::GetShortPathNameA(NP(p1),NP(p2),p3); }
+template<class T> DWORD GetFileAttributes(const T*p1) { return sizeof(T) > 1 ? ::GetFileAttributesW(WP(p1)) : ::GetFileAttributesA(NP(p1)); }
+template<class T> BOOL MoveFileEx(const T*p1,const T*p2,DWORD p3) { return sizeof(T) > 1 ? ::MoveFileExW(WP(p1),WP(p2),p3) : ::MoveFileExA(NP(p1),NP(p2),p3); }
+template<class T> HANDLE CreateFile(const T*p1,DWORD p2,DWORD p3,LPSECURITY_ATTRIBUTES p4,DWORD p5,DWORD p6,HANDLE p7) { return sizeof(T) > 1 ? ::CreateFileW(WP(p1),p2,p3,p4,p5,p6,p7) : ::CreateFileA(NP(p1),p2,p3,p4,p5,p6,p7); }
+template<class T> BOOL CreateProcess(const T*p1,const T*p2,LPSECURITY_ATTRIBUTES p3,LPSECURITY_ATTRIBUTES p4,BOOL p5,DWORD p6,LPVOID p7,const T*p8,STARTUPINFO*p9,LPPROCESS_INFORMATION p10) { return sizeof(T) > 1 ? ::CreateProcessW(WP(p1),WP(p2),p3,p4,p5,p6,p7,WP(p8),(STARTUPINFOW*)p9,p10) : ::CreateProcessA(NP(p1),NP(p2),p3,p4,p5,p6,p7,NP(p8),(STARTUPINFOA*)p9,p10); }
+}
+
+
+static bool IsWinNT()
+{
+#if defined(_WIN64) || (defined(_M_ARM) || defined(__arm__))
+ return true;
+#else
+ LPCWSTR str = L"count"; // Using this string because it's already used in other parts of the code
+ return CharNextW(str) != NULL;
+#endif
+}
+
+void SafeWow64EnableWow64FsRedirection(BYTE EnableFsRedirection)
+{
+#ifndef _WIN64
+ HMODULE hK32 = LoadLibraryA("KERNEL32");
+ FARPROC proc = GetProcAddress(hK32, "Wow64EnableWow64FsRedirection");
+ if (proc)
+ {
+ typedef BYTE WINNTBOOLEAN;
+ typedef WINNTBOOLEAN (WINAPI*W64EW64FSR)(WINNTBOOLEAN);
+ W64EW64FSR Wow64EnableWow64FsRedirectionFunc = (W64EW64FSR) proc;
+ Wow64EnableWow64FsRedirectionFunc(EnableFsRedirection);
+ }
+#endif
+}
+
+char *mystrstriA(char *a, const char *b)
+{
+ int l = lstrlenA(b);
+ while (lstrlenA(a) >= l)
+ {
+ char c = a[l];
+ a[l] = 0;
+ if (!lstrcmpiA(a, b))
+ {
+ a[l] = c;
+ return a;
+ }
+ a[l] = c;
+ a = CharNextA(a);
+ }
+ return NULL;
+}
+
+void mini_memcpy(void *out, const void *in, int len)
+{
+ char *c_out=(char*)out;
+ char *c_in=(char *)in;
+ while (len-- > 0)
+ {
+ *c_out++=*c_in++;
+ }
+}
+
+template<class T> static HANDLE myOpenFile(const T *fn, DWORD da, DWORD cd)
+{
+ DWORD attr = CALL(GetFileAttributes)(fn), share = FILE_SHARE_READ;
+ return CALL(CreateFile)(fn, da, share, NULL, cd, attr == INVALID_FILE_ATTRIBUTES ? 0 : attr, NULL);
+}
+
+#ifndef _WIN64
+/** Modifies the wininit.ini file to rename / delete a file.
+ *
+ * @param prevName The previous / current name of the file.
+ * @param newName The new name to move the file to. If NULL, the current file
+ * will be deleted.
+ */
+template<class T> void RenameViaWininit(const T* prevName, const T* newName) // Note: Not thread safe!
+{
+ static char szRenameLine[1024];
+ static T wininit[1024];
+ static T tmpbuf[1024];
+
+ int cchRenameLine;
+ LPCSTR szRenameSec = "[Rename]\r\n"; // rename section marker
+ HANDLE hfile;
+ DWORD dwFileSize;
+ DWORD dwBytes, dwRenameLinePos;
+ char *pszWinInit; // Contains the file contents of wininit.ini
+
+ int spn; // length of the short path name in TCHARs.
+
+ CALL(lstrcpy)(tmpbuf, MKSTR("NUL"));
+
+ if (newName) {
+ // create the file if it's not already there to prevent GetShortPathName from failing
+ CloseHandle(myOpenFile(newName,0,CREATE_NEW));
+ spn = CALL(GetShortPathName)(newName,tmpbuf,COUNTOF(tmpbuf));
+ if (!spn || spn > 1024)
+ return;
+ }
+ // wininit is used as a temporary here
+ spn = CALL(GetShortPathName)(prevName,wininit,COUNTOF(wininit));
+ if (!spn || spn > 1024)
+ return;
+#ifdef _UNICODE
+ cchRenameLine = wsprintfA(szRenameLine, "%S=%S\r\n", tmpbuf, wininit);
+#else
+ cchRenameLine = wsprintfA(szRenameLine, "%s=%s\r\n", tmpbuf, wininit);
+#endif
+ // Get the path to the wininit.ini file.
+ CALL(GetWindowsDirectory)(wininit, COUNTOF(wininit)-16);
+ CALL(lstrcat)(wininit, MKSTR("\\wininit.ini"));
+
+ hfile = myOpenFile(wininit, GENERIC_READ | GENERIC_WRITE, OPEN_ALWAYS);
+
+ if (hfile != INVALID_HANDLE_VALUE)
+ {
+ // We are now working on the Windows wininit file
+ dwFileSize = GetFileSize(hfile, NULL);
+ pszWinInit = (char*) GlobalAlloc(GPTR, dwFileSize + cchRenameLine + 10);
+
+ if (pszWinInit != NULL)
+ {
+ if (ReadFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL) && dwFileSize == dwBytes)
+ {
+ // Look for the rename section in the current file.
+ LPSTR pszRenameSecInFile = mystrstriA(pszWinInit, szRenameSec);
+ if (pszRenameSecInFile == NULL)
+ {
+ // No rename section. So we add it to the end of file.
+ lstrcpyA(pszWinInit+dwFileSize, szRenameSec);
+ dwFileSize += 10;
+ dwRenameLinePos = dwFileSize;
+ }
+ else
+ {
+ // There is a rename section, but is there another section after it?
+ char *pszFirstRenameLine = pszRenameSecInFile+10;
+ char *pszNextSec = mystrstriA(pszFirstRenameLine,"\n[");
+ if (pszNextSec)
+ {
+ char *p = pszWinInit + dwFileSize;
+ char *pEnd = pszWinInit + dwFileSize + cchRenameLine;
+
+ while (p > pszNextSec)
+ {
+ *pEnd-- = *p--;
+ }
+
+ dwRenameLinePos = BUGBUG64TRUNCATE(DWORD, pszNextSec - pszWinInit) + 1; // +1 for the \n
+ }
+ // rename section is last, stick item at end of file
+ else dwRenameLinePos = dwFileSize;
+ }
+
+ mini_memcpy(&pszWinInit[dwRenameLinePos], szRenameLine, cchRenameLine);
+ dwFileSize += cchRenameLine;
+
+ SetFilePointer(hfile, 0, NULL, FILE_BEGIN);
+ WriteFile(hfile, pszWinInit, dwFileSize, &dwBytes, NULL);
+
+ GlobalFree(pszWinInit);
+ }
+ }
+
+ CloseHandle(hfile);
+ }
+}
+#endif
+
+template<class T> BOOL DeleteFileOnReboot(const T *pszFile)
+{
+ BOOL fOk = CALL(MoveFileEx)(pszFile, NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
+#ifndef _WIN64
+ if (!fOk && sizeof(T) == 1)
+ {
+ RenameViaWininit(pszFile, (const T*)NULL);
+ fOk = TRUE; // BUGBUG: We just pretend everything is OK, nobody checks our return value anyway
+ }
+#endif
+ return fOk;
+}
+
+template<class T> void RegFile(T cmd, const T *file, BOOL x64)
+{
+ T *self; // These are allocated on the heap to avoid _chkstk
+ T *cmdline;
+ int ready = 0;
+
+ if (!*file || (cmd != _T('D') && cmd != _T('T') && cmd != _T('E')))
+ return;
+
+ self = (T*) GlobalAlloc(GPTR, sizeof(T)*STR_SIZE);
+ cmdline = (T*) GlobalAlloc(GPTR, sizeof(T)*STR_SIZE);
+
+ if (cmd == ('E'))
+ {
+ CALL_wsprintf(cmdline, MKSTR("\"%s\" /regserver"), file);
+ ready++;
+ }
+ else if (!x64)
+ {
+ if (CALL(GetModuleFileName)(GetModuleHandle(NULL), self, STR_SIZE))
+ {
+ CALL_wsprintf(cmdline, MKSTR("\"%s\" /%c%s"), self, cmd, file);
+ ready++;
+ }
+ }
+ else
+ {
+ if (CALL(GetSystemDirectory)(self, STR_SIZE))
+ {
+ CALL_wsprintf(cmdline, MKSTR("\"%s\\regsvr32.exe\" /s \"%s\""), self, file);
+ ready++;
+
+ SafeWow64EnableWow64FsRedirection(FALSE);
+ }
+ }
+
+ if (ready)
+ {
+ PROCESS_INFORMATION pi;
+ BYTE sibuf[sizeof(T) > 1 ? sizeof(STARTUPINFOW) : sizeof(STARTUPINFOA)] = {0,};
+ STARTUPINFO &si = (STARTUPINFO&) sibuf;
+ si.cb = sizeof(sibuf);
+
+ if (CALL(CreateProcess)(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
+ {
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+
+ if (x64)
+ {
+ SafeWow64EnableWow64FsRedirection(TRUE);
+ }
+ }
+
+ GlobalFree(self);
+ GlobalFree(cmdline);
+}
+
+template<class T> void RegDll(const T *file)
+{
+ HMODULE mod = CALL(LoadLibraryEx)(file, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (mod)
+ {
+ FARPROC regfunc = GetProcAddress(mod, "DllRegisterServer");
+ if (regfunc)
+ regfunc();
+ FreeLibrary(mod);
+ }
+}
+
+template<class T> void RegTypeLib(T *file)
+{
+ WCHAR wbuf[sizeof(T) > 1 ? 1 : STR_SIZE]; // Buffer only used by ANSI implementation!
+ WCHAR *wfile = wbuf; // Not const because of RegisterTypeLib in old PSDK
+ if (sizeof(T) > 1)
+ wfile = (WCHAR*) file;
+ else
+ {
+ if (MultiByteToWideChar(CP_ACP, 0, (const CHAR*) file, -1, wbuf, STR_SIZE) == 0)
+ return;
+ }
+
+ ITypeLib* tlib;
+ if (SUCCEEDED(LoadTypeLib(wfile, &tlib)))
+ {
+ RegisterTypeLib(tlib, wfile, NULL);
+ tlib->Release();
+ }
+}
+
+template<class T> int RegTool()
+{
+ T *cmdline;
+ T seekchar = (' ');
+
+ cmdline = CALL(GetCommandLine)();
+ if (*cmdline == ('\"'))
+ seekchar = *cmdline++;
+
+ while (*cmdline && *cmdline != seekchar)
+ cmdline = CALL(CharNext)(cmdline);
+ cmdline = CALL(CharNext)(cmdline);
+ while (*cmdline == (' '))
+ cmdline++;
+
+ if (*cmdline++ != ('/'))
+ {
+ return 1;
+ }
+
+ if (*cmdline == ('S'))
+ {
+ HKEY rootkey;
+ T *keyname, *file; // These are allocated on the heap to avoid _chkstk
+ keyname = (T*) GlobalAlloc(GPTR, STR_SIZE*sizeof(T));
+ file = (T*) GlobalAlloc(GPTR, STR_SIZE*sizeof(T));
+
+ if (SUCCEEDED(RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\NSIS.Library.RegTool.v3", 0, KEY_READ, &rootkey)))
+ {
+ DWORD keyidx = 0;
+ while (CALL(RegEnumKey)(rootkey, keyidx, keyname, STR_SIZE) == ERROR_SUCCESS)
+ {
+ HKEY key;
+
+ if (SUCCEEDED(CALL(RegOpenKeyEx)(rootkey, keyname, 0, KEY_READ, &key)))
+ {
+ DWORD t, count, l = sizeof(DWORD);
+
+ if (SUCCEEDED(CALL(RegQueryValueEx)(key, MKSTR("count"), NULL, &t, (LPBYTE) &count, &l)) && t == REG_DWORD)
+ {
+ DWORD j;
+ T valname[128], mode[3];
+
+ for (j = 0; ++j <= count;)
+ {
+ CALL_wsprintf(valname, MKSTR("%u.mode"), j);
+ l = sizeof(mode);
+ if (FAILED(CALL(RegQueryValueEx)(key, valname, NULL, &t, (LPBYTE) mode, &l)) || t != REG_SZ)
+ continue;
+
+ CALL_wsprintf(valname, MKSTR("%u.file"), j);
+ l = STR_SIZE*sizeof(T);
+ if (FAILED(CALL(RegQueryValueEx)(key, valname, NULL, &t, (LPBYTE) file, &l)) || t != REG_SZ)
+ continue;
+
+ // JP: Note, if this mode[1] is used as anything but a boolean later on,
+ // we'll need to consider the next line carefully.
+ RegFile(mode[0], file, mode[1] == 'X');
+ }
+ }
+
+ RegCloseKey(key);
+
+ CALL(RegDeleteKey)(rootkey, keyname);
+ }
+ keyidx++; // Must increment this so we don't loop forever if a non-admin accidentally executes RegTool /S
+ }
+
+ RegCloseKey(rootkey);
+ RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\\NSIS.Library.RegTool.v3");
+ }
+
+ {
+ if (CALL(GetModuleFileName)(GetModuleHandle(NULL), file, STR_SIZE))
+ {
+ DeleteFileOnReboot(file);
+ }
+ }
+ GlobalFree(keyname);
+ GlobalFree(file);
+ }
+ else
+ {
+ DWORD orgerrmode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
+ OleInitialize(NULL);
+
+ if (*cmdline == ('D'))
+ {
+ RegDll(cmdline + 1);
+ }
+ else if (*cmdline == ('T'))
+ {
+ RegTypeLib(cmdline + 1);
+ }
+
+ OleUninitialize();
+ SetErrorMode(orgerrmode);
+ }
+
+ return 0;
+}
+
+NSIS_ENTRYPOINT_GUINOCRT
+EXTERN_C void NSISWinMainNOCRT()
+{
+ int ec = IsWinNT() ? RegTool<WCHAR>() : RegTool<CHAR>();
+ ExitProcess(ec);
+}
diff --git a/Contrib/Library/RegTool/SConscript b/Contrib/Library/RegTool/SConscript
index abb3e55..570f0b8 100755
--- a/Contrib/Library/RegTool/SConscript
+++ b/Contrib/Library/RegTool/SConscript
@@ -1,7 +1,7 @@
target = 'RegTool'
files = Split("""
- RegTool.c
+ RegTool.cpp
""")
libs = Split("""
@@ -12,6 +12,8 @@ libs = Split("""
ole32
""")
-Import('BuildUtil')
+Import('BuildUtil env GetArcCPU')
-BuildUtil(target, files, libs, entry = 'NSISWinMainNOCRT', nodeflib = True, file_name = 'RegTool.bin')
+filename = 'RegTool-' + GetArcCPU(env) + '.bin'
+
+BuildUtil(target, files, libs, entry = 'NSISWinMainNOCRT', nodeflib = True, file_name = filename)
diff --git a/Contrib/MakeLangId/MakeLangId.cpp b/Contrib/MakeLangId/MakeLangId.cpp
index 30873e8..1b119a6 100755
--- a/Contrib/MakeLangId/MakeLangId.cpp
+++ b/Contrib/MakeLangId/MakeLangId.cpp
@@ -232,7 +232,7 @@ HWND g_hList;
static INT AddLocale(HWND hCtl, LPCTSTR Name, UINT LangId)
{
- INT idx = SendMessage(hCtl, CB_ADDSTRING, 0, (LPARAM) Name);
+ INT idx = (INT) SendMessage(hCtl, CB_ADDSTRING, 0, (LPARAM) Name);
if (idx != CB_ERR) SendMessage(hCtl, CB_SETITEMDATA, idx, LangId);
return idx;
}
@@ -241,7 +241,7 @@ static BOOL CALLBACK EnumSysLocalesProc(LPTSTR lpLocaleString)
{
const UINT cchbuf1 = 80+2+80+1+2+85+1+!0, cchbuf2 = 85+!0;
TCHAR buf1[cchbuf1], buf2[cchbuf2];
- UINT lid = StrToIntptr(lpLocaleString, true), lcid = MAKELCID(lid, SORT_DEFAULT);
+ UINT lid = (UINT) StrToIntptr(lpLocaleString, true), lcid = MAKELCID(lid, SORT_DEFAULT);
UINT retval = GetLocaleInfo(lcid, LOCALE_SENGLISHDISPLAYNAME|LOCALE_NOUSEROVERRIDE, buf1, cchbuf1);
if (!retval) // LOCALE_SENGLISHDISPLAYNAME is Win7+
@@ -284,8 +284,8 @@ static void OnLanguageChanged(HWND hDlg)
TCHAR buf1[cchbuf1], buf2[cchbuf2];
HWND hList = g_hList;
- INT idx = SendMessage(hList, CB_GETCURSEL, 0, 0);
- UINT lid = SendMessage(hList, CB_GETITEMDATA, idx, 0), lcid = MAKELCID(lid, SORT_DEFAULT), retval;
+ INT idx = (INT) SendMessage(hList, CB_GETCURSEL, 0, 0);
+ UINT lid = (UINT) SendMessage(hList, CB_GETITEMDATA, idx, 0), lcid = MAKELCID(lid, SORT_DEFAULT), retval;
EnableWindow(GetDlgItem(hDlg, IDOK), idx != CB_ERR);
if (idx == CB_ERR)
{
diff --git a/Contrib/Modern UI 2/License.txt b/Contrib/Modern UI 2/License.txt
index 8942adb..c3de19e 100755
--- a/Contrib/Modern UI 2/License.txt
+++ b/Contrib/Modern UI 2/License.txt
@@ -1,4 +1,4 @@
-Copyright © 2002-2016 Joost Verburg
+Copyright © 2002-2017 Joost Verburg
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/Contrib/Modern UI 2/MUI2.nsh b/Contrib/Modern UI 2/MUI2.nsh
index b2c5fc1..4068b34 100755
--- a/Contrib/Modern UI 2/MUI2.nsh
+++ b/Contrib/Modern UI 2/MUI2.nsh
@@ -1,22 +1,23 @@
/*
-NSIS Modern User Interface - Version 2.0
-Copyright 2002-2016 Joost Verburg
+NSIS Modern User Interface - Version 2.1
+Copyright 2002-2017 Joost Verburg
Contributors: Amir Szekely, Anders Kjersem
*/
!ifndef MUI_INCLUDED
-!echo "NSIS Modern User Interface version 2.0 - Copyright 2002-2016 Joost Verburg"
+!verbose push 3
+!define MUI_INCLUDED
+!define MUI_SYSVERSION "2.1"
+!verbose pop
+!echo "NSIS Modern User Interface version ${MUI_SYSVERSION} - Copyright 2002-2017 Joost Verburg"
;--------------------------------
!verbose push 3
!define /IfNDef MUI_VERBOSE 3
!verbose ${MUI_VERBOSE}
-!define MUI_INCLUDED
-!define MUI_SYSVERSION "2.0"
-
!addincludedir "${NSISDIR}\Contrib\Modern UI 2"
;--------------------------------
@@ -113,4 +114,4 @@ Contributors: Amir Szekely, Anders Kjersem
!macroend
!verbose pop
-!endif
+!endif ;~ MUI_INCLUDED
diff --git a/Contrib/Modern UI 2/Pages/Finish.nsh b/Contrib/Modern UI 2/Pages/Finish.nsh
index a0fdf40..e13f31c 100755
--- a/Contrib/Modern UI 2/Pages/Finish.nsh
+++ b/Contrib/Modern UI 2/Pages/Finish.nsh
@@ -412,6 +412,7 @@ Finish page (implemented using nsDialogs)
Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
nsDialogs::Show
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED
Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow
!ifdef MUI_FINISHPAGE_CANCEL_ENABLED
diff --git a/Contrib/Modern UI 2/Pages/StartMenu.nsh b/Contrib/Modern UI 2/Pages/StartMenu.nsh
index 780b3b1..f190205 100755
--- a/Contrib/Modern UI 2/Pages/StartMenu.nsh
+++ b/Contrib/Modern UI 2/Pages/StartMenu.nsh
@@ -141,8 +141,8 @@ Start Menu folder page
!endif
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
-
StartMenu::Show
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED
Pop $mui.StartMenuPage.Temp
${if} $mui.StartMenuPage.Temp == "success"
diff --git a/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh b/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh
index 4848826..c530bb5 100755
--- a/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh
+++ b/Contrib/Modern UI 2/Pages/UninstallConfirm.nsh
@@ -41,6 +41,10 @@ Uninstall confirmation page
UninstallText "${MUI_UNCONFIRMPAGE_TEXT_TOP}" "${MUI_UNCONFIRMPAGE_TEXT_LOCATION}"
+ !ifdef MUI_UNCONFIRMPAGE_VARIABLE
+ DirVar "${MUI_UNCONFIRMPAGE_VARIABLE}"
+ !endif
+
PageExEnd
!insertmacro MUI_UNFUNCTION_CONFIRMPAGE un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}
diff --git a/Contrib/Modern UI 2/Pages/Welcome.nsh b/Contrib/Modern UI 2/Pages/Welcome.nsh
index 0d84ac9..29f5204 100755
--- a/Contrib/Modern UI 2/Pages/Welcome.nsh
+++ b/Contrib/Modern UI 2/Pages/Welcome.nsh
@@ -160,6 +160,7 @@ Welcome page (implemented using nsDialogs)
Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageLoadFullWindow
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
nsDialogs::Show
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED
Call ${MUI_PAGE_UNINSTALLER_FUNCPREFIX}muiPageUnloadFullWindow
;Delete image from memory
diff --git a/Contrib/Modern UI 2/Readme.html b/Contrib/Modern UI 2/Readme.html
index b6bf419..d4b0986 100755
--- a/Contrib/Modern UI 2/Readme.html
+++ b/Contrib/Modern UI 2/Readme.html
@@ -191,7 +191,7 @@
</div>
</div>
<h1>
- Modern UI 2.0</h1>
+ Modern UI 2.1</h1>
<div>
<p>
This new version makes it easier to customize pages, because the same method can
@@ -855,6 +855,10 @@ Var PLUGINS_FOLDER
<p>
<strong>MUI_UNCONFIRMPAGE_TEXT_LOCATION</strong> <span class="parameter">text</span><br />
Text to display next to the uninstall location text box.</p>
+ <p>
+ <strong>MUI_UNCONFIRMPAGE_VARIABLE</strong> <span class="parameter">variable</span><br />
+ Variable in which to store the uninstall source folder.<br />
+ <em>Default: $INSTDIR</em></p>
</div>
</div>
</div>
@@ -1082,6 +1086,7 @@ FunctionEnd</pre>
<strong>MUI_PAGE_CUSTOMFUNCTION_PRE</strong> <span class="parameter">function</span><br />
<strong>MUI_PAGE_CUSTOMFUNCTION_SHOW</strong> <span class="parameter">function</span><br />
<strong>MUI_PAGE_CUSTOMFUNCTION_LEAVE</strong> <span class="parameter">function</span><br />
+ <strong>MUI_PAGE_CUSTOMFUNCTION_DESTROYED</strong> <span class="parameter">function</span><br />
</p>
<p>
The pre function is called first and allows you to initalize variables or decide
@@ -1091,8 +1096,10 @@ FunctionEnd</pre>
<p>
In the show function, the window handles of all controls on the page can be retrieved
from a Modern UI variable. A list of the variables names is not yet available. For
- now, refer to the source files of the Modern UI 2.0. The variable declarations can
+ now, refer to the source files of the Modern UI 2. The variable declarations can
be found in the first lines of the header file for a certain page.</p>
+ <p>
+ The destroyed function is called after a external/plug-in page has been destroyed.
</div>
</div>
<h1>
@@ -1124,7 +1131,7 @@ FunctionEnd</pre>
License Terms</h3>
<div class="toggle" id="toggle_lic">
<pre>
-Copyright &copy; 2002-2016 Joost Verburg
+Copyright &copy; 2002-2017 Joost Verburg
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/Contrib/Modern UI/License.txt b/Contrib/Modern UI/License.txt
index 0d3bc5e..e7c6ff5 100755
--- a/Contrib/Modern UI/License.txt
+++ b/Contrib/Modern UI/License.txt
@@ -1,4 +1,4 @@
-Copyright 2002-2016 Joost Verburg
+Copyright 2002-2017 Joost Verburg
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
diff --git a/Contrib/Modern UI/Readme.html b/Contrib/Modern UI/Readme.html
index 3d83f90..2f54f4e 100755
--- a/Contrib/Modern UI/Readme.html
+++ b/Contrib/Modern UI/Readme.html
@@ -845,6 +845,10 @@ Var PLUGINS_FOLDER
<p>
<strong>MUI_UNCONFIRMPAGE_TEXT_LOCATION</strong> <span class="parameter">text</span><br />
Text to display next to the uninstall location text box.</p>
+ <p>
+ <strong>MUI_UNCONFIRMPAGE_VARIABLE</strong> <span class="parameter">variable</span><br />
+ Variable in which to store the uninstall source folder.<br />
+ <em>Default: $INSTDIR</em></p>
</div>
</div>
</div>
@@ -1126,7 +1130,7 @@ FunctionEnd
License Terms</h3>
<div class="toggle" id="toggle_lic">
<pre>
-Copyright &copy; 2002-2016 Joost Verburg
+Copyright &copy; 2002-2017 Joost Verburg
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/Contrib/Modern UI/System.nsh b/Contrib/Modern UI/System.nsh
index d87b1d0..d64ec5f 100755
--- a/Contrib/Modern UI/System.nsh
+++ b/Contrib/Modern UI/System.nsh
@@ -1,12 +1,12 @@
/*
NSIS Modern User Interface - Version 1.8
-Copyright 2002-2016 Joost Verburg
+Copyright 2002-2017 Joost Verburg
*/
!ifndef MUI_INCLUDED
-!echo "NSIS Modern User Interface version 1.8 - Copyright 2002-2016 Joost Verburg"
+!echo "NSIS Modern User Interface version 1.8 - Copyright 2002-2017 Joost Verburg"
;--------------------------------
!verbose push 3
@@ -1123,6 +1123,10 @@ Var MUI_TEMP2
UninstallText "${MUI_UNCONFIRMPAGE_TEXT_TOP}" "${MUI_UNCONFIRMPAGE_TEXT_LOCATION}"
+ !ifdef MUI_UNCONFIRMPAGE_VARIABLE
+ DirVar "${MUI_UNCONFIRMPAGE_VARIABLE}"
+ !endif
+
PageExEnd
!insertmacro MUI_UNFUNCTION_CONFIRMPAGE un.mui.ConfirmPre_${MUI_UNIQUEID} un.mui.ConfirmShow_${MUI_UNIQUEID} un.mui.ConfirmLeave_${MUI_UNIQUEID}
@@ -1447,8 +1451,8 @@ Var MUI_TEMP2
!endif
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
-
StartMenu::Show
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED
Pop $MUI_TEMP1
StrCmp $MUI_TEMP1 "success" 0 +2
@@ -2188,7 +2192,8 @@ Var MUI_TEMP2
!macro MUI_UNGETLANGUAGE
- !verbose pop
+ !verbose push
+ !verbose ${MUI_VERBOSE}
!ifdef MUI_LANGDLL_REGISTRY_ROOT & MUI_LANGDLL_REGISTRY_KEY & MUI_LANGDLL_REGISTRY_VALUENAME
diff --git a/Contrib/MultiUser/MultiUser.nsh b/Contrib/MultiUser/MultiUser.nsh
index cf35b89..4235ce4 100755
--- a/Contrib/MultiUser/MultiUser.nsh
+++ b/Contrib/MultiUser/MultiUser.nsh
@@ -4,7 +4,7 @@ MultiUser.nsh
Installer configuration for multi-user Windows environments
-Copyright 2008-2016 Joost Verburg
+Copyright 2008-2017 Joost Verburg
*/
@@ -91,7 +91,11 @@ Install modes
!if "${UNINSTALLER_PREFIX}" != UN
;Set default installation location for installer
!ifdef MULTIUSER_INSTALLMODE_INSTDIR
- StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !ifdef MULTIUSER_USE_PROGRAMFILES64
+ StrCpy $INSTDIR "$PROGRAMFILES64\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !else
+ StrCpy $INSTDIR "$PROGRAMFILES\${MULTIUSER_INSTALLMODE_INSTDIR}"
+ !endif
!endif
!endif
@@ -429,7 +433,7 @@ Modern UI 2 page
nsDialogs::Create 1018
Pop $MultiUser.InstallModePage
- ${NSD_CreateLabel} 0u 0u 300u 20u "${MULTIUSER_INSTALLMODEPAGE_TEXT_TOP}"
+ ${NSD_CreateLabel} 0u 0u 300u 40u "${MULTIUSER_INSTALLMODEPAGE_TEXT_TOP}"
Pop $MultiUser.InstallModePage.Text
${NSD_CreateRadioButton} 20u 50u 280u 10u "${MULTIUSER_INSTALLMODEPAGE_TEXT_ALLUSERS}"
@@ -446,6 +450,7 @@ Modern UI 2 page
!insertmacro MUI_PAGE_FUNCTION_CUSTOM SHOW
nsDialogs::Show
+ !insertmacro MUI_PAGE_FUNCTION_CUSTOM DESTROYED
FunctionEnd
diff --git a/Contrib/MultiUser/Readme.html b/Contrib/MultiUser/Readme.html
index 7d2a729..8ce6de4 100755
--- a/Contrib/MultiUser/Readme.html
+++ b/Contrib/MultiUser/Readme.html
@@ -181,6 +181,14 @@ FunctionEnd</pre>
</tr>
<tr>
<td>
+ MULTIUSER_USE_PROGRAMFILES64
+ </td>
+ <td>
+ Use $PROGRAMFILES64 instead of $PROGRAMFILES as the default all users directory.
+ </td>
+ </tr>
+ <tr>
+ <td>
MULTIUSER_INIT_FUNCTIONQUIT<br />
MULTIUSER_INIT_UNFUNCTIONQUIT
</td>
diff --git a/Contrib/NSISdl/ReadMe.txt b/Contrib/NSISdl/ReadMe.txt
index 986ed07..7211a2b 100755
--- a/Contrib/NSISdl/ReadMe.txt
+++ b/Contrib/NSISdl/ReadMe.txt
@@ -3,7 +3,8 @@ NSISdl 1.3 - HTTP downloading plugin for NSIS
Copyright (C) 2001-2002 Yaroslav Faybishenko & Justin Frankel
-This plugin can be used from NSIS to download files via http.
+This plugin can be used from NSIS to download files via HTTP.
+Note: HTTPS is not supported, only plain HTTP!
To connect to the internet, use the Dialer plugin.
diff --git a/Contrib/SubStart/substart.c b/Contrib/SubStart/substart.c
index a8161f3..82e7986 100755
--- a/Contrib/SubStart/substart.c
+++ b/Contrib/SubStart/substart.c
@@ -2,7 +2,7 @@
* substart.c - This app runs the executable of the same name in the 'Bin'
* sub-folder and passes along the command line options.
*
- * Copyright (c) 2013-2016 Anders Kjersem
+ * Copyright (c) 2013-2017 Anders Kjersem
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Contrib/System/Source/Call-amd64.S b/Contrib/System/Source/Call-amd64.S
index cb18696..c564f4b 100755
--- a/Contrib/System/Source/Call-amd64.S
+++ b/Contrib/System/Source/Call-amd64.S
@@ -1,7 +1,7 @@
;#
;# This file is a part of NSIS.
;#
-;# Copyright (C) 2014-2016 Anders Kjersem
+;# Copyright (C) 2014-2017 Anders Kjersem
;#
;# Licensed under the zlib/libpng license (the "License");
;# you may not use this file except in compliance with the License.
diff --git a/Contrib/System/Source/Call.S b/Contrib/System/Source/Call.S
index 4ddac5e..d60cd17 100755
--- a/Contrib/System/Source/Call.S
+++ b/Contrib/System/Source/Call.S
@@ -1,5 +1,5 @@
;# Copyright (c) 2008 Thomas Gaugler <thomas@dadie.net>
-;# Copyright (c) 2008-2016 NSIS Contributors
+;# Copyright (c) 2008-2017 NSIS Contributors
;#
;# Permission is hereby granted, free of charge, to any person
;# obtaining a copy of this software and associated documentation
diff --git a/Contrib/System/Source/System.c b/Contrib/System/Source/System.c
index a115341..dbe8cf4 100755
--- a/Contrib/System/Source/System.c
+++ b/Contrib/System/Source/System.c
@@ -971,7 +971,7 @@ void ParamsIn(SystemProc *proc)
#endif
case PAT_CALLBACK:
// Generate new or use old callback
- if (lstrlen(realbuf) > 0)
+ if (realbuf[0])
par->Value = (INT_PTR) CreateCallback((SystemProc*) StrToIntPtr(realbuf));
break;
case PAT_REGMEM:
diff --git a/Contrib/System/System.html b/Contrib/System/System.html
index 0c03dcd..19bb8d4 100755
--- a/Contrib/System/System.html
+++ b/Contrib/System/System.html
@@ -7,7 +7,7 @@
<body>
<h1>NSIS System Plug-in</h1>
<p>
-<i>Copyright &copy; 2002 brainsucker (Nik Medved)</i><br><i>Copyright &copy; 2002-2016 NSIS Contributors</i>
+<i>Copyright &copy; 2002 brainsucker (Nik Medved)</i><br><i>Copyright &copy; 2002-2017 NSIS Contributors</i>
</p>
<h2>Table of Contents</h2>
@@ -693,7 +693,7 @@ DetailPrint "189189 = 189189 = $0" # 1
<blockquote><pre>
System::<b>Int64Op</b> 156545668489 ~
Pop $0
-DetailPrint "1 ~ = $0" # -156545668490
+DetailPrint "156545668489 ~ = $0" # -156545668490
</pre></blockquote>
<blockquote><pre>
System::<b>Int64Op</b> 1 !
diff --git a/Contrib/nsDialogs/example.nsi b/Contrib/nsDialogs/example.nsi
index 2446ac3..5373c4e 100755
--- a/Contrib/nsDialogs/example.nsi
+++ b/Contrib/nsDialogs/example.nsi
@@ -11,6 +11,7 @@ LicenseText "All the action takes place on the next page..."
Page license
Page custom nsDialogsPage
+!pragma warning disable 8000 ; "Page instfiles not used, no sections will be executed!"
Var BUTTON
Var EDIT
diff --git a/Contrib/nsDialogs/timer.nsi b/Contrib/nsDialogs/timer.nsi
index 3fed040..eee3d20 100755
--- a/Contrib/nsDialogs/timer.nsi
+++ b/Contrib/nsDialogs/timer.nsi
@@ -16,6 +16,7 @@ Var BUTTON
Var BUTTON2
Page custom nsDialogsPage
+!pragma warning disable 8000 ; "Page instfiles not used, no sections will be executed!"
Function OnTimer
diff --git a/Contrib/nsExec/nsexec.c b/Contrib/nsExec/nsexec.c
index b99d3ed..dd6e905 100755
--- a/Contrib/nsExec/nsexec.c
+++ b/Contrib/nsExec/nsexec.c
@@ -107,19 +107,19 @@ BOOL IsWOW64() {
* @param cnt [in] the size of widebuf in wchar_t's.
* @return true, if ASCII, false if suspected as wide.
*/
-BOOL WideConvertIfASCII(const char* ansiStr, int strLen, WCHAR* wideBuf, int cnt)
+BOOL WideConvertIfASCII(const char* ansiStr, int strLen, WCHAR* wideBuf, int cnt, BOOL OEMCP)
{
BOOL rval = FALSE;
wideBuf[0] = 0;
if (lstrlenA(ansiStr) == strLen)
{
- MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideBuf, cnt);
+ MultiByteToWideChar(OEMCP ? CP_OEMCP : CP_ACP, 0, ansiStr, -1, wideBuf, cnt);
rval = TRUE;
}
else
{
// Going to assume that it's a wide char array.
- lstrcpyW(wideBuf, (const WCHAR*) ansiStr);
+ lstrcpynW(wideBuf, (const WCHAR*) ansiStr, cnt);
}
return rval;
@@ -307,7 +307,7 @@ params:
#ifdef _UNICODE
ReadFile(read_stdout, ansiBuf, sizeof(ansiBuf)-1, &dwRead, NULL);
ansiBuf[dwRead] = 0;
- WideConvertIfASCII(ansiBuf, dwRead, szBuf, sizeof(szBuf)/sizeof(szBuf[0]));
+ WideConvertIfASCII(ansiBuf, dwRead, szBuf, sizeof(szBuf)/sizeof(szBuf[0]), bOEM);
#else
ReadFile(read_stdout, szBuf, sizeof(szBuf)-1, &dwRead, NULL);
szBuf[dwRead] = '\0';
diff --git a/Docs/src/SConscript b/Docs/src/SConscript
index 61d010c..e0241c9 100755
--- a/Docs/src/SConscript
+++ b/Docs/src/SConscript
@@ -160,18 +160,22 @@ env.Append(BUILDERS = {'Halibut' : docs_builder})
# fix hhc.exe reverse return value - UGLY
old_spawn = env['SPAWN']
-def new_spawn(*args, **kw):
- if 'hhc' in args[3]:
- if len(args) == 5:
- args = (args[0], args[1], args[2], args[3], {'PATH': args[4]['PATH']})
- else:
- kw['env'] = {}
+def env_trimming_spawn(*args, **kw):
+ # hhc.exe crashes and produces corrupt CHM files with big environment variables
+ # removing os env doesn't seem to break anything else and it's local to this doc building scons env
+ if len(args) == 5:
+ # env is passed arg (old scons versions maybe?)
+ args = (args[0], args[1], args[2], args[3], {})
+ else:
+ # env is passed as kwargs
+ kw['env'] = {}
result = old_spawn(*args, **kw)
+ # hhc returns 1 when it's successful, because why not...
for p in args[3]:
if 'hhc.exe' in p.lower():
return not result
return result
-env['SPAWN'] = new_spawn
+env['SPAWN'] = env_trimming_spawn
# BUILD!
docs = env.Halibut(env['NSISDOCTARGET'], ['$NSISDOCCONFIG'] + buts)
diff --git a/Docs/src/attributes.but b/Docs/src/attributes.but
index 2205ecc..66ac1f9 100755
--- a/Docs/src/attributes.but
+++ b/Docs/src/attributes.but
@@ -60,7 +60,7 @@ When used outside a \R{pageex}{PageEx} block: Sets the text for the titlebar of
When used inside a \R{pageex}{PageEx} block: Sets the subcaption of the current page.
-Accepts variables. If variables are used, they must be initialized on \R{oninit}{.onInit}.
+Accepts variables. If variables are used, they must be initialized on \R{oninit}{.onInit} or \R{onguiinit}{.onGUIInit}.
\S2{achangeui} ChangeUI
diff --git a/Docs/src/basic.but b/Docs/src/basic.but
index e2281fb..e346215 100755
--- a/Docs/src/basic.but
+++ b/Docs/src/basic.but
@@ -12,6 +12,10 @@ Delete file (which can be a file or wildcard, but should be specified with a ful
\c Delete $INSTDIR\somefile.dat
+\NsisWarnBlockContainerBegin
+\\<b\\>Warning:\\</b\\> The /REBOOTOK switch requires administrator rights on Windows NT and later.
+\NsisWarnBlockContainerEnd
+
\S2{exec} Exec
\c command
@@ -23,13 +27,20 @@ Execute the specified program and continue immediately. Note that the file speci
\S2{execshell} ExecShell
-\c action command [parameters] [SW_SHOWDEFAULT | SW_SHOWNORMAL | SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED | SW_HIDE]
+\c [/INVOKEIDLIST] action command [parameters] [SW_SHOWDEFAULT | SW_SHOWNORMAL | SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED | SW_HIDE]
-Execute the specified program using ShellExecute. Note that action is usually "open", "print", etc, but can be an empty string to use the default action. Parameters and the show type are optional. $OUTDIR is used as the working directory. The error flag is set if the process could not be launched.
+Execute the specified program using ShellExecuteEx. Note that action is usually "open", "print", etc, but can be an empty string to use the default action. Parameters and the show type are optional. $OUTDIR is used as the working directory. The error flag is set if the process could not be launched.
\c ExecShell "open" "http://nsis.sf.net/"
\c ExecShell "open" "$INSTDIR\readme.txt"
\c ExecShell "print" "$INSTDIR\readme.txt"
+\c ExecShell /INVOKEIDLIST "properties" "$TEMP"
+
+\S2{execshellwait} ExecShellWait
+
+\c [/INVOKEIDLIST] action command [parameters] [SW_SHOWDEFAULT | SW_SHOWNORMAL | SW_SHOWMAXIMIZED | SW_SHOWMINIMIZED | SW_HIDE]
+
+Execute the specified program using ExecShell and wait for executed process to quit. It will only wait for executable files and not other file types nor URLs.
\S2{execwait} ExecWait
@@ -108,6 +119,10 @@ If no absolute path is specified the current folder will be used. The current fo
\c Rename $INSTDIR\file.ext $INSTDIR\file.dat
+\NsisWarnBlockContainerBegin
+\\<b\\>Warning:\\</b\\> The /REBOOTOK switch requires administrator rights on Windows NT and later.
+\NsisWarnBlockContainerEnd
+
\S2{reservefile} ReserveFile
\c [/nonfatal] [/r] [/x file|wildcard [...]] file [file...] | [/nonfatal] /plugin file.dll
@@ -140,13 +155,19 @@ The next example will succeed in deleting the directory.
\c SetOutPath $TEMP
\c RMDir $TEMP\dir
-\\<b\\>Warning:\\</b\\> using \e{RMDir /r $INSTDIR} in the uninstaller is not safe. Though it is unlikely, the user might select to install to the Program Files folder and so this command will wipe out the entire Program Files folder, including other programs that has nothing to do with the uninstaller. The user can also put other files but the program's files and would expect them to get deleted with the program. Solutions are \W{http://nsis.sourceforge.net/Uninstall_only_installed_files}{available} for easily uninstalling only files which were installed by the installer.
+\NsisWarnBlockContainerBegin
+\\<b\\>Warning:\\</b\\> Using \e{RMDir /r $INSTDIR} in the uninstaller is not safe. Though it is unlikely, the user might select to install to the root of the Program Files folder and this command would wipe out the entire Program Files folder, including all other installed programs! The user can also put other files in the installation folder and wouldn't expect them to get deleted along with the program. Solutions are \W{http://nsis.sourceforge.net/Uninstall_only_installed_files}{available} for easily uninstalling only files which were installed by the installer.
+\NsisWarnBlockContainerEnd
+
+\NsisWarnBlockContainerBegin
+\\<b\\>Warning:\\</b\\> The /REBOOTOK switch requires administrator rights on Windows NT and later.
+\NsisWarnBlockContainerEnd
\S2{setoutpath} SetOutPath
\c outpath
-Sets the output path ($OUTDIR) and creates it (recursively if necessary), if it does not exist. Must be a full pathname, usually is just $INSTDIR (you can specify $INSTDIR if you are lazy with a single "-").
+Sets the output path ($OUTDIR) and creates it (recursively if necessary), if it does not exist. Must be a full pathname, usually is just $INSTDIR (you can specify $INSTDIR with a single "-" if you are lazy).
\c SetOutPath $INSTDIR
\c File program.exe
diff --git a/Docs/src/compiler.but b/Docs/src/compiler.but
index 5cf9fa8..eb36fa7 100755
--- a/Docs/src/compiler.but
+++ b/Docs/src/compiler.but
@@ -173,6 +173,16 @@ This command will issue a warning to the script compiler. You can also add a mes
\c !warning "using dangerous stuff"
\c !endif
+\S1{pragma} !pragma
+
+\c warning <enable|disable|default> code
+\c warning <push|pop>
+
+The pragma commands allows you to change compiler features and behavior.
+
+\c !pragma warning disable 9000 ; Disable warning about using "Setup.exe" as the name
+\c OutFile "Setup.exe"
+
\S1{verbose} !verbose
\c level | push | pop
diff --git a/Docs/src/compilerflags.but b/Docs/src/compilerflags.but
index c801a24..1f38b9f 100755
--- a/Docs/src/compilerflags.but
+++ b/Docs/src/compilerflags.but
@@ -138,7 +138,7 @@ The displayed name of these special entries are translated on the target system,
\S2{viproductversion} VIProductVersion
-\c [version_string_X.X.X.X]
+\c version_string_X.X.X.X
Sets the Product Version in the VS_FIXEDFILEINFO version information block.
@@ -146,7 +146,7 @@ Sets the Product Version in the VS_FIXEDFILEINFO version information block.
\S2{vifileversion} VIFileVersion
-\c [version_string_X.X.X.X]
+\c version_string_X.X.X.X
Sets the File Version in the VS_FIXEDFILEINFO version information block (You should also set the FileVersion string with VIAddVersionKey so the information is displayed at the top of the Version Tab in the Properties of the file). If you don't provide a File Version the Product Version is used in the VS_FIXEDFILEINFO block.
diff --git a/Docs/src/config.but b/Docs/src/config.but
index eb76e81..35bdfd9 100755
--- a/Docs/src/config.but
+++ b/Docs/src/config.but
@@ -2,7 +2,7 @@
\#{* Common config shared by all output formats *}
\#{**********************************************}
-\define{NsisCopyright} Copyright (C) 1999-2016 Contributors
+\define{NsisCopyright} Copyright (C) 1999-2017 Contributors
\copyright \NsisCopyright
diff --git a/Docs/src/credits.but b/Docs/src/credits.but
index 70e2ba1..40a25c1 100755
--- a/Docs/src/credits.but
+++ b/Docs/src/credits.but
@@ -154,6 +154,10 @@ Bulgarian - \e{Asparouh Kalyandjiev, Plamen Penkov}
Catalan - \e{falanko}
+Chinese (Simplified) - \e{Kii Ali}
+
+Chinese (Traditional) - \e{Kii Ali, Walter Cheuk}
+
Corsican - \e{Patriccollu di Santa Maria \uE8{e} Sich\uE8{e}}
Croatian - \e{Igor Ostriz, Vedran "RIV@NVX" Miletic}
@@ -188,7 +192,7 @@ Hungarian - \e{Soft-Trans Bt., Jozsef Tamas Herczeg, Lajos Molnar (Orfanik)}
Icelandic - \e{Gretar Orri Kristinsson}
-Indonesian - \e{ariel825010106}
+Indonesian - \e{\#{Ariel Silooy}ariel825010106}
Italian - \e{Orfanik, sanface, Alessandro Staltari, Lorenzo Bevilacqua}
@@ -240,8 +244,6 @@ Swedish - \e{Peter Gustafsson, Magnus Bonnevier, Rickard Angbratt}
Thai - \e{SoKoOLz, TuW@nNu (asdfuae)}
-Traditional & Simplified Chinese - \e{Kii Ali}
-
Turkish - \e{Bertan Kodamanoglu, Cagatay Dilsiz, Fatih BOY}
Ukrainian - \e{Yuri Holubow, Nash-Soft}
diff --git a/Docs/src/flowcontrol.but b/Docs/src/flowcontrol.but
index b025651..5c48a14 100755
--- a/Docs/src/flowcontrol.but
+++ b/Docs/src/flowcontrol.but
@@ -187,7 +187,7 @@ Same as \R{intcmp}{IntCmp}, but treats the values as unsigned integers.
\S2{messagebox} MessageBox
-\c mb_option_list messagebox_text [/SD return] [return_check jumpto] [return_check_2 jumpto_2]
+\c mb_option_list messagebox_text [/SD return] [return_check jumpto [return_check_2 jumpto_2]]
Displays a \R{messagebox}{MessageBox} containing the text "messagebox_text". mb_option_list must be one or more of the following, delimited by |s (e.g. MB_YESNO|MB_ICONSTOP).
diff --git a/Docs/src/history.but b/Docs/src/history.but
index 27ee00f..3345c6f 100755
--- a/Docs/src/history.but
+++ b/Docs/src/history.but
@@ -1,5 +1,55 @@
\A{history} Changelog and Release Notes
+\H{v3.02.1} 3.02.1
+
+Released on July 31st, 2017
+
+\S1{v3.02.1-cl} Changelog
+
+\S2{} Translations
+
+\b Fixed Chinese (Traditional) and Romanian translation bugs (\W{http://sf.net/p/nsis/bugs/1189}{bug #1189} and \W{http://sf.net/p/nsis/bugs/1191}{bug #1191})
+
+\b Fixed Scots Gaelic MUI finish page translation
+
+\H{v3.02} 3.02
+
+Released on July 23rd, 2017
+
+\S1{v3.02-cl} Changelog
+
+\S2{} Major Changes
+
+\b Fixed NSIS3 RegTool Win9x bug
+
+\b Added the HKCR32, HKCR64, HKCU32, HKCU64, HKLM32 and HKLM64 root keys
+
+\b Unsupported \R{setregview}{SetRegView} mode now fails all registry operations
+
+\b Added \R{execshellwait}{ExecShellWait}
+
+\b Added \R{writeregmultistr}{WriteRegMultiStr} (\W{http://sf.net/p/nsis/feature-requests/382}{RFE #382}, \W{http://sf.net/p/nsis/patches/219}{patch #219}) and WriteRegNone
+
+\b Added \R{pragma}{!pragma warning} (\W{http://sf.net/p/nsis/patches/267}{patch #267})
+
+\b \R{varconstant}{$LocalAppData} now resolves to the ProgramData folder in the \R{setshellvarcontext}{SetShellVarContext all} context
+
+\S2{} Minor Changes
+
+\b Variables used in \R{acaption}{Caption} can now be set in \R{onguiinit}{.onGUIInit} (\W{http://sf.net/p/nsis/feature-requests/539}{RFE #539})
+
+\b \L{../Docs/MultiUser/Readme.html}{MultiUser} now supports \R{varconstant}{$ProgramFiles64} (\W{http://sf.net/p/nsis/bugs/843}{bug #843})
+
+\b Added support for MUI_UNCONFIRMPAGE_VARIABLE (\W{http://sf.net/p/nsis/feature-requests/511}{RFE #511}) and MUI_PAGE_CUSTOMFUNCTION_DESTROYED
+
+\b Unicode nsExec now supports the /OEM switch (\W{http://sf.net/p/nsis/bugs/1171}{bug #1171})
+
+\S2{} Translations
+
+\b Chinese (Traditional) updates by Walter Cheuk
+
+\b Minor French improvements (\W{http://sf.net/p/nsis/patches/221}{patch #221})
+
\H{v3.01} 3.01
Released on December 11th, 2016
@@ -28,7 +78,7 @@ Released on December 11th, 2016
\b Updated Danish translation (\W{http://sf.net/p/nsis/bugs/1164}{bug #1164})
-\b Arabic, Norwegian, Portuguese, Ukrainian and Swedish MultiUser fixes (\W{http://sf.net/p/nsis/patches/278}{patch #278}, \W{http://sf.net/p/nsis/patches/279}{patch #279}, \W{http://sf.net/p/nsis/patches/274}{patch #274}, \W{http://sf.net/p/nsis/patches/275}{patch #275} & \W{http://sf.net/p/nsis/patches/277}{patch #277})
+\b Arabic, Norwegian, Portuguese, Ukrainian and Swedish \L{../Docs/MultiUser/Readme.html}{MultiUser} fixes (\W{http://sf.net/p/nsis/patches/278}{patch #278}, \W{http://sf.net/p/nsis/patches/279}{patch #279}, \W{http://sf.net/p/nsis/patches/274}{patch #274}, \W{http://sf.net/p/nsis/patches/275}{patch #275} & \W{http://sf.net/p/nsis/patches/277}{patch #277})
\H{v3.0} 3.0
@@ -3235,7 +3285,7 @@ Released on December 6th, 2002
\b !ifdef and friends can now be used in macros
-\b \R{sendmessage}{SendMessage} can send strings (put cw{STR:} before a param) and supports timeouts
+\b \R{sendmessage}{SendMessage} can send strings (put \cw{STR:} before a param) and supports timeouts
\b Right mouse button "Copy to clipboard" context menu for the Details window
diff --git a/Docs/src/langs.but b/Docs/src/langs.but
index 0e724a1..fbfee95 100755
--- a/Docs/src/langs.but
+++ b/Docs/src/langs.but
@@ -50,7 +50,7 @@ Does the same as \R{langstring}{LangString} only it loads the string from a text
As of version 2 NSIS fully supports multiple languages. The interface of one installer can support multiple languages.
-Use \R{loadlanguagefile}{LoadLanguageFile} for every language to load the default interface texts and language properties.
+Use \R{loadlanguagefile}{LoadLanguageFile} for every language to load the default interface texts and language properties. Visit the \W{http://forums.winamp.com/showthread.php?t=157119}{NSIS translations forum} for more information about creating new language files.
The default interface texts can easily be changed using instructions like \R{acomponenttext}{ComponentText} etc.
diff --git a/Docs/src/misc.but b/Docs/src/misc.but
index 5511996..da449c2 100755
--- a/Docs/src/misc.but
+++ b/Docs/src/misc.but
@@ -69,7 +69,7 @@ Sets the error level of the installer or uninstaller to \e{error_level}. See \R{
\c \\<b\\>current\\</b\\>|all
-Sets the context of $SMPROGRAMS and other shell folders. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes. If the all users folder is not found, the current user folder will be used. Please take into consideration that a "normal user" has no rights to write in the all users area. Only admins have full access rights to the all users area. You can check this by using the UserInfo plug-in. See Contrib\\UserInfo\\UserInfo.nsi for an example.
+Sets the context of $SMPROGRAMS and other \R{varconstant}{shell folders}. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes. If the all users folder is not found, the current user folder will be used. Please take into consideration that a "normal user" has no rights to write in the all users area. Only admins have full access rights to the all users area. You can check this by using the UserInfo plug-in. See Contrib\\UserInfo\\UserInfo.nsi for an example.
Note that, if used in installer code, this will only affect the installer, and if used in uninstaller code, this will only affect the uninstaller. To affect both, it needs to be used in both.
diff --git a/Docs/src/registry.but b/Docs/src/registry.but
index 90c0b39..cb442f5 100755
--- a/Docs/src/registry.but
+++ b/Docs/src/registry.but
@@ -2,7 +2,7 @@
In all of the below registry instructions use an empty string (just two quotes with nothing between them - "") as the key name to specify the default key which is shown as (Default) in regedit.exe.
-Use \R{setregview}{SetRegView} on Windows x64 to choose which registry view is used.
+Use \R{setregview}{SetRegView} on 64-bit Windows to choose which registry view is used.
If a full path is not specified for any of the INI handling instructions, the Windows directory will be used.
@@ -182,17 +182,31 @@ Write a string to the registry. \e{root_key} must be one of:
\b \e{SHCTX} or \e{SHELL_CONTEXT}
+\b \e{HKCR32} or \e{HKCR64}
+
+\b \e{HKCU32} or \e{HKCU64}
+
+\b \e{HKLM32} or \e{HKLM64}
+
If \e{root_key} is \e{SHCTX} or \e{SHELL_CONTEXT}, it will be replaced with \e{HKLM} if \R{setshellvarcontext}{SetShellVarContext} is set to \e{all} and with \e{HKCU} if \R{setshellvarcontext}{SetShellVarContext} is set to \e{current}.
The error flag is set if the string could not be written to the registry. The type of the string will be REG_SZ for \R{writeregstr}{WriteRegStr}, or REG_EXPAND_STR for \R{writeregexpandstr}{WriteRegExpandStr}. If the registry key doesn't exist it will be created.
\c WriteRegExpandStr HKLM "Software\My Company\My Software" "Expand String Value" "%WINDIR%\notepad.exe"
+\S2{writeregmultistr} WriteRegMultiStr
+
+\c /REGEDIT5 root_key subkey key_name value
+
+Writes a multi-string value. The /REGEDIT5 switch must be used and specifies that the data is in the hex format used by .reg files on Windows 2000 and later.
+
+\c WriteRegMultiStr /REGEDIT5 HKCU "Software\NSIS\Test" "Multi Value" 66,00,6f,00,6f,00,00,00,62,00,61,00,72,00,00,00,00,00
+
\S2{setregview} SetRegView
-\c \\<b\\>32\\</b\\>|64|lastused
+\c 32|64|\\<b\\>default\\</b\\>|lastused
-Sets the registry view affected by \R{registry}{registry commands}. On 64-bit versions of Windows there are two views; one for 32-bit applications and one for 64-bit applications. By default, 32-bit applications running on 64-bit systems (WOW64) only have access to the 32-bit view. Using \c{SetRegView 64} allows the installer to access keys in the 64-bit view of the registry.
+Sets the registry view affected by \R{registry}{registry commands} (root keys with a 32/64 suffix are not affected). On 64-bit versions of Windows there are two views; one for 32-bit applications and one for 64-bit applications. By default, 32-bit applications running on 64-bit systems (WOW64) only have access to the 32-bit view. Using \c{SetRegView 64} allows the installer to access keys in the 64-bit view of the registry. Registry operations will fail if the selected view is not supported by Windows.
Affects \R{deleteregkey}{DeleteRegKey}, \R{deleteregvalue}{DeleteRegValue}, \R{enumregkey}{EnumRegKey}, \R{enumregvalue}{EnumRegValue}, \R{readregdword}{ReadRegDWORD}, \R{readregstr}{ReadRegStr}, \R{writeregbin}{WriteRegBin}, \R{writeregdword}{WriteRegDWORD}, \R{writeregstr}{WriteRegStr} and \R{writeregexpandstr}{WriteRegExpandStr}.
@@ -201,12 +215,17 @@ Does not affect \R{ainstalldirregkey}{InstallDirRegKey}. Instead, the registry m
\c SetRegView 32
\c ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion ProgramFilesDir
\c DetailPrint $0 # prints C:\Program Files (x86)
-\c SetRegView 64
-\c ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion ProgramFilesDir
-\c DetailPrint $0 # prints C:\Program Files
+\c !include x64.nsh
+\c ${If} ${RunningX64}
+\c SetRegView 64
+\c ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion ProgramFilesDir
+\c DetailPrint $0 # prints C:\Program Files
+\c ${EndIf}
\c Function .onInit
-\c SetRegView 64
-\c ReadRegStr $INSTDIR HKLM Software\NSIS ""
-\c SetRegView 32
+\c ${If} ${RunningX64}
+\c SetRegView 64
+\c ReadRegStr $INSTDIR HKLM Software\NSIS ""
+\c SetRegView Default
+\c ${EndIf}
\c FunctionEnd
diff --git a/Docs/src/tutorial.but b/Docs/src/tutorial.but
index d4877b8..63571ef 100755
--- a/Docs/src/tutorial.but
+++ b/Docs/src/tutorial.but
@@ -248,7 +248,7 @@ The compiler will check your script and give you warnings or an error. If an err
NSIS supports different compression methods, as explained \R{asetcompressor}{here}. ZLIB is the default compression method, which is fast and uses only a little bit of memory. LZMA is a good method for the creation of small installers for internet distribution. BZIP2 usually compresses better than ZLIB but not as good as LZMA, it is useful if you need lower memory usage or fast script compilation.
-It it also possible to compile Windows installers on Linux, BSD or Mac OS X servers. See \R{build}{Building NSIS} for details.
+It is also possible to compile Windows installers on Linux, BSD or Mac OS X servers. See \R{build}{Building NSIS} for details.
\H{tutmodernui} Modern UI
diff --git a/Docs/src/ui.but b/Docs/src/ui.but
index 92f8e54..0598f27 100755
--- a/Docs/src/ui.but
+++ b/Docs/src/ui.but
@@ -42,7 +42,7 @@ Enables or disables mouse and keyboard input to the specified window or control.
\c user_var(hwnd output) windowclass [windowtitle] [windowparent] [childafter]
-Searches for a window. Behaves like Win32's FindWindowEx(). Searches by windowclass (and/or windowtitle if specified). If windowparent or childafter are specified, the search will be restricted as such. If windowclass or windowtitle is specified as "", they will not be used for the search. If the window is not found the user variable is set to 0. To accomplish old-style \R{findwindow}{FindWindow} behavior, use \R{findwindow}{FindWindow} with \R{sendmessage}{SendMessage}.
+Searches for a window. Behaves like Win32's FindWindowEx(). Searches by windowclass (and/or windowtitle if specified). If windowparent or childafter are specified, the search will be restricted as such. If windowclass or windowtitle is specified as "", they will not be used for the search. If the window is not found the user variable is set to 0.
\c FindWindow $1 "#32770" "" $HWNDPARENT # Finds the inner dialog
\c FindWindow $2 "EDIT" "" $1 # Finds the first edit control in the inner dialog
diff --git a/Docs/src/usefulinfos.but b/Docs/src/usefulinfos.but
index 6e21cc7..dc109df 100755
--- a/Docs/src/usefulinfos.but
+++ b/Docs/src/usefulinfos.but
@@ -10,7 +10,7 @@ Like other applications, installers made by NSIS return error levels as a result
\b 2 - Installation aborted by script
-As of NSIS 2.01, you can set the error level to other values using \R{seterrorlevel}{SetErrorLevel}.
+You can set the error level to other values using \R{seterrorlevel}{SetErrorLevel}.
Note that uninstallers copy themselves to the temporary directory and execute from there so the original uninstaller can be deleted. This means the error level the uninstaller sets is not available to the executing process, unless it simulates this copy process and executes the copied uninstaller. To simulate this process, use:
diff --git a/Docs/src/var.but b/Docs/src/var.but
index 4a372d2..1dadabd 100755
--- a/Docs/src/var.but
+++ b/Docs/src/var.but
@@ -177,9 +177,9 @@ This constant is not available on Windows 95 unless Internet Explorer 4 with Act
\e{$LOCALAPPDATA}
-The local (non-roaming) application data directory.
+The local (non-roaming) application data directory. The context of this constant (All Users or Current user) depends on the \R{setshellvarcontext}{SetShellVarContext} setting. The default is the current user.
-This constant is available on Windows 2000 and above.
+This constant is available on Windows ME, 2000 and above.
\e{$PRINTHOOD}
diff --git a/Examples/Modern UI/MultiLanguage.nsi b/Examples/Modern UI/MultiLanguage.nsi
index 5da8d00..9467a3b 100755
--- a/Examples/Modern UI/MultiLanguage.nsi
+++ b/Examples/Modern UI/MultiLanguage.nsi
@@ -45,10 +45,12 @@
;--------------------------------
;Pages
+ !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
+ !insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
diff --git a/Examples/bigtest.nsi b/Examples/bigtest.nsi
index 757ea32..1ef065d 100755
--- a/Examples/bigtest.nsi
+++ b/Examples/bigtest.nsi
@@ -36,6 +36,7 @@ LicenseText "A test text, make sure it's all there"
LicenseData "bigtest.nsi"
RequestExecutionLevel admin
+ManifestSupportedOS all
;--------------------------------
diff --git a/Examples/makensis.nsi b/Examples/makensis.nsi
index 77e5902..d2598f1 100755
--- a/Examples/makensis.nsi
+++ b/Examples/makensis.nsi
@@ -11,7 +11,7 @@
;--------------------------------
;Configuration
-!ifdef NSIS_MAKENSIS64
+!if ${NSIS_PTR_SIZE} > 4
!define BITS 64
!define NAMESUFFIX " (64 bit)"
!else
@@ -124,7 +124,7 @@ VIAddVersionKey "LegalCopyright" "http://nsis.sf.net/License"
;Installer Sections
!macro InstallPlugin pi
- !ifdef NSIS_MAKENSIS64
+ !if ${BITS} >= 64
File "/oname=$InstDir\Plugins\amd64-unicode\${pi}.dll" ..\Plugins\amd64-unicode\${pi}.dll
!else
File "/oname=$InstDir\Plugins\x86-ansi\${pi}.dll" ..\Plugins\x86-ansi\${pi}.dll
@@ -133,7 +133,7 @@ VIAddVersionKey "LegalCopyright" "http://nsis.sf.net/License"
!macroend
!macro InstallStub stub
- !ifdef NSIS_MAKENSIS64
+ !if ${BITS} >= 64
File ..\Stubs\${stub}-amd64-unicode
!else
File ..\Stubs\${stub}-x86-ansi
@@ -161,7 +161,7 @@ ${MementoSection} "NSIS Core Files (required)" SecCore
File ..\makensisw.exe
File ..\COPYING
File ..\NSIS.chm
- !searchparse /file "..\NSIS.chm" "ITSF" VALIDATE_CHM
+ !pragma verifychm "..\NSIS.chm"
File ..\NSIS.exe
!if /FileExists "..\NSIS.exe.manifest"
File "..\NSIS.exe.manifest"
@@ -237,11 +237,19 @@ ${MementoSection} "NSIS Core Files (required)" SecCore
SetOutPath $INSTDIR\Bin
File ..\Bin\LibraryLocal.exe
- File ..\Bin\RegTool.bin
+ !if ${BITS} >= 64
+ File /NonFatal ..\Bin\RegTool-x86.bin
+ File ..\Bin\RegTool-amd64.bin
+ !else
+ File ..\Bin\RegTool-x86.bin
+ !if /FileExists ..\Bin\RegTool-amd64.bin ; It is unlikely that this exists, avoid the /NonFatal warning.
+ File ..\Bin\RegTool-amd64.bin
+ !endif
+ !endif
CreateDirectory $INSTDIR\Plugins\x86-ansi
CreateDirectory $INSTDIR\Plugins\x86-unicode
- !ifdef NSIS_MAKENSIS64
+ !if ${BITS} >= 64
CreateDirectory $INSTDIR\Plugins\amd64-unicode
!endif
!insertmacro InstallPlugin TypeLib
@@ -497,11 +505,10 @@ ${MementoSection} "Language Files" SecLangFiles
SetOutPath $INSTDIR\Bin
File ..\Bin\MakeLangID.exe
- !insertmacro SectionFlagIsSet ${SecInterfacesModernUI} ${SF_SELECTED} mui nomui
- mui:
+ ${If} ${SectionIsSelected} ${SecInterfacesModernUI}
SetOutPath "$INSTDIR\Contrib\Language files"
File "..\Contrib\Language files\*.nsh"
- nomui:
+ ${EndIf}
${MementoSectionEnd}
@@ -787,13 +794,13 @@ Section -post
DetailPrint "Configuring Modern UI..."
SetDetailsPrint listonly
- ${If} ${SectionIsSelected} ${SecLangFiles}
+ ${IfNot} ${SectionIsSelected} ${SecLangFiles}
SetOutPath "$INSTDIR\Contrib\Language files"
File "..\Contrib\Language files\English.nlf"
File "..\Contrib\Language files\English.nsh"
${EndIf}
- ${If} ${SectionIsSelected} ${SecGraphics}
+ ${IfNot} ${SectionIsSelected} ${SecGraphics}
SetOutPath $INSTDIR\Contrib\Graphics\Checks
File "..\Contrib\Graphics\Checks\modern.bmp"
SetOutPath $INSTDIR\Contrib\Graphics\Icons
diff --git a/Include/LangFile.nsh b/Include/LangFile.nsh
index 6216849..c064c19 100755
--- a/Include/LangFile.nsh
+++ b/Include/LangFile.nsh
@@ -5,7 +5,7 @@ LangFile.nsh
Header file to create language files that can be
included with a single command.
-Copyright 2008-2016 Joost Verburg, Anders Kjersem
+Copyright 2008-2017 Joost Verburg, Anders Kjersem
* Either LANGFILE_INCLUDE or LANGFILE_INCLUDE_WITHDEFAULT
can be called from the script to include a language file.
diff --git a/Include/Library.nsh b/Include/Library.nsh
index 3455b59..b8de6cd 100755
--- a/Include/Library.nsh
+++ b/Include/Library.nsh
@@ -121,11 +121,15 @@
;------------------------
;Setup RegTool
+ !if ! /FileExists "${NSISDIR}\Bin\RegTool-${NSIS_CPU}.bin"
+ !error "Missing RegTool for ${NSIS_CPU}!"
+ !endif
+
ReadRegStr $R3 HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" "${REGTOOL_KEY}"
StrCpy $R3 $R3 -4 1
IfFileExists $R3 +3
- File /oname=$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe "${NSISDIR}\Bin\RegTool.bin"
+ File /oname=$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe "${NSISDIR}\Bin\RegTool-${NSIS_CPU}.bin"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
"${REGTOOL_KEY}" '"$R2\${REGTOOL_KEY}.$__INSTALLLLIB_SESSIONGUID.exe" /S'
diff --git a/Include/UpgradeDLL.nsh b/Include/UpgradeDLL.nsh
index 02e213c..6e8363e 100755
--- a/Include/UpgradeDLL.nsh
+++ b/Include/UpgradeDLL.nsh
@@ -60,26 +60,30 @@ Example:
;Advance counter
StrCpy $R0 0
- ReadRegDWORD $R0 HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "count"
+ ReadRegDWORD $R0 HKLM "Software\NSIS.Library.RegTool.v3\UpgradeDLLSession" "count"
IntOp $R0 $R0 + 1
- WriteRegDWORD HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "count" "$R0"
+ WriteRegDWORD HKLM "Software\NSIS.Library.RegTool.v3\UpgradeDLLSession" "count" "$R0"
;------------------------
;Setup RegTool
- ReadRegStr $R3 HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" "NSIS.Library.RegTool.v2"
+ !if ! /FileExists "${NSISDIR}\Bin\RegTool-${NSIS_CPU}.bin"
+ !error "Missing RegTool for ${NSIS_CPU}!"
+ !endif
+
+ ReadRegStr $R3 HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" "NSIS.Library.RegTool.v3"
StrCpy $R3 $R3 -4 1
IfFileExists $R3 +3
- File /oname=$R2\NSIS.Library.RegTool.v2.$HWNDPARENT.exe "${NSISDIR}\Bin\RegTool.bin"
+ File /oname=$R2\NSIS.Library.RegTool.v3.$HWNDPARENT.exe "${NSISDIR}\Bin\RegTool-${NSIS_CPU}.bin"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
- "NSIS.Library.RegTool.v2" '"$R2\NSIS.Library.RegTool.v2.$HWNDPARENT.exe" /S'
+ "NSIS.Library.RegTool.v3" '"$R2\NSIS.Library.RegTool.v3.$HWNDPARENT.exe" /S'
;------------------------
;Add RegTool entry
- WriteRegStr HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "$R0.file" "$R1"
- WriteRegStr HKLM "Software\NSIS.Library.RegTool.v2\UpgradeDLLSession" "$R0.mode" "${mode}"
+ WriteRegStr HKLM "Software\NSIS.Library.RegTool.v3\UpgradeDLLSession" "$R0.file" "$R1"
+ WriteRegStr HKLM "Software\NSIS.Library.RegTool.v3\UpgradeDLLSession" "$R0.mode" "${mode}"
Pop $R3
Pop $R2
diff --git a/Include/VB6RunTime.nsh b/Include/VB6RunTime.nsh
index ebc09cd..d42e166 100755
--- a/Include/VB6RunTime.nsh
+++ b/Include/VB6RunTime.nsh
@@ -4,7 +4,7 @@ VB6RunTime.nsh
Setup of Visual Basic 6.0 run-time files, including the Oleaut32.dll security update
-Copyright 2008-2016 Joost Verburg
+Copyright 2008-2017 Joost Verburg
To obtain the run-time files, download and extract
http://nsis.sourceforge.net/vb6runtime.zip
diff --git a/Include/Win/COM.nsh b/Include/Win/COM.nsh
index c839fd9..3837936 100755
--- a/Include/Win/COM.nsh
+++ b/Include/Win/COM.nsh
@@ -69,8 +69,11 @@ System::Call `${ptr}->${vtblidx}${decl}${params}`
!define ${iface}::${method} `${NSISCOMCALL} ${vtblidx} ${decl} `
!macroend
+!macro ComHlpr_CreateInstance clsid iid sysoutvarIFacePtr sysret
+System::Call 'OLE32::CoCreateInstance(g"${clsid}",i0,i23,g"${iid}",*p.${sysoutvarIFacePtr})i${sysret}'
+!macroend
!macro ComHlpr_CreateInProcInstance clsid iid sysoutvarIFacePtr sysret
-System::Call 'OLE32::CoCreateInstance(g "${clsid}",i 0,i ${CLSCTX_INPROC_SERVER},g "${iid}",*p.${sysoutvarIFacePtr})i${sysret}'
+System::Call 'OLE32::CoCreateInstance(g"${clsid}",i0,i${CLSCTX_INPROC_SERVER},g"${iid}",*p.${sysoutvarIFacePtr})i${sysret}'
!macroend
!macro ComHlpr_SafeRelease _p
@@ -95,7 +98,7 @@ ${NSISCOMIFACEDECL}IUnknown Release 2 ()i
!ifndef IID_IPersist
!define IID_IPersist {0000010c-0000-0000-C000-000000000046}
-${NSISCOMIFACEDECL}IPersist GetClassID 3 (*g)i
+${NSISCOMIFACEDECL}IPersist GetClassID 3 (g)i
!endif
!ifndef IID_IPersistFile
@@ -229,6 +232,33 @@ ${NSISCOMIFACEDECL}IApplicationAssociationRegistration ClearUserAssociations 8 (
${NSISCOMIFACEDECL}IApplicationAssociationRegistrationUI LaunchAdvancedAssociationUI 3 (w)i
!endif
+!ifndef CLSID_GameExplorer
+!define CLSID_GameExplorer {9A5EA990-3034-4D6F-9128-01F3C61022BC}
+!endif
+!ifndef IID_IGameExplorer
+!define IID_IGameExplorer {E7B2FB72-D728-49B3-A5F2-18EBF5F1349E} ;[Vista+]
+${NSISCOMIFACEDECL}IGameExplorer AddGame 3 (p,p,i,g)i
+${NSISCOMIFACEDECL}IGameExplorer RemoveGame 4 (i,i,i,i)i ; The parameter is a GUID, not REFGUID so the 'g' type cannot be used!
+${NSISCOMIFACEDECL}IGameExplorer UpdateGame 5 (i,i,i,i)i
+${NSISCOMIFACEDECL}IGameExplorer VerifyAccess 6 (p,*i)i
+!endif
+!define /ifndef GIS_NOT_INSTALLED 1
+!define /ifndef GIS_CURRENT_USER 2
+!define /ifndef GIS_ALL_USERS 3
+!ifndef IID_IGameExplorer2
+!define IID_IGameExplorer2 {86874AA7-A1ED-450d-A7EB-B89E20B2FFF3} ;[Seven+]
+${NSISCOMIFACEDECL}IGameExplorer2 InstallGame 3 (w,w,i)i
+${NSISCOMIFACEDECL}IGameExplorer2 UninstallGame 4 (w)i
+${NSISCOMIFACEDECL}IGameExplorer2 CheckAccess 5 (w,*i)i
+!endif
+!ifndef CLSID_GameStatistics
+!define CLSID_GameStatistics {DBC85A2C-C0DC-4961-B6E2-D28B62C11AD4}
+!endif
+!ifndef IID_IGameStatisticsMgr
+!define IID_IGameStatisticsMgr {AFF3EA11-E70E-407d-95DD-35E612C41CE2} ;[Seven+]
+${NSISCOMIFACEDECL}IGameStatisticsMgr GetGameStatistics 3 (w,i,*i,*p)i
+${NSISCOMIFACEDECL}IGameStatisticsMgr RemoveGameStatistics 4 (w)i
+!endif
!verbose pop
!endif /* __WIN_COM__INC */
diff --git a/Include/WinVer.nsh b/Include/WinVer.nsh
index bf9ea8d..312953d 100755
--- a/Include/WinVer.nsh
+++ b/Include/WinVer.nsh
@@ -155,6 +155,8 @@
!define WINVER_2012R2 0x06030001 ;6.03.9600
!define WINVER_10_NT 0x8A000000 ;10.0.10240
!define WINVER_10 0x0A000000 ;10.0.10240
+!define WINVER_2016_NT 0x8A000001 ;10.0.14393
+!define WINVER_2016 0x0A000001 ;10.0.14393
# use this to make all nt > 9x
@@ -416,6 +418,7 @@
!insertmacro __WinVer_DefineOSTest ${Test} 8.1 '${Suffix}'
!insertmacro __WinVer_DefineOSTest ${Test} 2012R2 '${Suffix}'
!insertmacro __WinVer_DefineOSTest ${Test} 10 '${Suffix}'
+ !insertmacro __WinVer_DefineOSTest ${Test} 2016 '${Suffix}'
!macroend
!insertmacro __WinVer_DefineOSTests AtLeast ""
diff --git a/Menu/images/header.gif b/Menu/images/header.gif
index 2dba679..ccf1bf3 100755
--- a/Menu/images/header.gif
+++ b/Menu/images/header.gif
Binary files differ
diff --git a/README.md b/README.md
new file mode 100755
index 0000000..4784bf0
--- /dev/null
+++ b/README.md
@@ -0,0 +1,11 @@
+# NSIS
+
+[![Build Status](https://travis-ci.org/kichik/nsis.svg?branch=master)](https://travis-ci.org/kichik/nsis)
+
+NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It is designed to be as small and flexible as possible and is therefore very suitable for internet distribution.
+
+## External Links
+
+ * [Simple tutorial](http://nsis.sourceforge.net/Simple_tutorials)
+ * [NSIS Homepage](http://nsis.sourceforge.net/)
+ * [User Manual](http://nsis.sourceforge.net/Docs/)
diff --git a/SConstruct b/SConstruct
index e4efb16..411ac05 100755
--- a/SConstruct
+++ b/SConstruct
@@ -207,13 +207,13 @@ if defenv['DEBUG']:
defenv.Append(CPPDEFINES = ['DEBUG'])
# add prefixes defines
-if 'NSIS_CONFIG_CONST_DATA_PATH' in defenv['NSIS_CPPDEFINES']:
- defenv.Append(NSIS_CPPDEFINES = [('PREFIX_CONF', '"%s"' % defenv.subst('$PREFIX_CONF'))])
- defenv.Append(NSIS_CPPDEFINES = [('PREFIX_DATA', '"%s"' % defenv.subst('$PREFIX_DATA'))])
- defenv.Append(NSIS_CPPDEFINES = [('PREFIX_DOC', '"%s"' % defenv.subst('$PREFIX_DOC'))])
-
-# Need this early for the config header files to be placed in
-if defenv['UNICODE']:
+if 'NSIS_CONFIG_CONST_DATA_PATH' in defenv['NSIS_CPPDEFINES']:
+ defenv.Append(NSIS_CPPDEFINES = [('PREFIX_CONF', '"%s"' % defenv.subst('$PREFIX_CONF'))])
+ defenv.Append(NSIS_CPPDEFINES = [('PREFIX_DATA', '"%s"' % defenv.subst('$PREFIX_DATA'))])
+ defenv.Append(NSIS_CPPDEFINES = [('PREFIX_DOC', '"%s"' % defenv.subst('$PREFIX_DOC'))])
+
+# Need this early for the config header files to be placed in
+if defenv['UNICODE']:
if defenv['DEBUG']:
defenv.Replace(BUILD_PREFIX = 'build/udebug')
else:
@@ -791,7 +791,7 @@ for util in utils:
path = 'Contrib/' + util
build_dir = '$BUILD_PREFIX/' + util
- exports = {'BuildUtil' : BuildUtil, 'BuildUtilEnv' : BuildUtilEnv, 'env' : util_env}
+ exports = {'BuildUtil' : BuildUtil, 'BuildUtilEnv' : BuildUtilEnv, 'env' : util_env, 'GetArcCPU' : GetArcCPU}
defenv.SConscript(dirs = path, variant_dir = build_dir, duplicate = False, exports = exports)
diff --git a/Source/7zip/7zGuids.cpp b/Source/7zip/7zGuids.cpp
index 7dd6911..4f9472c 100755
--- a/Source/7zip/7zGuids.cpp
+++ b/Source/7zip/7zGuids.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Common/InBuffer.cpp b/Source/7zip/7zip/Common/InBuffer.cpp
index f2a077c..a10902c 100755
--- a/Source/7zip/7zip/Common/InBuffer.cpp
+++ b/Source/7zip/7zip/Common/InBuffer.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Common/InBuffer.h b/Source/7zip/7zip/Common/InBuffer.h
index aa630c0..166e3d9 100755
--- a/Source/7zip/7zip/Common/InBuffer.h
+++ b/Source/7zip/7zip/Common/InBuffer.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Common/OutBuffer.cpp b/Source/7zip/7zip/Common/OutBuffer.cpp
index 700d9a3..1fa36e0 100755
--- a/Source/7zip/7zip/Common/OutBuffer.cpp
+++ b/Source/7zip/7zip/Common/OutBuffer.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Common/OutBuffer.h b/Source/7zip/7zip/Common/OutBuffer.h
index 9c6dfe3..305486f 100755
--- a/Source/7zip/7zip/Common/OutBuffer.h
+++ b/Source/7zip/7zip/Common/OutBuffer.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Common/StreamUtils.cpp b/Source/7zip/7zip/Common/StreamUtils.cpp
index a97e71f..3df7a8d 100755
--- a/Source/7zip/7zip/Common/StreamUtils.cpp
+++ b/Source/7zip/7zip/Common/StreamUtils.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Common/StreamUtils.h b/Source/7zip/7zip/Common/StreamUtils.h
index a1261ba..65a891c 100755
--- a/Source/7zip/7zip/Common/StreamUtils.h
+++ b/Source/7zip/7zip/Common/StreamUtils.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree.h
index 13b41fd..f256045 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,9 @@ class CMatchFinder:
UInt32 _matchMaxLen;
CIndex *_hash;
CIndex *_son;
+#ifdef HASH_ARRAY_2
UInt32 _hashMask;
+#endif
UInt32 _cutValue;
UInt32 _hashSizeSum;
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree2.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree2.h
index 40f4e2b..88b82d2 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree2.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree2.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3.h
index 7b318be..9819b00 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3Z.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3Z.h
index c9ee46e..d8f8ae8 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3Z.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3Z.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3ZMain.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3ZMain.h
index 04f28eb..543d0a8 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3ZMain.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree3ZMain.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4.h
index c41a2d3..d361648 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4b.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4b.h
index fb899c6..bb80d8d 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4b.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTree4b.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMF.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMF.h
index a07d93c..0e34772 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMF.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMF.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMFMain.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMFMain.h
index 620c17c..e6f7703 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMFMain.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMFMain.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMain.h b/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMain.h
index 874c909..9a16f5f 100755
--- a/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMain.h
+++ b/Source/7zip/7zip/Compress/LZ/BinTree/BinTreeMain.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/IMatchFinder.h b/Source/7zip/7zip/Compress/LZ/IMatchFinder.h
index 19134ac..63c8f19 100755
--- a/Source/7zip/7zip/Compress/LZ/IMatchFinder.h
+++ b/Source/7zip/7zip/Compress/LZ/IMatchFinder.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/LZInWindow.cpp b/Source/7zip/7zip/Compress/LZ/LZInWindow.cpp
index 6e50f5b..a550b3b 100755
--- a/Source/7zip/7zip/Compress/LZ/LZInWindow.cpp
+++ b/Source/7zip/7zip/Compress/LZ/LZInWindow.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/LZInWindow.h b/Source/7zip/7zip/Compress/LZ/LZInWindow.h
index c506067..560a0f5 100755
--- a/Source/7zip/7zip/Compress/LZ/LZInWindow.h
+++ b/Source/7zip/7zip/Compress/LZ/LZInWindow.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/LZOutWindow.cpp b/Source/7zip/7zip/Compress/LZ/LZOutWindow.cpp
index 6c233b2..c8c77e4 100755
--- a/Source/7zip/7zip/Compress/LZ/LZOutWindow.cpp
+++ b/Source/7zip/7zip/Compress/LZ/LZOutWindow.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZ/LZOutWindow.h b/Source/7zip/7zip/Compress/LZ/LZOutWindow.h
index 1480c8c..4b78af2 100755
--- a/Source/7zip/7zip/Compress/LZ/LZOutWindow.h
+++ b/Source/7zip/7zip/Compress/LZ/LZOutWindow.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZMA/LZMA.h b/Source/7zip/7zip/Compress/LZMA/LZMA.h
index b3a4f21..c25aa85 100755
--- a/Source/7zip/7zip/Compress/LZMA/LZMA.h
+++ b/Source/7zip/7zip/Compress/LZMA/LZMA.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.cpp b/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.cpp
index 40b1ad8..58b9514 100755
--- a/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.cpp
+++ b/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.h b/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.h
index 0beec40..0f83b7c 100755
--- a/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.h
+++ b/Source/7zip/7zip/Compress/LZMA/LZMAEncoder.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/RangeCoder/RangeCoder.h b/Source/7zip/7zip/Compress/RangeCoder/RangeCoder.h
index 93d0197..5640b66 100755
--- a/Source/7zip/7zip/Compress/RangeCoder/RangeCoder.h
+++ b/Source/7zip/7zip/Compress/RangeCoder/RangeCoder.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.cpp b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.cpp
index 39be712..2424137 100755
--- a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.cpp
+++ b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.h b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.h
index f1445df..e244143 100755
--- a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.h
+++ b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBit.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBitTree.h b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBitTree.h
index 8fc90fe..010e185 100755
--- a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBitTree.h
+++ b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderBitTree.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderOpt.h b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderOpt.h
index 0317669..d9e0985 100755
--- a/Source/7zip/7zip/Compress/RangeCoder/RangeCoderOpt.h
+++ b/Source/7zip/7zip/Compress/RangeCoder/RangeCoderOpt.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/ICoder.h b/Source/7zip/7zip/ICoder.h
index b283aa6..21fed8f 100755
--- a/Source/7zip/7zip/ICoder.h
+++ b/Source/7zip/7zip/ICoder.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/7zip/IStream.h b/Source/7zip/7zip/IStream.h
index 264e2df..bde3499 100755
--- a/Source/7zip/7zip/IStream.h
+++ b/Source/7zip/7zip/IStream.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/Alloc.cpp b/Source/7zip/Common/Alloc.cpp
index c59cf73..1aae485 100755
--- a/Source/7zip/Common/Alloc.cpp
+++ b/Source/7zip/Common/Alloc.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/Alloc.h b/Source/7zip/Common/Alloc.h
index a85b576..a7ca3a6 100755
--- a/Source/7zip/Common/Alloc.h
+++ b/Source/7zip/Common/Alloc.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/CRC.cpp b/Source/7zip/Common/CRC.cpp
index 87d198a..55f3514 100755
--- a/Source/7zip/Common/CRC.cpp
+++ b/Source/7zip/Common/CRC.cpp
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/CRC.h b/Source/7zip/Common/CRC.h
index 0f3fb4a..0403a59 100755
--- a/Source/7zip/Common/CRC.h
+++ b/Source/7zip/Common/CRC.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/Defs.h b/Source/7zip/Common/Defs.h
index 4f05f68..566f20a 100755
--- a/Source/7zip/Common/Defs.h
+++ b/Source/7zip/Common/Defs.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/MyCom.h b/Source/7zip/Common/MyCom.h
index 3b75acf..f74878a 100755
--- a/Source/7zip/Common/MyCom.h
+++ b/Source/7zip/Common/MyCom.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/MyGuidDef.h b/Source/7zip/Common/MyGuidDef.h
index f38d54c..ee99264 100755
--- a/Source/7zip/Common/MyGuidDef.h
+++ b/Source/7zip/Common/MyGuidDef.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/MyUnknown.h b/Source/7zip/Common/MyUnknown.h
index 3ac1e12..9dfd7a0 100755
--- a/Source/7zip/Common/MyUnknown.h
+++ b/Source/7zip/Common/MyUnknown.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/MyWindows.h b/Source/7zip/Common/MyWindows.h
index 2bc6760..6a2d3e2 100755
--- a/Source/7zip/Common/MyWindows.h
+++ b/Source/7zip/Common/MyWindows.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/StdAfx.h b/Source/7zip/Common/StdAfx.h
index a38a6cc..c4358b5 100755
--- a/Source/7zip/Common/StdAfx.h
+++ b/Source/7zip/Common/StdAfx.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/Common/Types.h b/Source/7zip/Common/Types.h
index 3e2e548..4b473ca 100755
--- a/Source/7zip/Common/Types.h
+++ b/Source/7zip/Common/Types.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/LZMADecode.c b/Source/7zip/LZMADecode.c
index 9106f01..4b8f790 100755
--- a/Source/7zip/LZMADecode.c
+++ b/Source/7zip/LZMADecode.c
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/7zip/LZMADecode.h b/Source/7zip/LZMADecode.h
index 7bdaad6..16cf482 100755
--- a/Source/7zip/LZMADecode.h
+++ b/Source/7zip/LZMADecode.h
@@ -4,7 +4,7 @@
* This file is a part of LZMA compression module for NSIS.
*
* Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
- * Modifications Copyright (C) 2003-2016 Amir Szekely <kichik@netvision.net.il>
+ * Modifications Copyright (C) 2003-2017 Amir Szekely <kichik@netvision.net.il>
*
* Licensed under the Common Public License version 1.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/DialogTemplate.cpp b/Source/DialogTemplate.cpp
index 1b98255..1238c50 100755
--- a/Source/DialogTemplate.cpp
+++ b/Source/DialogTemplate.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 2002-2016 Amir Szekely <kichik@netvision.net.il> and Contributors
+ * Copyright (C) 2002-2017 Amir Szekely <kichik@netvision.net.il> and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/DialogTemplate.h b/Source/DialogTemplate.h
index 72774e1..3e2ace6 100755
--- a/Source/DialogTemplate.h
+++ b/Source/DialogTemplate.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 2002-2016 Amir Szekely <kichik@netvision.net.il> and Contributors
+ * Copyright (C) 2002-2017 Amir Szekely <kichik@netvision.net.il> and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/Platform.h b/Source/Platform.h
index aa85d50..8fac3f2 100755
--- a/Source/Platform.h
+++ b/Source/Platform.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -492,6 +492,12 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG;
# define SHACF_FILESYSTEM 1
#endif
+#ifndef SEE_MASK_NOCLOSEPROCESS
+#define SEE_MASK_NOCLOSEPROCESS 0x00000040
+#define SEE_MASK_FLAG_NO_UI 0x00000400
+#define SEE_MASK_FLAG_DDEWAIT 0x00000100
+#endif
+
// other stuff
#ifndef CP_ACP
@@ -642,15 +648,20 @@ typedef DWORDLONG ULONGLONG,*PULONGLONG;
# define HKEY_DYN_DATA ((HKEY)0x80000006)
#endif
+#ifndef KEY_WOW64_32KEY
+# define KEY_WOW64_32KEY 0x200
+#endif
#ifndef KEY_WOW64_64KEY
# define KEY_WOW64_64KEY 0x100
#endif
#ifndef REG_SZ
+# define REG_NONE 0
# define REG_SZ 1
# define REG_EXPAND_SZ 2
# define REG_BINARY 3
# define REG_DWORD 4
+# define REG_MULTI_SZ 7
#endif
// show modes
@@ -1022,7 +1033,11 @@ typedef struct tagVS_FIXEDFILEINFO {
#endif
+#if defined(__clang__) && defined(__cplusplus) && __cplusplus < 201103L
+#define NSIS_CXX_THROWSPEC(throwspec) throw(throwspec) // Use exception specifications to avoid operator new missing-exception-spec warning
+#else
#define NSIS_CXX_THROWSPEC(ignoredthrowspec) // Ignore c++ exception specifications
+#endif
#define BUGBUG64TRUNCATE(cast,xpr) ( (cast) (xpr) )
/*
diff --git a/Source/Plugins.cpp b/Source/Plugins.cpp
index dc95ccd..e8bd86d 100755
--- a/Source/Plugins.cpp
+++ b/Source/Plugins.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/Plugins.h b/Source/Plugins.h
index b3f7ec4..d0c27d0 100755
--- a/Source/Plugins.h
+++ b/Source/Plugins.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/ResourceEditor.cpp b/Source/ResourceEditor.cpp
index 84a2630..1b28a4e 100755
--- a/Source/ResourceEditor.cpp
+++ b/Source/ResourceEditor.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 2002-2016 Amir Szekely <kichik@users.sourceforge.net>
+ * Copyright (C) 2002-2017 Amir Szekely <kichik@users.sourceforge.net>
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/ResourceEditor.h b/Source/ResourceEditor.h
index f05435f..23d809f 100755
--- a/Source/ResourceEditor.h
+++ b/Source/ResourceEditor.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 2002-2016 Amir Szekely <kichik@users.sourceforge.net>
+ * Copyright (C) 2002-2017 Amir Szekely <kichik@users.sourceforge.net>
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/ResourceVersionInfo.cpp b/Source/ResourceVersionInfo.cpp
index 682acdf..ad71ddd 100755
--- a/Source/ResourceVersionInfo.cpp
+++ b/Source/ResourceVersionInfo.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/ResourceVersionInfo.h b/Source/ResourceVersionInfo.h
index 1ba860b..6bc95f4 100755
--- a/Source/ResourceVersionInfo.h
+++ b/Source/ResourceVersionInfo.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/SConscript b/Source/SConscript
index 3f9af5b..75b7527 100755
--- a/Source/SConscript
+++ b/Source/SConscript
@@ -20,6 +20,7 @@ makensis_files = Split("""
ResourceEditor.cpp
ResourceVersionInfo.cpp
script.cpp
+ scriptpp.cpp
ShConstants.cpp
strlist.cpp
tokens.cpp
diff --git a/Source/ShConstants.cpp b/Source/ShConstants.cpp
index e893959..7f9ed9b 100755
--- a/Source/ShConstants.cpp
+++ b/Source/ShConstants.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/ShConstants.h b/Source/ShConstants.h
index 999a1a2..2b691b0 100755
--- a/Source/ShConstants.h
+++ b/Source/ShConstants.h
@@ -4,7 +4,7 @@
* This file is a part of NSIS.
*
* Copyright (C) 2003 Ramon
- * Copyright (C) 2003-2016 NSIS Contributors
+ * Copyright (C) 2003-2017 NSIS Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/afxres.h b/Source/afxres.h
index efa045b..13265fb 100755
--- a/Source/afxres.h
+++ b/Source/afxres.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/build.cpp b/Source/build.cpp
index 639951d..06776b4 100755
--- a/Source/build.cpp
+++ b/Source/build.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
#include "crc32.h"
#include "manifest.h"
#include "icon.h"
+#include "utf.h" // For NStream
#include "exehead/api.h"
#include "exehead/resource.h"
@@ -133,7 +134,7 @@ CEXEBuild::CEXEBuild(signed char pponly) :
m_target_type=TARGET_X86ANSI;
#ifdef _WIN32
- if (sizeof(void*) > 4) m_target_type = TARGET_AMD64; // BUGBUG: There is no instruction to select it so we force
+ if (sizeof(void*) > 4) m_target_type = TARGET_AMD64; // BUGBUG: scons 'TARGET_ARCH' should specify the default
#endif
build_unicode=TARGET_X86ANSI != m_target_type;
build_lockedunicodetarget=false;
@@ -362,8 +363,8 @@ CEXEBuild::CEXEBuild(signed char pponly) :
m_ShellConstants.add(_T("NETHOOD"), CSIDL_NETHOOD, CSIDL_NETHOOD);
m_ShellConstants.add(_T("FONTS"), CSIDL_FONTS, CSIDL_FONTS);
m_ShellConstants.add(_T("TEMPLATES"), CSIDL_TEMPLATES, CSIDL_COMMON_TEMPLATES);
- m_ShellConstants.add(_T("APPDATA"), CSIDL_APPDATA, CSIDL_COMMON_APPDATA);
- m_ShellConstants.add(_T("LOCALAPPDATA"), CSIDL_LOCAL_APPDATA, CSIDL_LOCAL_APPDATA);
+ m_ShellConstants.add(_T("APPDATA"), CSIDL_APPDATA, CSIDL_COMMON_APPDATA); // Note: There is no all-users roaming appdata folder.
+ m_ShellConstants.add(_T("LOCALAPPDATA"), CSIDL_LOCAL_APPDATA, CSIDL_COMMON_APPDATA);
m_ShellConstants.add(_T("PRINTHOOD"), CSIDL_PRINTHOOD, CSIDL_PRINTHOOD);
//m_ShellConstants.add(_T("ALTSTARTUP"), CSIDL_ALTSTARTUP, CSIDL_COMMON_ALTSTARTUP);
m_ShellConstants.add(_T("INTERNET_CACHE"), CSIDL_INTERNET_CACHE, CSIDL_INTERNET_CACHE);
@@ -375,7 +376,7 @@ CEXEBuild::CEXEBuild(signed char pponly) :
m_ShellConstants.add(_T("RESOURCES_LOCALIZED"), CSIDL_RESOURCES_LOCALIZED, CSIDL_RESOURCES_LOCALIZED);
m_ShellConstants.add(_T("CDBURN_AREA"), CSIDL_CDBURN_AREA, CSIDL_CDBURN_AREA);
// PROGRAMFILES&COMMONFILES does a registry lookup and the required string offsets are filled in later.
- // We do this because the unicode mode has to be locked when we call add_string...
+ // We do this later because the unicode mode has to be locked when we call add_string...
m_ShellConstants.add(_T("PROGRAMFILES"), 0, 0);
m_ShellConstants.add(_T("PROGRAMFILES32"), 0, 0);
m_ShellConstants.add(_T("PROGRAMFILES64"), 0, 0);
@@ -426,24 +427,25 @@ void CEXEBuild::init_shellconstantvalues()
static bool done = false;
if (done) return ; else done = true;
- const int orgunmode = uninstall_mode;
+ const int orgunmode = uninstall_mode, t64 = is_target_64bit(), reg = 0x80, r32 = t64 ? 0xC0 : reg, r64 = r32 ^ 0x40;
set_uninstall_mode(0);
// Note: The order matters because some of the strings are preprocessed and cf must be <= 0x40
unsigned int pf = add_asciistring(_T("ProgramFilesDir"), 0);
unsigned int cf = add_asciistring(_T("CommonFilesDir"), 0);
- unsigned int pf_def = add_asciistring(_T("C:\\Program Files"));
- m_ShellConstants.set_values(_T("PROGRAMFILES"), 0x80 | pf, pf_def);
- unsigned int pf64_def = add_asciistring(_T("$PROGRAMFILES"));
- m_ShellConstants.set_values(_T("PROGRAMFILES32"), 0x80 | pf, pf_def);
- m_ShellConstants.set_values(_T("PROGRAMFILES64"), 0xC0 | pf, pf64_def);
+ unsigned int pf_def = add_asciistring(_T("C:\\Program Files")); // Ultimate fallback
+ // TODO: 64-bit targets could use CSIDL_PROGRAM_FILES+CSIDL_PROGRAM_FILESX86?
+ m_ShellConstants.set_values(_T("PROGRAMFILES"), reg | pf, pf_def);
+ unsigned int pf_var = add_asciistring(_T("$PROGRAMFILES")); // Fallback for the 32/64 specific constants if the WOW registry view fails
+ m_ShellConstants.set_values(_T("PROGRAMFILES32"), r32 | pf, reg != r32 ? pf_var : pf_def);
+ m_ShellConstants.set_values(_T("PROGRAMFILES64"), r64 | pf, reg != r64 ? pf_var : pf_def);
unsigned int cf_def = add_asciistring(_T("$PROGRAMFILES\\Common Files"));
- m_ShellConstants.set_values(_T("COMMONFILES"), 0x80 | cf, cf_def);
- unsigned int cf64_def = add_asciistring(_T("$COMMONFILES"));
- m_ShellConstants.set_values(_T("COMMONFILES32"), 0x80 | cf, cf_def);
- m_ShellConstants.set_values(_T("COMMONFILES64"), 0xC0 | cf, cf64_def);
+ m_ShellConstants.set_values(_T("COMMONFILES"), reg | cf, cf_def);
+ unsigned int cf_var = add_asciistring(_T("$COMMONFILES"));
+ m_ShellConstants.set_values(_T("COMMONFILES32"), r32 | cf, reg != r32 ? cf_var : cf_def);
+ m_ShellConstants.set_values(_T("COMMONFILES64"), r64 | cf, reg != r64 ? cf_var : cf_def);
- if ( (pf >= 0x40 || pf_def >= 0xFF || pf64_def > 0xFF) // BUGBUG: pf_def should be ">"?
- || (cf > 0x40 || cf_def > 0xFF || cf64_def > 0xFF) )
+ if ( (pf >= 0x40 || pf_def >= 0xFF || pf_var > 0xFF) // BUGBUG: pf_def should be ">"?
+ || (cf > 0x40 || cf_def > 0xFF || cf_var > 0xFF) )
{
// see Source\exehead\util.c for implementation details
// basically, it knows it needs to get folders from the registry when the 0x80 is on
@@ -456,17 +458,13 @@ void CEXEBuild::init_shellconstantvalues()
unsigned int unpf = add_asciistring(_T("ProgramFilesDir"), 0);
unsigned int uncf = add_asciistring(_T("CommonFilesDir"), 0);
unsigned int unpf_def = add_asciistring(_T("C:\\Program Files"));
- unsigned int unpf64_def = add_asciistring(_T("$PROGRAMFILES"));
+ unsigned int unpf_var = add_asciistring(_T("$PROGRAMFILES"));
unsigned int uncf_def = add_asciistring(_T("$PROGRAMFILES\\Common Files"));
- unsigned int uncf64_def = add_asciistring(_T("$COMMONFILES"));
+ unsigned int uncf_var = add_asciistring(_T("$COMMONFILES"));
set_uninstall_mode(orgunmode);
- if ( unpf != pf
- || unpf_def != pf_def
- || unpf64_def != pf64_def
- || uncf != cf
- || uncf_def != cf_def
- || uncf64_def != cf64_def)
+ if ( unpf != pf || unpf_def != pf_def || unpf_var != pf_var
+ || uncf != cf || uncf_def != cf_def || uncf_var != cf_var )
{
const char* msg = "Internal compiler error: installer's shell constants are different than uninstallers!";
ERROR_MSG(_T("%") NPRIns, msg);
@@ -716,7 +714,7 @@ int CEXEBuild::preprocess_string(TCHAR *out, const TCHAR *in, WORD codepage/*=CP
if (_tcsstr(tbuf,_T(" "))) _tcsstr(tbuf,_T(" "))[0]=0;
}
if ( bDoWarning )
- warning_fl(_T("unknown variable/constant \"%") NPRIs _T("\" detected, ignoring"),tbuf);
+ warning_fl(DW_VAR_IGNORED_UNKNOWN, _T("unknown variable/constant \"%") NPRIs _T("\" detected, ignoring"),tbuf);
i = _T('$'); // redundant since i is already '$' and has not changed.
}
} // else
@@ -1683,7 +1681,7 @@ int CEXEBuild::resolve_coderefs(const TCHAR *str)
{
if (sec->code_size>0)
{
- warning(_T("%") NPRIs _T(" function \"%") NPRIs _T("\" not referenced - zeroing code (%d-%d) out\n"),str,
+ warning(DW_UNUSED_FUNCTION, _T("%") NPRIs _T(" function \"%") NPRIs _T("\" not referenced - zeroing code (%d-%d) out\n"),str,
ns_func.get()+sec->name_ptr,
sec->code,sec->code+sec->code_size);
memset(w+sec->code,0,sec->code_size*sizeof(entry));
@@ -1703,8 +1701,8 @@ int CEXEBuild::resolve_coderefs(const TCHAR *str)
if (!t->flags)
{
TCHAR *n=(TCHAR*)ns_label.get()+t->name_ptr;
- if (*n == _T('.')) warning(_T("global label \"%") NPRIs _T("\" not used"),n);
- else warning(_T("label \"%") NPRIs _T("\" not used"),n);
+ if (*n == _T('.')) warning(DW_UNUSED_GLOBALLABEL, _T("global label \"%") NPRIs _T("\" not used"),n);
+ else warning(DW_UNUSED_LABEL, _T("label \"%") NPRIs _T("\" not used"),n);
}
t++;
}
@@ -1837,7 +1835,7 @@ int CEXEBuild::AddVersionInfo()
{
if ( !*recverkeys ) break;
if ( !rVersionInfo.FindKey(lang_id, code_page, recverkeys) )
- warning(_T("Generating version information for language \"%04d-%") NPRIs _T("\" without standard key \"%") NPRIs _T("\""), lang_id, lang_name, recverkeys);
+ warning(DW_VI_MISSINGSTDKEY, _T("Generating version information for language \"%04d-%") NPRIs _T("\" without standard key \"%") NPRIs _T("\""), lang_id, lang_name, recverkeys);
recverkeys += _tcsclen(recverkeys) + 1;
}
@@ -2163,7 +2161,7 @@ again:
}
if (!instlog_used) {
- warning(_T("%") NPRIs _T("age instfiles not used, no sections will be executed!"), uninstall_mode ? _T("Uninstall p") : _T("P"));
+ warning(DW_INSTFILESPAGE_NOT_USED, _T("%") NPRIs _T("age instfiles not used, no sections will be executed!"), uninstall_mode ? _T("Uninstall p") : _T("P"));
}
}
}
@@ -2490,7 +2488,7 @@ int CEXEBuild::prepare_uninstaller() {
{
if (!uninstaller_writes_used)
{
- warning(_T("Uninstaller script code found but WriteUninstaller never used - no uninstaller will be created."));
+ warning(DW_UNCODE_WITHOUT_UNEXE, _T("Uninstaller script code found but WriteUninstaller never used - no uninstaller will be created."));
return PS_OK;
}
@@ -2547,7 +2545,7 @@ int CEXEBuild::pack_exe_header()
return PS_ERROR;
}
if (ec != 0)
- warning(_T("Packer returned %d, \"%") NPRIs _T("\" might still be unpacked\n"),ec,build_packname);
+ warning(DW_PACKHDR_RETNONZERO, _T("Packer returned %d, \"%") NPRIs _T("\" might still be unpacked\n"),ec,build_packname);
int result = update_exehead(build_packname);
_tremove(build_packname);
@@ -2649,7 +2647,7 @@ int CEXEBuild::write_output(void)
{
const bool orgdispwarn = display_warnings;
display_warnings = false; // Don't display warning inline in the middle of our statistics output.
- warning(_T("Insecure filename \"%") NPRIs _T("\", Windows will unsafely load compatibility shims into the process."), fname);
+ warning(DW_INSECURE_OUTFILENAME, _T("Insecure filename \"%") NPRIs _T("\", Windows will unsafely load compatibility shims into the process."), fname);
display_warnings = orgdispwarn;
}
}
@@ -3409,23 +3407,96 @@ void CEXEBuild::set_verbosity(int lvl)
g_display_errors = display_errors;
}
-void CEXEBuild::warninghelper(const TCHAR *msg)
+int CEXEBuild::parse_pragma(LineParser &line)
{
- m_warnings.add(msg,0);
+ const int rvSucc = PS_OK, rvWarn = PS_WARNING, rvErr = PS_WARNING; // rvErr is not PS_ERROR because we want !pragma parsing to be very forgiving.
- extern bool g_warnaserror;
- MakensisAPI::notify_e hostnotifyevnt = MakensisAPI::NOTIFY_WARNING;
- if (g_warnaserror)
+ // 2.47 shipped with a corrupted CHM file (bug #1129). This minimal verification command exists because the !searchparse hack we added does not work with codepage 936!
+ if (line.gettoken_enum(1, _T("verifychm\0")) == 0)
{
- hostnotifyevnt = MakensisAPI::NOTIFY_ERROR;
- display_warnings = display_errors;
+ struct { UINT32 Sig, Ver, cbH; } chm;
+ NIStream f;
+ bool valid = f.OpenFileForReading(line.gettoken_str(2));
+ valid = valid && 12 == f.ReadOctets(&chm, 12);
+ valid = valid && FIX_ENDIAN_INT32(chm.Sig) == 0x46535449 && (FIX_ENDIAN_INT32(chm.Ver)|1) == 3; // 'ITSF' v2..3
+ return valid ? rvSucc : (ERROR_MSG(_T("Error: Invalid format\n")), PS_ERROR);
}
- notify(hostnotifyevnt, msg);
- if (display_warnings)
+ if (line.gettoken_enum(1, _T("warning\0")) == -1)
+ return (warning_fl(DW_PP_PRAGMA_UNKNOWN, _T("Unknown pragma")), rvErr);
+
+ int warnOp = line.gettoken_enum(2, _T("disable\0enable\0default\0push\0pop\0")), ret = rvSucc;
+ if (warnOp < 0)
+ ret = rvErr, warning_fl(DW_PP_PRAGMA_UNKNOWN, _T("Unknown pragma")); // Unknown warning pragma action
+ else if (warnOp == 3)
+ diagstate.Push();
+ else if (warnOp == 4)
+ {
+ if (!diagstate.Pop())
+ ret = rvWarn, warning_fl(DW_PP_PRAGMA_INVALID, _T("Unexpected"));
+ }
+ else // warning: disable/enable/default
{
- PrintColorFmtMsg_WARN(_T("warning: %") NPRIs _T("\n"), msg);
+ for (int ti = 3; ti < line.getnumtokens(); ++ti)
+ {
+ DIAGCODE code = static_cast<DIAGCODE>(line.gettoken_int(ti));
+ if (!diagstate.IsValidCode(code))
+ ret = rvWarn, warning_fl(DW_PP_PRAGMA_INVALID, _T("Invalid number: \"%") NPRIs _T("\""), line.gettoken_str(ti));
+ else if (warnOp == 0)
+ diagstate.Disable(code);
+ else // if ((warnOp == 1) | (warnOp == 2)) All warnings currently default to enabled
+ diagstate.Enable(code);
+ }
}
+ return ret;
+}
+
+void DiagState::Push()
+{
+ DiagState *p = new DiagState();
+ p->m_Disabled = m_Disabled; // Copy current state
+ p->m_pStack = m_pStack, m_pStack = p;
+}
+bool DiagState::Pop()
+{
+ if (!m_pStack) return false;
+ DiagState *pPop = m_pStack;
+ m_pStack = pPop->m_pStack, pPop->m_pStack = 0;
+ m_Disabled.swap(pPop->m_Disabled);
+ delete pPop;
+ return true;
+}
+
+void CEXEBuild::warninghelper(DIAGCODE dc, bool fl, const TCHAR *fmt, va_list args)
+{
+ extern bool g_warnaserror;
+ bool showcode = dc != DIAGCODE_INTERNAL_HIDEDIAGCODE;
+ if (diagstate.IsDisabled(dc)) return ;
+
+ TCHAR codbuf[11+2+!0];
+ _stprintf(codbuf, showcode ? _T("%u: ") : _T(""), static_cast<unsigned int>(dc));
+ ExpandoString<TCHAR, COUNTOF(codbuf) + NSIS_MAX_STRLEN + 100> msgbuf;
+ ExpandoString<TCHAR, COUNTOF(codbuf) + 200> fmtbuf;
+ fmtbuf.StrFmt(_T("%") NPRIs _T("%") NPRIs, codbuf, fmt);
+ size_t cchMsg = msgbuf.StrVFmt(fmtbuf.GetPtr(), args);
+ if (fl)
+ {
+ msgbuf.Reserve(cchMsg+2+_tcslen(curfilename)+1+11+1+!0);
+ _stprintf(&msgbuf[cchMsg], _T(" (%") NPRIs _T(":%u)"), curfilename, linecnt);
+ }
+ const TCHAR *msg = msgbuf.GetPtr();
+
+ m_warnings.add(msg,0); // Add to list of warnings to display at the end
+
+ MakensisAPI::notify_e hostevent = MakensisAPI::NOTIFY_WARNING;
+ if (g_warnaserror)
+ hostevent = MakensisAPI::NOTIFY_ERROR, display_warnings = display_errors;
+
+ notify(hostevent, msg); // Notify the host
+
+ if (display_warnings) // Print "warning %msgwithcodeprefix%" or "warning: %msg%"
+ PrintColorFmtMsg_WARN(_T("warning%") NPRIs _T("%") NPRIs _T("\n"), showcode ? _T(" ") : _T(": "), msg);
+
if (g_warnaserror)
{
ERROR_MSG(_T("Error: warning treated as error\n"));
@@ -3435,28 +3506,20 @@ void CEXEBuild::warninghelper(const TCHAR *msg)
}
}
-void CEXEBuild::warning(const TCHAR *s, ...)
+void CEXEBuild::warning(DIAGCODE dc, const TCHAR *s, ...)
{
- ExpandoString<TCHAR, NSIS_MAX_STRLEN + 100> buf;
va_list val;
- va_start(val,s);
- buf.StrFmt(s,val);
+ va_start(val, s);
+ warninghelper(dc, false, s, val);
va_end(val);
-
- warninghelper(buf.GetPtr());
}
-void CEXEBuild::warning_fl(const TCHAR *s, ...)
+void CEXEBuild::warning_fl(DIAGCODE dc, const TCHAR *s, ...)
{
- ExpandoString<TCHAR, NSIS_MAX_STRLEN + 100> buf;
va_list val;
- va_start(val,s);
- size_t cchMsg = buf.StrFmt(s, val);
+ va_start(val, s);
+ warninghelper(dc, true, s, val);
va_end(val);
-
- buf.Reserve(cchMsg+2+_tcslen(curfilename)+50+1+!0);
- _stprintf(&buf[cchMsg], _T(" (%") NPRIs _T(":%u)"), curfilename, linecnt);
- warninghelper(buf.GetPtr());
}
void CEXEBuild::ERROR_MSG(const TCHAR *s, ...) const
@@ -3466,7 +3529,7 @@ void CEXEBuild::ERROR_MSG(const TCHAR *s, ...) const
ExpandoString<TCHAR, NSIS_MAX_STRLEN + 100> buf;
va_list val;
va_start(val,s);
- buf.StrFmt(s,val);
+ buf.StrVFmt(s,val);
va_end(val);
notify(MakensisAPI::NOTIFY_ERROR, buf.GetPtr());
@@ -3766,7 +3829,7 @@ void CEXEBuild::VerifyDeclaredUserVarRefs(UserVarsStringList *pVarsStringList)
{
if (!pVarsStringList->get_reference(i))
{
- warning(_T("Variable \"%") NPRIs _T("\" not referenced or never set, wasting memory!"), pVarsStringList->idx2name(i));
+ warning(DW_VAR_NOREF, _T("Variable \"%") NPRIs _T("\" not referenced or never set, wasting memory!"), pVarsStringList->idx2name(i));
}
}
}
@@ -3781,7 +3844,7 @@ bool CEXEBuild::IsIntOrUserVar(const LineParser &line, int token) const
}
int succ;
line.gettoken_int(token, &succ);
- return !!succ;
+ return succ != false;
}
int CEXEBuild::set_target_architecture_data()
@@ -3800,6 +3863,9 @@ int CEXEBuild::set_target_architecture_data()
}
definedlist.set(_T("NSIS_PTR_SIZE"), is_target_64bit() ? _T("8") : _T("4"));
+ tstring cpu = get_string_prefix(get_target_suffix(m_target_type), _T("-"));
+ definedlist.set(_T("NSIS_CPU"), cpu.c_str()); // Used by Library.nsh to pick the correct RegTool
+
definedlist.del(_T("NSIS_IX86"));
definedlist.del(_T("NSIS_AMD64"));
if (TARGET_AMD64 == m_target_type)
diff --git a/Source/build.h b/Source/build.h
index d08399e..74eeb2a 100755
--- a/Source/build.h
+++ b/Source/build.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -50,11 +50,75 @@
#include "czlib.h"
#include "cbzip2.h"
#include "clzma.h"
-#endif//NSIS_CONFIG_COMPRESSION_SUPPORT
+#endif //~ NSIS_CONFIG_COMPRESSION_SUPPORT
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
# include "Plugins.h"
-#endif //NSIS_CONFIG_PLUGIN_SUPPORT
+#endif //~ NSIS_CONFIG_PLUGIN_SUPPORT
+
+// 1000..4999 Errors
+// 5000..5999 Important generic warnings
+// 6000..6999 Script warnings
+// 7000..7499 Recovered from bad input etc. warnings
+// 7500..7999 Discouraged usage warnings (allocated top to bottom to reserve as much space as possible for more bad input codes)
+// 8000..8999 Generic warnings
+// 9000..9999 Breaking our and/or MS guidelines warnings
+typedef enum {
+ //DE_OOM = 1000?, // Generic out of memory
+ //DE_MMAP = 1001?,
+ //DE_STUB_SECTION = 1100?,
+ //DE_PP_VERBOSE_BAD_LEVEL = 4000?,
+ //DW_STALE_TEMP = 5020?, TODO: There is currently no way to disable this
+ DW_PACKHDR_RETNONZERO = 5021,
+ DW_UNSUPP_STORE_FILE_ATT = 5050,
+ //DW_CMDLINE_UNSUPP = 5200?,
+ //DW_CMDLINE_UNSUPP_WIN = 5201?,
+ DW_CMDLINE_UNSUPP_NIX = 5202,
+ DW_CMDLINE_BAD_INPUTENC = 5210, // reserved ..5229
+ DW_VAR_IGNORED_UNKNOWN = 6000, // reserved ..6009
+ DW_VAR_NOREF = 6001,
+ DW_UNUSED_FUNCTION = 6010, // reserved ..6019
+ DW_UNUSED_GLOBALLABEL = 6011,
+ DW_UNUSED_LABEL = 6012,
+ DW_UNCODE_WITHOUT_UNEXE = 6020,
+ DW_INNERSTRING_MULTISETWASTE = 6029,
+ DW_STRING_MULTISETWASTE = DW_INNERSTRING_MULTISETWASTE,
+ DW_LANGSTRING_MULTISETWASTE = 6030, // reserved ..6049
+ DW_LANGSTRING_NOTSETINLANG = 6040,
+ DW_LANGSTRING_SILENTLICENSE = 6049,
+ DW_COMMENT_NEWLINE = 6050, // reserved ..6079
+ DW_PLUGIN_NOUNLOAD_PLACEMENT = 6080, // reserved ..6099
+ DW_PP_PRAGMA_UNKNOWN = 6100, // reserved ..6199
+ DW_PP_PRAGMA_INVALID = 6101,
+ DW_PP_VERBOSE_POP_EMPTY_STACK = 6150,
+ //DW_PP_VERBOSE_BAD_LEVEL = 6151?, // 2.x failed to issue a warning. 3.x currently aborts with hard error.
+ DW_INCLUDE_NONFATAL_NOT_FOUND = 7000, // reserved ..7009
+ DW_FILE_NONFATAL_NOT_FOUND = 7010, // reserved ..7019
+ DW_LANGSTRING_OVERLONGLENGTH = 7020, // reserved ..7024
+ DW_BAD_LANGID = 7025, // reserved ..7029
+ DW_NLF_OLDVERSION = 7030, // reserved ..7049
+ DW_NLF_SYSCP = 7031,
+ DW_NLF_UNSUPPORTED_CP = 7032,
+ DW_NLF_NOT_PREFERRED_ENC = 7033,
+ DW_LICENSE_EMPTY = 7050,
+ DW_ATTRIBUTE_OVERLONGSTRING = 7060,
+ DW_PARSE_BADNUMBER = 7070,
+ DW_PARSE_LNK_HK = 7075,
+ DW_PARSE_REGPATHPREFIX = 7999,
+ DW_INSTFILESPAGE_NOT_USED = 8000, // reserved ..8019
+ DW_COMP_FINAL = 8020, // reserved ..8059
+ DW_COMP_WHOLE_IGNORE_OFF = 8021,
+ DW_COMP_LEVEL_IGNORE = 8025,
+ DW_COMP_DICT_IGNORE = 8026,
+ DW_COMP_DICTWHOLE = 8030,
+ DW_CMDLINE_HIGHPRIORITY = 8499,
+ DW_INSECURE_OUTFILENAME = 9000,
+ DW_VI_MISSINGSTDKEY = 9100,
+
+ DIAGCODE_INTERNAL_HIDEDIAGCODE = 9999,
+ DIAGCODE_INTERNAL_FIRST = 1000, DIAGCODE_INTERNAL_LAST = 9999
+} DIAGCODE;
+
#define PS_OK 0
#define PS_EOF 1
@@ -101,6 +165,21 @@ namespace MakensisAPI {
#define FLAG_OFFSET(flag) (FIELD_OFFSET(exec_flags_t, flag)/sizeof(int))
+class DiagState {
+public:
+ DiagState() : m_pStack(0) { assert(DIAGCODE_INTERNAL_LAST <= 0xffff); }
+ ~DiagState() { delete m_pStack; }
+ void Enable(DIAGCODE n) { m_Disabled.erase(static_cast<unsigned short>(n)); }
+ void Disable(DIAGCODE n) { m_Disabled.insert(static_cast<unsigned short>(n)); }
+ bool IsDisabled(DIAGCODE n) { return m_Disabled.find(static_cast<unsigned short>(n)) != m_Disabled.end(); }
+ void Push();
+ bool Pop();
+ static bool IsValidCode(unsigned int n) { return n >= DIAGCODE_INTERNAL_FIRST && n <= DIAGCODE_INTERNAL_LAST; }
+protected:
+ DiagState *m_pStack;
+ std::set<unsigned short> m_Disabled;
+};
+
class CEXEBuild {
public:
CEXEBuild(signed char pponly);
@@ -111,9 +190,10 @@ class CEXEBuild {
MAX_LINELENGTH = 16384, // NSI/NSH line limit, in TCHARs (including \0)
MAX_MACRORECURSION = 50
};
+ static const TCHAR* get_commandlinecode_filename() { return _T("<command line>"); }
- void warning(const TCHAR *s, ...); // to add a warning to the compiler's warning list.
- void warning_fl(const TCHAR *s, ...); // warning with file name and line count
+ void warning(DIAGCODE dc, const TCHAR *s, ...); // to add a warning to the compiler's warning list.
+ void warning_fl(DIAGCODE dc, const TCHAR *s, ...); // warning with file name and line number
void ERROR_MSG(const TCHAR *s, ...) const;
void SCRIPT_MSG(const TCHAR *s, ...) const;
void INFO_MSG(const TCHAR *s, ...) const;
@@ -248,7 +328,26 @@ class CEXEBuild {
bool inside_comment;
int multiple_entries_instruction; // 1 (true) or 0 (false)
+ int pp_macro(LineParser&line);
+ int pp_macroundef(LineParser&line);
+ int pp_insertmacro(LineParser&line);
+ int pp_tempfile(LineParser&line);
+ int pp_delfile(LineParser&line);
+ int pp_appendfile(LineParser&line);
+ int pp_getdllversion(LineParser&line);
+ int pp_searchreplacestring(LineParser&line);
+ int pp_searchparsestring(LineParser&line);
DefineList *searchParseString(const TCHAR *source_string, LineParser&line, int parmOffs, bool ignCase, bool noErrors, UINT*failParam = 0);
+ int pp_verbose(LineParser&line);
+ int pp_define(LineParser&line);
+ int pp_undef(LineParser&line);
+ int pp_packhdr(LineParser&line);
+ int pp_finalize(LineParser&line);
+ int pp_execute(int which_token, LineParser&line);
+ int pp_addincludedir(LineParser&line);
+ int pp_include(LineParser&line);
+ int pp_cd(LineParser&line);
+ int pp_pragma(LineParser&line);
// build.cpp functions used mostly by script.cpp
int set_target_architecture_data();
@@ -277,6 +376,7 @@ class CEXEBuild {
int preprocess_string(TCHAR *out, const TCHAR *in, WORD codepage=CP_ACP);
void init_shellconstantvalues();
+ int parse_pragma(LineParser &line);
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
int add_plugins_dir_initializer(void);
@@ -307,10 +407,12 @@ class CEXEBuild {
int resolve_instruction(const TCHAR *fn, const TCHAR *str, entry *w, int offs, int start, int end);
int resolve_coderefs(const TCHAR *str);
- void print_warnings();
- void warninghelper(const TCHAR *msg);
int uninstall_generate();
+ void print_warnings();
+ void warninghelper(DIAGCODE dc, bool fl, const TCHAR *fmt, va_list args);
+ DiagState diagstate;
+
/** Are we defining an uninstall version of the code?
* @param un Use like a boolean to define whether in uninstall mode.
*/
diff --git a/Source/bzip2/blocksort.c b/Source/bzip2/blocksort.c
index fef6a94..58f68c1 100755
--- a/Source/bzip2/blocksort.c
+++ b/Source/bzip2/blocksort.c
@@ -2,7 +2,7 @@
* This file is a part of the bzip2 compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.bzip.org/
diff --git a/Source/bzip2/bzlib.c b/Source/bzip2/bzlib.c
index c0112d1..f27f1dd 100755
--- a/Source/bzip2/bzlib.c
+++ b/Source/bzip2/bzlib.c
@@ -2,7 +2,7 @@
* This file is a part of the bzip2 compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.bzip.org/
diff --git a/Source/bzip2/bzlib.h b/Source/bzip2/bzlib.h
index d42ceac..69f7c58 100755
--- a/Source/bzip2/bzlib.h
+++ b/Source/bzip2/bzlib.h
@@ -2,7 +2,7 @@
* This file is a part of the bzip2 compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.bzip.org/
diff --git a/Source/bzip2/compress.c b/Source/bzip2/compress.c
index 8bbce9d..54c0c97 100755
--- a/Source/bzip2/compress.c
+++ b/Source/bzip2/compress.c
@@ -2,7 +2,7 @@
* This file is a part of the bzip2 compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.bzip.org/
diff --git a/Source/bzip2/decompress.c b/Source/bzip2/decompress.c
index 868ed43..1acbf0b 100755
--- a/Source/bzip2/decompress.c
+++ b/Source/bzip2/decompress.c
@@ -2,7 +2,7 @@
* This file is a part of the bzip2 compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.bzip.org/
diff --git a/Source/bzip2/huffman.c b/Source/bzip2/huffman.c
index 2b6a2f4..7d1e768 100755
--- a/Source/bzip2/huffman.c
+++ b/Source/bzip2/huffman.c
@@ -2,7 +2,7 @@
* This file is a part of the bzip2 compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.bzip.org/
diff --git a/Source/cbzip2.h b/Source/cbzip2.h
index b3c5998..074b2d9 100755
--- a/Source/cbzip2.h
+++ b/Source/cbzip2.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/clzma.cpp b/Source/clzma.cpp
index c3f5c0f..fd48a8e 100755
--- a/Source/clzma.cpp
+++ b/Source/clzma.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/clzma.h b/Source/clzma.h
index 5007bbd..026f89a 100755
--- a/Source/clzma.h
+++ b/Source/clzma.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/compressor.h b/Source/compressor.h
index 029ed61..68782d6 100755
--- a/Source/compressor.h
+++ b/Source/compressor.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/crc32.c b/Source/crc32.c
index 5a468f0..b68caa8 100755
--- a/Source/crc32.c
+++ b/Source/crc32.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/crc32.h b/Source/crc32.h
index 6e7d2a7..85f8ca6 100755
--- a/Source/crc32.h
+++ b/Source/crc32.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/czlib.h b/Source/czlib.h
index 306e022..175fa14 100755
--- a/Source/czlib.h
+++ b/Source/czlib.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/dirreader.cpp b/Source/dirreader.cpp
index 523ddfc..969f57a 100755
--- a/Source/dirreader.cpp
+++ b/Source/dirreader.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/dirreader.h b/Source/dirreader.h
index f028dd9..4831724 100755
--- a/Source/dirreader.h
+++ b/Source/dirreader.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c
index f67c65a..5bf955c 100755
--- a/Source/exehead/Main.c
+++ b/Source/exehead/Main.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -28,9 +28,7 @@
#ifndef LOAD_LIBRARY_SEARCH_USER_DIRS
#define LOAD_LIBRARY_SEARCH_USER_DIRS 0x00000400
-#endif
-#ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
-#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
+#define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
#endif
#ifndef SHTDN_REASON_FLAG_PLANNED
#define SHTDN_REASON_FLAG_PLANNED 0x80000000
@@ -58,11 +56,13 @@
extern HANDLE dbd_hFile;
#endif
-TCHAR g_caption[NSIS_MAX_STRLEN*2];
+TCHAR g_caption[NSIS_MAX_STRLEN*2]; // Why does this have to be NSIS_MAX_STRLEN*2?
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
HWND g_hwnd;
HANDLE g_hInstance;
#endif
+void *g_SHGetFolderPath;
+DWORD g_WinVer;
void NSISCALL CleanUp();
@@ -77,14 +77,12 @@ TCHAR *ValidateTempDir()
return my_GetTempFileName(state_language, state_temp_dir);
}
-void *g_SHGetFolderPath;
NSIS_ENTRYPOINT_GUINOCRT
EXTERN_C void NSISWinMainNOCRT()
{
int ret = 0;
const TCHAR *m_Err = _LANG_ERRORWRITINGTEMP;
-
int cl_flags = 0;
TCHAR *realcmds;
@@ -92,13 +90,14 @@ EXTERN_C void NSISWinMainNOCRT()
TCHAR *cmdline;
SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
+ g_WinVer = GetVersion() & ~(NSIS_WINVER_WOW64FLAG); // We store a private flag in the build number bits
{
// bug #1125: Don't load modules from the application nor current directory.
// SetDefaultDllDirectories() allows us to restrict implicitly loaded and
// dynamically loaded modules to just %windir%\System32 and directories
// added with AddDllDirectory(). This prevents DLL search order attacks (CAPEC-471).
- DWORD winver = GetVersion();
+ DWORD winver = g_WinVer;
// CoCreateInstance(CLSID_ShellLink, ...) fails on Vista if SetDefaultDllDirectories is called
BOOL avoidwinbug = LOWORD(winver) == MAKEWORD(6, 0);
if (!avoidwinbug)
@@ -119,6 +118,9 @@ EXTERN_C void NSISWinMainNOCRT()
"CRYPTBASE\0" // Win7 without KB2533623: OleInitialize ... RPCRT4.UuidCreate ... RPCRT4.GenerateRandomNumber
"OLEACC\0" // Vista: SHFileOperation ... SHELL32.CProgressDialogUI::_Setup ... SHELL32.GetRoleTextW
"CLBCATQ\0" // XP.SP2&SP3: SHAutoComplete ... OLE32!InitializeCatalogIfNecessary ... OLE32!CComCatalog::TryToLoadCLB
+#ifndef NSIS_SUPPORT_GETDLLVERSION
+ "VERSION\0"
+#endif
;
const char *dll;
for (dll = preload; dll[0]; dll += lstrlenA(dll) + 1)
@@ -142,6 +144,16 @@ EXTERN_C void NSISWinMainNOCRT()
#endif
g_SHGetFolderPath = myGetProcAddress(MGA_SHGetFolderPath); // and SHFOLDER
+#ifndef _WIN64
+ {
+ // KEY_WOW64_xxKEY causes registry functions to fail on WinNT4 & Win2000.
+ // We don't filter them out because all registry instructions are supposed to fail when
+ // accessing a unsupported view and RegKey* takes care of that by looking at the WOW64 flag.
+ FARPROC fp = myGetProcAddress(MGA_IsOS);
+ enum { os_wow6432 = 30 };
+ if (fp && ((BOOL(WINAPI*)(UINT))fp)(os_wow6432)) g_WinVer |= NSIS_WINVER_WOW64FLAG;
+ }
+#endif
InitCommonControls();
diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c
index 6e6b3bf..1fa13c4 100755
--- a/Source/exehead/Ui.c
+++ b/Source/exehead/Ui.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft, Jeff Doozan and Contributors
+ * Copyright (C) 1999-2017 Nullsoft, Jeff Doozan and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -103,6 +103,15 @@ static void NSISCALL SetActiveCtl(HWND hCtl)
SendMessage(g_hwnd, WM_NEXTDLGCTL, (WPARAM) hCtl, TRUE);
}
+static BOOL NSISCALL LaunchURL(HWND hOwner, LPCTSTR URL, int ShowMode)
+{
+ SHELLEXECUTEINFO sei;
+ sei.fMask = SEE_MASK_FLAG_NO_UI|SEE_MASK_FLAG_DDEWAIT;
+ sei.hwnd = hOwner, sei.nShow = SW_SHOWNORMAL;
+ sei.lpVerb = _T("open"), sei.lpFile = URL, sei.lpParameters=NULL, sei.lpDirectory = NULL;
+ return myShellExecuteEx(&sei);
+}
+
static void NSISCALL NotifyCurWnd(UINT uNotifyCode)
{
if (m_curwnd)
@@ -170,6 +179,16 @@ void NSISCALL build_g_logfile()
int *cur_langtable;
+static TCHAR* update_caption()
+{
+ TCHAR *gcap = g_caption;
+ GetNSISString(gcap, LANG_CAPTION);
+#ifdef NSIS_SUPPORT_BGBG
+ my_SetWindowText(m_bgwnd, gcap);
+#endif
+ return gcap;
+}
+
static void NSISCALL set_language()
{
LANGID lang_mask=(LANGID)~0;
@@ -200,14 +219,9 @@ lang_again:
}
cur_langtable = selected_langtable;
-
myitoa(state_language, *(LANGID*)language_table);
- {
- TCHAR *caption = GetNSISString(g_caption,LANG_CAPTION);
-#ifdef NSIS_SUPPORT_BGBG
- my_SetWindowText(m_bgwnd, caption);
-#endif
- }
+
+ update_caption();
// reload section names
{
@@ -581,7 +595,7 @@ nextPage:
SetActiveCtl(m_hwndOK);
}
- mystrcpy(g_tmp,g_caption);
+ mystrcpy(g_tmp,update_caption());
GetNSISString(g_tmp+mystrlen(g_tmp),this_page->caption);
my_SetWindowText(hwndDlg,g_tmp);
@@ -808,7 +822,7 @@ static INT_PTR CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
if (tr.chrg.cpMax-tr.chrg.cpMin < COUNTOF(ps_tmpbuf)) {
SendMessage(hwLicense,EM_GETTEXTRANGE,0,(LPARAM)&tr);
SetCursor(LoadCursor(0, IDC_WAIT));
- ShellExecute(hwndDlg,_T("open"),tr.lpstrText,NULL,NULL,SW_SHOWNORMAL);
+ LaunchURL(hwndDlg,tr.lpstrText,SW_SHOWNORMAL);
SetCursor(LoadCursor(0, IDC_ARROW));
}
}
diff --git a/Source/exehead/afxres.h b/Source/exehead/afxres.h
index 738cf5c..f505120 100755
--- a/Source/exehead/afxres.h
+++ b/Source/exehead/afxres.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/api.h b/Source/exehead/api.h
index 474bce5..0ad9fe7 100755
--- a/Source/exehead/api.h
+++ b/Source/exehead/api.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -36,25 +36,24 @@ enum NSPIM
// Should always be __cdecl for future expansion possibilities
typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
-// extra_parameters data structures containing other interesting stuff
-// but the stack, variables and HWND passed on to plug-ins.
+// extra_parameters data structure containing other interesting stuff
+// besides the stack, variables and HWND passed on to plug-ins.
typedef struct
{
- int autoclose;
- int all_user_var;
- int exec_error;
- int abort;
- int exec_reboot; // NSIS_SUPPORT_REBOOT
- int reboot_called; // NSIS_SUPPORT_REBOOT
- int XXX_cur_insttype; // Deprecated
- int plugin_api_version; // see NSISPIAPIVER_CURR
- // used to be XXX_insttype_changed
- int silent; // NSIS_CONFIG_SILENT_SUPPORT
- int instdir_error;
- int rtl;
- int errlvl;
- int alter_reg_view;
- int status_update;
+ int autoclose; // SetAutoClose
+ int all_user_var; // SetShellVarContext: User context = 0, Machine context = 1
+ int exec_error; // IfErrors
+ int abort; // IfAbort
+ int exec_reboot; // IfRebootFlag (NSIS_SUPPORT_REBOOT)
+ int reboot_called; // NSIS_SUPPORT_REBOOT
+ int XXX_cur_insttype; // Deprecated
+ int plugin_api_version; // Plug-in ABI. See NSISPIAPIVER_CURR (Note: used to be XXX_insttype_changed)
+ int silent; // IfSilent (NSIS_CONFIG_SILENT_SUPPORT)
+ int instdir_error; // GetInstDirError
+ int rtl; // 1 if $LANGUAGE is a RTL language
+ int errlvl; // SetErrorLevel
+ int alter_reg_view; // SetRegView: Default View = 0, Alternative View = (sizeof(void*) > 4 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY)
+ int status_update; // SetDetailsPrint
} exec_flags_t;
#ifndef NSISCALL
@@ -83,4 +82,4 @@ typedef struct {
// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
#define NOTIFY_BYE_BYE 'x'
-#endif /* _PLUGIN_H_ */
+#endif /* _NSIS_EXEHEAD_API_H_ */
diff --git a/Source/exehead/bgbg.c b/Source/exehead/bgbg.c
index 852db7f..c2cbba6 100755
--- a/Source/exehead/bgbg.c
+++ b/Source/exehead/bgbg.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/components.c b/Source/exehead/components.c
index bdbcb91..786729b 100755
--- a/Source/exehead/components.c
+++ b/Source/exehead/components.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/components.h b/Source/exehead/components.h
index 33cb3ef..1d62251 100755
--- a/Source/exehead/components.h
+++ b/Source/exehead/components.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/config.h b/Source/exehead/config.h
index 1f4303d..e99a25d 100755
--- a/Source/exehead/config.h
+++ b/Source/exehead/config.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c
index 6d5702b..86fed6f 100755
--- a/Source/exehead/exec.c
+++ b/Source/exehead/exec.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -156,30 +156,41 @@ static TCHAR * NSISCALL GetStringFromParm(int id_)
}
#ifdef NSIS_SUPPORT_REGISTRYFUNCTIONS
+static HKEY NSISCALL GetRegRootKey(int RootKey)
+{
+ if (RootKey < 0) return (HKEY) (UINT_PTR) RootKey;
+ return (HKEY) ((UINT_PTR) HKEY_CURRENT_USER + RootKey + g_exec_flags.all_user_var); // SHCTX[32|64|ANY]: HKEY_CURRENT_USER + 1 == HKEY_LOCAL_MACHINE
+}
+static HKEY NSISCALL RegOpenScriptKey(REGSAM RS)
+{
+ HKEY hKey;
+ return RegKeyOpen(GetRegRootKey(g_parms[1]), GetStringFromParm(0x22), RS|KEY_FROMSCRIPT, &hKey) ? NULL : hKey;
+}
+static HKEY NSISCALL RegCreateScriptKey(int RootKey, LPCTSTR SubKey, REGSAM RS)
+{
+ HKEY hKey;
+ return RegKeyCreate(GetRegRootKey(RootKey), SubKey, RS|KEY_FROMSCRIPT, &hKey) ? NULL : hKey;
+}
-#define AlterRegistrySAM(sam) (sam | g_exec_flags.alter_reg_view)
-
-// based loosely on code from Tim Kosse
-// in win9x this isn't necessary (RegDeleteKey() can delete a tree of keys),
-// but in win2k you need to do this manually.
-static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyifempty)
+// RegDeleteKey on Win9x will delete a tree of keys, WinNT will only delete a key without subkeys.
+// RegDeleteKeyEx on 32-bit Windows accepts but ignores the KEY_WOW64_xxKEY flags and always uses the
+// one and only native key. Our RegKeyOpen will intentionally fail if a incompatible WoW64 flag is used.
+#define DRTF_ONLYIFNOSUBKEYS DELREGKEY_ONLYIFNOSUBKEYS
+static LONG NSISCALL DeleteRegTree(HKEY hThisKey, LPCTSTR SubKey, REGSAM SamviewAndFlags)
{
- HKEY key;
- int retval=RegOpenKeyEx(thiskey,lpSubKey,0,AlterRegistrySAM(KEY_ENUMERATE_SUB_KEYS),&key);
- if (retval==ERROR_SUCCESS)
+ HKEY hKey;
+ UINT onlyifempty = SamviewAndFlags & DRTF_ONLYIFNOSUBKEYS;
+ REGSAM samview = SamviewAndFlags & (KEY_WOW64_32KEY|KEY_WOW64_64KEY);
+ LONG retval = RegKeyOpen(hThisKey, SubKey, KEY_ENUMERATE_SUB_KEYS|samview, &hKey);
+ if (retval == ERROR_SUCCESS)
{
- // NB - don't change this to static (recursive function)
- TCHAR buffer[MAX_PATH+1];
- while (RegEnumKey(key,0,buffer,MAX_PATH+1)==ERROR_SUCCESS)
+ TCHAR child[MAX_PATH+1]; // NB - don't change this to static (recursive function)
+ while (RegEnumKey(hKey, 0, child, COUNTOF(child)) == ERROR_SUCCESS)
{
- if (onlyifempty)
- {
- RegCloseKey(key);
- return !ERROR_SUCCESS;
- }
- if ((retval=myRegDeleteKeyEx(key,buffer,0)) != ERROR_SUCCESS) break;
+ if (onlyifempty) return (RegCloseKey(hKey), !ERROR_SUCCESS);
+ if ((retval = DeleteRegTree(hKey, child, SamviewAndFlags)) != ERROR_SUCCESS) break;
}
- RegCloseKey(key);
+ RegCloseKey(hKey);
{
typedef LONG (WINAPI * RegDeleteKeyExPtr)(HKEY, LPCTSTR, REGSAM, DWORD);
RegDeleteKeyExPtr RDKE = (RegDeleteKeyExPtr)
@@ -189,31 +200,19 @@ static LONG NSISCALL myRegDeleteKeyEx(HKEY thiskey, LPCTSTR lpSubKey, int onlyif
myGetProcAddress(MGA_RegDeleteKeyEx);
#endif
if (RDKE)
- retval=RDKE(thiskey,lpSubKey,AlterRegistrySAM(0),0);
+ retval = RDKE(hThisKey, SubKey, samview, 0);
else
- retval=g_exec_flags.alter_reg_view||RegDeleteKey(thiskey,lpSubKey);
+ retval = RegDeleteKey(hThisKey, SubKey);
}
}
return retval;
}
-
-static HKEY NSISCALL GetRegRootKey(int hRootKey)
-{
- if (hRootKey)
- return (HKEY) (UINT_PTR) hRootKey;
-
- // HKEY_LOCAL_MACHINE - HKEY_CURRENT_USER == 1
- return (HKEY) ((UINT_PTR) HKEY_CURRENT_USER + g_exec_flags.all_user_var);
-}
-
-static HKEY NSISCALL myRegOpenKey(REGSAM samDesired)
+static LONG NSISCALL RegDeleteScriptKey(int RootKey, LPCTSTR SubKey, REGSAM SamviewAndFlags)
{
HKEY hKey;
- if (RegOpenKeyEx(GetRegRootKey(g_parms[1]), GetStringFromParm(0x22), 0, AlterRegistrySAM(samDesired), &hKey) == ERROR_SUCCESS)
- {
- return hKey;
- }
- return NULL;
+ SamviewAndFlags |= KEY_FROMSCRIPT;
+ hKey = GetRegKeyAndSAM(GetRegRootKey(RootKey), &SamviewAndFlags);
+ return hKey ? DeleteRegTree(hKey, SubKey, SamviewAndFlags) : ERROR_INVALID_HANDLE; // ERROR_CANTOPEN?
}
#endif//NSIS_SUPPORT_REGISTRYFUNCTIONS
@@ -285,7 +284,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
return ExecuteCodeSegment(v,NULL);
}
case EW_UPDATETEXT:
- log_printf2(_T("detailprint: %s"),GetStringFromParm(0x00));
+ log_printf2(_T("DetailPrint: %s"),GetStringFromParm(0x00));
update_status_text(parm0,0);
break;
case EW_SLEEP:
@@ -306,6 +305,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{
FIELDN(g_exec_flags_last_used,parm0)=FIELDN(g_exec_flags,parm0);
FIELDN(g_exec_flags,parm0)=GetIntFromParm(1);
+ log_printf3(_T("SetFlag: %d=%d"),parm0,FIELDN(g_exec_flags,parm0));
}
else
{
@@ -876,20 +876,27 @@ static int NSISCALL ExecuteEntry(entry *entry_)
#ifdef NSIS_SUPPORT_SHELLEXECUTE
case EW_SHELLEXEC: // this uses improvements of Andras Varga
{
- int x;
- TCHAR *buf0=GetStringFromParm(0x00);
- TCHAR *buf3=GetStringFromParm(0x31);
- TCHAR *buf2=GetStringFromParm(0x22);
+ SHELLEXECUTEINFO sei;
+ TCHAR *buf0=GetStringFromParm(0x00); // Verb
+ TCHAR *buf3=GetStringFromParm(0x31); // File
+ TCHAR *buf2=GetStringFromParm(0x22); // Parameters
GetStringFromParm(0x15); // For update_status_text_buf1
update_status_text_buf1(LANG_EXECSHELL);
- x=(int)(INT_PTR)ShellExecute(g_hwnd,buf0[0]?buf0:NULL,buf3,buf2[0]?buf2:NULL,state_output_directory,parm3);
- if (x < 33)
+ sei.fMask=parm4;
+ sei.hwnd=g_hwnd, sei.nShow=parm3;
+ sei.lpVerb=buf0[0]?buf0:NULL, sei.lpFile=buf3, sei.lpParameters=buf2[0]?buf2:NULL, sei.lpDirectory=state_output_directory;
+ if (!myShellExecuteEx(&sei))
{
- log_printf5(_T("ExecShell: warning: error (\"%s\": file:\"%s\" params:\"%s\")=%d"),buf0,buf3,buf2,x);
+ log_printf5(_T("ExecShell: warning: error (\"%s\": file:\"%s\" params:\"%s\")=%d"),buf0,buf3,buf2,GetLastError());
exec_error++;
}
else
{
+ if (SEE_MASK_NOCLOSEPROCESS & sei.fMask)
+ {
+ WaitForProcess(sei.hProcess);
+ CloseHandle(sei.hProcess);
+ }
log_printf4(_T("ExecShell: success (\"%s\": file:\"%s\" params:\"%s\")"),buf0,buf3,buf2);
}
}
@@ -910,17 +917,11 @@ static int NSISCALL ExecuteEntry(entry *entry_)
log_printf2(_T("Exec: success (\"%s\")"),buf0);
if (parm2)
{
- DWORD lExitCode;
- while (WaitForSingleObject(hProc,100) == WAIT_TIMEOUT)
- {
- MessageLoop(WM_PAINT);
- }
- GetExitCodeProcess(hProc, &lExitCode);
-
+ DWORD lExitCode=WaitForProcess(hProc);
if (parm1>=0) myitoa(var1,lExitCode);
else if (lExitCode) exec_error++;
}
- CloseHandle( hProc );
+ CloseHandle(hProc);
}
else
{
@@ -1209,11 +1210,11 @@ static int NSISCALL ExecuteEntry(entry *entry_)
#ifdef NSIS_SUPPORT_REGISTRYFUNCTIONS
case EW_DELREG:
{
- long res=!ERROR_SUCCESS;
- const TCHAR *rkn UNUSED=RegKeyHandleToName((HKEY)parm1);
- if (!parm4)
+ long res=!ERROR_SUCCESS, rootkey=parm1;
+ const TCHAR *rkn UNUSED=RegKeyHandleToName((HKEY)rootkey);
+ if (!parm4) // TOK_DELETEREGVALUE
{
- HKEY hKey=myRegOpenKey(KEY_SET_VALUE);
+ HKEY hKey=RegOpenScriptKey(KEY_SET_VALUE);
if (hKey)
{
TCHAR *buf3=GetStringFromParm(0x33);
@@ -1222,11 +1223,11 @@ static int NSISCALL ExecuteEntry(entry *entry_)
RegCloseKey(hKey);
}
}
- else
+ else // TOK_DELETEREGKEY
{
TCHAR *buf2=GetStringFromParm(0x22);
log_printf3(_T("DeleteRegKey: \"%s\\%s\""),rkn,buf2);
- res = myRegDeleteKeyEx(GetRegRootKey(parm1),buf2,parm4&2);
+ res = RegDeleteScriptKey(rootkey,buf2,parm4 >> DELREGKEYFLAGSSHIFT); // SHR is 1 byte smaller than AND
}
if (res != ERROR_SUCCESS)
exec_error++;
@@ -1235,15 +1236,13 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_WRITEREG: // write registry value
{
HKEY hKey;
- HKEY rootkey=GetRegRootKey(parm0);
- int type=parm4;
- int rtype=parm5;
+ int rootkey=parm0, type=parm4, rtype=parm5;
TCHAR *buf0=GetStringFromParm(0x02);
TCHAR *buf1=GetStringFromParm(0x11);
- const TCHAR *rkn UNUSED=RegKeyHandleToName(rootkey);
+ const TCHAR *rkn UNUSED=RegKeyHandleToName((HKEY)rootkey);
exec_error++;
- if (RegCreateKeyEx(rootkey,buf1,0,0,0,AlterRegistrySAM(KEY_SET_VALUE),0,&hKey,0) == ERROR_SUCCESS)
+ if ((hKey = RegCreateScriptKey(rootkey, buf1, KEY_SET_VALUE)))
{
LPBYTE data = (LPBYTE) buf2;
DWORD size = 0;
@@ -1270,11 +1269,12 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{
#ifdef NSIS_CONFIG_LOG
TCHAR binbuf[128];
+ LPCTSTR logf = rtype==REG_NONE?_T("WriteRegNone"):rtype==REG_MULTI_SZ?_T("WriteRegMultiStr"):_T("WriteRegBin");
#endif
// use buf2, buf3 and buf4
size = GetCompressedDataFromDataBlockToMemory(parm3, data, (3 * NSIS_MAX_STRLEN)*sizeof(TCHAR));
LogData2Hex(binbuf, COUNTOF(binbuf), data, size);
- log_printf5(_T("WriteRegBin: \"%s\\%s\" \"%s\"=\"%s\""),rkn,buf1,buf0,binbuf);
+ log_printf6(_T("%s: \"%s\\%s\" \"%s\"=\"%s\""),logf,rkn,buf1,buf0,binbuf);
}
if (size >= 0 && RegSetValueEx(hKey,buf0,0,rtype,data,size) == ERROR_SUCCESS)
@@ -1293,14 +1293,13 @@ static int NSISCALL ExecuteEntry(entry *entry_)
break;
case EW_READREGSTR: // read registry string
{
- HKEY hKey=myRegOpenKey(KEY_READ);
+ HKEY hKey=RegOpenScriptKey(KEY_READ);
TCHAR *p=var0;
TCHAR *buf3=GetStringFromParm(0x33); // buf3 == key name
p[0]=0;
if (hKey)
{
- DWORD l = NSIS_MAX_STRLEN*sizeof(TCHAR);
- DWORD t;
+ DWORD l = NSIS_MAX_STRLEN*sizeof(TCHAR), t;
// Jim Park: If plain text in p or binary data in p,
// user must be careful in accessing p correctly.
@@ -1330,21 +1329,19 @@ static int NSISCALL ExecuteEntry(entry *entry_)
break;
case EW_REGENUM:
{
- HKEY key=myRegOpenKey(KEY_READ);
+ HKEY hKey=RegOpenScriptKey(KEY_READ);
TCHAR *p=var0;
int b=GetIntFromParm(3);
- p[0]=0;
- if (key)
+ p[0]=0; // "" on error. This assumes that RegEnumKey and RegEnumValue do not party on our buffer!
+ if (hKey)
{
- DWORD d=NSIS_MAX_STRLEN-1;
- if (parm4) RegEnumKey(key,b,p,d);
- else if (RegEnumValue(key,b,p,&d,NULL,NULL,NULL,NULL)!=ERROR_SUCCESS)
- {
+ DWORD d=NSIS_MAX_STRLEN-1; // -1 is not required here?
+ if (parm4)
+ RegEnumKey(hKey,b,p,d);
+ else if (RegEnumValue(hKey,b,p,&d,NULL,NULL,NULL,NULL) != ERROR_SUCCESS)
exec_error++;
- break;
- }
- p[NSIS_MAX_STRLEN-1]=0;
- RegCloseKey(key);
+ p[NSIS_MAX_STRLEN-1]=0; // Not required?
+ RegCloseKey(hKey);
}
else exec_error++;
}
diff --git a/Source/exehead/exec.h b/Source/exehead/exec.h
index 59aa6f2..6440d95 100755
--- a/Source/exehead/exec.h
+++ b/Source/exehead/exec.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/fileform.c b/Source/exehead/fileform.c
index 387ea1e..c22104c 100755
--- a/Source/exehead/fileform.c
+++ b/Source/exehead/fileform.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/fileform.h b/Source/exehead/fileform.h
index 96acc39..87105a3 100755
--- a/Source/exehead/fileform.h
+++ b/Source/exehead/fileform.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@
enum
{
EW_INVALID_OPCODE, // zero is invalid. useful for catching errors. (otherwise an all zeroes instruction
- // does nothing, which is easily ignored but means something is wrong.
+ // does nothing, which is easily ignored but means something is wrong)
EW_RET, // return from function call
EW_NOP, // Nop/Jump, do nothing: 1, [?new address+1:advance one]
EW_ABORT, // Abort: 1 [status]
@@ -118,7 +118,7 @@ enum
#endif
#ifdef NSIS_SUPPORT_SHELLEXECUTE
- EW_SHELLEXEC, // ShellExecute program: 4, [shell action, complete commandline, parameters, showwindow]
+ EW_SHELLEXEC, // ShellExecute program: 5, [SEE_MASK_FLAG_*, verb, file, parameters, showwindow] (Will wait if SEE_MASK_NOCLOSEPROCESS is set)
#endif
#ifdef NSIS_SUPPORT_EXECUTE
@@ -155,7 +155,7 @@ enum
#endif
#ifdef NSIS_SUPPORT_REGISTRYFUNCTIONS
- EW_DELREG, // DeleteRegValue/DeleteRegKey: 4, [root key(int), KeyName, ValueName, delkeyonlyifempty]. ValueName is -1 if delete key
+ EW_DELREG, // DeleteRegValue/DeleteRegKey: 4, [root key(int), KeyName, ValueName, ActionAndFlags(DELREG*)]
EW_WRITEREG, // Write Registry value: 5, [RootKey(int),KeyName,ItemName,ItemData,typelen]
// typelen=1 for str, 2 for dword, 3 for binary, 0 for expanded str
EW_READREGSTR, // ReadRegStr: 5 [output, rootkey(int), keyname, itemname, ==1?int::str]
@@ -203,7 +203,7 @@ enum
#ifdef _UNICODE // opcodes available only in Unicode installers must be at the end of the enumeration
#ifdef NSIS_SUPPORT_FILEFUNCTIONS
- EW_FPUTWS, // FileWriteUTF16LE: 3 [handle, string, ?int:string]
+ EW_FPUTWS, // FileWriteUTF16LE: 4 [handle, string, ?int:string, TryWriteBOM]
EW_FGETWS, // FileReadUTF16LE: 4 [handle, output, maxlen, ?getchar:gets]
#endif//NSIS_SUPPORT_FILEFUNCTIONS
#endif
@@ -504,12 +504,38 @@ typedef struct {
# define ctlcolors ctlcolors32
#endif
+
// constants for myDelete (util.c)
#define DEL_DIR 1
#define DEL_RECURSE 2
#define DEL_REBOOT 4
#define DEL_SIMPLE 8
+
+#define REGROOTVIEW32 0x40000000
+#define REGROOTVIEW64 0x20000000
+#define REGROOTVIEWTOSAMVIEW(rv) ( ((UINT_PTR)(rv)&(REGROOTVIEW32|REGROOTVIEW64)) >> 21 ) // REGROOTVIEWxx to KEY_WOW64_xxKEY
+#define IsRegRootkeyForcedView(hKey) ( ((UINT_PTR) (hKey) & (REGROOTVIEW32|REGROOTVIEW64)) )
+#define MAKEREGROOTVIEW(r, fv) ( (HKEY) ((UINT_PTR)(r) | (fv)) )
+#define HKSHCTX ( (HKEY) 0 ) // Converted to HKCU or HKLM by GetRegRootKey
+#define HKSHCTX32 MAKEREGROOTVIEW(HKSHCTX, REGROOTVIEW32)
+#define HKSHCTX64 MAKEREGROOTVIEW(HKSHCTX, REGROOTVIEW64)
+#define HKCR32 MAKEREGROOTVIEW(HKEY_CLASSES_ROOT, REGROOTVIEW32)
+#define HKCR64 MAKEREGROOTVIEW(HKEY_CLASSES_ROOT, REGROOTVIEW64)
+#define HKCU32 MAKEREGROOTVIEW(HKEY_CURRENT_USER, REGROOTVIEW32)
+#define HKCU64 MAKEREGROOTVIEW(HKEY_CURRENT_USER, REGROOTVIEW64)
+#define HKLM32 MAKEREGROOTVIEW(HKEY_LOCAL_MACHINE, REGROOTVIEW32)
+#define HKLM64 MAKEREGROOTVIEW(HKEY_LOCAL_MACHINE, REGROOTVIEW64)
+#define HKSHCTXANY MAKEREGROOTVIEW(HKSHCTX, REGROOTVIEW32|REGROOTVIEW64)
+#define HKCRANY MAKEREGROOTVIEW(HKEY_CLASSES_ROOT, REGROOTVIEW32|REGROOTVIEW64)
+#define HKCUANY MAKEREGROOTVIEW(HKEY_CURRENT_USER, REGROOTVIEW32|REGROOTVIEW64)
+#define HKLMANY MAKEREGROOTVIEW(HKEY_LOCAL_MACHINE, REGROOTVIEW32|REGROOTVIEW64)
+#define DELREG_VALUE 0 // TOK_DELETEREGVALUE
+#define DELREG_KEY 1 // TOK_DELETEREGKEY
+#define DELREGKEY_ONLYIFNOSUBKEYS 1 // Shifted and stored as 2 in the binary for compatibility with <= 3.1
+#define DELREGKEYFLAGSSHIFT 1 // parm4 is shifted so exehead can remove the DELREG_KEY bit
+
+
#ifdef NSIS_SUPPORT_CREATESHORTCUT
#define CS_HK_MASK 0xffff0000 // HotKey
#define CS_HK_SHIFT 16
@@ -521,6 +547,7 @@ typedef struct {
#define CS_II_MAX (CS_II_MASK >> CS_II_SHIFT)
#endif
+
// special escape characters used in strings: (we use control codes in order to minimize conflicts with normal characters)
#define NS_LANG_CODE _T('\x01') // for a langstring
#define NS_SHELL_CODE _T('\x02') // for a shell folder path
diff --git a/Source/exehead/lang.h b/Source/exehead/lang.h
index 8a00968..7fd2d8d 100755
--- a/Source/exehead/lang.h
+++ b/Source/exehead/lang.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/plugin.c b/Source/exehead/plugin.c
index a514dd2..8549486 100755
--- a/Source/exehead/plugin.c
+++ b/Source/exehead/plugin.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/plugin.h b/Source/exehead/plugin.h
index 403dae4..1030bed 100755
--- a/Source/exehead/plugin.h
+++ b/Source/exehead/plugin.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/state.h b/Source/exehead/state.h
index 0b72d59..61cfc9d 100755
--- a/Source/exehead/state.h
+++ b/Source/exehead/state.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/ui.h b/Source/exehead/ui.h
index 8f884b9..c902ea7 100755
--- a/Source/exehead/ui.h
+++ b/Source/exehead/ui.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/exehead/util.c b/Source/exehead/util.c
index 14503c9..b84e246 100755
--- a/Source/exehead/util.c
+++ b/Source/exehead/util.c
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -99,6 +99,13 @@ HANDLE NSISCALL myCreateProcess(TCHAR *cmd)
return ProcInfo.hProcess;
}
+BOOL NSISCALL myShellExecuteEx(SHELLEXECUTEINFO*pSEI)
+{
+ pSEI->cbSize = sizeof(SHELLEXECUTEINFO);
+ pSEI->lpIDList = NULL; // Must set this because SEE_MASK_INVOKEIDLIST might be set by ExecShell[Wait]
+ return ShellExecuteEx(pSEI);
+}
+
/*BOOL NSISCALL my_SetWindowText(HWND hWnd, const TCHAR *val)
{
return SendMessage(hWnd,WM_SETTEXT,0,(LPARAM)val);
@@ -144,7 +151,7 @@ int NSISCALL my_MessageBox(const TCHAR *text, UINT type) {
mbp.hwndOwner = g_hwnd;
mbp.hInstance = g_hInstance;
mbp.lpszText = text;
- mbp.lpszCaption = g_caption;
+ mbp.lpszCaption = g_caption; // Should call update_caption() here?
mbp.dwStyle = _type;
return MessageBoxIndirect(&mbp);
@@ -539,7 +546,11 @@ void RenameViaWininit(const TCHAR* prevName, const TCHAR* newName)
int spn; // length of the short path name in TCHARs.
- lstrcpy(tmpbuf, _T("NUL"));
+ // Optimized mystrcpy(tmpbuf, _T("NUL")):
+ if (sizeof(TCHAR) == 1)
+ *(UINT32*)tmpbuf = ((UINT32)'N' << 0) | ((UINT32)'U' << 8) | ((UINT32)'L' << 16) | ((UINT32)'\0' << 24);
+ else
+ *(UINT64*)tmpbuf = ((UINT64)'N' << 0) | ((UINT64)'U' << 16) | ((UINT64)'L' << 32) | ((UINT64)'\0' << 48);
if (newName) {
// create the file if it's not already there to prevent GetShortPathName from failing
@@ -643,22 +654,52 @@ void NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew)
}
#endif
-// The value of registry->sub->name is stored in out. If failure, then out becomes
-// an empty string "".
-void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR *out, int x64)
+#define GetAltViewREGSAM() ( sizeof(void*) > 4 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY )
+HKEY NSISCALL GetRegKeyAndSAM(HKEY hKey, REGSAM*pRS)
+{
+ const REGSAM samviewmask = (KEY_WOW64_32KEY|KEY_WOW64_64KEY);
+ const REGSAM incompatsamview = SystemSupportsAltRegView() ? 0 : GetAltViewREGSAM();
+ REGSAM sam = *pRS, incompatsam = incompatsamview;
+#ifdef C_ASSERT
+ {C_ASSERT(REGROOTVIEWTOSAMVIEW(REGROOTVIEW32|REGROOTVIEW64) == (KEY_WOW64_32KEY|KEY_WOW64_64KEY));}
+#endif
+ if ((sam & KEY_FORCEVIEW) && IsRegRootkeyForcedView(hKey))
+ {
+ REGSAM keysamview = REGROOTVIEWTOSAMVIEW(hKey);
+ if (keysamview == samviewmask) keysamview = (g_exec_flags.alter_reg_view & ~incompatsamview); // HKxxANY tries to honor SetRegView
+ sam &= ~samviewmask, sam |= (keysamview & ~(sizeof(void*) > 4 ? 0 : KEY_WOW64_32KEY)); // HKxx32 has the *_32KEY bit set but WinNT4&2000 cannot handle any KEY_WOW64_xxKEY flags.
+ hKey = (HKEY) ( (UINT_PTR) hKey & ~(REGROOTVIEW32|REGROOTVIEW64) );
+ }
+ else if (sam & KEY_ALTERVIEW)
+ {
+ sam |= g_exec_flags.alter_reg_view; // We don't mask away the incompatsamview bits because the operation is supposed to fail if the view is not supported.
+ }
+ *pRS = sam & ~(NSIS_REGSAM_PRIVATEMASK); // Filter away internal flags
+ return (incompatsam & sam) ? NULL : hKey; // Fail if the requested view is not supported
+}
+LONG NSISCALL RegKeyOpen(HKEY hBase, LPCTSTR SubKey, REGSAM RS, HKEY*phKey)
+{
+ if (!(hBase = GetRegKeyAndSAM(hBase, &RS))) return ERROR_INVALID_HANDLE; // ERROR_CANTOPEN?
+ return RegOpenKeyEx(hBase, SubKey, 0, RS, phKey);
+}
+LONG NSISCALL RegKeyCreate(HKEY hBase, LPCTSTR SubKey, REGSAM RS, HKEY*phKey)
+{
+ if (!(hBase = GetRegKeyAndSAM(hBase, &RS))) return ERROR_INVALID_HANDLE; // ERROR_CANTOPEN?
+ return RegCreateKeyEx(hBase, SubKey, 0, 0, 0, RS, 0, phKey, 0);
+}
+
+void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR *out, UINT altview)
{
HKEY hKey;
- *out=0;
- if (RegOpenKeyEx(root,sub,0,KEY_READ|(x64?KEY_WOW64_64KEY:0),&hKey) == ERROR_SUCCESS)
+ DWORD cb = NSIS_MAX_STRLEN*sizeof(TCHAR), rt, ec;
+ REGSAM samview = altview ? GetAltViewREGSAM() : 0;
+ if ((ec = RegKeyOpen(root, sub, KEY_READ|samview, &hKey)) == ERROR_SUCCESS)
{
- DWORD l = NSIS_MAX_STRLEN*sizeof(TCHAR);
- DWORD t;
- // Note that RegQueryValueEx returns Unicode strings if _UNICODE is defined for the
- // REG_SZ type.
- if (RegQueryValueEx(hKey,name,NULL,&t,(LPBYTE)out,&l ) != ERROR_SUCCESS || (t != REG_SZ && t != REG_EXPAND_SZ)) *out=0;
- out[NSIS_MAX_STRLEN-1]=0;
+ ec = RegQueryValueEx(hKey, name, NULL, &rt, (LPBYTE)out, &cb);
RegCloseKey(hKey);
+ out[NSIS_MAX_STRLEN-1] = 0; // Make sure the string is terminated. This could potentially truncate a long string by 1 character!
}
+ if (ec != ERROR_SUCCESS || (rt != REG_SZ && rt != REG_EXPAND_SZ)) *out = 0; // Empty string on failure
}
void NSISCALL iptrtostr(TCHAR *s, INT_PTR d)
@@ -764,8 +805,10 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
int fldrs[4];
if (nVarIdx < NS_SKIP_CODE)
{
- // the next 2 BYTEs in the string might be coding either a value 0..MAX_CODED (nData), or 2 CSIDL of Special folders (for NS_SHELL_CODE)
+ // The next 2 BYTEs in the string might be coding either a value 0..MAX_CODED (nData), or 2 CSIDL of Special folders (for NS_SHELL_CODE)
nData = DECODE_SHORT(in);
+ // There are 2 CSIDL parameters for each context and query must be used before create
+ // because of bug #820 (CSIDL_FLAG_CREATE failures on root paths are cached in Vista).
#ifdef _UNICODE
fldrs[1] = LOBYTE(*in); // current user
fldrs[0] = fldrs[1] | CSIDL_FLAG_CREATE;
@@ -777,7 +820,6 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
fldrs[2] = in[1] | CSIDL_FLAG_CREATE; // all users
fldrs[3] = in[1];
#endif
- //TODO: are fldrs[1] and fldrs[3] really useful? why not force folder creation directly?
in += sizeof(SHORT)/sizeof(TCHAR);
if (nVarIdx == NS_SHELL_CODE)
@@ -785,10 +827,8 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
LPITEMIDLIST idl;
int x = 2;
- DWORD ver = GetVersion();
-
+ DWORD ver = sizeof(void*) > 4 ? MAKEWORD(5, 2) : g_WinVer; // We only care about 95/98 vs ME/NT4+
/*
-
SHGetFolderPath as provided by shfolder.dll is used to get special folders
unless the installer is running on Windows 95/98. For 95/98 shfolder.dll is
only used for the Application Data and Documents folder (if the DLL exists).
@@ -802,12 +842,10 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
SHGetFolderPath in shell32.dll could be called directly for Windows versions
later than 95/98 but there is no need to do so, because shfolder.dll is still
provided and calls shell32.dll.
-
*/
-
BOOL use_shfolder =
// Use shfolder if not on 95/98
- !((ver & 0x80000000) && (LOWORD(ver) != 0x5A04)) ||
+ !((ver & 0x80000000) && (LOWORD(ver) != MAKEWORD(4,90))) ||
// Unless the Application Data or Documents folder is requested
(
@@ -819,7 +857,7 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
if (g_exec_flags.all_user_var)
{
- x = 4;
+ x = 4; // Get common folder > Create common folder > Get user folder > Create user folder
}
if (fldrs[1] & 0x80)
@@ -829,12 +867,12 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab)
GetNSISString(out, fldrs[3]);
x = 0;
}
- else if (fldrs[1] == CSIDL_SYSTEM)
+ else if (fldrs[1] == CSIDL_SYSTEM) // Does not work on 95, 98 nor NT4. Works on ME and 2000+.
{
GetSystemDirectory(out, NSIS_MAX_STRLEN);
x = 0;
}
- else if (fldrs[1] == CSIDL_WINDOWS)
+ else if (fldrs[1] == CSIDL_WINDOWS) // Does not work on 95, 98 nor NT4. Works on ME and 2000+.
{
GetWindowsDirectory(out, NSIS_MAX_STRLEN);
x = 0;
@@ -982,22 +1020,27 @@ void NSISCALL log_write(int close)
const TCHAR * _RegKeyHandleToName(HKEY hKey)
{
- if (hKey == HKEY_CLASSES_ROOT)
- return _T("HKEY_CLASSES_ROOT");
- else if (hKey == HKEY_CURRENT_USER)
- return _T("HKEY_CURRENT_USER");
- else if (hKey == HKEY_LOCAL_MACHINE)
- return _T("HKEY_LOCAL_MACHINE");
- else if (hKey == HKEY_USERS)
- return _T("HKEY_USERS");
- else if (hKey == HKEY_PERFORMANCE_DATA)
- return _T("HKEY_PERFORMANCE_DATA");
- else if (hKey == HKEY_CURRENT_CONFIG)
- return _T("HKEY_CURRENT_CONFIG");
- else if (hKey == HKEY_DYN_DATA)
- return _T("HKEY_DYN_DATA");
- else
- return _T("invalid registry key");
+ if (hKey == HKEY_CLASSES_ROOT) return _T("HKEY_CLASSES_ROOT");
+ if (hKey == HKEY_CURRENT_USER) return _T("HKEY_CURRENT_USER");
+ if (hKey == HKEY_LOCAL_MACHINE) return _T("HKEY_LOCAL_MACHINE");
+ if (hKey == HKEY_USERS) return _T("HKEY_USERS");
+ if (hKey == HKEY_PERFORMANCE_DATA) return _T("HKEY_PERFORMANCE_DATA");
+ if (hKey == HKEY_CURRENT_CONFIG) return _T("HKEY_CURRENT_CONFIG");
+ if (hKey == HKEY_DYN_DATA) return _T("HKEY_DYN_DATA");
+ if (hKey == HKSHCTX) return _T("HKSHCTX");
+ if (hKey == HKSHCTX32) return _T("HKSHCTX32");
+ if (hKey == HKSHCTX64) return _T("HKSHCTX64");
+ if (hKey == HKCR32) return _T("HKCR32");
+ if (hKey == HKCR64) return _T("HKCR64");
+ if (hKey == HKCU32) return _T("HKCU32");
+ if (hKey == HKCU64) return _T("HKCU64");
+ if (hKey == HKLM32) return _T("HKLM32");
+ if (hKey == HKLM64) return _T("HKLM64");
+ if (hKey == HKSHCTXANY) return _T("HKSHCTXANY");
+ if (hKey == HKCRANY) return _T("HKCRANY");
+ if (hKey == HKCUANY) return _T("HKCUANY");
+ if (hKey == HKLMANY) return _T("HKLMANY");
+ return _T("HK??");
}
void _LogData2Hex(TCHAR *buf, size_t cchbuf, BYTE *data, size_t cbdata)
@@ -1103,6 +1146,9 @@ struct MGA_FUNC MGA_FUNCS[] = {
#endif
{"ADVAPI32", "InitiateShutdownW"},
{"SHELL32", (CHAR*) 680}, // IsUserAnAdmin
+#ifndef _WIN64
+ {"SHLWAPI", (CHAR*) 437}, // IsOS
+#endif
{"SHLWAPI", "SHAutoComplete"},
{"SHFOLDER", "SHGetFolderPathW"},
#ifdef NSIS_SUPPORT_GETDLLVERSION
@@ -1118,6 +1164,9 @@ struct MGA_FUNC MGA_FUNCS[] = {
{"ADVAPI32", "RegDeleteKeyExA"},
{"ADVAPI32", "InitiateShutdownA"},
{"SHELL32", (CHAR*) 680}, // IsUserAnAdmin
+#ifndef _WIN64
+ {"SHLWAPI", (CHAR*) 437}, // IsOS
+#endif
{"SHLWAPI", "SHAutoComplete"},
{"SHFOLDER", "SHGetFolderPathA"},
#ifdef NSIS_SUPPORT_GETDLLVERSION
@@ -1192,3 +1241,13 @@ void * NSISCALL NSISGetProcAddress(HANDLE dllHandle, TCHAR* funcName)
return GetProcAddress(dllHandle, funcName);
#endif
}
+
+DWORD NSISCALL WaitForProcess(HANDLE hProcess)
+{
+ DWORD excod;
+ while (WaitForSingleObject(hProcess, 100) == WAIT_TIMEOUT)
+ MessageLoop(WM_PAINT);
+
+ GetExitCodeProcess(hProcess, &excod);
+ return excod;
+}
diff --git a/Source/exehead/util.h b/Source/exehead/util.h
index dca2b47..08b06d5 100755
--- a/Source/exehead/util.h
+++ b/Source/exehead/util.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ TCHAR * NSISCALL GetNSISString(TCHAR *outbuf, int strtab);
// use the LANG_STR_TAB() macro to decode it.
#define GetNSISTab(strtab) (strtab < 0 ? LANG_STR_TAB(strtab) : strtab)
-void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR *out, int x64);
#define myatoi(s) ( (int)strtoiptr(s) )
INT_PTR NSISCALL strtoiptr(const TCHAR *s);
#define myitoa iptrtostr
@@ -41,6 +40,27 @@ TCHAR * NSISCALL mystrcpy(TCHAR *out, const TCHAR *in);
int NSISCALL mystrlen(const TCHAR *in);
TCHAR * NSISCALL mystrcat(TCHAR *out, const TCHAR *concat);
TCHAR * NSISCALL mystrstr(TCHAR *a, TCHAR *b);
+
+
+#ifndef KEY_CREATE_LINK
+#define KEY_CREATE_LINK 0x0020
+#endif
+#define KEY_FORCEVIEW KEY_CREATE_LINK // Our private flag used by RegKey* to indicate that we want it to handle HKLM[32|64] style root keys. Cannot be set if the HKEY is a real handle!
+#define KEY_ALTERVIEW SYNCHRONIZE // Our private flag used by RegKey* to indicate that we want it to apply g_exec_flags.alter_reg_view. (MSDN:"Registry keys do not support the SYNCHRONIZE standard access right")
+#define KEY_FROMSCRIPT (KEY_FORCEVIEW|KEY_ALTERVIEW) // Use this flag for registry operations from a .nsi script
+#define NSIS_REGSAM_PRIVATEMASK (KEY_FROMSCRIPT|KEY_FORCEVIEW|KEY_ALTERVIEW)
+HKEY NSISCALL GetRegKeyAndSAM(HKEY hKey, REGSAM*pRS);
+LONG NSISCALL RegKeyOpen(HKEY hBase, LPCTSTR SubKey, REGSAM RS, HKEY*phKey);
+LONG NSISCALL RegKeyCreate(HKEY hBase, LPCTSTR SubKey, REGSAM RS, HKEY*phKey);
+void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR *out, UINT altview);
+
+
+extern DWORD g_WinVer; // GetVersion()
+#define NSIS_WINVER_WOW64FLAG ( sizeof(void*) > 4 ? ( 0 ) : ( 0x40000000 ) )
+#define IsWow64() ( sizeof(void*) > 4 ? ( FALSE ) : ( g_WinVer & NSIS_WINVER_WOW64FLAG ) )
+#define SystemSupportsAltRegView() ( sizeof(void*) > 4 ? ( TRUE ) : ( IsWow64() ) )
+
+
WIN32_FIND_DATA * NSISCALL file_exists(TCHAR *buf);
TCHAR * NSISCALL my_GetTempFileName(TCHAR *buf, const TCHAR *dir);
BOOL NSISCALL myReadFile(HANDLE h, LPVOID buf, DWORD cb);
@@ -94,6 +114,7 @@ DWORD NSISCALL CreateRestrictedDirectory(LPCTSTR path);
DWORD NSISCALL CreateNormalDirectory(LPCTSTR path);
HANDLE NSISCALL myCreateProcess(TCHAR *cmd);
+BOOL NSISCALL myShellExecuteEx(SHELLEXECUTEINFO*pSEI);
int NSISCALL my_MessageBox(const TCHAR *text, UINT type);
void NSISCALL myDelete(TCHAR *buf, int flags);
@@ -134,6 +155,9 @@ enum myGetProcAddressFunctions {
#endif
MGA_InitiateShutdown,
MGA_IsUserAnAdmin,
+#ifndef _WIN64
+ MGA_IsOS,
+#endif
MGA_SHAutoComplete, // x64 can link to shlwapi directly but as long as MGA_SHGetFolderPath is used we can stick with myGetProcAddress
MGA_SHGetFolderPath, // TODO: This can probably call something else directly on x64
#ifdef NSIS_SUPPORT_GETDLLVERSION
@@ -157,7 +181,9 @@ void NSISCALL MessageLoop(UINT uCheckedMsg);
* @param funcName The name of the function to get the address of.
* @return The pointer to the function. Null if failure.
*/
-void * NSISCALL NSISGetProcAddress(HANDLE dllHandle, TCHAR* funcName);
+void* NSISCALL NSISGetProcAddress(HANDLE dllHandle, TCHAR* funcName);
+
+DWORD NSISCALL WaitForProcess(HANDLE hProcess);
// Turn a pair of chars into a word
// Turn four chars into a dword
diff --git a/Source/fileform.cpp b/Source/fileform.cpp
index f1779f0..4f75ccb 100755
--- a/Source/fileform.cpp
+++ b/Source/fileform.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/fileform.h b/Source/fileform.h
index 443b5c4..358c7c7 100755
--- a/Source/fileform.h
+++ b/Source/fileform.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/growbuf.cpp b/Source/growbuf.cpp
index 7b90f1c..c0a6f6f 100755
--- a/Source/growbuf.cpp
+++ b/Source/growbuf.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/growbuf.h b/Source/growbuf.h
index e3a57e0..4b968a9 100755
--- a/Source/growbuf.h
+++ b/Source/growbuf.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/icon.cpp b/Source/icon.cpp
index d875c55..5080d0f 100755
--- a/Source/icon.cpp
+++ b/Source/icon.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/icon.h b/Source/icon.h
index ac7a5e6..be085a0 100755
--- a/Source/icon.h
+++ b/Source/icon.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/lang.cpp b/Source/lang.cpp
index 00e24c0..faad6d8 100755
--- a/Source/lang.cpp
+++ b/Source/lang.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -136,9 +136,9 @@ NLFString NLFStrings[NLF_STRINGS] = {
{_T("^CopyDetails"), _T("Copy Details To Clipboard"), BOTH_STATIC},
{_T("^LogInstall"), _T("Log install process"), BOTH_STATIC},
{_T("^Byte"), _T("B"), BOTH_STATIC},
- {_T("^Kilo"), _T("K"), BOTH_STATIC},
- {_T("^Mega"), _T("M"), BOTH_STATIC},
- {_T("^Giga"), _T("G"), BOTH_STATIC},
+ {_T("^Kilo"), _T(" K"), BOTH_STATIC},
+ {_T("^Mega"), _T(" M"), BOTH_STATIC},
+ {_T("^Giga"), _T(" G"), BOTH_STATIC},
{_T("^Font"), _T("MS Shell Dlg"), NONE_STATIC},
{_T("^FontSize"), _T("8"), NONE_STATIC},
{_T("^RTL"), _T("0"), NONE_STATIC},
@@ -494,7 +494,7 @@ int CEXEBuild::SetLangString(const TCHAR *name, LANGID lang, const TCHAR *str, B
int sn;
if (!LicenseData && _tcsclen(str) > NSIS_MAX_STRLEN-1)
- warning_fl(_T("LangString \"%") NPRIs _T("\" longer than NSIS_MAX_STRLEN!"), name);
+ warning_fl(DW_LANGSTRING_OVERLONGLENGTH, _T("LangString \"%") NPRIs _T("\" longer than NSIS_MAX_STRLEN!"), name);
int pos = build_langstrings.get(name, &sn);
if (pos < 0)
@@ -589,9 +589,9 @@ int CEXEBuild::GenerateLangTable(LanguageTable *lt, int num_lang_tables) {
if (lsn[0] != _T('^'))
{
if (lt[i].nlf.m_bLoaded)
- warning(_T("LangString \"%") NPRIs _T("\" is not set in language table of language %") NPRIs, lsn, lt[i].nlf.m_szName);
+ warning(DW_LANGSTRING_NOTSETINLANG, _T("LangString \"%") NPRIs _T("\" is not set in language table of language %") NPRIs, lsn, lt[i].nlf.m_szName);
else
- warning(_T("LangString \"%") NPRIs _T("\" is not set in language table of language %d"), lsn, lt[i].lang_id);
+ warning(DW_LANGSTRING_NOTSETINLANG, _T("LangString \"%") NPRIs _T("\" is not set in language table of language %d"), lsn, lt[i].lang_id);
}
}
else
@@ -1009,7 +1009,7 @@ l_readerr:
if (p) *p = t;
if (nlf_version != NLF_VERSION) {
- warning_fl(_T("%") NPRIs _T(" language file version doesn't match. Using default English texts for missing strings."), nlf->m_szName);
+ warning_fl(DW_NLF_OLDVERSION, _T("%") NPRIs _T(" language file version doesn't match. Using default English texts for missing strings."), nlf->m_szName);
}
// set ^Language
@@ -1036,7 +1036,7 @@ l_readerr:
// Get code page
bool isnlfdataucp = false; // Unicode-only language?
- nlf->m_uCodePage = CP_ACP;
+ nlf->m_uCodePage = NSISRT_GetASCIICodepage();
if (!GetNextNLFLine(lr, buf, NSIS_MAX_STRLEN, errlr)) goto l_readerr;
TrimTrailingNewlines(buf);
if (buf[0] != _T('-') || buf[1] != 0) {
@@ -1049,11 +1049,11 @@ l_readerr:
}
if ((unsigned)nlf->m_uCodePage <= 1 && !lr.IsUnicode()) // Warn if someone uses a system specific codepage
{
- warning_fl(_T("%") NPRIs _T(" language file uses the system default codepage!"), nlf->m_szName);
+ warning_fl(DW_NLF_SYSCP, _T("%") NPRIs _T(" language file uses the system default codepage!"), nlf->m_szName);
}
if (CP_ACP != nlf->m_uCodePage && !isnlfdataucp && !IsValidCodePage(nlf->m_uCodePage))
{
- warning_fl(_T("%") NPRIs _T(" language file uses a codepage (%d) that is not supported on this system, using ACP!"), nlf->m_szName, nlf->m_uCodePage);
+ warning_fl(DW_NLF_UNSUPPORTED_CP, _T("%") NPRIs _T(" language file uses a codepage (%d) that is not supported on this system, using ACP!"), nlf->m_szName, nlf->m_uCodePage);
nlf->m_uCodePage = CP_ACP;
}
}
@@ -1061,7 +1061,7 @@ l_readerr:
// SVN is not a big fan of UTF16 so we should always use UTF8SIG
if (isnlfdataucp && !lr.StreamEncoding().IsUTF8())
{
- warning_fl(_T("%") NPRIs _T(" Unicode language file is not UTF8SIG."), nlf->m_szName);
+ warning_fl(DW_NLF_NOT_PREFERRED_ENC, _T("%") NPRIs _T(" Unicode language file is not UTF8SIG."), nlf->m_szName);
}
#ifdef _UNICODE
diff --git a/Source/lang.h b/Source/lang.h
index f419729..2a64ecd 100755
--- a/Source/lang.h
+++ b/Source/lang.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/lineparse.cpp b/Source/lineparse.cpp
index 62311e4..7149107 100755
--- a/Source/lineparse.cpp
+++ b/Source/lineparse.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -138,7 +138,7 @@ double LineParser::gettoken_number(int token, int *success/*=0*/) const
{
const TCHAR*str=gettoken_str(token);
if (_T('-') == *str || _T('+') == *str) ++str;
- bool forceint = false;
+ unsigned int forceint = false;
if (_T('0') == str[0])
{
if (_T('x') == (str[1]|32)) ++forceint;
@@ -149,6 +149,31 @@ double LineParser::gettoken_number(int token, int *success/*=0*/) const
return forceint ? gettoken_int(token,success) : gettoken_float(token,success);
}
+int LineParser::gettoken_binstrdata(int token, char*buffer, int bufcap) const
+{
+ const TCHAR*p=gettoken_str(token);
+ int a,b,c,d=0;
+ while (*p)
+ {
+ a=*p;
+ if (a >= _T('0') && a <= _T('9')) a-=_T('0');
+ else if (a >= _T('a') && a <= _T('f')) a-=_T('a')-10;
+ else if (a >= _T('A') && a <= _T('F')) a-=_T('A')-10;
+ else if (a == _T(',')) { ++p; continue; } // Allow comma separator (for Regedit5 .reg format)
+ else break;
+ b=*++p;
+ if (b >= _T('0') && b <= _T('9')) b-=_T('0');
+ else if (b >= _T('a') && b <= _T('f')) b-=_T('a')-10;
+ else if (b >= _T('A') && b <= _T('F')) b-=_T('A')-10;
+ else break;
+ c=(a<<4)|b, p++;
+ if (d >= bufcap) return -1; // Buffer too small
+ buffer[d++]=c;
+ }
+ if (*p) return -2; // Did not parse the entire buffer
+ return d;
+}
+
TCHAR* LineParser::gettoken_str(int token) const
{
token+=m_eat;
diff --git a/Source/lineparse.h b/Source/lineparse.h
index 8df1738..70fcb29 100755
--- a/Source/lineparse.h
+++ b/Source/lineparse.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ class LineParser {
double gettoken_float(int token, int *success=0) const;
int gettoken_int(int token, int *success=0) const;
double gettoken_number(int token, int *success=0) const;
+ int gettoken_binstrdata(int token, char*buffer, int bufcap) const;
TCHAR *gettoken_str(int token) const;
int gettoken_enum(int token, const TCHAR *strlist); // null separated list
diff --git a/Source/makenssi.cpp b/Source/makenssi.cpp
index 2c3b4e2..9568430 100755
--- a/Source/makenssi.cpp
+++ b/Source/makenssi.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@
#include "winchar.h" // assert(sizeof(WINWCHAR)...)
#include <nsis-version.h>
-#define NSIS_COPYYEARS _T("1999-2016")
+#define NSIS_COPYYEARS _T("1999-2017")
using namespace std;
@@ -439,9 +439,9 @@ static inline int makensismain(int argc, TCHAR **argv)
#else
const TCHAR*const badnonwinswitchfmt=OPT_STR _T("%") NPRIs _T(" is disabled for non Win32 platforms.");
if (hostnotifyhandle)
- build.warning(badnonwinswitchfmt,_T("NOTIFYHWND"));
+ build.warning(DW_CMDLINE_UNSUPP_NIX,badnonwinswitchfmt,_T("NOTIFYHWND"));
if (NStreamEncoding::UNKNOWN==outputenc.GetCodepage())
- build.warning(badnonwinswitchfmt,_T("OUTPUTCHARSET"));
+ build.warning(DW_CMDLINE_UNSUPP_NIX,badnonwinswitchfmt,_T("OUTPUTCHARSET"));
#endif // ~_WIN32
if (!argc)
@@ -491,7 +491,7 @@ static inline int makensismain(int argc, TCHAR **argv)
if (NStreamEncoding::UNKNOWN == cp)
{
if (_tcsicmp(argv[argpos], _T("AUTO")))
- build.warning(OPT_STR _T("INPUTCHARSET: Ignoring invalid charset %") NPRIs , argv[argpos]);
+ build.warning(DW_CMDLINE_BAD_INPUTENC, OPT_STR _T("INPUTCHARSET: Ignoring invalid charset %") NPRIs , argv[argpos]);
cp = NStreamEncoding::AUTO;
}
inputenc.SafeSetCodepage(cp);
@@ -522,9 +522,9 @@ static inline int makensismain(int argc, TCHAR **argv)
};
if (!SetPriorityClass(hProc, classes[p].priority))
SetPriorityClass(hProc, classes[p].fallback);
- if (p == 5) build.warning(_T("makensis is running in REALTIME priority mode!"));
+ if (p == 5) build.warning(DW_CMDLINE_HIGHPRIORITY,_T("makensis is running in REALTIME priority mode!"));
#else
- build.warning(badnonwinswitchfmt,_T("Px"));
+ build.warning(DW_CMDLINE_UNSUPP_NIX,badnonwinswitchfmt,_T("Px"));
#endif
}
// Already parsed these (must adjust argpos)
@@ -543,7 +543,7 @@ static inline int makensismain(int argc, TCHAR **argv)
}
else if (S7IsChEqualI('x',swname[0]) && swname[1])
{
- if (build.process_oneline(swname+1,_T("<command line>"),argpos+1) != PS_OK)
+ if (build.process_oneline(swname+1,build.get_commandlinecode_filename(),argpos+1) != PS_OK)
{
return 1;
}
@@ -567,7 +567,7 @@ static inline int makensismain(int argc, TCHAR **argv)
noconfig=true;
tstring main_conf;
TCHAR* env_var = _tgetenv(_T("NSISCONFDIR"));
- if(env_var == NULL)
+ if (env_var == NULL)
#ifndef NSIS_CONFIG_CONST_DATA_PATH
main_conf = get_dir_name(get_executable_dir(argv[0]));
#else
@@ -704,8 +704,10 @@ int main(int argc, char **argv)
int wargc = 0;
wchar_t term[1], *p, **wargv = (wchar_t **) malloc((argc+1) * sizeof(void*));
if (wargv)
+ {
for ( ; wargc < argc; ++wargc )
if ((p = NSISRT_mbtowc(argv[wargc]))) wargv[wargc] = p; else break;
+ }
if (wargc == argc)
*term = L'\0', wargv[wargc] = term, errno = _tmain(wargc,wargv);
else
diff --git a/Source/manifest.cpp b/Source/manifest.cpp
index c2a0b51..5bb4343 100755
--- a/Source/manifest.cpp
+++ b/Source/manifest.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -47,10 +47,13 @@ static const struct { const TCHAR *name, *guidstr; } g_soslmap[] = {
{ _T("Win10"), _T("{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}") } //blogs.msdn.com/b/chuckw/archive/2013/09/10/manifest-madness.aspx
};
-void SupportedOSList::addall()
+bool SupportedOSList::addall()
{
+ m_isdefaultlist = false;
for (UINT i = 0; i < COUNTOF(g_soslmap); ++i)
- append(g_soslmap[i].name);
+ if (!append(g_soslmap[i].name))
+ return false;
+ return true;
}
bool SupportedOSList::append(const TCHAR* osid)
diff --git a/Source/manifest.h b/Source/manifest.h
index d96df4b..ebe32a2 100755
--- a/Source/manifest.h
+++ b/Source/manifest.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@ namespace manifest
if (-1 == pos) return 0;
return m_list.get() + pos;
}
- void addall();
+ bool addall();
void deleteall()
{
m_list.deleteall();
diff --git a/Source/mmap.cpp b/Source/mmap.cpp
index 0947802..d2aa345 100755
--- a/Source/mmap.cpp
+++ b/Source/mmap.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/mmap.h b/Source/mmap.h
index 904b8e9..6b4a40a 100755
--- a/Source/mmap.h
+++ b/Source/mmap.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/script.cpp b/Source/script.cpp
index f921d51..aa10a0e 100755
--- a/Source/script.cpp
+++ b/Source/script.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -12,8 +12,6 @@
*
* This software is provided 'as-is', without any express or implied
* warranty.
- *
- * Unicode support by Jim Park -- 08/09/2007
*/
#include "Platform.h"
@@ -40,9 +38,7 @@
using namespace std;
-#ifdef _WIN32
-# include <direct.h> // for chdir
-#else
+#ifndef _WIN32
# include <sys/stat.h> // for stat and umask
# include <sys/types.h> // for mode_t
# include <fcntl.h> // for O_RDONLY
@@ -50,32 +46,8 @@ using namespace std;
# include <stdlib.h> // for mkstemp
#endif
-#define MAX_INCLUDEDEPTH 10
-
#define REGROOTKEYTOINT(hk) ( (INT) (((INT_PTR)(hk)) & 0xffffffff) ) // Masking off non-existing top bits to make GCC happy
-
-static UINT read_line_helper(NStreamLineReader&lr, TCHAR*buf, UINT cch)
-{
- // Helper function for reading lines from text files. buf MUST be valid and cch MUST be > 1!
- // Returns 0 on error or the number of characters read including the first \n, \r or \0.
- // When it returns 0, buf[0] is 0 for EOF and NStream::ERR_* for errors.
- UINT lrr = lr.ReadLine(buf, cch), eof = 0;
- if (NStream::OK != lrr)
- {
- ++eof;
- if (!lr.IsEOF())
- {
- buf[0] = (TCHAR) lrr;
- return 0;
- }
- }
- const bool unicode = lr.IsUnicode();
- for(cch = 0;; ++cch)
- if (!buf[cch] || NStream::IsNewline(buf[cch], unicode))
- break;
- if (cch) eof = 0; // Read something, postpone EOF
- return ++cch - eof;
-}
+#define REGROOTKEYTOINTEX(hk, removeviewbits) ( REGROOTKEYTOINT(hk) & ~(removeviewbits ? (REGROOTVIEW32|REGROOTVIEW64) : 0) )
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
static bool LookupWinSysColorId(const TCHAR*Str, UINT&Clr)
@@ -105,168 +77,7 @@ static UINT ParseCtlColor(const TCHAR*Str, int&CCFlags, int CCFlagmask)
v = _tcstoul(Str, &pEnd, 16), clr = ((v&0xff)<<16)|(v&0xff00)|((v&0xff0000)>>16);
return clr;
}
-#endif
-
-#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
-// Added by Sunil Kamath 11 June 2003
-TCHAR *CEXEBuild::set_file_predefine(const TCHAR *filename)
-{
- TCHAR *oldfileinfo = NULL;
- TCHAR *oldfilename = definedlist.find(_T("__FILE__"));
- TCHAR *oldfiledir = definedlist.find(_T("__FILEDIR__"));
- if(oldfilename && oldfiledir)
- {
- oldfileinfo = new TCHAR[_tcslen(oldfilename)+1+_tcslen(oldfiledir)+1];
- _tcscpy(oldfileinfo, oldfilename);
- _tcscat(oldfileinfo, _T("|"));
- _tcscat(oldfileinfo, oldfiledir);
- definedlist.del(_T("__FILE__"));
- definedlist.del(_T("__FILEDIR__"));
- }
- const TCHAR *p = _tcsrchr(filename,_T('\\')), *p2 = _tcsrchr(filename,_T('/'));
- if(p2 > p) p = p2;
- if(p) p++; else p = filename;
- definedlist.add(_T("__FILE__"),p);
- TCHAR dir[260]; // BUGBUG: MAX_PATH outside #ifdef _WIN32, should be PATH/NAME_MAX on POSIX?
-#ifdef _WIN32
- LPTSTR lpFilePart;
- GetFullPathName(filename, COUNTOF(dir), dir, &lpFilePart);
- PathRemoveFileSpec(dir);
-#else
- if(p == filename)
- _tcscpy(dir, _T("."));
- else
- my_strncpy(dir, filename, p-filename+!0);
-#endif
- definedlist.add(_T("__FILEDIR__"),dir);
-
- return oldfileinfo;
-}
-void CEXEBuild::restore_file_predefine(TCHAR *oldfilename)
-{
- definedlist.del(_T("__FILEDIR__"));
- definedlist.del(_T("__FILE__"));
- if(oldfilename) {
- TCHAR *oldfiledir = _tcschr(oldfilename, _T('|'));
- definedlist.add(_T("__FILEDIR__"),oldfiledir+1);
- *oldfiledir = '\0';
- definedlist.add(_T("__FILE__"),oldfilename);
- delete[] oldfilename;
- }
-}
-
-TCHAR *CEXEBuild::set_timestamp_predefine(const TCHAR *filename)
-{
- TCHAR *oldtimestamp = definedlist.find(_T("__TIMESTAMP__"));
- if(oldtimestamp) {
- oldtimestamp = _tcsdup(oldtimestamp);
- definedlist.del(_T("__TIMESTAMP__"));
- }
-
-#ifdef _WIN32
- TCHAR datebuf[128] = _T(""), timebuf[128] = _T(""), timestampbuf[256];
- WIN32_FIND_DATA fd;
- FILETIME floctime;
- SYSTEMTIME stime;
-
- HANDLE hSearch = FindFirstFile(filename, &fd);
- if (hSearch != INVALID_HANDLE_VALUE)
- {
- FindClose(hSearch);
-
- FileTimeToLocalFileTime(&fd.ftLastWriteTime, &floctime);
- FileTimeToSystemTime(&floctime, &stime);
-
- GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &stime, NULL, datebuf, COUNTOF(datebuf));
- GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stime, NULL, timebuf, COUNTOF(timebuf));
- wsprintf(timestampbuf,_T("%") NPRIs _T(" %") NPRIs,datebuf,timebuf);
-
- definedlist.add(_T("__TIMESTAMP__"),timestampbuf);
- }
-#else
- struct stat st;
- if (!_tstat(filename, &st))
- definedlist.add(_T("__TIMESTAMP__"),PosixBug_CtoTString(ctime(&st.st_mtime)));
-#endif
-
- return oldtimestamp;
-}
-void CEXEBuild::restore_timestamp_predefine(TCHAR *oldtimestamp)
-{
- definedlist.del(_T("__TIMESTAMP__"));
- if(oldtimestamp) {
- definedlist.add(_T("__TIMESTAMP__"),oldtimestamp);
- free(oldtimestamp);
- }
-}
-
-TCHAR *CEXEBuild::set_line_predefine(int linecnt, BOOL is_macro)
-{
- TCHAR* linebuf = NULL;
- MANAGE_WITH(linebuf, free);
-
- TCHAR temp[128] = _T("");
- _stprintf(temp,_T("%d"),linecnt);
-
- TCHAR *oldline = definedlist.find(_T("__LINE__"));
- if(oldline) {
- oldline = _tcsdup(oldline);
- definedlist.del(_T("__LINE__"));
- }
- if(is_macro && oldline) {
- linebuf = (TCHAR *)malloc((_tcslen(oldline)+_tcslen(temp)+2)*sizeof(TCHAR));
- _stprintf(linebuf,_T("%") NPRIs _T(".%") NPRIs,oldline,temp);
- }
- else {
- linebuf = _tcsdup(temp);
- }
- definedlist.add(_T("__LINE__"),linebuf);
-
- return oldline;
-}
-void CEXEBuild::restore_line_predefine(TCHAR *oldline)
-{
- definedlist.del(_T("__LINE__"));
- if(oldline) {
- definedlist.add(_T("__LINE__"),oldline);
- free(oldline);
- }
-}
-
-void CEXEBuild::set_date_time_predefines()
-{
- time_t etime;
- struct tm * ltime;
- TCHAR datebuf[128], timebuf[128];
-
- time(&etime);
- ltime = localtime(&etime);
-#ifdef _WIN32
- SYSTEMTIME stime;
- stime.wYear = ltime->tm_year+1900;
- stime.wMonth = ltime->tm_mon + 1;
- stime.wDay = ltime->tm_mday;
- stime.wHour= ltime->tm_hour;
- stime.wMinute= ltime->tm_min;
- stime.wSecond= ltime->tm_sec;
- stime.wMilliseconds= 0;
- GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &stime, NULL, datebuf, sizeof(datebuf));
- definedlist.add(_T("__DATE__"),(TCHAR *)datebuf);
- GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stime, NULL, timebuf, sizeof(timebuf));
- definedlist.add(_T("__TIME__"),(TCHAR *)timebuf);
-#else
- my_strftime(datebuf, sizeof(datebuf), _T("%x"), ltime);
- definedlist.add(_T("__DATE__"),(TCHAR *)datebuf);
- my_strftime(timebuf, sizeof(timebuf), _T("%X"), ltime);
- definedlist.add(_T("__TIME__"),(TCHAR *)timebuf);
-#endif
-}
-void CEXEBuild::del_date_time_predefines()
-{
- definedlist.del(_T("__DATE__"));
- definedlist.del(_T("__TIME__"));
-}
-#endif
+#endif //~ NSIS_CONFIG_ENHANCEDUI_SUPPORT
int CEXEBuild::process_script(NIStream&Strm, const TCHAR *filename)
{
@@ -282,7 +93,6 @@ int CEXEBuild::process_script(NIStream&Strm, const TCHAR *filename)
}
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
set_date_time_predefines();
TCHAR *oldfilename = set_file_predefine(curfilename);
TCHAR *oldtimestamp = set_timestamp_predefine(curfilename);
@@ -291,7 +101,6 @@ int CEXEBuild::process_script(NIStream&Strm, const TCHAR *filename)
int ret=parseScript();
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
restore_file_predefine(oldfilename);
restore_timestamp_predefine(oldtimestamp);
del_date_time_predefines();
@@ -317,8 +126,6 @@ int CEXEBuild::process_script(NIStream&Strm, const TCHAR *filename)
#define PRINTHELPEX(cmdname) { print_help((cmdname)); return PS_ERROR; }
#define PRINTHELP() PRINTHELPEX(line.gettoken_str(0))
-static void PREPROCESSONLY_BEGINCOMMENT() { extern FILE *g_output; _ftprintf(g_output,_T("!if 0 /*\n")); }
-static void PREPROCESSONLY_ENDCOMMENT() { extern FILE *g_output; _ftprintf(g_output,_T("*/\n!endif\n")); }
void CEXEBuild::start_ifblock()
{
@@ -346,7 +153,6 @@ int CEXEBuild::num_ifblock()
return build_preprocessor_data.getlen() / sizeof(ifblock);
}
-// Func size: just under 200 lines (orip)
int CEXEBuild::doParse(const TCHAR *str)
{
LineParser line(inside_comment);
@@ -368,7 +174,7 @@ int CEXEBuild::doParse(const TCHAR *str)
if (prevline.inComment() && !thisline.inComment())
{
- warning_fl(_T("comment contains line-continuation character, following line will be ignored"));
+ warning_fl(DW_COMMENT_NEWLINE, _T("comment contains line-continuation character, following line will be ignored"));
}
}
@@ -446,9 +252,7 @@ parse_again:
}
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
- // Added by Ximon Eighteen 5th August 2002
- // We didn't recognise this command, could it be the name of a
- // function exported from a dll?
+ // We didn't recognise this command, could it be the name of a function exported from a dll?
// Plugins cannot be called in global scope so there is no need to initialize the list first
if (m_pPlugins && m_pPlugins->IsPluginCommand(tokstr0))
{
@@ -614,7 +418,7 @@ parse_again:
PRINTHELPEX(cmdnam)
}
if (!cnv1 || !cnv2) {
- warning_fl(_T("Invalid number: \"%") NPRIs _T("\""), line.gettoken_str(!cnv1 ? 1 : 3));
+ warning_fl(DW_PARSE_BADNUMBER, _T("Invalid number: \"%") NPRIs _T("\""), line.gettoken_str(!cnv1 ? 1 : 3));
}
}
else PRINTHELPEX(cmdnam)
@@ -685,7 +489,6 @@ parse_again:
return PS_OK;
}
-// Func size: about 140 lines (orip)
#ifdef NSIS_FIX_DEFINES_IN_STRINGS
void CEXEBuild::ps_addtoline(const TCHAR *str, GrowBuf &linedata, StringList &hist, bool bIgnoreDefines /*= false*/)
#else
@@ -871,7 +674,7 @@ int CEXEBuild::parseScript()
{
if (linereader.IsEOF())
{
- if(!str[0]) break;
+ if (!str[0]) break;
}
else
{
@@ -891,16 +694,12 @@ int CEXEBuild::parseScript()
GrowBuf linedata;
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
TCHAR *oldline = set_line_predefine(linecnt, FALSE);
#endif
-
ps_addtoline(str,linedata,hist);
linedata.add(_T(""),sizeof(_T("")));
int ret=doParse((TCHAR*)linedata.get());
-
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
restore_line_predefine(oldline);
#endif
@@ -910,94 +709,6 @@ int CEXEBuild::parseScript()
return PS_EOF;
}
-int CEXEBuild::includeScript(const TCHAR *f, NStreamEncoding&enc)
-{
- NIStream incstrm;
- const bool openok = incstrm.OpenFileForReading(f,enc);
- if (NStreamEncoding::AUTO == enc.GetCodepage() && // !include defaults to UTF-8 after "Unicode true"
- build_unicode && !enc.IsUnicodeCodepage(enc.GetPlatformDefaultCodepage()) &&
- enc.GetPlatformDefaultCodepage() == incstrm.StreamEncoding().GetCodepage()
- ) incstrm.StreamEncoding().SetCodepage(NStreamEncoding::UTF8);
- enc = incstrm.StreamEncoding();
-
- TCHAR bufcpdisp[20];
- incstrm.StreamEncoding().GetCPDisplayName(bufcpdisp);
- SCRIPT_MSG(_T("!include: \"%") NPRIs _T("\" (%") NPRIs _T(")\n"),f,bufcpdisp);
- if (!openok)
- {
- ERROR_MSG(_T("!include: could not open file: \"%") NPRIs _T("\"\n"),f);
- return PS_ERROR;
- }
-
- if (build_include_depth >= MAX_INCLUDEDEPTH)
- {
- ERROR_MSG(_T("!include: too many levels of includes (%d max).\n"),MAX_INCLUDEDEPTH);
- return PS_ERROR;
- }
- build_include_depth++;
-
- const int last_linecnt=linecnt;
- const TCHAR *last_filename=curfilename;
- curfilename=f, linecnt=0;
- NStreamLineReader linereader(incstrm);
- NStreamLineReader*last_linereader=curlinereader;
- curlinereader=&linereader;
-
-#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
- TCHAR *oldfilename = set_file_predefine(curfilename);
- TCHAR *oldtimestamp = set_timestamp_predefine(curfilename);
-#endif
-
- int r=parseScript();
-
-#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
- restore_file_predefine(oldfilename);
- restore_timestamp_predefine(oldtimestamp);
-#endif
-
- const int errlinecnt=linecnt;
- curfilename=last_filename, linecnt=last_linecnt;
- curlinereader=last_linereader;
-
- build_include_depth--;
- if (r != PS_EOF && r != PS_OK)
- {
- ERROR_MSG(_T("!include: error in script: \"%") NPRIs _T("\" on line %d\n"),f,errlinecnt);
- return PS_ERROR;
- }
- SCRIPT_MSG(_T("!include: closed: \"%") NPRIs _T("\"\n"),f);
- return PS_OK;
-}
-
-TCHAR* CEXEBuild::GetMacro(const TCHAR *macroname, TCHAR**macroend /*= 0*/)
-{
- TCHAR *t = (TCHAR*)m_macros.get(), *mbeg, *mbufbeg = t;
- for (; t && *t; ++t)
- {
- mbeg = t;
- const bool foundit = !_tcsicmp(mbeg, macroname);
- t += _tcslen(t) + 1; // advance over macro name
-
- // advance over parameters
- while (*t) t += _tcslen(t) + 1;
- t++;
-
- // advance over data
- while (*t) t += _tcslen(t) + 1;
-
- if (foundit)
- {
- if (macroend) *macroend = ++t;
- return mbeg;
- }
-
- if (t-mbufbeg >= m_macros.getlen()-1) break;
- }
- return 0;
-}
-
int CEXEBuild::LoadLicenseFile(const TCHAR *file, TCHAR** pdata, const TCHAR *cmdname, WORD AnsiCP) // caller must free *pdata, even on error result
{
NIStream strm;
@@ -1014,7 +725,7 @@ int CEXEBuild::LoadLicenseFile(const TCHAR *file, TCHAR** pdata, const TCHAR *cm
if (!cbFileData)
{
- warning_fl(_T("%") NPRIs _T(": empty license file \"%") NPRIs _T("\"\n"),cmdname,file);
+ warning_fl(DW_LICENSE_EMPTY, _T("%") NPRIs _T(": empty license file \"%") NPRIs _T("\"\n"),cmdname,file);
}
else
build_lockedunicodetarget=true;
@@ -1075,13 +786,12 @@ int CEXEBuild::process_oneline(const TCHAR *line, const TCHAR *filename, int lin
GrowBuf linedata;
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
TCHAR *oldfilename = NULL, *oldtimestamp = NULL, *oldline = NULL;
- bool is_commandline = !_tcscmp(filename,_T("<command line>"));
+ bool is_commandline = !_tcscmp(filename, get_commandlinecode_filename());
bool is_macro = !_tcsncmp(filename,_T("macro:"),6);
- if(!is_commandline) { // Don't set the predefines for command line /X option
- if(!is_macro) {
+ if (!is_commandline) { // Don't set the predefines for command line /X option
+ if (!is_macro) {
oldfilename = set_file_predefine(curfilename);
oldtimestamp = set_timestamp_predefine(curfilename);
}
@@ -1094,9 +804,8 @@ int CEXEBuild::process_oneline(const TCHAR *line, const TCHAR *filename, int lin
int ret = doParse((TCHAR*)linedata.get());
#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
- // Added by Sunil Kamath 11 June 2003
- if(!is_commandline) { // Don't set the predefines for command line /X option
- if(!is_macro) {
+ if (!is_commandline) { // Don't set the predefines for command line /X option
+ if (!is_macro) {
restore_file_predefine(oldfilename);
restore_timestamp_predefine(oldtimestamp);
}
@@ -1137,17 +846,23 @@ int CEXEBuild::process_jump(LineParser &line, int wt, int *offs)
#define SECTION_FIELD_GET(field) (FIELD_OFFSET(section, field)/sizeof(int))
#define SECTION_FIELD_SET(field) (-1 - (int)(FIELD_OFFSET(section, field)/sizeof(int)))
-// Func size: about 5000 lines (orip)
-int CEXEBuild::doCommand(int which_token, LineParser &line)
+#define INVALIDREGROOT ( (HKEY) 0x8000baad )
+static HKEY ParseRegRootKey(LineParser &line, int tok)
{
static const TCHAR *rootkeys[2] = {
- _T("HKCR\0HKLM\0HKCU\0HKU\0HKCC\0HKDD\0HKPD\0SHCTX\0"),
+ _T("HKCR\0HKLM\0HKCU\0HKU\0HKCC\0HKDD\0HKPD\0SHCTX\0HKCR32\0HKCR64\0HKCU32\0HKCU64\0HKLM32\0HKLM64\0HKCRANY\0HKCUANY\0HKLMANY\0SHCTX32\0SHCTX64\0SHCTXANY\0"),
_T("HKEY_CLASSES_ROOT\0HKEY_LOCAL_MACHINE\0HKEY_CURRENT_USER\0HKEY_USERS\0HKEY_CURRENT_CONFIG\0HKEY_DYN_DATA\0HKEY_PERFORMANCE_DATA\0SHELL_CONTEXT\0")
};
static const HKEY rootkey_tab[] = {
- HKEY_CLASSES_ROOT,HKEY_LOCAL_MACHINE,HKEY_CURRENT_USER,HKEY_USERS,HKEY_CURRENT_CONFIG,HKEY_DYN_DATA,HKEY_PERFORMANCE_DATA,0
+ HKEY_CLASSES_ROOT,HKEY_LOCAL_MACHINE,HKEY_CURRENT_USER,HKEY_USERS,HKEY_CURRENT_CONFIG,HKEY_DYN_DATA,HKEY_PERFORMANCE_DATA,HKSHCTX,HKCR32,HKCR64,HKCU32,HKCU64,HKLM32,HKLM64,HKCRANY,HKCUANY,HKLMANY,HKSHCTX32,HKSHCTX64,HKSHCTXANY
};
+ int k = line.gettoken_enum(tok, rootkeys[0]);
+ if (k == -1) k = line.gettoken_enum(tok, rootkeys[1]);
+ return k == -1 ? INVALIDREGROOT : rootkey_tab[k];
+}
+int CEXEBuild::doCommand(int which_token, LineParser &line)
+{
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
if (PS_OK != initialize_default_plugins()) return PS_ERROR;
#endif
@@ -1159,353 +874,24 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
// macro stuff
///////////////////////////////////////////////////////////////////////////////
case TOK_P_MACRO:
- {
- const TCHAR*const macroname=line.gettoken_str(1);
- if (!macroname[0]) PRINTHELP()
- if (MacroExists(macroname))
- {
- ERROR_MSG(_T("!macro: macro named \"%") NPRIs _T("\" already found!\n"),macroname);
- return PS_ERROR;
- }
- m_macros.add(macroname,(int)(_tcslen(macroname)+1)*sizeof(TCHAR));
-
- for (int pc=2; pc < line.getnumtokens(); pc++)
- {
- if (!line.gettoken_str(pc)[0])
- {
- ERROR_MSG(_T("!macro: macro parameter %d is empty, not valid!\n"),pc-1);
- return PS_ERROR;
- }
- int a;
- for (a=2; a < pc; a++)
- {
- if (!_tcsicmp(line.gettoken_str(pc),line.gettoken_str(a)))
- {
- ERROR_MSG(_T("!macro: macro parameter named %") NPRIs _T(" is used multiple times!\n"),
- line.gettoken_str(pc));
- return PS_ERROR;
- }
- }
- m_macros.add(line.gettoken_str(pc),(int)(_tcslen(line.gettoken_str(pc))+1)*sizeof(TCHAR));
- }
- m_macros.add(_T(""),sizeof(_T("")));
-
- for (;;)
- {
- TCHAR *str = m_templinebuf, *p = str;
- UINT lrres = curlinereader->ReadLine(str,MAX_LINELENGTH);
- if (NStream::OK != lrres)
- {
- if (curlinereader->IsEOF())
- {
- if (!str[0])
- {
- ERROR_MSG(_T("!macro \"%") NPRIs _T("\": unterminated (no !macroend found in file)!\n"),macroname);
- return PS_ERROR;
- }
- }
- else
- {
- ERROR_MSG(curlinereader->GetErrorMessage(lrres).c_str());
- return PS_ERROR;
- }
- }
- //SCRIPT_MSG(_T("%") NPRIs _T("%") NPRIs, str, str[_tcslen(str)-1]==_T('\n')?_T(""):_T("\n"));
- // remove trailing whitespace
- while (*p) p++;
- if (p > str) p--;
- while (p >= str && (*p == _T('\r') || *p == _T('\n') || *p == _T(' ') || *p == _T('\t'))) p--;
- *++p = 0;
- LineParser l2(false);
- if (!l2.parse(str))
- {
- if (!_tcsicmp(l2.gettoken_str(0),_T("!macroend")))
- {
- linecnt++;
- break;
- }
- if (!_tcsicmp(l2.gettoken_str(0),_T("!macro")))
- {
- ERROR_MSG(_T("Error: can't define a macro inside a macro!\n"));
- return PS_ERROR;
- }
- }
- if (str[0]) m_macros.add(str,(int)(_tcslen(str)+1)*sizeof(TCHAR));
- else m_macros.add(_T(" "),sizeof(_T(" ")));
- linecnt++;
- }
- m_macros.add(_T(""),sizeof(_T("")));
- }
- return PS_OK;
+ return pp_macro(line);
case TOK_P_MACROEND:
- ERROR_MSG(_T("!macroend: no macro currently open.\n"));
- return PS_ERROR;
+ return (ERROR_MSG(_T("!macroend: no macro currently open.\n")), PS_ERROR);
case TOK_P_MACROUNDEF:
- {
- const TCHAR*const mname=line.gettoken_str(1);
- if (!mname[0]) PRINTHELP()
- TCHAR *mbeg, *mend;
- mbeg=GetMacro(mname,&mend);
- if (!mbeg)
- {
- ERROR_MSG(_T("!macroundef: \"%") NPRIs _T("\" does not exist!\n"),mname);
- return PS_ERROR;
- }
- TCHAR *mbufb=(TCHAR*)m_macros.get();
- const size_t mcb=((mend)-mbeg)*sizeof(TCHAR), mbufcb=m_macros.getlen();
- memmove(mbeg,mend,mbufcb-(((mbeg-mbufb)*sizeof(TCHAR))+mcb));
- m_macros.resize(truncate_cast(int,(size_t)(mbufcb-mcb)));
- SCRIPT_MSG(_T("!macroundef: %") NPRIs _T("\n"),mname);
- }
- return PS_OK;
+ return pp_macroundef(line);
case TOK_P_INSERTMACRO:
- {
- const TCHAR*const macroname=line.gettoken_str(1);
- if (!macroname[0]) PRINTHELP()
- TCHAR *t=GetMacro(macroname), *m=(TCHAR *)m_macros.get();
- SCRIPT_MSG(_T("!insertmacro: %") NPRIs _T("\n"),macroname);
- if (!t)
- {
- ERROR_MSG(_T("!insertmacro: macro named \"%") NPRIs _T("\" not found!\n"),macroname);
- return PS_ERROR;
- }
- t+=_tcslen(t)+1;
-
- GrowBuf l_define_names;
- DefineList l_define_saves;
- int npr=0;
- // advance over params
- while (*t)
- {
- TCHAR *v=definedlist.find(t);
- if (v)
- {
- l_define_saves.add(t,v);
- definedlist.del(t);
- }
- l_define_names.add(t,(int)(_tcslen(t)+1)*sizeof(TCHAR));
- definedlist.add(t,line.gettoken_str(npr+2));
-
- npr++;
- t+=_tcslen(t)+1;
- }
- l_define_names.add(_T(""),sizeof(_T("")));
- t++;
- if (npr != line.getnumtokens()-2)
- {
- ERROR_MSG(_T("!insertmacro: macro \"%") NPRIs _T("\" requires %d parameter(s), passed %d!\n"),
- macroname,npr,line.getnumtokens()-2);
- return PS_ERROR;
- }
- static unsigned char insertmacrorecursion=0;
- if (++insertmacrorecursion > MAX_MACRORECURSION)
- {
- ERROR_MSG(_T("!insertmacro: insert depth is limited to %u macros!\n"),MAX_MACRORECURSION);
- return PS_ERROR;
- }
- const bool oldparserinsidecomment=inside_comment;
- inside_comment=false; // "!insertmacro foo /*" does not mean that the macro body is a comment
- TCHAR str[1024];
- wsprintf(str,_T("macro:%") NPRIs,macroname);
- const TCHAR *oldmacroname=m_currentmacroname;
- m_currentmacroname=macroname;
- definedlist.set(_T("__MACRO__"),m_currentmacroname);
- int lp=0;
- while (*t)
- {
- lp++;
- if (_tcscmp(t,_T(" ")))
- {
- int ret=process_oneline(t,str,lp);
- if (ret != PS_OK)
- {
- ERROR_MSG(_T("Error in macro %") NPRIs _T(" on macroline %d\n"),macroname,lp);
- return ret;
- }
- }
- {
- // fix t if process_oneline changed m_macros
- TCHAR *nm=(TCHAR *)m_macros.get();
- if (nm != m) t += nm - m, m = nm;
- }
- t+=_tcslen(t)+1;
- }
- {
- TCHAR *p=(TCHAR*)l_define_names.get();
- while (*p)
- {
- definedlist.del(p);
- TCHAR *v;
- if ((v=l_define_saves.find(p))) definedlist.add(p,v);
- p+=_tcslen(p)+1;
- }
- }
- definedlist.del(_T("__MACRO__"));
- m_currentmacroname=oldmacroname;
- if (oldmacroname) definedlist.add(_T("__MACRO__"),oldmacroname);
- inside_comment=oldparserinsidecomment;
- --insertmacrorecursion;
- SCRIPT_MSG(_T("!insertmacro: end of %") NPRIs _T("\n"),macroname);
- }
- return PS_OK;
+ return pp_insertmacro(line);
// preprocessor files fun
///////////////////////////////////////////////////////////////////////////////
-
case TOK_P_TEMPFILE:
- {
- TCHAR *symbol = line.gettoken_str(1);
- const TCHAR *fpath;
-#ifdef _WIN32
- TCHAR buf[MAX_PATH], buf2[MAX_PATH];
- GetTempPath(MAX_PATH, buf);
- if (!GetTempFileName(buf, _T("nst"), 0, buf2))
- {
- ERROR_MSG(_T("!tempfile: unable to create temporary file.\n"));
- return PS_ERROR;
- }
- fpath = buf2;
-#else // !_WIN32
- char t[] = ("/tmp/makensisXXXXXX");
- const mode_t old_umask = umask(0077);
- int fd = mkstemp(t);
- umask(old_umask);
- if (fd == -1) { L_tok_p_tempfile_oom:
- ERROR_MSG(_T("!tempfile: unable to create temporary file.\n"));
- return PS_ERROR;
- }
- close(fd);
-#ifdef _UNICODE
- if (!(fpath = NSISRT_mbtowc(t))) goto L_tok_p_tempfile_oom;
-#else
- fpath = t;
-#endif
-#endif // ~_WIN32
-
- if (definedlist.add(symbol, fpath))
- {
- ERROR_MSG(_T("!tempfile: \"%") NPRIs _T("\" already defined!\n"), symbol);
- return PS_ERROR;
- }
- SCRIPT_MSG(_T("!tempfile: \"%") NPRIs _T("\"=\"%") NPRIs _T("\"\n"), symbol, fpath);
-#if !defined(_WIN32) && defined(_UNICODE)
- NSISRT_free(fpath);
-#endif
- }
- return PS_OK;
-
+ return pp_tempfile(line);
case TOK_P_DELFILE:
- {
- int fatal = 1;
- int a = 1;
- TCHAR *fc = line.gettoken_str(a);
- if (line.getnumtokens()==3)
- {
- if(!_tcsicmp(fc,_T("/nonfatal")))
- {
- fatal = 0;
- fc = line.gettoken_str(++a);
- }
- else PRINTHELP();
- }
-
- SCRIPT_MSG(_T("!delfile: \"%") NPRIs _T("\"\n"), line.gettoken_str(a));
-
- tstring dir = get_dir_name(fc), spec = get_file_name(fc);
- tstring basedir = dir + PLATFORM_PATH_SEPARATOR_STR;
- if (dir == spec) dir = _T("."), basedir = _T(""); // no path, just file name
-
- boost::scoped_ptr<dir_reader> dr( new_dir_reader() );
- dr->read(dir); // BUGBUG: PATH_CONVERT?
-
- for (dir_reader::iterator files_itr = dr->files().begin();
- files_itr != dr->files().end();
- files_itr++)
- {
- if (!dir_reader::matches(*files_itr, spec))
- continue;
-
- tstring file = basedir + *files_itr; // BUGBUG: PATH_CONVERT?
-
- int result = _tunlink(file.c_str());
- if (result == -1) {
- ERROR_MSG(_T("!delfile: \"%") NPRIs _T("\" couldn't be deleted.\n"), file.c_str());
- if (fatal)
- {
- return PS_ERROR;
- }
- }
- else
- {
- SCRIPT_MSG(_T("!delfile: deleted \"%") NPRIs _T("\"\n"), file.c_str());
- }
- }
- }
- return PS_OK;
-
+ return pp_delfile(line);
case TOK_P_APPENDFILE:
- {
- WORD tok = 0, cp = 0;
- bool bom = false, forceEnc = false, rawnl = false;
- TCHAR *param, buf[9+!0];
- for (;;)
- {
- param = line.gettoken_str(++tok);
- my_strncpy(buf, param, COUNTOF(buf));
- if (!_tcsicmp(param,_T("/RawNL"))) ++rawnl;
- else if(!_tcsicmp(buf,_T("/CharSet=")))
- {
- ++forceEnc, cp = GetEncodingFromString(param+9, bom);
- if (NStreamEncoding::UNKNOWN == cp)
- {
- ERROR_MSG(_T("!appendfile: Invalid parameter \"%") NPRIs _T("\"!\n"), param);
- return PS_ERROR;
- }
- }
- else break;
- }
- if (line.getnumtokens() != 2 + tok) { PRINTHELP(); return PS_ERROR; }
- param = line.gettoken_str(tok);
- NOStream ostrm;
- if (!ostrm.CreateFileForAppending(param, NStreamEncoding::ACP))
- {
- ERROR_MSG(_T("!appendfile: \"%") NPRIs _T("\" couldn't be opened.\n"), param);
- return PS_ERROR;
- }
- if (ostrm.IsUnicode()) bom = false;
- if (forceEnc) ostrm.StreamEncoding().SetCodepage(cp);
- const TCHAR *const text = line.gettoken_str(++tok);
- bool succ = bom ? ostrm.WriteBOM(ostrm.StreamEncoding()) : true;
- if (!succ || rawnl ? !ostrm.WriteString(text) : !ostrm.WritePlatformNLString(text))
- {
- ERROR_MSG(_T("!appendfile: error writing to \"%") NPRIs _T("\".\n"), param);
- return PS_ERROR;
- }
- SCRIPT_MSG(_T("!appendfile: \"%") NPRIs _T("\" \"%") NPRIs _T("\"\n"), param, text);
- }
- return PS_OK;
-
+ return pp_appendfile(line);
case TOK_P_GETDLLVERSION:
- {
- const TCHAR *cmdname = _T("!getdllversion");
- DWORD low, high;
- if (!GetDLLVersion(line.gettoken_str(1), high, low))
- {
- ERROR_MSG(_T("%") NPRIs _T(": error reading version info from \"%") NPRIs _T("\"\n"), cmdname, line.gettoken_str(1));
- return PS_ERROR;
- }
- TCHAR *symbuf = m_templinebuf, numbuf[30], *basesymname = line.gettoken_str(2);
- DWORD vals[] = { high>>16, high&0xffff, low>>16, low&0xffff };
- SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T(" (%u.%u.%u.%u)->(%") NPRIs _T("<1..4>)\n"),
- cmdname, line.gettoken_str(1), vals[0], vals[1], vals[2], vals[3], basesymname);
- for (UINT i = 0; i < 4; ++i)
- {
- _stprintf(symbuf,_T("%") NPRIs _T("%u"), basesymname, i+1);
- _stprintf(numbuf,_T("%lu"), vals[i]);
- definedlist.add(symbuf, numbuf);
- }
- }
- return PS_OK;
+ return pp_getdllversion(line);
// page ordering stuff
///////////////////////////////////////////////////////////////////////////////
@@ -1526,9 +912,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
int k = line.gettoken_enum(1,_T("custom\0license\0components\0directory\0instfiles\0uninstConfirm\0"));
-
if (k < 0) PRINTHELP();
-
if (add_page(k) != PS_OK)
return PS_ERROR;
@@ -1537,10 +921,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ERROR_MSG(_T("Error: custom page specified, NSIS_SUPPORT_CODECALLBACKS not defined.\n"));
return PS_ERROR;
}
-#endif//!NSIS_SUPPORT_CODECALLBACKS
-
- if (k) {
- // not custom
+#endif //~ NSIS_SUPPORT_CODECALLBACKS
+ if (k) { // not custom
#ifdef NSIS_SUPPORT_CODECALLBACKS
switch (line.getnumtokens() - enable_last_page_cancel) {
case 6:
@@ -1555,11 +937,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (*line.gettoken_str(2))
cur_page->prefunc = ns_func.add(line.gettoken_str(2),0);
}
-#endif//NSIS_SUPPORT_CODECALLBACKS
+#endif //~ NSIS_SUPPORT_CODECALLBACKS
}
#ifdef NSIS_SUPPORT_CODECALLBACKS
- else {
- // a custom page
+ else { // a custom page
switch (line.getnumtokens() - enable_last_page_cancel) {
case 6:
PRINTHELP();
@@ -1577,10 +958,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
PRINTHELP();
}
}
-#endif//NSIS_SUPPORT_CODECALLBACKS
+#endif //~ NSIS_SUPPORT_CODECALLBACKS
SCRIPT_MSG(_T("%") NPRIs _T("Page: %") NPRIs, uninstall_mode?_T("Uninst"):_T(""), line.gettoken_str(1));
-
#ifdef NSIS_SUPPORT_CODECALLBACKS
if (cur_page->prefunc>=0)
SCRIPT_MSG(_T(" (%") NPRIs _T(":%") NPRIs _T(")"), k?_T("pre"):_T("creator"), line.gettoken_str(2));
@@ -1599,13 +979,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
add_page(PAGE_COMPLETED);
page_end();
}
-
set_uninstall_mode(0);
}
return PS_OK;
-
- // extended page setting
- case TOK_PAGEEX:
+ case TOK_PAGEEX: // extended page setting
{
int k = line.gettoken_enum(1,_T("custom\0license\0components\0directory\0instfiles\0uninstConfirm\0"));
if (k < 0) {
@@ -1613,34 +990,28 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (k < 0) PRINTHELP();
set_uninstall_mode(1);
}
-
SCRIPT_MSG(_T("PageEx: %") NPRIs _T("\n"), line.gettoken_str(1));
-
if (add_page(k) != PS_OK)
return PS_ERROR;
cur_page->flags |= PF_PAGE_EX;
}
return PS_OK;
-
case TOK_PAGEEXEND:
{
SCRIPT_MSG(_T("PageExEnd\n"));
-
#ifdef NSIS_SUPPORT_CODECALLBACKS
if (cur_page_type == PAGE_CUSTOM && !cur_page->prefunc) {
ERROR_MSG(_T("Error: custom pages must have a creator function.\n"));
return PS_ERROR;
}
#endif
-
page_end();
if (cur_page_type == PAGE_INSTFILES) {
add_page(PAGE_COMPLETED);
page_end();
}
-
set_uninstall_mode(0);
}
return PS_OK;
@@ -1648,15 +1019,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#ifdef NSIS_SUPPORT_CODECALLBACKS
{
SCRIPT_MSG(_T("PageCallbacks:"));
-
if (cur_page_type == PAGE_CUSTOM)
{
switch (line.getnumtokens())
{
case 4:
- {
PRINTHELP();
- }
case 3:
{
if (*line.gettoken_str(2))
@@ -1780,23 +1148,20 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
}
}
-
int custom = cur_page_type == PAGE_CUSTOM ? 1 : 0;
-
if (cur_page->prefunc>=0)
SCRIPT_MSG(_T(" %") NPRIs _T(":%") NPRIs, !custom?_T("pre"):_T("creator"), line.gettoken_str(1));
if (cur_page->showfunc>=0 && !custom)
SCRIPT_MSG(_T(" show:%") NPRIs, line.gettoken_str(2));
if (cur_page->leavefunc>=0)
SCRIPT_MSG(_T(" leave:%") NPRIs, line.gettoken_str(3-custom));
-
SCRIPT_MSG(_T("\n"));
}
return PS_OK;
#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_CODECALLBACKS not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//NSIS_SUPPORT_CODECALLBACKS
+#endif //~ NSIS_SUPPORT_CODECALLBACKS
#else
case TOK_PAGE:
case TOK_UNINSTPAGE:
@@ -1805,7 +1170,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_PAGECALLBACKS:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_VISIBLE_SUPPORT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//NSIS_CONFIG_VISIBLE_SUPPORT
+#endif //~ NSIS_CONFIG_VISIBLE_SUPPORT
+
// header flags
///////////////////////////////////////////////////////////////////////////////
case TOK_LANGSTRING:
@@ -1815,7 +1181,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
TCHAR *str = line.gettoken_str(3);
const int ret = SetLangString(name, lang, str);
if (ret == PS_WARNING)
- warning_fl(_T("LangString \"%") NPRIs _T("\" set multiple times for %d, wasting space"), name, lang);
+ warning_fl(DW_LANGSTRING_MULTISETWASTE, _T("LangString \"%") NPRIs _T("\" set multiple times for %d, wasting space"), name, lang);
else if (ret == PS_ERROR) {
ERROR_MSG(_T("Error: can't set LangString \"%") NPRIs _T("\"!\n"), name);
return PS_ERROR;
@@ -1831,26 +1197,22 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
const TCHAR *cmdnam = get_commandtoken_name(which_token);
#ifdef NSIS_CONFIG_SILENT_SUPPORT
if (build_header.flags&(CH_FLAGS_SILENT|CH_FLAGS_SILENT_LOG))
- {
- warning_fl(_T("%") NPRIs _T(": SilentInstall enabled, wasting space"), cmdnam);
- }
+ warning_fl(DW_LANGSTRING_SILENTLICENSE, _T("%") NPRIs _T(": SilentInstall enabled, wasting space"), cmdnam);
#endif
TCHAR *name = line.gettoken_str(1);
LANGID lang = ParseLangIdParameter(line, 2);
- TCHAR *file = line.gettoken_str(3);
-
- TCHAR *data = NULL;
+ TCHAR *file = line.gettoken_str(3), *data = NULL;
MANAGE_WITH(data, free);
LanguageTable *pLT = GetLangTable(lang);
WORD acp = pLT ? pLT->nlf.m_uCodePage : CP_ACP;
int ret = LoadLicenseFile(file, &data, cmdnam, acp);
if (ret != PS_OK)
- return ret;
+ return ret;
ret = SetLangString(name, lang, data, true);
if (ret == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(" \"%") NPRIs _T("\" set multiple times for %d, wasting space"), cmdnam, name, lang);
+ warning_fl(DW_LANGSTRING_MULTISETWASTE, _T("%") NPRIs _T(" \"%") NPRIs _T("\" set multiple times for %d, wasting space"), cmdnam, name, lang);
else if (ret == PS_ERROR)
{
ERROR_MSG(_T("Error: can't set %") NPRIs _T(" \"%") NPRIs _T("\"!\n"), cmdnam, name);
@@ -1864,7 +1226,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_NAME:
{
if (SetInnerString(NLF_NAME,line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
SetInnerString(NLF_NAME_DA,line.gettoken_str(2));
SCRIPT_MSG(_T("Name: \"%") NPRIs _T("\""),line.gettoken_str(1));
if (*line.gettoken_str(2))
@@ -1877,7 +1239,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (!cur_page)
{
if (SetInnerString(NLF_CAPTION,line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
}
else
{
@@ -1926,17 +1288,17 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
return PS_ERROR;
}
return PS_OK;
-#else//NSIS_CONFIG_COMPONENTPAGE
+#else
case TOK_CHECKBITMAP:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_COMPONENTPAGE not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_CONFIG_COMPONENTPAGE
+#endif //~ NSIS_CONFIG_COMPONENTPAGE
case TOK_DIRTEXT:
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
{
if (!cur_page) {
if (SetInnerString(NLF_DIR_TEXT, line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
if (line.getnumtokens() > 2)
SetInnerString(NLF_DIR_SUBTEXT, line.gettoken_str(2));
if (line.getnumtokens() > 3)
@@ -1960,10 +1322,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("DirText: \"%") NPRIs _T("\" \"%") NPRIs _T("\" \"%") NPRIs _T("\" \"%") NPRIs _T("\"\n"),line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3),line.gettoken_str(4));
}
return PS_OK;
-#else//NSIS_CONFIG_VISIBLE_SUPPORT
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_VISIBLE_SUPPORT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_CONFIG_VISIBLE_SUPPORT
+#endif //~ NSIS_CONFIG_VISIBLE_SUPPORT
case TOK_DIRVAR:
{
if (cur_page_type != PAGE_DIRECTORY && cur_page_type != PAGE_UNINSTCONFIRM) {
@@ -2000,7 +1362,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
if (!cur_page) {
if (SetInnerString(NLF_COMP_TEXT, line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
if (line.getnumtokens() > 2)
SetInnerString(NLF_COMP_SUBTEXT1, line.gettoken_str(2));
if (line.getnumtokens() > 3)
@@ -2037,7 +1399,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
SCRIPT_MSG(_T("InstType: setting custom text to: \"%") NPRIs _T("\"\n"),line.gettoken_str(1)+14);
if (SetInnerString(NLF_COMP_CUSTOM,line.gettoken_str(1)+14) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),_T("InstType /CUSTOMSTRING"));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),_T("InstType /CUSTOMSTRING"));
}
else if (line.gettoken_str(1)[0]==_T('/'))
{
@@ -2068,18 +1430,18 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
}
return PS_OK;
-#else//NSIS_CONFIG_COMPONENTPAGE
+#else
case TOK_COMPTEXT:
case TOK_INSTTYPE:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified but NSIS_CONFIG_COMPONENTPAGE not defined\n"),line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_CONFIG_COMPONENTPAGE
+#endif //~ NSIS_CONFIG_COMPONENTPAGE
#ifdef NSIS_CONFIG_LICENSEPAGE
case TOK_LICENSETEXT:
{
if (!cur_page) {
if (SetInnerString(NLF_LICENSE_TEXT, line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
SetInnerString(NLF_LICENSE_TEXT_FSRB, line.gettoken_str(1));
SetInnerString(NLF_LICENSE_TEXT_FSCB, line.gettoken_str(1));
if (line.getnumtokens() > 2)
@@ -2126,7 +1488,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (!cur_page) {
if (SetInnerString(NLF_LICENSE_DATA,data) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),cmdnam);
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),cmdnam);
}
else {
if (cur_page_type != PAGE_LICENSE) {
@@ -2153,7 +1515,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SetInnerString(NLF_BTN_LICENSE_AGREE, line.gettoken_str(2));
break;
}
-
switch (k) {
case 0: license_res_id = IDD_LICENSE; break;
case 1: license_res_id = IDD_LICENSE_FSCB; break;
@@ -2174,7 +1535,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
cur_page->flags &= ~(PF_LICENSE_FORCE_SELECTION | PF_LICENSE_NO_FORCE_SELECTION);
-
switch (k) {
case 0:
cur_page->dlg_id = IDD_LICENSE;
@@ -2190,7 +1550,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
break;
}
}
-
SCRIPT_MSG(_T("LicenseForceSelection: %") NPRIs _T(" \"%") NPRIs _T("\" \"%") NPRIs _T("\"\n"), line.gettoken_str(1), line.gettoken_str(2), line.gettoken_str(3));
}
return PS_OK;
@@ -2217,13 +1576,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
}
return PS_OK;
-#else//!NSIS_CONFIG_LICENSEPAGE
+#else
case TOK_LICENSETEXT:
case TOK_LICENSEDATA:
case TOK_LICENSEBKCOLOR:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_LICENSEPAGE not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_CONFIG_LICENSEPAGE
+#endif //~ NSIS_CONFIG_LICENSEPAGE
#ifdef NSIS_CONFIG_SILENT_SUPPORT
case TOK_SILENTINST:
{
@@ -2235,12 +1594,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ERROR_MSG(_T("SilentInstall: silentlog specified, no log support compiled in (use NSIS_CONFIG_LOG)\n"));
return PS_ERROR;
}
-#endif//NSIS_CONFIG_LOG
+#endif //~ NSIS_CONFIG_LOG
SCRIPT_MSG(_T("SilentInstall: %") NPRIs _T("\n"),line.gettoken_str(1));
#ifdef NSIS_CONFIG_LICENSEPAGE
if (k && HasUserDefined(NLF_LICENSE_DATA))
{
- warning_fl(_T("SilentInstall: LicenseData already specified. wasting space"));
+ warning_fl(DW_LANGSTRING_SILENTLICENSE, _T("SilentInstall: LicenseData already specified. wasting space"));
}
if (k) {
build_header.flags|=CH_FLAGS_SILENT;
@@ -2251,7 +1610,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
build_header.flags&=~CH_FLAGS_SILENT;
build_header.flags&=~CH_FLAGS_SILENT_LOG;
}
-#endif//NSIS_CONFIG_LICENSEPAGE
+#endif //~ NSIS_CONFIG_LICENSEPAGE
}
return PS_OK;
case TOK_SILENTUNINST:
@@ -2288,14 +1647,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("SetSilent: %") NPRIs _T("\n"),line.gettoken_str(1));
}
return add_entry(&ent);
-#else//!NSIS_CONFIG_SILENT_SUPPORT
+#else
case TOK_SILENTINST:
case TOK_SILENTUNINST:
case TOK_IFSILENT:
case TOK_SETSILENT:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_SILENT_SUPPORT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//NSIS_CONFIG_SILENT_SUPPORT
+#endif //~ NSIS_CONFIG_SILENT_SUPPORT
case TOK_OUTFILE:
my_strncpy(build_output_filename,line.gettoken_str(1),COUNTOF(build_output_filename));
SCRIPT_MSG(_T("OutFile: \"%") NPRIs _T("\"\n"),build_output_filename);
@@ -2305,7 +1664,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
TCHAR *p = line.gettoken_str(1);
if (build_header.install_directory_ptr)
{
- warning_fl(_T("%") NPRIs _T(": specified multiple times. wasting space"),line.gettoken_str(0));
+ warning_fl(DW_STRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times. wasting space"),line.gettoken_str(0));
}
build_header.install_directory_ptr = add_string(p);
build_header.install_directory_auto_append = 0;
@@ -2327,16 +1686,16 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_INSTALLDIRREGKEY: // InstallDirRegKey
{
if (build_header.install_reg_key_ptr)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_STRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
- int k=line.gettoken_enum(1,rootkeys[0]);
- if (k == -1) k=line.gettoken_enum(1,rootkeys[1]);
- if (k == -1) PRINTHELP()
- build_header.install_reg_rootkey=REGROOTKEYTOINT(rootkey_tab[k]);
- if (!build_header.install_reg_rootkey) PRINTHELP() // SHCTX is invalid here
+ HKEY hRK = ParseRegRootKey(line,1);
+ if (INVALIDREGROOT == hRK) PRINTHELP()
+ if (HKSHCTX == hRK) PRINTHELP() // SHCTX is invalid here
+ if (IsRegRootkeyForcedView(hRK)) PRINTHELP() // 32|64 views are also invalid
+ build_header.install_reg_rootkey=REGROOTKEYTOINT(hRK);
build_header.install_reg_key_ptr = add_string(line.gettoken_str(2),0);
if (line.gettoken_str(2)[0] == _T('\\'))
- warning_fl(_T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
+ warning_fl(DW_PARSE_REGPATHPREFIX, _T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
build_header.install_reg_value_ptr = add_string(line.gettoken_str(3),0);
SCRIPT_MSG(_T("InstallRegKey: \"%") NPRIs _T("\\%") NPRIs _T("\\%") NPRIs _T("\"\n"),line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3));
}
@@ -2401,7 +1760,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_VISIBLE_SUPPORT not defined.\n"),line.gettoken_str(0));
return PS_ERROR;
-#endif // NSIS_CONFIG_VISIBLE_SUPPORT
+#endif //~ NSIS_CONFIG_VISIBLE_SUPPORT
case TOK_SHOWDETAILSUNINST:
#ifndef NSIS_CONFIG_UNINSTALL_SUPPORT
ERROR_MSG(_T("Error: ShowUninstDetails specified but NSIS_CONFIG_UNINSTALL_SUPPORT not defined\n"));
@@ -2435,7 +1794,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_DIRSHOW:
/*{
int k=line.gettoken_enum(1,_T("show\0hide\0"));
- if (k == -1) PRINTHELP();
+ if (k < 0) PRINTHELP();
if (k)
build_header.flags|=CH_FLAGS_DIR_NO_SHOW;
else
@@ -2459,14 +1818,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#ifndef NSIS_SUPPORT_BGBG
ERROR_MSG(_T("Error: BGFont specified but NSIS_SUPPORT_BGBG not defined\n"));
return PS_ERROR;
-#else//NSIS_SUPPORT_BGBG
+#else // NSIS_SUPPORT_BGBG
if (line.getnumtokens()==1)
{
memcpy(&bg_font,&bg_default_font,sizeof(LOGFONT));
SCRIPT_MSG(_T("BGFont: default font\n"));
return PS_OK;
}
-
LOGFONT newfont;
newfont.lfHeight=40;
newfont.lfWidth=0;
@@ -2524,12 +1882,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("\n"));
memcpy(&bg_font, &newfont, sizeof(LOGFONT));
return PS_OK;
-#endif//NSIS_SUPPORT_BGBG
+#endif //~ NSIS_SUPPORT_BGBG
case TOK_BGGRADIENT:
#ifndef NSIS_SUPPORT_BGBG
ERROR_MSG(_T("Error: BGGradient specified but NSIS_SUPPORT_BGBG not defined\n"));
return PS_ERROR;
-#else//NSIS_SUPPORT_BGBG
+#else // NSIS_SUPPORT_BGBG
if (line.getnumtokens()==1)
{
SCRIPT_MSG(_T("BGGradient: default colors\n"));
@@ -2565,13 +1923,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("BGGradient: 0x%06X->0x%06X (text=0x%06X)\n"),v1,v2,v3);
}
-
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
build_uninst.bg_color1=build_header.bg_color1;
build_uninst.bg_color2=build_header.bg_color2;
build_uninst.bg_textcolor=build_header.bg_textcolor;
-#endif//NSIS_CONFIG_UNINSTALL_SUPPORT
-#endif//NSIS_SUPPORT_BGBG
+#endif //~ NSIS_CONFIG_UNINSTALL_SUPPORT
+#endif //~ NSIS_SUPPORT_BGBG
return PS_OK;
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
case TOK_INSTCOLORS:
@@ -2593,7 +1950,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
build_header.lb_bg=((v2&0xff)<<16)|(v2&0xff00)|((v2&0xff0000)>>16);
SCRIPT_MSG(_T("InstallColors: fg=%06X bg=%06X\n"),v1,v2);
}
-
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
build_uninst.lb_fg=build_header.lb_fg;
build_uninst.lb_bg=build_header.lb_bg;
@@ -2636,7 +1992,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
CResourceEditor *uire = new CResourceEditor(ui, len);
-
init_res_editor();
// Search for required items
@@ -2646,7 +2001,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#define SAVE(x) uire->FreeResource(dlg); dlg = UIDlg.Save(dwSize); res_editor->UpdateResource(RT_DIALOG, x, NSIS_DEFAULT_LANG, dlg, dwSize); UIDlg.FreeSavedTemplate(dlg);
LPBYTE dlg = NULL;
-
if (k == 0 || k == 1) {
GET(IDD_LICENSE);
SEARCH(IDC_EDIT1);
@@ -2683,14 +2037,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
DialogItemTemplate* dlgItem = 0;
for (int i = 0; (dlgItem = UIDlg.GetItemByIdx(i)); i++) {
bool check = false;
-
if (IS_INTRESOURCE(dlgItem->szClass)) {
if (dlgItem->szClass == MAKEINTRESOURCEWINW(0x0082)) {
check = true;
}
- } else {
+ } else
check = WinWStrICmpASCII(dlgItem->szClass, "Static") == 0;
- }
if (check) {
if ((dlgItem->dwStyle & SS_BITMAP) == SS_BITMAP) {
@@ -2700,7 +2052,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
}
}
-
SAVE(IDD_INST);
}
@@ -2817,7 +2168,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#else
ERROR_MSG(_T("Error: AddBrandingImage is disabled for non Win32 platforms.\n"));
return PS_ERROR;
-#endif
+#endif //~ _WIN32
case TOK_SETFONT:
{
unsigned char failed = 0;
@@ -2857,7 +2208,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_SETFONT:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_VISIBLE_SUPPORT not defined.\n"),line.gettoken_str(0));
return PS_ERROR;
-#endif// NSIS_CONFIG_VISIBLE_SUPPORT
+#endif //~ NSIS_CONFIG_VISIBLE_SUPPORT
case TOK_PEDLLCHARACTERISTICS:
{
@@ -2908,11 +2259,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
switch(line.gettoken_enum(1,_T("none\0all\0")))
{
- case 0:
- return PS_OK;
- case 1:
- manifest_sosl.addall();
- return PS_OK;
+ case 0: return PS_OK;
+ case 1: return manifest_sosl.addall() ? PS_OK : PS_ERROR;
}
}
for(int argi = 1; argi < line.getnumtokens(); ++argi)
@@ -2973,7 +2321,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
}
return PS_OK;
-#endif
+#endif //~ _UNICODE
// Ability to change compression methods from within the script
case TOK_SETCOMPRESSOR:
@@ -2985,7 +2333,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
if (build_compressor_final)
{
- warning_fl(_T("SetCompressor ignored due to previous call with the /FINAL switch"));
+ warning_fl(DW_COMP_FINAL, _T("SetCompressor ignored due to previous call with the /FINAL switch"));
return PS_OK;
}
build_compress_whole = false;
@@ -3027,10 +2375,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("SetCompressor: %") NPRIs _T("%") NPRIs _T("%") NPRIs _T("\n"), build_compressor_final ? _T("/FINAL ") : _T(""), build_compress_whole ? _T("/SOLID ") : _T(""), line.gettoken_str(a));
}
return PS_OK;
-#else//NSIS_CONFIG_COMPRESSION_SUPPORT
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_COMPRESSION_SUPPORT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//NSIS_CONFIG_COMPRESSION_SUPPORT
+#endif //~ NSIS_CONFIG_COMPRESSION_SUPPORT
case TOK_LOADNLF:
{
SCRIPT_MSG(_T("LoadLanguageFile: %") NPRIs _T("\n"), line.gettoken_str(1));
@@ -3045,534 +2393,54 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
last_used_lang = table->lang_id;
- // define LANG_LangName as "####" (lang id)
- // for example ${LANG_ENGLISH} = 1033
- TCHAR lang_id[16], lang_cp[16], lang_name[1024];
- wsprintf(lang_name, _T("LANG_%") NPRIs, table->nlf.m_szName);
+ // define LANG_LangName as "####" (lang id), for example ${LANG_ENGLISH} = 1033
+ TCHAR lang_id[16], lang_cp[16], lang_def[1024];
+ wsprintf(lang_def, _T("LANG_%") NPRIs, table->nlf.m_szName);
wsprintf(lang_id, _T("%u"), table->lang_id);
+ definedlist.add(lang_def, lang_id);
+ wsprintf(lang_def, _T("LANG_%") NPRIs _T("_CP"), table->nlf.m_szName);
wsprintf(lang_cp, _T("%u"), table->nlf.m_uCodePage);
- definedlist.add(lang_name, lang_id);
- wsprintf(lang_name, _T("LANG_%") NPRIs _T("_CP"), table->nlf.m_szName);
- definedlist.add(lang_name, lang_cp);
+ definedlist.add(lang_def, lang_cp);
}
return PS_OK;
// preprocessor-ish (ifdef/ifndef/else/endif are handled one step out from here)
///////////////////////////////////////////////////////////////////////////////
case TOK_P_DEFINE:
- {
- const TCHAR *cmdnam=line.gettoken_str(0), *define=line.gettoken_str(1);
- GrowBuf file_buf;
- TCHAR datebuf[256], mathbuf[256], *value;
- int dupemode=0;
-
- if (!_tcsicmp(define,_T("/ifndef")))
- dupemode=1;
- else if (!_tcsicmp(define,_T("/redef")))
- dupemode=2;
-
- if (dupemode!=0)
- {
- line.eattoken();
- define=line.gettoken_str(1);
- if (dupemode==1 && definedlist.find(define)) return PS_OK;
- }
-
- if (!_tcsicmp(define,_T("/date")) || !_tcsicmp(define,_T("/utcdate"))) {
- if (line.getnumtokens()!=4) PRINTHELPEX(cmdnam)
-
- const TCHAR *date_type = define;
- time_t rawtime;
- time(&rawtime);
- define=line.gettoken_str(2), value=line.gettoken_str(3);
-
- if (!_tcsicmp(date_type,_T("/utcdate")))
- rawtime = mktime(gmtime(&rawtime));
-
- datebuf[0]=0;
- size_t s=_tcsftime(datebuf,COUNTOF(datebuf),value,localtime(&rawtime));
- if (s == 0)
- datebuf[0]=0;
- else
- datebuf[max(s,COUNTOF(datebuf)-1)]=0;
-
- value=datebuf;
- } else if (!_tcsicmp(define,_T("/file")) || !_tcsicmp(define,_T("/file_noerr"))) {
-
- if (line.getnumtokens()!=4) PRINTHELPEX(cmdnam)
- const TCHAR *const filename=line.gettoken_str(3), *const swit=define;
- NIStream filestrm;
- if (!filestrm.OpenFileForReading(filename)) {
- if (!swit[5]) { // "/file" vs "/file_noerr"
- ERROR_MSG(_T("!define /file: file not found (\"%") NPRIs _T("\")\n"),filename);
- return PS_ERROR;
- }
- } else {
- NStreamLineReader lr(filestrm);
- TCHAR *str=m_templinebuf;
- for (UINT linnum = 0;;) {
- ++linnum;
- UINT cch=read_line_helper(lr,str,MAX_LINELENGTH);
- if (!cch) {
- if (*str) {
- tstring lrmsg=lr.GetErrorMessage((UINT)*str,filename,linnum);
- ERROR_MSG(_T("!define %") NPRIs _T(": %") NPRIs,swit,lrmsg.c_str());
- return PS_ERROR;
- }
- break; // EOF
- }
- str[--cch]=_T('\0'); // Remove \r or \n, we always append \n
- if (file_buf.getlen()) file_buf.add(_T("\n"),sizeof(TCHAR));
- file_buf.add(str,cch*sizeof(TCHAR));
- }
- }
- define = line.gettoken_str(2);
- file_buf.add(_T("\0"),sizeof(TCHAR));
- value = (TCHAR *)file_buf.get();
-
- } else if (!_tcsicmp(define,_T("/math"))) {
-
- int value1, value2;
- TCHAR *mathop;
-
- if (line.getnumtokens()!=6) PRINTHELPEX(cmdnam)
- define = line.gettoken_str(2);
- value1 = line.gettoken_int(3);
- mathop = line.gettoken_str(4);
- value2 = line.gettoken_int(5);
- value = mathbuf;
-
- if (!_tcscmp(mathop,_T("+"))) {
- _stprintf(value,_T("%d"),value1+value2);
- } else if (!_tcscmp(mathop,_T("-"))) {
- _stprintf(value,_T("%d"),value1-value2);
- } else if (!_tcscmp(mathop,_T("*"))) {
- _stprintf(value,_T("%d"),value1*value2);
- } else if (!_tcscmp(mathop,_T("&"))) {
- _stprintf(value,_T("%d"),value1&value2);
- } else if (!_tcscmp(mathop,_T("|"))) {
- _stprintf(value,_T("%d"),value1|value2);
- } else if (!_tcscmp(mathop,_T("^"))) {
- _stprintf(value,_T("%d"),value1^value2);
- } else if (!_tcscmp(mathop,_T("<<")) || !_tcscmp(mathop,_T("<<<")) ) {
- _stprintf(value,_T("%d"),value1<<value2);
- } else if (!_tcscmp(mathop,_T(">>"))) {
- _stprintf(value,_T("%d"),(signed int)value1>>(signed int)value2);
- } else if (!_tcscmp(mathop,_T(">>>"))) {
- _stprintf(value,_T("%u"),(unsigned int)value1>>(unsigned int)value2);
- } else if (!_tcscmp(mathop,_T("/"))) {
- if (value2==0) {
- ERROR_MSG(_T("!define /math: division by zero! (\"%i %") NPRIs _T(" %i\")\n"),value1,mathop,value2);
- return PS_ERROR;
- }
- _stprintf(value,_T("%d"),value1/value2);
- } else if (!_tcscmp(mathop,_T("%"))) {
- if (value2==0) {
- ERROR_MSG(_T("!define /math: division by zero! (\"%i %") NPRIs _T(" %i\")\n"),value1,mathop,value2);
- return PS_ERROR;
- }
- _stprintf(value,_T("%d"),value1%value2);
- } else PRINTHELPEX(cmdnam)
-
- } else {
- if (line.getnumtokens()>=4) PRINTHELPEX(cmdnam)
- value=line.gettoken_str(2);
- }
-
- if (dupemode==2) definedlist.del(define);
- if (definedlist.add(define,value))
- {
- ERROR_MSG(_T("!define: \"%") NPRIs _T("\" already defined!\n"),define);
- return PS_ERROR;
- }
- SCRIPT_MSG(_T("!define: \"%") NPRIs _T("\"=\"%") NPRIs _T("\"\n"),define,value);
- }
- return PS_OK;
+ return pp_define(line);
case TOK_P_UNDEF:
- if (definedlist.del(line.gettoken_str(1)))
- {
- ERROR_MSG(_T("!undef: \"%") NPRIs _T("\" not defined!\n"),line.gettoken_str(1));
- return PS_ERROR;
- }
- SCRIPT_MSG(_T("!undef: \"%") NPRIs _T("\"\n"),line.gettoken_str(1));
- return PS_OK;
+ return pp_undef(line);
case TOK_P_PACKEXEHEADER:
- {
- TCHAR* packname = line.gettoken_str(1);
- PATH_CONVERT(packname);
- my_strncpy(build_packname,packname,COUNTOF(build_packname));
- my_strncpy(build_packcmd,line.gettoken_str(2),COUNTOF(build_packcmd));
- SCRIPT_MSG(_T("!packhdr: filename=\"%") NPRIs _T("\", command=\"%") NPRIs _T("\"\n"),
- build_packname, build_packcmd);
- }
- return PS_OK;
+ return pp_packhdr(line);
case TOK_P_FINALIZE:
- {
- TCHAR* cmdstr=line.gettoken_str(1);
- int validparams=false;
- struct postbuild_cmd *newcmd, *prevcmd;
- newcmd=(struct postbuild_cmd*) (new BYTE[FIELD_OFFSET(struct postbuild_cmd,cmd[_tcsclen(cmdstr)+1])]);
- newcmd->next=NULL, _tcscpy(newcmd->cmd,cmdstr);
- newcmd->cmpop=line.gettoken_enum(2,_T("<\0>\0<>\0=\0ignore\0")), newcmd->cmpval=line.gettoken_int(3,&validparams);
- if (line.getnumtokens() == 1+1) newcmd->cmpop=4, validparams=true; // just a command, ignore the exit code
- if (newcmd->cmpop == -1 || !validparams) PRINTHELP();
- for (prevcmd=postbuild_cmds; prevcmd && prevcmd->next;) prevcmd=prevcmd->next;
- if (prevcmd) prevcmd->next=newcmd; else postbuild_cmds=newcmd;
- SCRIPT_MSG(_T("!finalize: \"%") NPRIs _T("\"\n"),cmdstr);
- }
- return PS_OK;
+ return pp_finalize(line);
case TOK_P_SYSTEMEXEC:
case TOK_P_EXECUTE:
case TOK_P_MAKENSIS:
- {
- const TCHAR *cmdname=get_commandtoken_name(which_token);
- const TCHAR *exec=line.gettoken_str(1), *define=0;
- TCHAR buf[33];
- int comp=line.gettoken_enum(2,_T("<\0>\0<>\0=\0ignore\0"));
- int validparams=true, ret=-1, cmpv=0, forceutf8=0;
- switch(line.getnumtokens()-1)
- {
- case 1: comp=4; break;
- case 2: comp=5, validparams=!!*(define=line.gettoken_str(2)); break;
- case 3: cmpv=line.gettoken_int(3,&validparams); break;
- default: forceutf8=comp=-1;
- }
- if (!validparams || comp == -1) PRINTHELP()
- tstring compile;
- if (TOK_P_MAKENSIS == which_token)
- {
- extern const TCHAR *g_argv0;
- compile=_T("\""), compile+=get_executable_path(g_argv0), compile+= _T("\"");
- compile+= _T(" ") OPT_STR _T("v"), wsprintf(buf,_T("%d"),get_verbosity()), compile+=buf;
-#if defined(_WIN32) && defined(_UNICODE) // POSIX does not support -OUTPUTCHARSET
- compile+= _T(" ") OPT_STR _T("OCS UTF8"), forceutf8++; // Force UTF-8 and disable batch-file workaround in RunChildProcessRedirected
-#endif
- if (*exec) compile+= _T(" "), compile+=exec;
- exec=compile.c_str();
- }
- SCRIPT_MSG(_T("%") NPRIs _T(": \"%") NPRIs _T("\"\n"),cmdname,exec);
- if (preprocessonly) PREPROCESSONLY_BEGINCOMMENT();
-#ifdef _WIN32
- if (TOK_P_SYSTEMEXEC != which_token)
- ret=RunChildProcessRedirected(exec, forceutf8 ? true : false);
- else
-#endif //~ _WIN32
- ret=sane_system(exec);
- if (comp == 5)
- {
- _stprintf(buf,_T("%d"),ret);
- definedlist.set(define,buf);
- }
- else if (!check_external_exitcode(ret,comp,cmpv))
- {
- ERROR_MSG(_T("%") NPRIs _T(": returned %d, aborting\n"),cmdname,ret);
- return PS_ERROR;
- }
- if (preprocessonly) PREPROCESSONLY_ENDCOMMENT();
- SCRIPT_MSG(_T("%") NPRIs _T(": returned %d\n"),cmdname,ret);
- }
- return PS_OK;
+ return pp_execute(which_token, line);
case TOK_P_ADDINCLUDEDIR:
- {
- TCHAR *f = line.gettoken_str(1);
- PATH_CONVERT(f);
- include_dirs.add(f,0);
- }
- return PS_OK;
+ return pp_addincludedir(line);
case TOK_P_INCLUDE:
- {
- bool required = true;
- NStreamEncoding enc(NStreamEncoding::AUTO);
- TCHAR *f;
- unsigned int toks = line.getnumtokens() - 1, included = 0;
- for(unsigned int tok = 0; toks;)
- {
- f = line.gettoken_str(++tok);
- if (tok >= toks) break;
- if (!_tcsicmp(f,_T("/nonfatal"))) required = false;
- TCHAR buf[9+1];
- my_strncpy(buf,f,COUNTOF(buf));
- if (!_tcsicmp(buf,_T("/charset="))) {
- WORD cp = GetEncodingFromString(f+9);
- if (NStreamEncoding::UNKNOWN == cp) toks = 0;
- enc.SafeSetCodepage(cp);
- }
- }
- if (!toks || !*f) PRINTHELP();
-
- TCHAR *fc = my_convert(f);
- tstring dir = get_dir_name(fc), spec = get_file_name(fc), basedir = dir;
- my_convert_free(fc);
- path_append_separator(basedir);
- if (dir == spec) basedir = _T(""), dir = _T("."); // no path, just file name
-
- // search working directory
- boost::scoped_ptr<dir_reader> dr( new_dir_reader() );
- dr->read(dir);
- for (dir_reader::iterator files_itr = dr->files().begin();
- files_itr != dr->files().end();
- files_itr++)
- {
- if (!dir_reader::matches(*files_itr, spec)) continue;
-
- tstring incfile = basedir + *files_itr;
- if (includeScript(incfile.c_str(), enc) != PS_OK)
- return PS_ERROR;
- else
- included++;
- }
- if (included) return PS_OK;
-
- // search include dirs
- TCHAR *incdir = include_dirs.get();
- int incdirs = include_dirs.getnum();
- for (int i = 0; i < incdirs; i++, incdir += _tcslen(incdir) + 1) {
- tstring curincdir(incdir), incfile;
- if (_T(".") != dir) path_append(curincdir, dir);
-
- boost::scoped_ptr<dir_reader> dr( new_dir_reader() );
- dr->read(curincdir);
- for (dir_reader::iterator incdir_itr = dr->files().begin();
- incdir_itr != dr->files().end();
- incdir_itr++)
- {
- if (!dir_reader::matches(*incdir_itr, spec)) continue;
-
- path_append(incfile = curincdir, *incdir_itr);
- if (includeScript(incfile.c_str(), enc) != PS_OK)
- return PS_ERROR;
- else
- included++;
- }
- if (included) return PS_OK;
- }
-
- // nothing found
- if (!included)
- {
- if(required) {
- ERROR_MSG(_T("!include: could not find: \"%") NPRIs _T("\"\n"),f);
- return PS_ERROR;
- } else {
- warning_fl(_T("!include: could not find: \"%") NPRIs _T("\""),f);
- }
- }
- }
- return PS_OK;
+ return pp_include(line);
case TOK_P_CD:
- if (!line.gettoken_str(1)[0] || _tchdir(line.gettoken_str(1)))
- {
- ERROR_MSG(_T("!cd: error changing to: \"%") NPRIs _T("\"\n"),line.gettoken_str(1));
- return PS_ERROR;
- }
- return PS_OK;
+ return pp_cd(line);
+ case TOK_P_PRAGMA:
+ return parse_pragma(line) == PS_ERROR ? PS_ERROR : PS_OK;
case TOK_P_ERROR:
ERROR_MSG(_T("!error: %") NPRIs _T("\n"),line.gettoken_str(1));
return PS_ERROR;
case TOK_P_WARNING:
- warning_fl(_T("!warning: %") NPRIs,line.gettoken_str(1));
+ warning_fl(DIAGCODE_INTERNAL_HIDEDIAGCODE, _T("!warning: %") NPRIs,line.gettoken_str(1));
return PS_OK;
case TOK_P_ECHO:
SCRIPT_MSG(_T("%") NPRIs _T(" (%") NPRIs _T(":%d)\n"), line.gettoken_str(1),curfilename,linecnt);
return PS_OK;
case TOK_P_SEARCHPARSESTRING:
- {
- bool ignCase=false, noErrors=false, isFile=false;
- int parmOffs=1;
- while (parmOffs < line.getnumtokens())
- {
- if (!_tcsicmp(line.gettoken_str(parmOffs),_T("/ignorecase"))) { ignCase=true; parmOffs++; }
- else if (!_tcsicmp(line.gettoken_str(parmOffs),_T("/noerrors"))) { noErrors=true; parmOffs++; }
- else if (!_tcsicmp(line.gettoken_str(parmOffs),_T("/file"))) { isFile=true; parmOffs++; }
- else break;
- }
- if (parmOffs+3 > line.getnumtokens())
- {
- ERROR_MSG(_T("!searchparse: not enough parameters\n"));
- return PS_ERROR;
- }
- const TCHAR *source_string = line.gettoken_str(parmOffs++);
- DefineList *list=NULL;
-
- if (isFile)
- {
- const TCHAR *const filename = source_string;
- NIStream filestrm;
- if (!filestrm.OpenFileForReading(filename))
- {
- ERROR_MSG(_T("!searchparse /file: error opening \"%") NPRIs _T("\"\n"),filename);
- return PS_ERROR;
- }
- UINT req_parm=(line.getnumtokens() - parmOffs)/2, fail_parm=0;
- NStreamLineReader lr(filestrm);
- GrowBuf tmpstr;
- TCHAR *str=m_templinebuf;
- UINT linnum=0;
- for (;;)
- {
- tmpstr.resize(0);
- for (;;)
- {
- ++linnum;
- UINT cch=read_line_helper(lr,str,MAX_LINELENGTH);
- if (!cch)
- {
- if (*str)
- {
- tstring lrmsg=lr.GetErrorMessage((UINT)*str,filename,linnum);
- ERROR_MSG(_T("!searchparse: %") NPRIs,lrmsg.c_str());
- return PS_ERROR;
- }
- break; // EOF
- }
- str[--cch]=_T('\0'); // remove newline
-
- const bool endSlash=cch && _T('\\') == str[cch-1];
- if (endSlash) --cch; // don't include the slash character
- if (tmpstr.getlen() || endSlash) tmpstr.add(str,cch*sizeof(TCHAR));
-
- // if we have valid contents and not ending on slash, then done
- if (!endSlash && (str[0] || tmpstr.getlen())) break;
- }
-
- if (!str[0] && !tmpstr.getlen()) break; // reached eof
-
- TCHAR *thisline=str;
- if (tmpstr.getlen())
- {
- tmpstr.add(_T("\0"),sizeof(TCHAR));
- thisline=(TCHAR *)tmpstr.get();
- }
- UINT linefailparm;
- DefineList *tlist = searchParseString(thisline,line,parmOffs,ignCase,true,&linefailparm);
- if (linefailparm > fail_parm) fail_parm = linefailparm;
- if (tlist && tlist->getnum())
- {
- if (!list || tlist->getnum() > list->getnum())
- {
- delete list;
- list=tlist, tlist=0;
- if ((unsigned)list->getnum() >= req_parm)
- {
- fail_parm = -1; // success
- break; // we found all the tokens, stop parsing the file
- }
- }
- }
- delete tlist;
- // parse line
- }
- if ((UINT)-1 != fail_parm && !noErrors)
- {
- const TCHAR *msgprefix=!fail_parm ? _T("starting ") : _T("");
- TCHAR *p=line.gettoken_str(parmOffs + (fail_parm*2));
- ERROR_MSG(_T("!searchparse: %") NPRIs _T("string \"%") NPRIs _T("\" not found in file!\n"),msgprefix,p?p:_T("(null)"));
- return PS_ERROR;
- }
- }
- else
- {
- list=searchParseString(source_string,line,parmOffs,ignCase,noErrors);
- if (!list && !noErrors) return PS_ERROR;
- }
-
- if (list) // if we got our list, merge them defines in
- {
- int i;
- for (i=0;i<list->getnum(); i++)
- {
- TCHAR *def=list->getname(i), *val=list->getvalue(i);
- if (def && val) definedlist.set(def,val);
- }
- }
- delete list;
- }
- return PS_OK;
+ return pp_searchparsestring(line);
case TOK_P_SEARCHREPLACESTRING:
- {
- int ignoreCase=!_tcsicmp(line.gettoken_str(1),_T("/ignorecase"));
- if (line.getnumtokens()!=5+ignoreCase) PRINTHELP()
-
- TCHAR *define=line.gettoken_str(1+ignoreCase);
- TCHAR *src = line.gettoken_str(2+ignoreCase);
- TCHAR *search = line.gettoken_str(3+ignoreCase);
- TCHAR *replace = line.gettoken_str(4+ignoreCase);
- int searchlen=(int)_tcslen(search), replacelen=(int)_tcslen(replace);
- if (!searchlen)
- {
- ERROR_MSG(_T("!searchreplace: search string must not be empty for search/replace!\n"));
- return PS_ERROR;
- }
-
- GrowBuf valout;
- while (*src)
- {
- if (ignoreCase ? _tcsnicmp(src,search,searchlen) : _tcsncmp(src,search,searchlen))
- valout.add(src++,sizeof(TCHAR));
- else
- {
- valout.add(replace,sizeof(TCHAR)*replacelen);
- src+=searchlen;
- }
- }
- valout.add(_T(""),sizeof(TCHAR));
-
- definedlist.del(define); // allow changing variables since we'll often use this in series
- if (definedlist.add(define,(TCHAR*)valout.get()))
- {
- ERROR_MSG(_T("!searchreplace: error defining \"%") NPRIs _T("\"!\n"),define);
- return PS_ERROR;
- }
- SCRIPT_MSG(_T("!searchreplace: \"%") NPRIs _T("\"=\"%") NPRIs _T("\"\n"),define,(TCHAR*)valout.get());
- }
- return PS_OK;
-
+ return pp_searchreplacestring(line);
case TOK_P_VERBOSE:
- {
- for(int argi=1; argi<line.getnumtokens(); ++argi)
- {
- int v,k=line.gettoken_enum(argi,_T("push\0pop\0"));
- if (k < 0)
- {
- // just set
- int numconv;
- v=line.gettoken_int(argi,&numconv);
- if (!numconv || v < 0 || v > 4 )
- {
- // < 2.47 would reset level to 0 without warning!
- ERROR_MSG(_T("!verbose: Invalid verbose level\n"));
- return PS_ERROR;
- }
- }
- else
- {
- if (k)
- {
- // pop
- int l=verbose_stack.getlen();
- if (l)
- {
- v=((int*)verbose_stack.get())[(l/sizeof(int))-1];
- verbose_stack.resize(l-sizeof(int));
- }
- else
- {
- warning_fl(_T("!verbose: Pop failed, stack is empty"));
- continue; // Pop failed, should still process the next parameter
- }
- }
- else
- {
- // push
- v=get_verbosity();
- verbose_stack.add(&v,sizeof(int));
- continue;
- }
- }
- set_verbosity(v);
- }
- }
- return PS_OK;
+ return pp_verbose(line);
case TOK_UNINSTALLEXENAME: PRINTHELP()
@@ -3580,7 +2448,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_UNINSTCAPTION:
{
if (SetInnerString(NLF_UCAPTION,line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
SCRIPT_MSG(_T("UninstCaption: \"%") NPRIs _T("\"\n"),line.gettoken_str(1));
}
return PS_OK;
@@ -3599,7 +2467,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
if (!cur_page) {
if (SetInnerString(NLF_UNINST_TEXT, line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
SetInnerString(NLF_UNINST_SUBTEXT, line.gettoken_str(2));
}
else {
@@ -3641,7 +2509,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
DefineInnerLangString(NLF_CREATED_UNINST);
}
return add_entry(&ent);
-#else//!NSIS_CONFIG_UNINSTALL_SUPPORT
+#else //! NSIS_CONFIG_UNINSTALL_SUPPORT
case TOK_WRITEUNINSTALLER:
case TOK_UNINSTCAPTION:
case TOK_UNINSTICON:
@@ -3651,10 +2519,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
return PS_ERROR;
#endif
-
// section/function stuff
///////////////////////////////////////////////////////////////////////////////
-
case TOK_SECTION:
{
int a = 1, unselected = 0;
@@ -3758,14 +2624,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
// flag setters
///////////////////////////////////////////////////////////////////////////////
-
- // BEGIN - Added by ramon 23 May 2003
case TOK_ALLOWSKIPFILES:
build_allowskipfiles=line.gettoken_enum(1,_T("off\0on\0"));
if (build_allowskipfiles==-1) PRINTHELP()
SCRIPT_MSG(_T("AllowSkipFiles: %") NPRIs _T("\n"),line.gettoken_str(1));
return PS_OK;
- // END - Added by ramon 23 May 2003
case TOK_SETDATESAVE:
build_datesave=line.gettoken_enum(1,_T("off\0on\0"));
if (build_datesave==-1) PRINTHELP()
@@ -3788,12 +2651,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (build_plugin_unload==-1) PRINTHELP()
SCRIPT_MSG(_T("SetPluginUnload: %") NPRIs _T("\n"),line.gettoken_str(1));
return PS_OK;
-#endif //NSIS_CONFIG_PLUGIN_SUPPORT
+#endif //~ NSIS_CONFIG_PLUGIN_SUPPORT
case TOK_SETCOMPRESS:
build_compress=line.gettoken_enum(1,_T("off\0auto\0force\0"));
if (build_compress==-1) PRINTHELP()
if (build_compress==0 && build_compress_whole)
- warning_fl(_T("'SetCompress off' encountered, and in whole compression mode. Effectively ignored."));
+ warning_fl(DW_COMP_WHOLE_IGNORE_OFF, _T("'SetCompress off' encountered, and in whole compression mode. Effectively ignored."));
SCRIPT_MSG(_T("SetCompress: %") NPRIs _T("\n"),line.gettoken_str(1));
return PS_OK;
case TOK_DBOPTIMIZE:
@@ -3815,9 +2678,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_SETCOMPRESSIONLEVEL:
{
if (compressor == &lzma_compressor)
- warning_fl(_T("SetCompressionLevel: compressor is set to LZMA. Effectively ignored."));
+ warning_fl(DW_COMP_LEVEL_IGNORE, _T("SetCompressionLevel: compressor is set to LZMA. Effectively ignored."));
if (build_compressor_set && build_compress_whole)
- warning_fl(_T("SetCompressionLevel: data already compressed in compress whole mode. Effectively ignored."));
+ warning_fl(DW_COMP_LEVEL_IGNORE, _T("SetCompressionLevel: data already compressed in compress whole mode. Effectively ignored."));
int s;
build_compress_level=line.gettoken_int(1,&s);
@@ -3828,9 +2691,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_SETCOMPRESSORDICTSIZE:
{
if (compressor != &lzma_compressor)
- warning_fl(_T("SetCompressorDictSize: compressor is not set to LZMA. Effectively ignored."));
+ warning_fl(DW_COMP_DICT_IGNORE, _T("SetCompressorDictSize: compressor is not set to LZMA. Effectively ignored."));
if (build_compressor_set && build_compress_whole)
- warning_fl(_T("SetCompressorDictSize: data already compressed in compress whole mode. Effectively ignored."));
+ warning_fl(DW_COMP_DICT_IGNORE, _T("SetCompressorDictSize: data already compressed in compress whole mode. Effectively ignored."));
int s;
build_compress_dict_size=line.gettoken_int(1,&s);
@@ -3844,7 +2707,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_SETCOMPRESSORDICTSIZE:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_COMPRESSION_SUPPORT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//NSIS_CONFIG_COMPRESSION_SUPPORT
+#endif //~ NSIS_CONFIG_COMPRESSION_SUPPORT
case TOK_ADDSIZE:
{
int succ, size_kb=line.gettoken_int(1,&succ);
@@ -3905,17 +2768,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
wsprintf(str, _T("Nullsoft Install System %") NPRIs, NSIS_VERSION);
short old_width = td.GetItem(IDC_VERSTR)->sWidth;
-
switch (trim) {
case 1: td.LTrimToString(IDC_VERSTR, str, 4); break;
case 2: td.RTrimToString(IDC_VERSTR, str, 4); break;
case 3: td.CTrimToString(IDC_VERSTR, str, 4); break;
}
-
if (td.GetItem(IDC_VERSTR)->sWidth > old_width)
- warning_fl(_T("BrandingText: \"%") NPRIs _T("\" is too long, trimming has expanded the label"), str);
+ warning_fl(DW_ATTRIBUTE_OVERLONGSTRING, _T("BrandingText: \"%") NPRIs _T("\" is too long, trimming has expanded the label"), str);
}
-
DWORD dwSize;
dlg = td.Save(dwSize);
res_editor->UpdateResource(RT_DIALOG, IDD_INST, NSIS_DEFAULT_LANG, dlg, dwSize);
@@ -3968,7 +2828,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
if (!cur_page) {
if (SetInnerString(NLF_BTN_DETAILS,line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
}
else {
if (cur_page_type != PAGE_INSTFILES) {
@@ -3984,7 +2844,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
if (!cur_page) {
if (SetInnerString(NLF_COMPLETED,line.gettoken_str(1)) == PS_WARNING)
- warning_fl(_T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
+ warning_fl(DW_INNERSTRING_MULTISETWASTE, _T("%") NPRIs _T(": specified multiple times, wasting space"),line.gettoken_str(0));
}
else {
if (cur_page_type != PAGE_INSTFILES) {
@@ -4023,15 +2883,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
ent.which=EW_SETFLAG;
ent.offsets[0]=FLAG_OFFSET(alter_reg_view);
- // "64" results in setting the flag to 1 which alters the view
- int k=line.gettoken_enum(1,_T("32\0") _T("64\0lastused\0"));
- if (k<0) PRINTHELP()
- if (k == 0) // 32
- ent.offsets[1]=add_intstring(0);
- else if (k == 1) // 64
- ent.offsets[1]=add_intstring(KEY_WOW64_64KEY);
- else if (k == 2) // last used
- ent.offsets[2]=1;
+ int k=line.gettoken_enum(1,_T("32\0") _T("64\0default\0lastused\0"));
+ if (k == 0) ent.offsets[1]=add_intstring(is_target_64bit() ? KEY_WOW64_32KEY : 0); // 32
+ else if (k == 1) ent.offsets[1]=add_intstring(KEY_WOW64_64KEY); // 64
+ else if (k == 2) ent.offsets[1]=add_intstring(0); // default
+ else if (k == 3) ent.offsets[2]=1; // last used
+ else PRINTHELP()
SCRIPT_MSG(_T("SetRegView: %") NPRIs _T("\n"),line.gettoken_str(1));
}
return add_entry(&ent);
@@ -4131,43 +2988,46 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
DefineInnerLangString(NLF_EXEC);
return add_entry(&ent);
-#else//!NSIS_SUPPORT_EXECUTE
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_EXECUTE not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_EXECUTE
- case TOK_EXECSHELL: // this uses improvements of Andras Varga
+#endif //~ NSIS_SUPPORT_EXECUTE
+ case TOK_EXECSHELL:
+ case TOK_EXECSHELLWAIT:
#ifdef NSIS_SUPPORT_SHELLEXECUTE
{
- const TCHAR *verb=line.gettoken_str(1), *file=line.gettoken_str(2), *params=line.gettoken_str(3);
+ UINT to=0, xflags=0;
+ static const TCHAR*fn=_T("/INVOKEIDLIST\0/CONNECTNETDRV\0/DOENVSUBST\0/NOIDLIST\0/NOCONSOLE\0/NOZONECHECKS\0/WAITFORINPUTIDLE\0/LOGUSAGE\0/ASYNCOK\0");
+ static const UINT fv[]={ 0x0000000C, 0x00000080, 0x00000200, 0x00001000,0x00008000, 0x00800000, 0x02000000, 0x04000000,0x00100000 };
+ for (int k;;) if ((k = line.gettoken_enum(to+1,fn)) < 0) { if (line.gettoken_str(to+1)[0]=='/') PRINTHELP(); break; } else xflags|=fv[k], to++;
+ const TCHAR *verb=line.gettoken_str(to+1), *file=line.gettoken_str(to+2), *params=line.gettoken_str(to+3), *cnam=get_commandtoken_name(which_token);
ent.which=EW_SHELLEXEC;
- ent.offsets[0]=add_string(verb);
- ent.offsets[1]=add_string(file);
- ent.offsets[2]=add_string(params);
- ent.offsets[3]=SW_SHOWNORMAL;
- if (line.getnumtokens() > 4)
+ ent.offsets[0]=add_string(verb), ent.offsets[1]=add_string(file);
+ ent.offsets[2]=add_string(params), ent.offsets[3]=SW_SHOWNORMAL;
+ ent.offsets[4]=SEE_MASK_FLAG_NO_UI|SEE_MASK_FLAG_DDEWAIT|xflags|(which_token==TOK_EXECSHELLWAIT ? SEE_MASK_NOCLOSEPROCESS : 0);
+ if (line.getnumtokens()-to > 4)
{
int tab[8]={SW_SHOWDEFAULT,SW_SHOWNORMAL,SW_SHOWMAXIMIZED,SW_SHOWMINIMIZED,SW_HIDE,SW_SHOW,SW_SHOWNA,SW_SHOWMINNOACTIVE};
- int a=line.gettoken_enum(4,_T("SW_SHOWDEFAULT\0SW_SHOWNORMAL\0SW_SHOWMAXIMIZED\0SW_SHOWMINIMIZED\0SW_HIDE\0SW_SHOW\0SW_SHOWNA\0SW_SHOWMINNOACTIVE\0"));
- if (a < 0) PRINTHELP()
- ent.offsets[3]=tab[a];
+ int a=line.gettoken_enum(to+4,_T("SW_SHOWDEFAULT\0SW_SHOWNORMAL\0SW_SHOWMAXIMIZED\0SW_SHOWMINIMIZED\0SW_HIDE\0SW_SHOW\0SW_SHOWNA\0SW_SHOWMINNOACTIVE\0"));
+ if (a >= 0) ent.offsets[3]=tab[a]; else PRINTHELP()
}
- tstring detail=tstring(verb)+(_T(" ")+!*verb)+tstring(file);
+ tstring detail=tstring(verb)+(_T(" ")[!*verb])+tstring(file);
ent.offsets[5]=add_string(detail.c_str());
- SCRIPT_MSG(_T("ExecShell: %") NPRIs _T(": \"%") NPRIs _T("\" \"%") NPRIs _T("\" %") NPRIs _T("\n"),verb,file,params,line.gettoken_str(4));
+ SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T(": \"%") NPRIs _T("\" \"%") NPRIs _T("\" %") NPRIs _T("\n"),cnam,verb,file,params,line.gettoken_str(to+4));
DefineInnerLangString(NLF_EXEC_SHELL);
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_SHELLEXECUTE
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_SHELLEXECUTE not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_SHELLEXECUTE
+#endif //~ NSIS_SUPPORT_SHELLEXECUTE
case TOK_CALLINSTDLL:
case TOK_REGDLL:
case TOK_UNREGDLL:
#ifndef NSIS_SUPPORT_ACTIVEXREG
ERROR_MSG(_T("%") NPRIs _T(": support not compiled in (NSIS_SUPPORT_ACTIVEXREG)\n"),line.gettoken_str(0));
return PS_ERROR;
-#else//NSIS_SUPPORT_ACTIVEXREG
+#else // NSIS_SUPPORT_ACTIVEXREG
ent.which=EW_REGISTERDLL;
ent.offsets[0]=add_string(line.gettoken_str(1));
if (which_token == TOK_UNREGDLL)
@@ -4187,7 +3047,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (!ent.offsets[1]) PRINTHELP()
ent.offsets[2]=0;
}
- else // register
+ else // Register DLL
{
ent.offsets[1] = add_string(line.gettoken_str(2));
if (!ent.offsets[1]) ent.offsets[1]=add_asciistring(_T("DllRegisterServer"));
@@ -4195,13 +3055,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
SCRIPT_MSG(_T("%") NPRIs _T(": \"%") NPRIs _T("\" %") NPRIs _T("\n"),line.gettoken_str(0),line.gettoken_str(1), line.gettoken_str(ent.offsets[3]?3:2));
-
DefineInnerLangString(NLF_SYMBOL_NOT_FOUND);
DefineInnerLangString(NLF_COULD_NOT_LOAD);
DefineInnerLangString(NLF_NO_OLE);
// not used anywhere - DefineInnerLangString(NLF_ERR_REG_DLL);
return add_entry(&ent);
-#endif//NSIS_SUPPORT_ACTIVEXREG
+#endif //~ NSIS_SUPPORT_ACTIVEXREG
case TOK_RENAME:
#ifdef NSIS_SUPPORT_RENAME
{
@@ -4233,20 +3092,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#endif
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_RENAME
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_RENAME not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_RENAME
+#endif //~ NSIS_SUPPORT_RENAME
case TOK_MESSAGEBOX:
#ifdef NSIS_SUPPORT_MESSAGEBOX
{
#define MBD(x) {x,_T(#x)},
- struct
- {
- int id;
- const TCHAR *str;
- } list[]=
- {
+ struct { int id; const TCHAR *str; } list[] = {
MBD(MB_ABORTRETRYIGNORE)
MBD(MB_OK)
MBD(MB_OKCANCEL)
@@ -4324,10 +3178,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("\n"));
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_MESSAGEBOX
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_MESSAGEBOX not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_MESSAGEBOX
+#endif //~ NSIS_SUPPORT_MESSAGEBOX
case TOK_CREATESHORTCUT:
#ifdef NSIS_SUPPORT_CREATESHORTCUT
{
@@ -4380,14 +3234,14 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
c=VK_F1-1+_ttoi(s+1);
if (_ttoi(s+1) < 1 || _ttoi(s+1) > 24)
- warning_fl(_T("CreateShortcut: F-key \"%") NPRIs _T("\" out of range"),s);
+ warning_fl(DW_PARSE_LNK_HK, _T("CreateShortcut: F-key \"%") NPRIs _T("\" out of range"),s);
}
else if (((s[0] >= _T('A') && s[0] <= _T('Z')) || (s[0] >= _T('0') && s[0] <= _T('9'))) && !s[1])
c=s[0];
else
{
c=s[0];
- warning_fl(_T("CreateShortcut: unrecognized hotkey \"%") NPRIs _T("\""),s);
+ warning_fl(DW_PARSE_LNK_HK, _T("CreateShortcut: unrecognized hotkey \"%") NPRIs _T("\""),s);
}
ent.offsets[4] |= ((c) << CS_HK_SHIFT) & CS_HK_MASK;
}
@@ -4400,10 +3254,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
DefineInnerLangString(NLF_ERR_CREATING_SHORTCUT);
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_CREATESHORTCUT
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_CREATESHORTCUT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//NSIS_SUPPORT_CREATESHORTCUT
+#endif //~ NSIS_SUPPORT_CREATESHORTCUT
#ifdef NSIS_SUPPORT_HWNDS
case TOK_FINDWINDOW:
ent.which=EW_FINDWINDOW;
@@ -4419,33 +3273,24 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_SENDMESSAGE:
{
ent.which=EW_SENDMESSAGE;
-
if (line.gettoken_str(1)[0] == _T('/') || line.gettoken_str(2)[0] == _T('/') ||
line.gettoken_str(3)[0] == _T('/') || line.gettoken_str(4)[0] == _T('/'))
- {
PRINTHELP()
- }
SCRIPT_MSG(_T("SendMessage:"));
int a=5;
- ent.offsets[0]=GetUserVarIndex(line, 5);
+ ent.offsets[0]=GetUserVarIndex(line,a);
if (ent.offsets[0]>=0)
- {
- SCRIPT_MSG(_T("(->%") NPRIs _T(")"),line.gettoken_str(5));
- a++;
- }
+ SCRIPT_MSG(_T("(->%") NPRIs _T(")"),line.gettoken_str(a++));
- if (!_tcsncmp(line.gettoken_str(a),_T("/TIMEOUT="),9))
+ if (!_tcsncicmp(line.gettoken_str(a),_T("/TIMEOUT="),9))
{
- ent.offsets[5]|=_ttoi(line.gettoken_str(a)+9)<<2;
+ ent.offsets[5]|=_ttoi(line.gettoken_str(a++)+9)<<2;
SCRIPT_MSG(_T(" (timeout=%d)"),ent.offsets[5]>>2);
- a++;
}
if (line.getnumtokens()>a)
- {
PRINTHELP()
- }
if (!_tcsncmp(line.gettoken_str(3),_T("STR:"),4))
{
@@ -4608,7 +3453,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("BringToFront\n"));
}
return add_entry(&ent);
-#else//NSIS_CONFIG_ENHANCEDUI_SUPPORT
+#else
case TOK_GETDLGITEM:
case TOK_SETCTLCOLORS:
case TOK_SHOWWINDOW:
@@ -4618,8 +3463,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_ENABLEWINDOW:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_ENHANCEDUI_SUPPORT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//NSIS_CONFIG_ENHANCEDUI_SUPPORT
-#else//!NSIS_SUPPORT_HWNDS
+#endif //~ NSIS_CONFIG_ENHANCEDUI_SUPPORT
+#else //! NSIS_SUPPORT_HWNDS
case TOK_ISWINDOW:
case TOK_SENDMESSAGE:
case TOK_FINDWINDOW:
@@ -4632,7 +3477,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_BRINGTOFRONT:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_HWNDS not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_HWNDS
+#endif //~ NSIS_SUPPORT_HWNDS
case TOK_DELETE:
#ifdef NSIS_SUPPORT_DELETE
{
@@ -4661,10 +3506,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#endif
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_DELETE
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_DELETE not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_DELETE
+#endif //~ NSIS_SUPPORT_DELETE
case TOK_RMDIR:
#ifdef NSIS_SUPPORT_RMDIR
{
@@ -4703,10 +3548,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#endif
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_RMDIR
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_RMDIR not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_RMDIR
+#endif //~ NSIS_SUPPORT_RMDIR
case TOK_RESERVEFILE:
case TOK_FILE:
#ifdef NSIS_SUPPORT_FILE
@@ -4725,7 +3570,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#ifdef _WIN32
attrib=1;
#else
- warning_fl(_T("%") NPRIs _T("File /a is disabled for non Win32 platforms."),(which_token == TOK_FILE)?_T(""):_T("Reserve"));
+ warning_fl(DW_UNSUPP_STORE_FILE_ATT, _T("%") NPRIs _T("File /a is disabled for non Win32 platforms."),(which_token == TOK_FILE)?_T(""):_T("Reserve"));
#endif
a++;
}
@@ -4760,14 +3605,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
else
{
- warning_fl(_T("%") NPRIs _T("File: \"%") NPRIs _T("\" -> no files found"),(which_token == TOK_FILE)?_T(""):_T("Reserve"),line.gettoken_str(a));
+ warning_fl(DW_FILE_NONFATAL_NOT_FOUND, _T("%") NPRIs _T("File: \"%") NPRIs _T("\" -> no files found"),(which_token == TOK_FILE)?_T(""):_T("Reserve"),line.gettoken_str(a));
- // workaround for bug #1299100
- // add a nop opcode so relative jumps will work as expected
+ // workaround for bug #1299100: add a nop opcode so relative jumps will work as expected
add_entry_direct(EW_NOP);
}
}
-
return PS_OK;
}
if (!_tcsnicmp(line.gettoken_str(a),_T("/x"),2))
@@ -4825,16 +3668,16 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
else
{
- warning_fl(_T("%") NPRIs _T("File: \"%") NPRIs _T("\" -> no files found."),(which_token == TOK_FILE)?_T(""):_T("Reserve"),t);
+ warning_fl(DW_FILE_NONFATAL_NOT_FOUND, _T("%") NPRIs _T("File: \"%") NPRIs _T("\" -> no files found."),(which_token == TOK_FILE)?_T(""):_T("Reserve"),t);
}
}
}
}
return PS_OK;
-#else//!NSIS_SUPPORT_FILE
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_FILE not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_FILE
+#endif //~ NSIS_SUPPORT_FILE
#ifdef NSIS_SUPPORT_COPYFILES
case TOK_COPYFILES:
{
@@ -4870,21 +3713,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
DefineInnerLangString(NLF_COPY_TO);
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_COPYFILES
+#else
case TOK_COPYFILES:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_COPYFILES not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_COPYFILES
-
+#endif //~ NSIS_SUPPORT_COPYFILES
case TOK_SETFILEATTRIBUTES:
{
#define MBD(x) {x,_T(#x)},
- struct
- {
- int id;
- const TCHAR *str;
- } list[]=
- {
+ struct { int id; const TCHAR *str; } list[] = {
MBD(FILE_ATTRIBUTE_NORMAL)
MBD(FILE_ATTRIBUTE_ARCHIVE)
MBD(FILE_ATTRIBUTE_HIDDEN)
@@ -4892,7 +3729,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
MBD(FILE_ATTRIBUTE_READONLY)
MBD(FILE_ATTRIBUTE_SYSTEM)
MBD(FILE_ATTRIBUTE_TEMPORARY)
- {FILE_ATTRIBUTE_NORMAL,_T("NORMAL")},
+ {FILE_ATTRIBUTE_NORMAL,_T("NORMAL")}, // Short alias
{FILE_ATTRIBUTE_ARCHIVE,_T("ARCHIVE")},
{FILE_ATTRIBUTE_HIDDEN,_T("HIDDEN")},
{FILE_ATTRIBUTE_OFFLINE,_T("OFFLINE")},
@@ -4960,19 +3797,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ent.which=EW_SETFLAG;
ent.offsets[0]=FLAG_OFFSET(status_update);
int k=line.gettoken_enum(1,_T("both\0textonly\0listonly\0none\0lastused\0"));
- if (k<0) PRINTHELP()
+ if (k < 0) PRINTHELP()
if (k == 4)
- {
- ent.offsets[2]=1;
- }
+ ent.offsets[2]=1; // lastused
else
- {
- // both 0
- // textonly 2
- // listonly 4
- // none 6
- ent.offsets[1]=add_intstring(k*2);
- }
+ ent.offsets[1]=add_intstring(k*2); // both=0, textonly=2, listonly=4, none=6
SCRIPT_MSG(_T("SetDetailsPrint: %") NPRIs _T("\n"),line.gettoken_str(1));
}
return add_entry(&ent);
@@ -5153,7 +3982,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_STROPTS
+#else
case TOK_GETDLLVERSIONLOCAL:
case TOK_GETFILETIMELOCAL:
case TOK_GETFUNCTIONADDR:
@@ -5165,7 +3994,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_STRCMPS:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_STROPTS not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_STROPTS
+#endif //~ NSIS_SUPPORT_STROPTS
#ifdef NSIS_SUPPORT_INIFILES
case TOK_DELETEINISEC:
case TOK_DELETEINISTR:
@@ -5210,7 +4039,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ent.offsets[3]=add_string(line.gettoken_str(2));
SCRIPT_MSG(_T("ReadINIStr %") NPRIs _T(" [%") NPRIs _T("]:%") NPRIs _T(" from %") NPRIs _T("\n"),line.gettoken_str(1),line.gettoken_str(3),line.gettoken_str(4),line.gettoken_str(2));
return add_entry(&ent);
-#else//!NSIS_SUPPORT_INIFILES
+#else
case TOK_DELETEINISEC:
case TOK_DELETEINISTR:
case TOK_FLUSHINI:
@@ -5218,7 +4047,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_READINISTR:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_INIFILES not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_INIFILES
+#endif //~ NSIS_SUPPORT_INIFILES
case TOK_DETAILPRINT:
ent.which=EW_UPDATETEXT;
ent.offsets[0]=add_string(line.gettoken_str(1));
@@ -5263,7 +4092,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_GETFULLPATHNAME:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_FNUTIL not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif
+#endif //~ NSIS_SUPPORT_FNUTIL
case TOK_GETDLLVERSION:
#ifdef NSIS_SUPPORT_GETDLLVERSION
ent.which=EW_GETDLLVERSION;
@@ -5274,10 +4103,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("GetDLLVersion: %") NPRIs _T("->%") NPRIs _T(",%") NPRIs _T("\n"),
line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3));
return add_entry(&ent);
-#else//!NSIS_SUPPORT_GETDLLVERSION
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_GETDLLVERSION not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_GETDLLVERSION
+#endif //~ NSIS_SUPPORT_GETDLLVERSION
case TOK_GETFILETIME:
#ifdef NSIS_SUPPORT_GETFILETIME
ent.which=EW_GETFILETIME;
@@ -5288,10 +4117,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("GetFileTime: %") NPRIs _T("->%") NPRIs _T(",%") NPRIs _T("\n"),
line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3));
return add_entry(&ent);
-#else//!NSIS_SUPPORT_GETFILETIME
+#else
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_GETFILETIME not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_GETFILETIME
+#endif //~ NSIS_SUPPORT_GETFILETIME
#ifdef NSIS_SUPPORT_INTOPTS
case TOK_INTOP:
ent.which=EW_INTOP;
@@ -5328,30 +4157,29 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("%") NPRIs _T(" %") NPRIs _T(":%") NPRIs _T(" equal=%") NPRIs _T(", < %") NPRIs _T(", > %") NPRIs _T("\n"),line.gettoken_str(0),
line.gettoken_str(1),line.gettoken_str(2), line.gettoken_str(3),line.gettoken_str(4),line.gettoken_str(5));
return add_entry(&ent);
-#else//!NSIS_SUPPORT_INTOPTS
+#else
case TOK_INTOP:
case TOK_INTCMP:
case TOK_INTFMT:
case TOK_INTCMPU:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_INTOPTS not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_INTOPTS
+#endif //~ NSIS_SUPPORT_INTOPTS
#ifdef NSIS_SUPPORT_REGISTRYFUNCTIONS
case TOK_READREGSTR:
case TOK_READREGDWORD:
{
ent.which=EW_READREGSTR;
ent.offsets[0]=GetUserVarIndex(line, 1);
- int k=line.gettoken_enum(2,rootkeys[0]);
- if (k == -1) k=line.gettoken_enum(2,rootkeys[1]);
- if (ent.offsets[0] == -1 || k == -1) PRINTHELP()
- ent.offsets[1]=REGROOTKEYTOINT(rootkey_tab[k]);
+ HKEY hRK = ParseRegRootKey(line,2);
+ if (ent.offsets[0] == -1 || INVALIDREGROOT == hRK) PRINTHELP()
+ ent.offsets[1]=REGROOTKEYTOINT(hRK);
ent.offsets[2]=add_string(line.gettoken_str(3));
ent.offsets[3]=add_string(line.gettoken_str(4));
if (which_token == TOK_READREGDWORD) ent.offsets[4]=1;
else ent.offsets[4]=0;
if (line.gettoken_str(3)[0] == _T('\\'))
- warning_fl(_T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
+ warning_fl(DW_PARSE_REGPATHPREFIX, _T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
SCRIPT_MSG(_T("%") NPRIs _T(" %") NPRIs _T(" %") NPRIs _T("\\%") NPRIs _T("\\%") NPRIs _T("\n"),line.gettoken_str(0),
line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3),line.gettoken_str(4));
@@ -5360,91 +4188,74 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_DELETEREGVALUE:
case TOK_DELETEREGKEY:
{
- int a=1;
- if (which_token==TOK_DELETEREGKEY)
+ int a=1, iskeyop;
+ if ((iskeyop = which_token == TOK_DELETEREGKEY))
{
- ent.offsets[4]=1;
TCHAR *s=line.gettoken_str(a);
if (s[0] == _T('/'))
{
if (_tcsicmp(s,_T("/ifempty"))) PRINTHELP()
- a++;
- ent.offsets[4]=3;
+ a++, ent.offsets[4]|=(DELREGKEY_ONLYIFNOSUBKEYS<<DELREGKEYFLAGSSHIFT);
}
if (line.gettoken_str(a+2)[0]) PRINTHELP()
}
- int k=line.gettoken_enum(a,rootkeys[0]);
- if (k == -1) k=line.gettoken_enum(a,rootkeys[1]);
- if (k == -1) PRINTHELP()
+ HKEY hRK=ParseRegRootKey(line,a);
+ if (INVALIDREGROOT == hRK) PRINTHELP()
ent.which=EW_DELREG;
- ent.offsets[1]=REGROOTKEYTOINT(rootkey_tab[k]);
+ ent.offsets[1]=REGROOTKEYTOINTEX(hRK, iskeyop); // DELETEREGKEY needs the REGSAM view bits in parm4 and NOT in HKEY while DELETEREGVALUE needs them in HKEY.
ent.offsets[2]=add_string(line.gettoken_str(a+1));
- ent.offsets[3]=(which_token==TOK_DELETEREGKEY)?0:add_string(line.gettoken_str(a+2));
+ ent.offsets[3]=iskeyop ? 0 : add_string(line.gettoken_str(a+2));
+ ent.offsets[4]|=iskeyop ? DELREG_KEY|(REGROOTVIEWTOSAMVIEW(hRK)<<DELREGKEYFLAGSSHIFT) : DELREG_VALUE;
if (line.gettoken_str(a+1)[0] == _T('\\'))
- warning_fl(_T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
- if (which_token==TOK_DELETEREGKEY)
+ warning_fl(DW_PARSE_REGPATHPREFIX, _T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
+ if (iskeyop)
SCRIPT_MSG(_T("DeleteRegKey: %") NPRIs _T("\\%") NPRIs _T("\n"),line.gettoken_str(a),line.gettoken_str(a+1));
else
SCRIPT_MSG(_T("DeleteRegValue: %") NPRIs _T("\\%") NPRIs _T("\\%") NPRIs _T("\n"),line.gettoken_str(a),line.gettoken_str(a+1),line.gettoken_str(a+2));
}
return add_entry(&ent);
- case TOK_WRITEREGSTR:
- case TOK_WRITEREGEXPANDSTR:
- case TOK_WRITEREGBIN:
+ case TOK_WRITEREGSTR: case TOK_WRITEREGEXPANDSTR:
+ case TOK_WRITEREGBIN: case TOK_WRITEREGNONE:
+ case TOK_WRITEREGMULTISZ:
case TOK_WRITEREGDWORD:
{
- int k=line.gettoken_enum(1,rootkeys[0]);
- if (k == -1) k=line.gettoken_enum(1,rootkeys[1]);
- if (k == -1) PRINTHELP()
+ const TCHAR*cmdname=get_commandtoken_name(which_token);
+ int reg5=0==line.gettoken_enum(1,_T("/REGEDIT5\0")), multisz=which_token == TOK_WRITEREGMULTISZ;
+ if (reg5) line.eattoken();
+ HKEY hRK=ParseRegRootKey(line,1);
+ if (INVALIDREGROOT == hRK || reg5 != multisz) PRINTHELPEX(cmdname); // WriteRegMultiStr only supports the /REGEDIT5 serialized format right now but we really should allow variables at some point.
ent.which=EW_WRITEREG;
- ent.offsets[0]=REGROOTKEYTOINT(rootkey_tab[k]);
+ ent.offsets[0]=REGROOTKEYTOINT(hRK);
ent.offsets[1]=add_string(line.gettoken_str(2));
if (line.gettoken_str(2)[0] == _T('\\'))
- warning_fl(_T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
+ warning_fl(DW_PARSE_REGPATHPREFIX, _T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),cmdname);
ent.offsets[2]=add_string(line.gettoken_str(3));
if (which_token == TOK_WRITEREGSTR || which_token == TOK_WRITEREGEXPANDSTR)
{
SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\\%") NPRIs _T("\\%") NPRIs _T("=%") NPRIs _T("\n"),
- line.gettoken_str(0),line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3),line.gettoken_str(4));
+ cmdname,line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3),line.gettoken_str(4));
ent.offsets[3]=add_string(line.gettoken_str(4));
ent.offsets[4]=ent.offsets[5]=REG_SZ;
if (which_token == TOK_WRITEREGEXPANDSTR)
ent.offsets[5]=REG_EXPAND_SZ;
}
- if (which_token == TOK_WRITEREGBIN)
+ if (which_token == TOK_WRITEREGBIN || multisz || which_token == TOK_WRITEREGNONE)
{
- char data[3*NSIS_MAX_STRLEN]; // Jim Park: Keep the data as char / 8 bits
- TCHAR *p=line.gettoken_str(4);
- int data_len=0;
- while (*p)
+ char data[3*NSIS_MAX_STRLEN];
+ int data_len=line.gettoken_binstrdata(4, data, sizeof(data)), none=which_token == TOK_WRITEREGNONE;
+ if (data_len < 0)
{
- int c;
- int a,b;
- a=*p;
- if (a >= _T('0') && a <= _T('9')) a-=_T('0');
- else if (a >= _T('a') && a <= _T('f')) a-=_T('a')-10;
- else if (a >= _T('A') && a <= _T('F')) a-=_T('A')-10;
- else break;
- b=*++p;
- if (b >= _T('0') && b <= _T('9')) b-=_T('0');
- else if (b >= _T('a') && b <= _T('f')) b-=_T('a')-10;
- else if (b >= _T('A') && b <= _T('F')) b-=_T('A')-10;
- else break;
- p++;
- c=(a<<4)|b;
- if (data_len >= 3*NSIS_MAX_STRLEN)
- {
- ERROR_MSG(_T("WriteRegBin: %d bytes of data exceeded\n"),3*NSIS_MAX_STRLEN);
- return PS_ERROR;
- }
- data[data_len++]=c;
+ if (data_len == -2) PRINTHELPEX(cmdname);
+ ERROR_MSG(_T("%") NPRIs _T(": %d bytes of data exceeded\n"),cmdname,sizeof(data));
+ return PS_ERROR;
}
- if (*p) PRINTHELP()
- SCRIPT_MSG(_T("WriteRegBin: %") NPRIs _T("\\%") NPRIs _T("\\%") NPRIs _T("=%") NPRIs _T("\n"),
- line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3),line.gettoken_str(4));
+ if (multisz && (data_len < 4 || 0 != read_ptr_as<UINT32>(&data[data_len-4]))) PRINTHELPEX(cmdname); // Must end with 4 zero bytes
+ SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\\%") NPRIs _T("\\%") NPRIs _T("=%") NPRIs _T("\n"),
+ cmdname,line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3),line.gettoken_str(4));
+ if (multisz && !build_unicode) for (int p1=0, p2=p1; p1 < data_len; data_len--) data[p1++]=data[p2], p2+=2; // BUGBUG: Should convert each string from UTF-16 to DBCS but only exehead knows the codepage, limited to ASCII for now.
ent.offsets[3]=add_db_data(data,data_len);
if (ent.offsets[3] < 0) return PS_ERROR;
- ent.offsets[4]=ent.offsets[5]=REG_BINARY;
+ ent.offsets[4]=REG_BINARY, ent.offsets[5]=none?REG_NONE:multisz?REG_MULTI_SZ:REG_BINARY;
}
if (which_token == TOK_WRITEREGDWORD)
{
@@ -5461,19 +4272,18 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
{
ent.which=EW_REGENUM;
ent.offsets[0]=GetUserVarIndex(line, 1);
- int k=line.gettoken_enum(2,rootkeys[0]);
- if (k == -1) k=line.gettoken_enum(2,rootkeys[1]);
- if (ent.offsets[0] == -1 || k == -1) PRINTHELP()
- ent.offsets[1]=REGROOTKEYTOINT(rootkey_tab[k]);
+ HKEY hRK=ParseRegRootKey(line,2);
+ if (ent.offsets[0] == -1 || INVALIDREGROOT == hRK) PRINTHELP()
+ ent.offsets[1]=REGROOTKEYTOINT(hRK);
ent.offsets[2]=add_string(line.gettoken_str(3));
ent.offsets[3]=add_string(line.gettoken_str(4));
ent.offsets[4]=which_token == TOK_ENUMREGKEY;
- if (line.gettoken_str(3)[0] == _T('\\')) warning_fl(_T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
+ if (line.gettoken_str(3)[0] == _T('\\')) warning_fl(DW_PARSE_REGPATHPREFIX, _T("%") NPRIs _T(": registry path name begins with \'\\\', may cause problems"),line.gettoken_str(0));
SCRIPT_MSG(_T("%") NPRIs _T(" %") NPRIs _T(" %") NPRIs _T("\\%") NPRIs _T("\\%") NPRIs _T("\n"),which_token == TOK_ENUMREGKEY ? _T("EnumRegKey") : _T("EnumRegValue"),
line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3),line.gettoken_str(4));
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_REGISTRYFUNCTIONS
+#else
case TOK_READREGSTR:
case TOK_READREGDWORD:
case TOK_DELETEREGVALUE:
@@ -5481,12 +4291,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_WRITEREGSTR:
case TOK_WRITEREGEXPANDSTR:
case TOK_WRITEREGBIN:
+ case TOK_WRITEREGMULTISZ:
case TOK_WRITEREGDWORD:
case TOK_ENUMREGKEY:
case TOK_ENUMREGVAL:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_REGISTRYFUNCTIONS not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_REGISTRYFUNCTIONS
+#endif //~ NSIS_SUPPORT_REGISTRYFUNCTIONS
#ifdef NSIS_SUPPORT_STACK
case TOK_EXCH:
{
@@ -5537,13 +4348,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (ent.offsets[0] < 0) PRINTHELP()
SCRIPT_MSG(_T("Pop: %") NPRIs _T("\n"),line.gettoken_str(1));
return add_entry(&ent);
-#else//!NSIS_SUPPORT_STACK
+#else
case TOK_POP:
case TOK_PUSH:
case TOK_EXCH:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_STACK not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_STACK
+#endif //~ NSIS_SUPPORT_STACK
#ifdef NSIS_SUPPORT_ENVIRONMENT
case TOK_READENVSTR:
ent.which=EW_READENVSTR;
@@ -5567,12 +4378,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (ent.offsets[0] < 0) PRINTHELP()
SCRIPT_MSG(_T("ExpandEnvStrings: %") NPRIs _T("->%") NPRIs _T("\n"),line.gettoken_str(2),line.gettoken_str(1));
return add_entry(&ent);
-#else//!NSIS_SUPPORT_ENVIRONMENT
+#else
case TOK_EXPANDENVSTRS:
case TOK_READENVSTR:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_ENVIRONMENT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_ENVIRONMENT
+#endif //~ NSIS_SUPPORT_ENVIRONMENT
#ifdef NSIS_SUPPORT_FINDFIRST
case TOK_FINDFIRST:
ent.which=EW_FINDFIRST;
@@ -5595,13 +4406,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (ent.offsets[0] < 0) PRINTHELP()
SCRIPT_MSG(_T("FindClose: %") NPRIs _T("\n"),line.gettoken_str(1));
return add_entry(&ent);
-#else//!NSIS_SUPPORT_FINDFIRST
+#else
case TOK_FINDCLOSE:
case TOK_FINDNEXT:
case TOK_FINDFIRST:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_FINDFIRST not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_FINDFIRST
+#endif //~ NSIS_SUPPORT_FINDFIRST
#ifdef NSIS_SUPPORT_FILEFUNCTIONS
case TOK_FILEOPEN:
{
@@ -5732,7 +4543,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (ent.offsets[0]<0) PRINTHELP()
SCRIPT_MSG(_T("FileWriteWord: %") NPRIs _T("->%") NPRIs _T("\n"),line.gettoken_str(2),line.gettoken_str(1));
return add_entry(&ent);
-#endif
+#endif //~ _UNICODE
case TOK_FILESEEK:
{
const TCHAR *modestr;
@@ -5760,7 +4571,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_FILEFUNCTIONS
+#else
case TOK_FILEOPEN:
case TOK_FILECLOSE:
case TOK_FILESEEK:
@@ -5776,7 +4587,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#endif
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_FILEFUNCTIONS not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_FILEFUNCTIONS
+#endif //~ NSIS_SUPPORT_FILEFUNCTIONS
#ifdef NSIS_SUPPORT_REBOOT
case TOK_REBOOT:
{
@@ -5808,13 +4619,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ent.offsets[1]=add_intstring(k);
}
return add_entry(&ent);
-#else//!NSIS_SUPPORT_REBOOT
+#else
case TOK_REBOOT:
case TOK_IFREBOOTFLAG:
case TOK_SETREBOOTFLAG:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_REBOOT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_REBOOT
+#endif //~ NSIS_SUPPORT_REBOOT
#ifdef NSIS_CONFIG_LOG
case TOK_LOGSET:
ent.which=EW_LOG;
@@ -5829,13 +4640,12 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ent.offsets[1]=add_string(line.gettoken_str(1));
SCRIPT_MSG(_T("LogText \"%") NPRIs _T("\"\n"),line.gettoken_str(1));
return add_entry(&ent);
-#else//!NSIS_CONFIG_LOG
-
+#else
case TOK_LOGSET:
case TOK_LOGTEXT:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_LOG not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_CONFIG_LOG
+#endif //~ NSIS_CONFIG_LOG
#ifdef NSIS_CONFIG_COMPONENTPAGE
case TOK_SECTIONSETTEXT:
ent.which=EW_SECTIONSET;
@@ -5932,7 +4742,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
if (ent.offsets[1]<0) PRINTHELP()
SCRIPT_MSG(_T("GetCurInstType: %") NPRIs _T("\n"),line.gettoken_str(1));
return add_entry(&ent);
-#else//!NSIS_CONFIG_COMPONENTPAGE
+#else
case TOK_SECTIONSETTEXT:
case TOK_SECTIONGETTEXT:
case TOK_SECTIONSETFLAGS:
@@ -5945,7 +4755,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_GETCURINSTTYPE:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_COMPONENTPAGE not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_CONFIG_COMPONENTPAGE
+#endif //~ NSIS_CONFIG_COMPONENTPAGE
#ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT
case TOK_SETBRANDINGIMAGE:
{
@@ -5978,13 +4788,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG(_T("\n"));
}
return add_entry(&ent);
-#else//NSIS_CONFIG_ENHANCEDUI_SUPPORT
+#else
case TOK_SETBRANDINGIMAGE:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_ENHANCEDUI_SUPPORT not defined.\n"),line.gettoken_str(0));
return PS_ERROR;
-#endif//!NSIS_SUPPORT_CREATEFONT
-
- // Added by ramon 3 jun 2003
+#endif //~ NSIS_SUPPORT_CREATEFONT
case TOK_DEFVAR:
{
int a=1;
@@ -6005,8 +4813,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
return DeclaredUserVar(line.gettoken_str(a));
}
return PS_OK;
-
- // Added by ramon 6 jun 2003
#ifdef NSIS_SUPPORT_VERSION_INFO
case TOK_VI_ADDKEY:
{
@@ -6086,19 +4892,28 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
}
return PS_OK;
-
#else
case TOK_VI_ADDKEY:
case TOK_VI_SETPRODUCTVERSION:
case TOK_VI_SETFILEVERSION:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_SUPPORT_VERSION_INFO not defined.\n"),line.gettoken_str(0));
return PS_ERROR;
-#endif
+#endif //~ NSIS_SUPPORT_VERSION_INFO
+ case TOK_LOCKWINDOW:
+#ifdef NSIS_LOCKWINDOW_SUPPORT
+ SCRIPT_MSG(_T("LockWindow: lock state=%d\n"),line.gettoken_str(1));
+ ent.which=EW_LOCKWINDOW;
+ ent.offsets[0]=line.gettoken_enum(1,_T("on\0off\0"));
+ if (ent.offsets[0] == -1) PRINTHELP();
+ return add_entry(&ent);
+#else
+ ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_LOCKWINDOW_SUPPORT not defined.\n"),line.gettoken_str(0));
+ return PS_ERROR;
+#endif //~ NSIS_LOCKWINDOW_SUPPORT
// end of instructions
///////////////////////////////////////////////////////////////////////////////
- // Added by Ximon Eighteen 5th August 2002
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
case TOK_PLUGINDIR:
{
@@ -6145,9 +4960,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
ent.offsets[0]=ns_func.add(uninstall_mode?_T("un.Initialize_____Plugins"):_T("Initialize_____Plugins"),0);
if ((ret=add_entry(&ent)) != PS_OK) return ret;
- // DLL name on the users machine
TCHAR tempDLL[NSIS_MAX_STRLEN];
- wsprintf(tempDLL, _T("$PLUGINSDIR\\%") NPRIs, dllName.c_str());
+ wsprintf(tempDLL, _T("$PLUGINSDIR\\%") NPRIs, dllName.c_str()); // DLL name on the end-users machine
// Add the DLL to the installer
if (data_handle == -1)
@@ -6171,7 +4985,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
m_pPlugins->SetDllDataHandle(!!uninstall_mode, command, data_handle);
build_overwrite=old_build_overwrite;
build_datesave=old_build_datesave;
- // Added by ramon 23 May 2003
build_allowskipfiles=old_build_allowskipfiles;
}
else
@@ -6209,7 +5022,6 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
// First push dll args
-
int parmst=i; // we push 'em in reverse order
int nounloadmisused=0;
for (; i < line.getnumtokens(); i++) {
@@ -6224,7 +5036,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
SCRIPT_MSG(_T("\n"));
if (nounloadmisused)
- warning_fl(_T("/NOUNLOAD must come first before any plugin parameter. Unless the plugin you are trying to use has a parameter /NOUNLOAD, you are doing something wrong"));
+ warning_fl(DW_PLUGIN_NOUNLOAD_PLACEMENT, _T("/NOUNLOAD must come first before any plugin parameter. Unless the plugin you are trying to use has a parameter /NOUNLOAD, you are doing something wrong"));
// next, call it
ent.which=EW_REGISTERDLL;
@@ -6262,20 +5074,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
case TOK_INITPLUGINSDIR:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_PLUGIN_SUPPORT not defined.\n"),line.gettoken_str(0));
return PS_ERROR;
-#endif// NSIS_CONFIG_PLUGIN_SUPPORT
-
-#ifdef NSIS_LOCKWINDOW_SUPPORT
- case TOK_LOCKWINDOW:
- SCRIPT_MSG(_T("LockWindow: lock state=%d\n"),line.gettoken_str(1));
- ent.which=EW_LOCKWINDOW;
- ent.offsets[0]=line.gettoken_enum(1,_T("on\0off\0"));
- if (ent.offsets[0] == -1) PRINTHELP();
- return add_entry(&ent);
-#else
- case TOK_LOCKWINDOW:
- ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_LOCKWINDOW_SUPPORT not defined.\n"),line.gettoken_str(0));
- return PS_ERROR;
-#endif // NSIS_LOCKWINDOW_SUPPORT
+#endif //~ NSIS_CONFIG_PLUGIN_SUPPORT
default:
break;
@@ -6570,7 +5369,6 @@ int CEXEBuild::add_file(const tstring& dir, const tstring& file, int attrib, con
#endif
}
}
-
return PS_OK;
}
@@ -6585,7 +5383,6 @@ int CEXEBuild::do_add_file_create_dir(const tstring& local_dir, const tstring& d
}
int outdir = add_string(outdir_s.c_str());
-
if (add_entry_direct(EW_CREATEDIR, outdir, 1) != PS_OK) {
return PS_ERROR;
}
@@ -6593,7 +5390,6 @@ int CEXEBuild::do_add_file_create_dir(const tstring& local_dir, const tstring& d
#ifdef _WIN32
if (attrib) {
int ndc = add_asciistring(_T("."));
-
DWORD attr = GetFileAttributes(local_dir.c_str());
if (attr != INVALID_FILE_ATTRIBUTES)
{
@@ -6604,58 +5400,15 @@ int CEXEBuild::do_add_file_create_dir(const tstring& local_dir, const tstring& d
}
}
#endif
-
return PS_OK;
}
#endif
-DefineList *CEXEBuild::searchParseString(const TCHAR *source_string, LineParser&line, int parmOffs, bool ignCase, bool noErrors, UINT*failParam)
-{
- const bool allowEmptyFirstTok = true;
- if (failParam) *failParam = 0;
- DefineList *ret = NULL;
- const TCHAR *defout = 0, *src_start = 0, *tok;
- int toklen = 0, maxlen;
- for (;;)
- {
- tok = line.gettoken_str(parmOffs++);
- const bool lasttoken = parmOffs > line.getnumtokens();
- if (!*tok)
- tok = 0, maxlen = -1; // No more tokens to search for, save the rest of the string
- else
- {
- toklen = (int) _tcslen(tok);
- while (*source_string && (ignCase?_tcsnicmp(source_string,tok,toklen):_tcsncmp(source_string,tok,toklen))) source_string++;
- maxlen = (int)(source_string - src_start); // Length of previous string
- }
- if (defout && defout[0]) // We now know the start and length of the previous string, add it to the list
- {
- if (!ret) ret = new DefineList();
- if (maxlen < 0)
- ret->add(defout,src_start);
- else
- ret->addn(defout,maxlen,src_start);
- }
- if (!tok && lasttoken) break;
- if (!*source_string || (allowEmptyFirstTok ? false : !tok)) // We did not find the requested token!
- {
- if (failParam) *failParam = ret ? ret->getnum() : 0;
- if (noErrors) break; // Caller is OK with a incomplete list of matched strings
- const TCHAR *msgprefix = src_start ? _T("") : _T("starting ");
- ERROR_MSG(_T("!searchparse: %") NPRIs _T("string \"%") NPRIs _T("\" not found, aborted search!\n"),msgprefix,tok?tok:_T("(null)"));
- delete ret;
- return NULL;
- }
- defout = line.gettoken_str(parmOffs++), src_start = source_string += toklen;
- }
- return ret;
-}
-
LANGID CEXEBuild::ParseLangIdParameter(const LineParser&line, int token)
{
int succ, lid = line.gettoken_int(token, &succ);
if (!lid) lid = last_used_lang;
if (!succ)
- warning_fl(_T("\"%") NPRIs _T("\" is not a valid language id, using language id %u!"), line.gettoken_str(token), lid);
+ warning_fl(DW_BAD_LANGID, _T("\"%") NPRIs _T("\" is not a valid language id, using language id %u!"), line.gettoken_str(token), lid);
return lid;
}
diff --git a/Source/scriptpp.cpp b/Source/scriptpp.cpp
new file mode 100755
index 0000000..7674294
--- /dev/null
+++ b/Source/scriptpp.cpp
@@ -0,0 +1,1233 @@
+/*
+ * scriptpp.cpp
+ *
+ * This file is a part of NSIS.
+ *
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
+ *
+ * Licensed under the zlib/libpng license (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ * Licence details can be found in the file COPYING.
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ */
+
+#include "Platform.h"
+#include <stdio.h>
+#include <ctype.h>
+#include "tstring.h"
+#include "lineparse.h"
+#include <nsis-version.h>
+#include "tokens.h"
+#include "build.h"
+#include "utf.h"
+#include "util.h"
+#include "dirreader.h"
+#include <cassert> // for assert(3)
+#include <time.h>
+#include <algorithm>
+#include "boost/scoped_ptr.hpp"
+
+using namespace std;
+
+#ifdef _WIN32
+# include <direct.h> // for chdir
+#else
+# include <sys/stat.h> // for stat and umask
+# include <sys/types.h> // for mode_t
+# include <fcntl.h> // for O_RDONLY
+# include <unistd.h>
+# include <stdlib.h> // for mkstemp
+#endif
+
+#define MAX_INCLUDEDEPTH 10
+
+#define PRINTHELPEX(cmdname) { print_help((cmdname)); return PS_ERROR; }
+#define PRINTHELP() PRINTHELPEX(line.gettoken_str(0))
+static void PREPROCESSONLY_BEGINCOMMENT() { extern FILE *g_output; _ftprintf(g_output, _T("!if 0 /*\n")); }
+static void PREPROCESSONLY_ENDCOMMENT() { extern FILE *g_output; _ftprintf(g_output, _T("*/\n!endif\n")); }
+
+
+static UINT read_line_helper(NStreamLineReader&lr, TCHAR*buf, UINT cch)
+{
+ // Helper function for reading lines from text files. buf MUST be valid and cch MUST be > 1!
+ // Returns 0 on error or the number of characters read including the first \n, \r or \0.
+ // When it returns 0, buf[0] is 0 for EOF and NStream::ERR_* for errors.
+ UINT lrr = lr.ReadLine(buf, cch), eof = 0;
+ if (NStream::OK != lrr)
+ {
+ ++eof;
+ if (!lr.IsEOF())
+ {
+ buf[0] = (TCHAR) lrr;
+ return 0;
+ }
+ }
+ const bool unicode = lr.IsUnicode();
+ for(cch = 0;; ++cch)
+ if (!buf[cch] || NStream::IsNewline(buf[cch], unicode))
+ break;
+ if (cch) eof = 0; // Read something, postpone EOF
+ return ++cch - eof;
+}
+
+#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
+TCHAR *CEXEBuild::set_file_predefine(const TCHAR *filename)
+{
+ TCHAR *oldfileinfo = NULL;
+ TCHAR *oldfilename = definedlist.find(_T("__FILE__"));
+ TCHAR *oldfiledir = definedlist.find(_T("__FILEDIR__"));
+ if (oldfilename && oldfiledir)
+ {
+ oldfileinfo = new TCHAR[_tcslen(oldfilename)+1+_tcslen(oldfiledir)+1];
+ _tcscpy(oldfileinfo, oldfilename);
+ _tcscat(oldfileinfo, _T("|"));
+ _tcscat(oldfileinfo, oldfiledir);
+ definedlist.del(_T("__FILE__"));
+ definedlist.del(_T("__FILEDIR__"));
+ }
+ const TCHAR *p = _tcsrchr(filename,_T('\\')), *p2 = _tcsrchr(filename,_T('/'));
+ if (p2 > p) p = p2;
+ if (p) p++; else p = filename;
+ definedlist.add(_T("__FILE__"),p);
+ TCHAR dir[260]; // BUGBUG: MAX_PATH outside #ifdef _WIN32, should be PATH/NAME_MAX on POSIX?
+#ifdef _WIN32
+ LPTSTR lpFilePart;
+ GetFullPathName(filename, COUNTOF(dir), dir, &lpFilePart);
+ PathRemoveFileSpec(dir);
+#else
+ if (p == filename)
+ _tcscpy(dir, _T("."));
+ else
+ my_strncpy(dir, filename, p-filename+!0);
+#endif
+ definedlist.add(_T("__FILEDIR__"),dir);
+ return oldfileinfo;
+}
+void CEXEBuild::restore_file_predefine(TCHAR *oldfilename)
+{
+ definedlist.del(_T("__FILEDIR__"));
+ definedlist.del(_T("__FILE__"));
+ if (oldfilename)
+ {
+ TCHAR *oldfiledir = _tcschr(oldfilename, _T('|'));
+ definedlist.add(_T("__FILEDIR__"),oldfiledir+1);
+ *oldfiledir = '\0';
+ definedlist.add(_T("__FILE__"),oldfilename);
+ delete[] oldfilename;
+ }
+}
+
+TCHAR *CEXEBuild::set_timestamp_predefine(const TCHAR *filename)
+{
+ TCHAR *oldtimestamp = definedlist.find(_T("__TIMESTAMP__"));
+ if (oldtimestamp)
+ {
+ oldtimestamp = _tcsdup(oldtimestamp);
+ definedlist.del(_T("__TIMESTAMP__"));
+ }
+#ifdef _WIN32
+ TCHAR datebuf[128] = _T(""), timebuf[128] = _T(""), timestampbuf[256];
+ WIN32_FIND_DATA fd;
+ FILETIME floctime;
+ SYSTEMTIME stime;
+
+ HANDLE hSearch = FindFirstFile(filename, &fd);
+ if (hSearch != INVALID_HANDLE_VALUE)
+ {
+ FindClose(hSearch);
+
+ FileTimeToLocalFileTime(&fd.ftLastWriteTime, &floctime);
+ FileTimeToSystemTime(&floctime, &stime);
+ GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &stime, NULL, datebuf, COUNTOF(datebuf));
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &stime, NULL, timebuf, COUNTOF(timebuf));
+ wsprintf(timestampbuf,_T("%") NPRIs _T(" %") NPRIs,datebuf,timebuf);
+ definedlist.add(_T("__TIMESTAMP__"),timestampbuf);
+ }
+#else
+ struct stat st;
+ if (!_tstat(filename, &st))
+ definedlist.add(_T("__TIMESTAMP__"),PosixBug_CtoTString(ctime(&st.st_mtime)));
+#endif
+ return oldtimestamp;
+}
+void CEXEBuild::restore_timestamp_predefine(TCHAR *oldtimestamp)
+{
+ definedlist.del(_T("__TIMESTAMP__"));
+ if (oldtimestamp)
+ {
+ definedlist.add(_T("__TIMESTAMP__"),oldtimestamp);
+ free(oldtimestamp);
+ }
+}
+
+TCHAR *CEXEBuild::set_line_predefine(int linecnt, BOOL is_macro)
+{
+ TCHAR* linebuf = NULL;
+ MANAGE_WITH(linebuf, free);
+
+ TCHAR temp[128] = _T("");
+ _stprintf(temp,_T("%d"),linecnt);
+
+ TCHAR *oldline = definedlist.find(_T("__LINE__"));
+ if (oldline)
+ {
+ oldline = _tcsdup(oldline);
+ definedlist.del(_T("__LINE__"));
+ }
+ if (is_macro && oldline)
+ {
+ linebuf = (TCHAR *)malloc((_tcslen(oldline)+_tcslen(temp)+2)*sizeof(TCHAR));
+ _stprintf(linebuf,_T("%") NPRIs _T(".%") NPRIs,oldline,temp);
+ }
+ else
+ {
+ linebuf = _tcsdup(temp);
+ }
+ definedlist.add(_T("__LINE__"),linebuf);
+
+ return oldline;
+}
+void CEXEBuild::restore_line_predefine(TCHAR *oldline)
+{
+ definedlist.del(_T("__LINE__"));
+ if (oldline)
+ {
+ definedlist.add(_T("__LINE__"),oldline);
+ free(oldline);
+ }
+}
+
+void CEXEBuild::set_date_time_predefines()
+{
+ time_t etime;
+ struct tm *ltime;
+ TCHAR datebuf[128], timebuf[128];
+
+ time(&etime);
+ ltime = localtime(&etime);
+#ifdef _WIN32
+ SYSTEMTIME st;
+ st.wYear = ltime->tm_year+1900, st.wMonth = ltime->tm_mon + 1, st.wDay = ltime->tm_mday;
+ st.wHour = ltime->tm_hour, st.wMinute = ltime->tm_min, st.wSecond = ltime->tm_sec;
+ st.wMilliseconds = 0;
+ GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, datebuf, sizeof(datebuf));
+ definedlist.add(_T("__DATE__"), datebuf);
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, &st, NULL, timebuf, sizeof(timebuf));
+ definedlist.add(_T("__TIME__"), timebuf);
+#else
+ my_strftime(datebuf, sizeof(datebuf), _T("%x"), ltime);
+ definedlist.add(_T("__DATE__"), datebuf);
+ my_strftime(timebuf, sizeof(timebuf), _T("%X"), ltime);
+ definedlist.add(_T("__TIME__"), timebuf);
+#endif
+}
+void CEXEBuild::del_date_time_predefines()
+{
+ definedlist.del(_T("__DATE__"));
+ definedlist.del(_T("__TIME__"));
+}
+#endif
+
+TCHAR* CEXEBuild::GetMacro(const TCHAR *macroname, TCHAR**macroend /*= 0*/)
+{
+ TCHAR *t = (TCHAR*)m_macros.get(), *mbeg, *mbufbeg = t;
+ for (; t && *t; ++t)
+ {
+ mbeg = t;
+ const bool foundit = !_tcsicmp(mbeg, macroname);
+ t += _tcslen(t) + 1; // advance over macro name
+
+ // advance over parameters
+ while (*t) t += _tcslen(t) + 1;
+ t++;
+
+ // advance over data
+ while (*t) t += _tcslen(t) + 1;
+
+ if (foundit)
+ {
+ if (macroend) *macroend = ++t;
+ return mbeg;
+ }
+
+ if (t-mbufbeg >= m_macros.getlen()-1) break;
+ }
+ return 0;
+}
+
+int CEXEBuild::pp_macro(LineParser&line)
+{
+ const TCHAR*const macroname = line.gettoken_str(1);
+ if (!macroname[0]) PRINTHELP()
+ if (MacroExists(macroname))
+ {
+ ERROR_MSG(_T("!macro: macro named \"%") NPRIs _T("\" already exists!\n"), macroname);
+ return PS_ERROR;
+ }
+ m_macros.add(macroname, (int)(_tcslen(macroname)+1)*sizeof(TCHAR));
+
+ for (int pc=2; pc < line.getnumtokens(); pc++)
+ {
+ if (!line.gettoken_str(pc)[0])
+ {
+ ERROR_MSG(_T("!macro: macro parameter %d is empty, not valid!\n"), pc-1);
+ return PS_ERROR;
+ }
+ for (int a = 2; a < pc; a++)
+ {
+ if (!_tcsicmp(line.gettoken_str(pc), line.gettoken_str(a)))
+ {
+ ERROR_MSG(_T("!macro: macro parameter named %") NPRIs _T(" is used multiple times!\n"), line.gettoken_str(pc));
+ return PS_ERROR;
+ }
+ }
+ m_macros.add(line.gettoken_str(pc), (int)(_tcslen(line.gettoken_str(pc))+1)*sizeof(TCHAR));
+ }
+ m_macros.add(_T(""), sizeof(_T("")));
+
+ for (;;)
+ {
+ TCHAR *str = m_templinebuf, *p = str;
+ UINT lrres = curlinereader->ReadLine(str, MAX_LINELENGTH);
+ if (NStream::OK != lrres)
+ {
+ if (curlinereader->IsEOF())
+ {
+ if (!str[0])
+ {
+ ERROR_MSG(_T("!macro \"%") NPRIs _T("\": unterminated (no !macroend found in file)!\n"), macroname);
+ return PS_ERROR;
+ }
+ }
+ else
+ {
+ ERROR_MSG(curlinereader->GetErrorMessage(lrres).c_str());
+ return PS_ERROR;
+ }
+ }
+ //SCRIPT_MSG(_T("%") NPRIs _T("%") NPRIs, str, str[_tcslen(str)-1] == _T('\n') ? _T("") : _T("\n"));
+ // remove trailing whitespace
+ while (*p) p++;
+ if (p > str) p--;
+ while (p >= str && (*p == _T('\r') || *p == _T('\n') || *p == _T(' ') || *p == _T('\t'))) p--;
+ *++p = 0;
+ LineParser l2(false);
+ if (!l2.parse(str))
+ {
+ if (!_tcsicmp(l2.gettoken_str(0), _T("!macroend")))
+ {
+ linecnt++;
+ break;
+ }
+ if (!_tcsicmp(l2.gettoken_str(0), _T("!macro")))
+ {
+ ERROR_MSG(_T("Error: can't define a macro inside a macro!\n"));
+ return PS_ERROR;
+ }
+ }
+ if (str[0]) m_macros.add(str, (int)(_tcslen(str)+1)*sizeof(TCHAR));
+ else m_macros.add(_T(" "), sizeof(_T(" ")));
+ linecnt++;
+ }
+ m_macros.add(_T(""), sizeof(_T("")));
+ return PS_OK;
+}
+
+int CEXEBuild::pp_macroundef(LineParser&line)
+{
+ const TCHAR*const mname = line.gettoken_str(1);
+ if (!mname[0]) PRINTHELP()
+ TCHAR *mend, *mbeg = GetMacro(mname, &mend);
+ if (!mbeg)
+ {
+ ERROR_MSG(_T("!macroundef: \"%") NPRIs _T("\" does not exist!\n"), mname);
+ return PS_ERROR;
+ }
+ TCHAR *mbufb = (TCHAR*)m_macros.get();
+ const size_t mcb = ((mend)-mbeg)*sizeof(TCHAR), mbufcb = m_macros.getlen();
+ memmove(mbeg, mend, mbufcb-(((mbeg-mbufb)*sizeof(TCHAR))+mcb));
+ m_macros.resize(truncate_cast(int,(size_t)(mbufcb-mcb)));
+ SCRIPT_MSG(_T("!macroundef: %") NPRIs _T("\n"), mname);
+ return PS_OK;
+}
+
+int CEXEBuild::pp_insertmacro(LineParser&line)
+{
+ static unsigned char g_insertmacrorecursion = 0;
+ const TCHAR*const macroname = line.gettoken_str(1);
+ if (!macroname[0]) PRINTHELP()
+ TCHAR *t = GetMacro(macroname), *m = (TCHAR *)m_macros.get();
+ SCRIPT_MSG(_T("!insertmacro: %") NPRIs _T("\n"), macroname);
+ if (!t)
+ {
+ ERROR_MSG(_T("!insertmacro: macro named \"%") NPRIs _T("\" not found!\n"), macroname);
+ return PS_ERROR;
+ }
+ t+=_tcslen(t)+1;
+
+ GrowBuf l_define_names;
+ DefineList l_define_saves;
+ int npr = 0;
+ // advance over params
+ while (*t)
+ {
+ TCHAR *v = definedlist.find(t);
+ if (v)
+ {
+ l_define_saves.add(t,v);
+ definedlist.del(t);
+ }
+ l_define_names.add(t, (int)(_tcslen(t)+1)*sizeof(TCHAR));
+ definedlist.add(t, line.gettoken_str(npr+2));
+
+ npr++;
+ t += _tcslen(t)+1;
+ }
+ l_define_names.add(_T(""), sizeof(_T("")));
+ t++;
+ if (npr != line.getnumtokens()-2)
+ {
+ ERROR_MSG(_T("!insertmacro: macro \"%") NPRIs _T("\" requires %d parameter(s), passed %d!\n"), macroname, npr,line.getnumtokens()-2);
+ return PS_ERROR;
+ }
+ if (++g_insertmacrorecursion > MAX_MACRORECURSION)
+ {
+ ERROR_MSG(_T("!insertmacro: insert depth is limited to %u macros!\n"), MAX_MACRORECURSION);
+ return PS_ERROR;
+ }
+ const bool oldparserinsidecomment = inside_comment;
+ inside_comment = false; // "!insertmacro foo /*" does not mean that the macro body is a comment
+ TCHAR str[1024];
+ wsprintf(str, _T("macro:%") NPRIs, macroname);
+ const TCHAR *oldmacroname = m_currentmacroname;
+ m_currentmacroname = macroname;
+ definedlist.set(_T("__MACRO__"), m_currentmacroname);
+ int lp = 0;
+ while (*t)
+ {
+ lp++;
+ if (_tcscmp(t, _T(" ")))
+ {
+ int ret = process_oneline(t, str, lp);
+ if (ret != PS_OK)
+ {
+ ERROR_MSG(_T("Error in macro %") NPRIs _T(" on macroline %d\n"), macroname, lp);
+ return ret;
+ }
+ }
+ {
+ // fix t if process_oneline changed m_macros
+ TCHAR *nm = (TCHAR*)m_macros.get();
+ if (nm != m) t += nm - m, m = nm;
+ }
+ t += _tcslen(t)+1;
+ }
+ {
+ TCHAR *p = (TCHAR*)l_define_names.get();
+ while (*p)
+ {
+ definedlist.del(p);
+ TCHAR *v;
+ if ((v = l_define_saves.find(p)))
+ definedlist.add(p,v);
+ p += _tcslen(p)+1;
+ }
+ }
+ definedlist.del(_T("__MACRO__"));
+ m_currentmacroname = oldmacroname;
+ if (oldmacroname) definedlist.add(_T("__MACRO__"), oldmacroname);
+ inside_comment = oldparserinsidecomment;
+ --g_insertmacrorecursion;
+ SCRIPT_MSG(_T("!insertmacro: end of %") NPRIs _T("\n"), macroname);
+ return PS_OK;
+}
+
+int CEXEBuild::pp_tempfile(LineParser&line)
+{
+ TCHAR *symbol = line.gettoken_str(1);
+ const TCHAR *fpath;
+#ifdef _WIN32
+ TCHAR buf[MAX_PATH], buf2[MAX_PATH];
+ GetTempPath(MAX_PATH, buf);
+ if (!GetTempFileName(buf, _T("nst"), 0, buf2))
+ {
+ ERROR_MSG(_T("!tempfile: unable to create temporary file.\n"));
+ return PS_ERROR;
+ }
+ fpath = buf2;
+#else // !_WIN32
+ char t[] = ("/tmp/makensisXXXXXX");
+ const mode_t old_umask = umask(0077);
+ int fd = mkstemp(t);
+ umask(old_umask);
+ if (fd == -1)
+ { L_tok_p_tempfile_oom:
+ ERROR_MSG(_T("!tempfile: unable to create temporary file.\n"));
+ return PS_ERROR;
+ }
+ close(fd);
+#ifdef _UNICODE
+ if (!(fpath = NSISRT_mbtowc(t))) goto L_tok_p_tempfile_oom;
+#else
+ fpath = t;
+#endif
+#endif // ~_WIN32
+
+ if (definedlist.add(symbol, fpath))
+ {
+ ERROR_MSG(_T("!tempfile: \"%") NPRIs _T("\" already defined!\n"), symbol);
+ return PS_ERROR;
+ }
+ SCRIPT_MSG(_T("!tempfile: \"%") NPRIs _T("\"=\"%") NPRIs _T("\"\n"), symbol, fpath);
+#if !defined(_WIN32) && defined(_UNICODE)
+ NSISRT_free(fpath);
+#endif
+ return PS_OK;
+}
+
+int CEXEBuild::pp_delfile(LineParser&line)
+{
+ int fatal = 1;
+ int a = 1;
+ TCHAR *fc = line.gettoken_str(a);
+ if (line.getnumtokens()==3)
+ {
+ if (!_tcsicmp(fc,_T("/nonfatal")))
+ fatal = 0, fc = line.gettoken_str(++a);
+ else
+ PRINTHELP();
+ }
+
+ SCRIPT_MSG(_T("!delfile: \"%") NPRIs _T("\"\n"), line.gettoken_str(a));
+
+ tstring dir = get_dir_name(fc), spec = get_file_name(fc);
+ tstring basedir = dir + PLATFORM_PATH_SEPARATOR_STR;
+ if (dir == spec) dir = _T("."), basedir = _T(""); // no path, just file name
+
+ boost::scoped_ptr<dir_reader> dr( new_dir_reader() );
+ dr->read(dir); // BUGBUG: PATH_CONVERT?
+
+ for (dir_reader::iterator files_itr = dr->files().begin();
+ files_itr != dr->files().end();
+ files_itr++)
+ {
+ if (!dir_reader::matches(*files_itr, spec))
+ continue;
+
+ tstring file = basedir + *files_itr; // BUGBUG: PATH_CONVERT?
+
+ int result = _tunlink(file.c_str());
+ if (result == -1)
+ {
+ ERROR_MSG(_T("!delfile: \"%") NPRIs _T("\" couldn't be deleted.\n"), file.c_str());
+ if (fatal) return PS_ERROR;
+ }
+ else
+ SCRIPT_MSG(_T("!delfile: deleted \"%") NPRIs _T("\"\n"), file.c_str());
+ }
+ return PS_OK;
+}
+
+int CEXEBuild::pp_appendfile(LineParser&line)
+{
+ WORD tok = 0, cp = 0, forceEnc = false, rawnl = false;
+ bool bom = false;
+ TCHAR *param, buf[9+!0];
+ for (;;)
+ {
+ param = line.gettoken_str(++tok);
+ my_strncpy(buf, param, COUNTOF(buf));
+ if (!_tcsicmp(param,_T("/RawNL")))
+ ++rawnl;
+ else if (!_tcsicmp(buf,_T("/CharSet=")))
+ {
+ ++forceEnc, cp = GetEncodingFromString(param+9, bom);
+ if (NStreamEncoding::UNKNOWN == cp)
+ {
+ ERROR_MSG(_T("!appendfile: Invalid parameter \"%") NPRIs _T("\"!\n"), param);
+ return PS_ERROR;
+ }
+ }
+ else
+ break;
+ }
+ if (line.getnumtokens() != 2 + tok)
+ {
+ PRINTHELP();
+ return PS_ERROR;
+ }
+ param = line.gettoken_str(tok);
+ NOStream ostrm;
+ if (!ostrm.CreateFileForAppending(param, NStreamEncoding::ACP))
+ {
+ ERROR_MSG(_T("!appendfile: \"%") NPRIs _T("\" couldn't be opened.\n"), param);
+ return PS_ERROR;
+ }
+ if (ostrm.IsUnicode()) bom = false;
+ if (forceEnc) ostrm.StreamEncoding().SetCodepage(cp);
+ const TCHAR *const text = line.gettoken_str(++tok);
+ bool succ = bom ? ostrm.WriteBOM(ostrm.StreamEncoding()) : true;
+ if (!succ || (rawnl ? !ostrm.WriteString(text) : !ostrm.WritePlatformNLString(text)))
+ {
+ ERROR_MSG(_T("!appendfile: error writing to \"%") NPRIs _T("\".\n"), param);
+ return PS_ERROR;
+ }
+ SCRIPT_MSG(_T("!appendfile: \"%") NPRIs _T("\" \"%") NPRIs _T("\"\n"), param, text);
+ return PS_OK;
+}
+
+int CEXEBuild::pp_getdllversion(LineParser&line)
+{
+ const TCHAR *cmdname = _T("!getdllversion");
+ DWORD low, high;
+ if (!GetDLLVersion(line.gettoken_str(1), high, low))
+ {
+ ERROR_MSG(_T("%") NPRIs _T(": error reading version info from \"%") NPRIs _T("\"\n"), cmdname, line.gettoken_str(1));
+ return PS_ERROR;
+ }
+ TCHAR *symbuf = m_templinebuf, numbuf[30], *basesymname = line.gettoken_str(2);
+ DWORD vals[] = { high >> 16, high & 0xffff, low >> 16, low & 0xffff };
+ SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T(" (%u.%u.%u.%u)->(%") NPRIs _T("<1..4>)\n"),
+ cmdname, line.gettoken_str(1), vals[0], vals[1], vals[2], vals[3], basesymname);
+ for (UINT i = 0; i < 4; ++i)
+ {
+ _stprintf(symbuf,_T("%") NPRIs _T("%u"), basesymname, i+1);
+ _stprintf(numbuf,_T("%lu"), vals[i]);
+ definedlist.add(symbuf, numbuf);
+ }
+ return PS_OK;
+}
+
+int CEXEBuild::pp_searchreplacestring(LineParser&line)
+{
+ int ignoreCase = !_tcsicmp(line.gettoken_str(1), _T("/ignorecase"));
+ if (line.getnumtokens() != 5+ignoreCase) PRINTHELP()
+
+ TCHAR *define = line.gettoken_str(1+ignoreCase);
+ TCHAR *src = line.gettoken_str(2+ignoreCase);
+ TCHAR *search = line.gettoken_str(3+ignoreCase);
+ TCHAR *replace = line.gettoken_str(4+ignoreCase);
+ int searchlen = (int)_tcslen(search), replacelen = (int)_tcslen(replace);
+ if (!searchlen)
+ {
+ ERROR_MSG(_T("!searchreplace: search string must not be empty for search/replace!\n"));
+ return PS_ERROR;
+ }
+
+ GrowBuf valout;
+ while (*src)
+ {
+ if (ignoreCase ? _tcsnicmp(src, search, searchlen) : _tcsncmp(src, search, searchlen))
+ valout.add(src++, sizeof(TCHAR));
+ else
+ {
+ valout.add(replace, sizeof(TCHAR)*replacelen);
+ src += searchlen;
+ }
+ }
+ valout.add(_T(""),sizeof(TCHAR));
+
+ definedlist.del(define); // allow changing variables since we'll often use this in series
+ if (definedlist.add(define, (TCHAR*)valout.get()))
+ {
+ ERROR_MSG(_T("!searchreplace: error defining \"%") NPRIs _T("\"!\n"), define);
+ return PS_ERROR;
+ }
+ SCRIPT_MSG(_T("!searchreplace: \"%") NPRIs _T("\"=\"%") NPRIs _T("\"\n"), define,(TCHAR*)valout.get());
+ return S_OK;
+}
+
+int CEXEBuild::pp_searchparsestring(LineParser&line)
+{
+ bool ignCase = false, noErrors = false, isFile = false;
+ int parmOffs = 1;
+ while (parmOffs < line.getnumtokens())
+ {
+ if (!_tcsicmp(line.gettoken_str(parmOffs), _T("/ignorecase"))) { ignCase = true; parmOffs++; }
+ else if (!_tcsicmp(line.gettoken_str(parmOffs), _T("/noerrors"))) { noErrors = true; parmOffs++; }
+ else if (!_tcsicmp(line.gettoken_str(parmOffs), _T("/file"))) { isFile = true; parmOffs++; }
+ else break;
+ }
+ if (parmOffs+3 > line.getnumtokens())
+ {
+ ERROR_MSG(_T("!searchparse: not enough parameters\n"));
+ return PS_ERROR;
+ }
+ const TCHAR *source_string = line.gettoken_str(parmOffs++);
+ DefineList *list = 0;
+
+ if (isFile)
+ {
+ const TCHAR *const filename = source_string;
+ NIStream filestrm;
+ if (!filestrm.OpenFileForReading(filename))
+ {
+ ERROR_MSG(_T("!searchparse /file: error opening \"%") NPRIs _T("\"\n"), filename);
+ return PS_ERROR;
+ }
+ UINT req_parm = (line.getnumtokens() - parmOffs)/2, fail_parm = 0, linnum = 0;
+ NStreamLineReader lr(filestrm);
+ GrowBuf tmpstr;
+ TCHAR *str = m_templinebuf;
+ for (;;)
+ {
+ tmpstr.resize(0);
+ for (;;)
+ {
+ ++linnum;
+ UINT cch = read_line_helper(lr, str, MAX_LINELENGTH);
+ if (!cch)
+ {
+ if (*str)
+ {
+ tstring lrmsg = lr.GetErrorMessage((UINT)*str, filename, linnum);
+ ERROR_MSG(_T("!searchparse: %") NPRIs, lrmsg.c_str());
+ return PS_ERROR;
+ }
+ break; // EOF
+ }
+ str[--cch] = _T('\0'); // remove newline
+
+ const bool endSlash = (cch && _T('\\') == str[cch-1]);
+ if (endSlash) --cch; // don't include the slash character
+ if (tmpstr.getlen() || endSlash) tmpstr.add(str,cch*sizeof(TCHAR));
+
+ // if we have valid contents and not ending on slash, then done
+ if (!endSlash && (str[0] || tmpstr.getlen())) break;
+ }
+
+ if (!str[0] && !tmpstr.getlen()) break; // reached eof
+
+ TCHAR *thisline = str;
+ if (tmpstr.getlen())
+ {
+ tmpstr.add(_T("\0"),sizeof(TCHAR));
+ thisline = (TCHAR*)tmpstr.get();
+ }
+ UINT linefailparm;
+ DefineList *tlist = searchParseString(thisline, line, parmOffs, ignCase, true, &linefailparm);
+ if (linefailparm > fail_parm) fail_parm = linefailparm;
+ if (tlist && tlist->getnum())
+ {
+ if (!list || tlist->getnum() > list->getnum())
+ {
+ delete list;
+ list = tlist, tlist = 0;
+ if ((unsigned)list->getnum() >= req_parm)
+ {
+ fail_parm = -1; // success
+ break; // we found all the tokens, stop parsing the file
+ }
+ }
+ }
+ delete tlist;
+ // parse line
+ }
+ if ((UINT)-1 != fail_parm && !noErrors)
+ {
+ const TCHAR *msgprefix = !fail_parm ? _T("starting ") : _T("");
+ TCHAR *p = line.gettoken_str(parmOffs + (fail_parm*2));
+ ERROR_MSG(_T("!searchparse: %") NPRIs _T("string \"%") NPRIs _T("\" not found in file!\n"), msgprefix, p ? p : _T("(null)"));
+ return PS_ERROR;
+ }
+ }
+ else
+ {
+ list = searchParseString(source_string, line, parmOffs, ignCase, noErrors);
+ if (!list && !noErrors) return PS_ERROR;
+ }
+
+ if (list) // if we got our list, merge them defines in
+ {
+ for (int i=0; i < list->getnum(); i++)
+ {
+ TCHAR *def = list->getname(i), *val = list->getvalue(i);
+ if (def && val) definedlist.set(def,val);
+ }
+ }
+ delete list;
+ return PS_OK;
+}
+
+DefineList *CEXEBuild::searchParseString(const TCHAR *source_string, LineParser&line, int parmOffs, bool ignCase, bool noErrors, UINT*failParam)
+{
+ const bool allowEmptyFirstTok = true;
+ if (failParam) *failParam = 0;
+ DefineList *ret = NULL;
+ const TCHAR *defout = 0, *src_start = 0, *tok;
+ int toklen = 0, maxlen;
+ for (;;)
+ {
+ tok = line.gettoken_str(parmOffs++);
+ const bool lasttoken = parmOffs > line.getnumtokens();
+ if (!*tok)
+ tok = 0, maxlen = -1; // No more tokens to search for, save the rest of the string
+ else
+ {
+ toklen = (int) _tcslen(tok);
+ while (*source_string && (ignCase?_tcsnicmp(source_string, tok, toklen):_tcsncmp(source_string, tok, toklen))) source_string++;
+ maxlen = (int)(source_string - src_start); // Length of previous string
+ }
+ if (defout && defout[0]) // We now know the start and length of the previous string, add it to the list
+ {
+ if (!ret) ret = new DefineList();
+ if (maxlen < 0)
+ ret->add(defout, src_start);
+ else
+ ret->addn(defout, maxlen, src_start);
+ }
+ if (!tok && lasttoken) break;
+ if (!*source_string || (allowEmptyFirstTok ? false : !tok)) // We did not find the requested token!
+ {
+ if (failParam) *failParam = ret ? ret->getnum() : 0;
+ if (noErrors) break; // Caller is OK with a incomplete list of matched strings
+ const TCHAR *msgprefix = src_start ? _T("") : _T("starting ");
+ ERROR_MSG(_T("!searchparse: %") NPRIs _T("string \"%") NPRIs _T("\" not found, aborted search!\n"), msgprefix, tok ? tok : _T("(null)"));
+ delete ret;
+ return NULL;
+ }
+ defout = line.gettoken_str(parmOffs++), src_start = source_string += toklen;
+ }
+ return ret;
+}
+
+int CEXEBuild::pp_verbose(LineParser&line)
+{
+ for(int argi = 1; argi < line.getnumtokens(); ++argi)
+ {
+ int k = line.gettoken_enum(argi, _T("push\0pop\0")), v, convsucc;
+ if (k < 0) // not push/pop, just set the level
+ {
+ v = line.gettoken_int(argi, &convsucc);
+ if (!convsucc || v < 0 || v > 4 )
+ {
+ // < 2.47 would reset level to 0 without warning!
+ ERROR_MSG(_T("!verbose: Invalid verbose level\n"));
+ return PS_ERROR;
+ }
+ }
+ else
+ {
+ if (k) // pop
+ {
+ int l = verbose_stack.getlen();
+ if (l)
+ {
+ v= ((int*)verbose_stack.get())[(l/sizeof(int))-1];
+ verbose_stack.resize(l-sizeof(int));
+ }
+ else
+ {
+ warning_fl(DW_PP_VERBOSE_POP_EMPTY_STACK, _T("!verbose: Pop failed, stack is empty"));
+ continue; // Pop failed, should still process the next parameter
+ }
+ }
+ else // push
+ {
+ v = get_verbosity();
+ verbose_stack.add(&v,sizeof(int));
+ continue;
+ }
+ }
+ set_verbosity(v);
+ }
+ return PS_OK;
+}
+
+int CEXEBuild::pp_define(LineParser&line)
+{
+ const TCHAR *cmdnam = line.gettoken_str(0), *define = line.gettoken_str(1);
+ GrowBuf file_buf;
+ TCHAR datebuf[256], mathbuf[256], *value;
+ int dupemode = 0;
+
+ if (!_tcsicmp(define, _T("/ifndef")))
+ dupemode = 1;
+ else if (!_tcsicmp(define, _T("/redef")))
+ dupemode = 2;
+
+ if (dupemode != 0)
+ {
+ line.eattoken();
+ define = line.gettoken_str(1);
+ if (dupemode == 1 && definedlist.find(define)) return PS_OK;
+ }
+
+ if (!_tcsicmp(define, _T("/date")) || !_tcsicmp(define, _T("/utcdate")))
+ {
+ if (line.getnumtokens() != 4) PRINTHELPEX(cmdnam)
+
+ const TCHAR *date_type = define;
+ time_t rawtime;
+ time(&rawtime);
+ define = line.gettoken_str(2), value = line.gettoken_str(3);
+
+ if (!_tcsicmp(date_type, _T("/utcdate")))
+ rawtime = mktime(gmtime(&rawtime));
+
+ datebuf[0] = 0;
+ size_t s = _tcsftime(datebuf, COUNTOF(datebuf), value, localtime(&rawtime));
+ if (s == 0)
+ datebuf[0] = _T('\0');
+ else
+ datebuf[max(s, COUNTOF(datebuf)-1)] = _T('\0');
+
+ value = datebuf;
+ }
+ else if (!_tcsicmp(define, _T("/file")) || !_tcsicmp(define, _T("/file_noerr")))
+ {
+ if (line.getnumtokens() != 4) PRINTHELPEX(cmdnam)
+ const TCHAR *const filename = line.gettoken_str(3), *const swit = define;
+ NIStream filestrm;
+ if (!filestrm.OpenFileForReading(filename))
+ {
+ if (!swit[5])
+ { // "/file" vs "/file_noerr"
+ ERROR_MSG(_T("!define /file: file not found (\"%") NPRIs _T("\")\n"), filename);
+ return PS_ERROR;
+ }
+ }
+ else
+ {
+ NStreamLineReader lr(filestrm);
+ TCHAR *str = m_templinebuf;
+ for (UINT linnum = 0;;) {
+ ++linnum;
+ UINT cch = read_line_helper(lr, str, MAX_LINELENGTH);
+ if (!cch) {
+ if (*str) {
+ tstring lrmsg = lr.GetErrorMessage((UINT)*str, filename, linnum);
+ ERROR_MSG(_T("!define %") NPRIs _T(": %") NPRIs, swit, lrmsg.c_str());
+ return PS_ERROR;
+ }
+ break; // EOF
+ }
+ str[--cch] = _T('\0'); // Remove \r or \n, we always append \n
+ if (file_buf.getlen()) file_buf.add(_T("\n"), sizeof(TCHAR));
+ file_buf.add(str, cch*sizeof(TCHAR));
+ }
+ }
+ define = line.gettoken_str(2);
+ file_buf.add(_T("\0"), sizeof(TCHAR));
+ value = (TCHAR *)file_buf.get();
+ }
+ else if (!_tcsicmp(define, _T("/math")))
+ {
+ int value1, value2;
+ TCHAR *mathop;
+
+ if (line.getnumtokens() != 6) PRINTHELPEX(cmdnam)
+ define = line.gettoken_str(2);
+ value1 = line.gettoken_int(3);
+ mathop = line.gettoken_str(4);
+ value2 = line.gettoken_int(5);
+ value = mathbuf;
+
+ if (!_tcscmp(mathop,_T("+"))) {
+ _stprintf(value, _T("%d"), value1 + value2);
+ } else if (!_tcscmp(mathop, _T("-"))) {
+ _stprintf(value, _T("%d"), value1 - value2);
+ } else if (!_tcscmp(mathop, _T("*"))) {
+ _stprintf(value, _T("%d"), value1 * value2);
+ } else if (!_tcscmp(mathop, _T("&"))) {
+ _stprintf(value, _T("%d"), value1 & value2);
+ } else if (!_tcscmp(mathop, _T("|"))) {
+ _stprintf(value, _T("%d"), value1 | value2);
+ } else if (!_tcscmp(mathop, _T("^"))) {
+ _stprintf(value, _T("%d"), value1 ^ value2);
+ } else if (!_tcscmp(mathop, _T("<<")) || !_tcscmp(mathop, _T("<<<")) ) {
+ _stprintf(value, _T("%d"), value1 << value2);
+ } else if (!_tcscmp(mathop, _T(">>"))) {
+ _stprintf(value, _T("%d"), (signed int)value1 >> (signed int)value2);
+ } else if (!_tcscmp(mathop, _T(">>>"))) {
+ _stprintf(value, _T("%u"), (unsigned int)value1 >> (unsigned int)value2);
+ } else if (!_tcscmp(mathop, _T("/"))) {
+ if (value2 == 0)
+ {
+ ERROR_MSG(_T("!define /math: division by zero! (\"%i %") NPRIs _T(" %i\")\n"), value1, mathop, value2);
+ return PS_ERROR;
+ }
+ _stprintf(value, _T("%d"), value1 / value2);
+ } else if (!_tcscmp(mathop, _T("%")))
+ {
+ if (value2 == 0)
+ {
+ ERROR_MSG(_T("!define /math: division by zero! (\"%i %") NPRIs _T(" %i\")\n"),value1,mathop,value2);
+ return PS_ERROR;
+ }
+ _stprintf(value, _T("%d"), value1 % value2);
+ }
+ else
+ PRINTHELPEX(cmdnam)
+ }
+ else
+ {
+ if (line.getnumtokens() >= 4) PRINTHELPEX(cmdnam)
+ value = line.gettoken_str(2);
+ }
+
+ if (dupemode == 2) definedlist.del(define);
+ if (definedlist.add(define, value))
+ {
+ ERROR_MSG(_T("!define: \"%") NPRIs _T("\" already defined!\n"), define);
+ return PS_ERROR;
+ }
+ SCRIPT_MSG(_T("!define: \"%") NPRIs _T("\"=\"%") NPRIs _T("\"\n"), define, value);
+ return PS_OK;
+}
+
+int CEXEBuild::pp_undef(LineParser&line)
+{
+ if (definedlist.del(line.gettoken_str(1)))
+ {
+ ERROR_MSG(_T("!undef: \"%") NPRIs _T("\" not defined!\n"), line.gettoken_str(1));
+ return PS_ERROR; // Should this be a warning?
+ }
+ SCRIPT_MSG(_T("!undef: \"%") NPRIs _T("\"\n"), line.gettoken_str(1));
+ return PS_OK;
+}
+
+int CEXEBuild::pp_packhdr(LineParser&line)
+{
+ unsigned int bufOf = false;
+ TCHAR *packname = line.gettoken_str(1);
+ PATH_CONVERT(packname);
+ if (!strtrycpy(build_packname, packname, COUNTOF(build_packname))) ++bufOf;
+ if (!strtrycpy(build_packcmd, line.gettoken_str(2), COUNTOF(build_packcmd))) ++bufOf;
+ SCRIPT_MSG(_T("!packhdr: filename=\"%") NPRIs _T("\", command=\"%") NPRIs _T("\"\n"), build_packname, build_packcmd);
+ return bufOf ? PS_ERROR : PS_OK;
+}
+
+int CEXEBuild::pp_finalize(LineParser&line)
+{
+ TCHAR* cmdstr = line.gettoken_str(1);
+ int validparams = false;
+ struct postbuild_cmd *newcmd, *prevcmd;
+ newcmd = (struct postbuild_cmd*) (new BYTE[FIELD_OFFSET(struct postbuild_cmd, cmd[_tcsclen(cmdstr)+1])]);
+ newcmd->next = NULL, _tcscpy(newcmd->cmd, cmdstr);
+ newcmd->cmpop = line.gettoken_enum(2, _T("<\0>\0<>\0=\0ignore\0")), newcmd->cmpval = line.gettoken_int(3, &validparams);
+ if (line.getnumtokens() == 1+1)
+ newcmd->cmpop = 4, validparams = true; // just a command, ignore the exit code
+ if (newcmd->cmpop == -1 || !validparams)
+ PRINTHELP();
+ for (prevcmd = postbuild_cmds; prevcmd && prevcmd->next;)
+ prevcmd = prevcmd->next;
+ if (prevcmd) prevcmd->next = newcmd; else postbuild_cmds = newcmd;
+ SCRIPT_MSG(_T("!finalize: \"%") NPRIs _T("\"\n"), cmdstr);
+ return PS_OK;
+}
+
+int CEXEBuild::pp_execute(int which_token, LineParser&line)
+{
+ const TCHAR *cmdname=get_commandtoken_name(which_token);
+ const TCHAR *exec=line.gettoken_str(1), *define=0;
+ TCHAR buf[33];
+ int comp=line.gettoken_enum(2,_T("<\0>\0<>\0=\0ignore\0"));
+ int validparams=true, ret=-1, cmpv=0, forceutf8=0;
+ switch(line.getnumtokens()-1)
+ {
+ case 1: comp=4; break;
+ case 2: comp=5, validparams=!!*(define=line.gettoken_str(2)); break;
+ case 3: cmpv=line.gettoken_int(3,&validparams); break;
+ default: forceutf8=comp=-1;
+ }
+ if (!validparams || comp == -1) PRINTHELP()
+ tstring compile;
+ if (TOK_P_MAKENSIS == which_token)
+ {
+ extern const TCHAR *g_argv0;
+ compile=_T("\""), compile+=get_executable_path(g_argv0), compile+= _T("\"");
+ compile+= _T(" ") OPT_STR _T("v"), wsprintf(buf,_T("%d"),get_verbosity()), compile+=buf;
+#if defined(_WIN32) && defined(_UNICODE) // POSIX does not support -OUTPUTCHARSET
+ compile+= _T(" ") OPT_STR _T("OCS UTF8"), forceutf8++; // Force UTF-8 and disable batch-file workaround in RunChildProcessRedirected
+#endif
+ if (*exec) compile+= _T(" "), compile+=exec;
+ exec=compile.c_str();
+ }
+ SCRIPT_MSG(_T("%") NPRIs _T(": \"%") NPRIs _T("\"\n"),cmdname,exec);
+ if (preprocessonly) PREPROCESSONLY_BEGINCOMMENT();
+#ifdef _WIN32
+ if (TOK_P_SYSTEMEXEC != which_token)
+ ret=RunChildProcessRedirected(exec, forceutf8 ? true : false);
+ else
+#endif //~ _WIN32
+ ret=sane_system(exec), (void)forceutf8; // forceutf8 is not used on POSIX
+
+ if (comp == 5)
+ {
+ _stprintf(buf,_T("%d"),ret);
+ definedlist.set(define,buf);
+ }
+ else if (!check_external_exitcode(ret,comp,cmpv))
+ {
+ ERROR_MSG(_T("%") NPRIs _T(": returned %d, aborting\n"),cmdname,ret);
+ return PS_ERROR;
+ }
+ if (preprocessonly) PREPROCESSONLY_ENDCOMMENT();
+ SCRIPT_MSG(_T("%") NPRIs _T(": returned %d\n"),cmdname,ret);
+ return PS_OK;
+}
+
+int CEXEBuild::pp_addincludedir(LineParser&line)
+{
+ TCHAR *f = line.gettoken_str(1);
+ PATH_CONVERT(f);
+ include_dirs.add(f, 0);
+ return PS_OK;
+}
+
+int CEXEBuild::includeScript(const TCHAR *file, NStreamEncoding&enc)
+{
+ NIStream incstrm;
+ const bool openok = incstrm.OpenFileForReading(file, enc);
+ if (NStreamEncoding::AUTO == enc.GetCodepage()
+ && build_unicode && !enc.IsUnicodeCodepage(enc.GetPlatformDefaultCodepage())
+ && enc.GetPlatformDefaultCodepage() == incstrm.StreamEncoding().GetCodepage() )
+ {
+ incstrm.StreamEncoding().SetCodepage(NStreamEncoding::UTF8); // !include defaults to UTF-8 after "Unicode true"
+ }
+ enc = incstrm.StreamEncoding();
+
+ TCHAR bufcpdisp[20];
+ incstrm.StreamEncoding().GetCPDisplayName(bufcpdisp);
+ SCRIPT_MSG(_T("!include: \"%") NPRIs _T("\" (%") NPRIs _T(")\n"), file, bufcpdisp);
+ if (!openok)
+ {
+ ERROR_MSG(_T("!include: could not open file: \"%") NPRIs _T("\"\n"), file);
+ return PS_ERROR;
+ }
+
+ if (build_include_depth >= MAX_INCLUDEDEPTH)
+ {
+ ERROR_MSG(_T("!include: too many levels of includes (%d max).\n"),MAX_INCLUDEDEPTH);
+ return PS_ERROR;
+ }
+ build_include_depth++;
+
+ const int last_linecnt = linecnt;
+ const TCHAR *last_filename = curfilename;
+ curfilename = file, linecnt = 0;
+ NStreamLineReader linereader(incstrm);
+ NStreamLineReader *last_linereader = curlinereader;
+ curlinereader = &linereader;
+#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
+ TCHAR *oldfilename = set_file_predefine(curfilename);
+ TCHAR *oldtimestamp = set_timestamp_predefine(curfilename);
+#endif
+
+ int r = parseScript();
+ const int errline = linecnt;
+
+#ifdef NSIS_SUPPORT_STANDARD_PREDEFINES
+ restore_file_predefine(oldfilename);
+ restore_timestamp_predefine(oldtimestamp);
+#endif
+ curfilename = last_filename, linecnt = last_linecnt;
+ curlinereader = last_linereader;
+
+ build_include_depth--;
+ if (r != PS_EOF && r != PS_OK)
+ {
+ ERROR_MSG(_T("!include: error in script: \"%") NPRIs _T("\" on line %d\n"), file, errline);
+ return PS_ERROR;
+ }
+ SCRIPT_MSG(_T("!include: closed: \"%") NPRIs _T("\"\n"), file);
+ return PS_OK;
+}
+
+int CEXEBuild::pp_include(LineParser&line)
+{
+ bool required = true;
+ NStreamEncoding enc(NStreamEncoding::AUTO);
+ TCHAR *f;
+ unsigned int toks = line.getnumtokens() - 1, included = 0;
+ for(unsigned int tok = 0; toks;)
+ {
+ f = line.gettoken_str(++tok);
+ if (tok >= toks) break;
+ if (!_tcsicmp(f,_T("/nonfatal"))) required = false;
+ TCHAR buf[9+1];
+ my_strncpy(buf, f, COUNTOF(buf));
+ if (!_tcsicmp(buf,_T("/charset=")))
+ {
+ WORD cp = GetEncodingFromString(f+9);
+ if (NStreamEncoding::UNKNOWN == cp) toks = 0;
+ enc.SafeSetCodepage(cp);
+ }
+ }
+ if (!toks || !*f) PRINTHELP();
+
+ TCHAR *fc = my_convert(f);
+ tstring dir = get_dir_name(fc), spec = get_file_name(fc), basedir = dir;
+ my_convert_free(fc);
+ path_append_separator(basedir);
+ if (dir == spec) basedir = _T(""), dir = _T("."); // no path, just file name
+
+ // search working directory
+ boost::scoped_ptr<dir_reader> dr( new_dir_reader() );
+ dr->read(dir);
+ for (dir_reader::iterator files_itr = dr->files().begin();
+ files_itr != dr->files().end();
+ files_itr++)
+ {
+ if (!dir_reader::matches(*files_itr, spec)) continue;
+
+ tstring incfile = basedir + *files_itr;
+ if (includeScript(incfile.c_str(), enc) != PS_OK)
+ return PS_ERROR;
+ else
+ included++;
+ }
+ if (included) return PS_OK;
+
+ // search include dirs
+ TCHAR *incdir = include_dirs.get();
+ int incdirs = include_dirs.getnum();
+ for (int i = 0; i < incdirs; i++, incdir += _tcslen(incdir) + 1)
+ {
+ tstring curincdir(incdir), incfile;
+ if (_T(".") != dir) path_append(curincdir, dir);
+
+ boost::scoped_ptr<dir_reader> dr( new_dir_reader() );
+ dr->read(curincdir);
+ for (dir_reader::iterator incdir_itr = dr->files().begin();
+ incdir_itr != dr->files().end();
+ incdir_itr++)
+ {
+ if (!dir_reader::matches(*incdir_itr, spec)) continue;
+
+ path_append(incfile = curincdir, *incdir_itr);
+ if (includeScript(incfile.c_str(), enc) != PS_OK)
+ return PS_ERROR;
+ else
+ included++;
+ }
+ if (included) return PS_OK;
+ }
+
+ if (!included) // nothing found?
+ {
+ if (required)
+ {
+ ERROR_MSG(_T("!include: could not find: \"%") NPRIs _T("\"\n"), f);
+ return PS_ERROR;
+ }
+ else
+ warning_fl(DW_INCLUDE_NONFATAL_NOT_FOUND, _T("!include: could not find: \"%") NPRIs _T("\""), f);
+ }
+ return PS_OK;
+}
+
+int CEXEBuild::pp_cd(LineParser&line)
+{
+ const TCHAR *dir = line.gettoken_str(1);
+ if (!dir[0] || _tchdir(dir))
+ {
+ ERROR_MSG(_T("!cd: error changing to: \"%") NPRIs _T("\"\n"), dir);
+ return PS_ERROR;
+ }
+ return PS_OK;
+}
diff --git a/Source/strlist.cpp b/Source/strlist.cpp
index d4edb69..4ef7545 100755
--- a/Source/strlist.cpp
+++ b/Source/strlist.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/strlist.h b/Source/strlist.h
index 9df66ae..85f6081 100755
--- a/Source/strlist.h
+++ b/Source/strlist.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/tchar.h b/Source/tchar.h
index 925ccac..be0649b 100755
--- a/Source/tchar.h
+++ b/Source/tchar.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* This software is provided 'as-is', without any express or implied
* warranty.
diff --git a/Source/tokens.cpp b/Source/tokens.cpp
index 998bcf2..030dc12 100755
--- a/Source/tokens.cpp
+++ b/Source/tokens.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -62,8 +62,8 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_DBOPTIMIZE,_T("SetDatablockOptimize"),1,0,_T("(off|on)"),TP_ALL},
{TOK_DELETEINISEC,_T("DeleteINISec"),2,0,_T("ini_file section_name"),TP_CODE},
{TOK_DELETEINISTR,_T("DeleteINIStr"),3,0,_T("ini_file section_name entry_name"),TP_CODE},
-{TOK_DELETEREGKEY,_T("DeleteRegKey"),2,1,_T("[/ifempty] root_key subkey\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
-{TOK_DELETEREGVALUE,_T("DeleteRegValue"),3,0,_T("root_key subkey entry_name\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_DELETEREGKEY,_T("DeleteRegKey"),2,1,_T("[/ifempty] root_key subkey\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_DELETEREGVALUE,_T("DeleteRegValue"),3,0,_T("root_key subkey entry_name\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
{TOK_DELETE,_T("Delete"),1,1,_T("[/REBOOTOK] filespec"),TP_CODE},
{TOK_DETAILPRINT,_T("DetailPrint"),1,0,_T("message"),TP_CODE},
{TOK_DIRTEXT,_T("DirText"),0,4,_T("[directory_page_description] [directory_page_subtext] [browse_button_text] [browse_dlg_text]"),TP_PG},
@@ -75,12 +75,13 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_ROOTDIRINST,_T("AllowRootDirInstall"),1,0,_T("(true|false)"),TP_GLOBAL},
{TOK_CHECKBITMAP,_T("CheckBitmap"),1,0,_T("local_bitmap.bmp"),TP_GLOBAL},
{TOK_ENABLEWINDOW,_T("EnableWindow"),2,0,_T("hwnd state(1|0)"),TP_CODE},
-{TOK_ENUMREGKEY,_T("EnumRegKey"),4,0,_T("$(user_var: output) rootkey subkey index\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
-{TOK_ENUMREGVAL,_T("EnumRegValue"),4,0,_T("$(user_var: output) rootkey subkey index\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_ENUMREGKEY,_T("EnumRegKey"),4,0,_T("$(user_var: output) rootkey subkey index\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_ENUMREGVAL,_T("EnumRegValue"),4,0,_T("$(user_var: output) rootkey subkey index\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
{TOK_EXCH,_T("Exch"),0,1,_T("[$(user_var)] | [stack_item_index]"),TP_CODE},
{TOK_EXEC,_T("Exec"),1,0,_T("command_line"),TP_CODE},
{TOK_EXECWAIT,_T("ExecWait"),1,1,_T("command_line [$(user_var: return value)]"),TP_CODE},
-{TOK_EXECSHELL,_T("ExecShell"),2,2,_T("(open|print|etc) command_line [parameters [showmode]]\n showmode=(SW_SHOWNORMAL|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_HIDE|SW_SHOW)"),TP_CODE},
+{TOK_EXECSHELL,_T("ExecShell"),2,11,_T("[flags] verb command_line [parameters [showmode]]\n verb=(open|print)\n showmode=(SW_SHOWNORMAL|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_HIDE|SW_SHOW)"),TP_CODE},
+{TOK_EXECSHELLWAIT,_T("ExecShellWait"),2,11,_T("[flags] verb command_line [parameters [showmode]]"),TP_CODE},
{TOK_EXPANDENVSTRS,_T("ExpandEnvStrings"),2,0,_T("$(user_var: output) string"),TP_CODE},
{TOK_FINDWINDOW,_T("FindWindow"),2,3,_T("$(user_var: handle output) WindowClass [WindowTitle] [Window_Parent] [Child_After]"),TP_CODE},
{TOK_FINDCLOSE,_T("FindClose"),1,0,_T("$(user_var: handle input)"),TP_CODE},
@@ -140,7 +141,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_MESSAGEBOX,_T("MessageBox"),2,6,_T("mode messagebox_text [/SD return] [return_check label_to_goto_if_equal [return_check2 label2]]\n mode=modeflag[|modeflag[|modeflag[...]]]\n ")
_T("modeflag=(MB_ABORTRETRYIGNORE|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_YESNO|MB_YESNOCANCEL|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_USERICON|MB_TOPMOST|MB_SETFOREGROUND|MB_RIGHT"),TP_CODE},
{TOK_NOP,_T("Nop"),0,0,_T(""),TP_CODE},
-{TOK_NAME,_T("Name"),1,1,_T("installer_name installer_name_doubled_ampersands"),TP_GLOBAL},
+{TOK_NAME,_T("Name"),1,1,_T("installer_name [installer_name_doubled_ampersands]"),TP_GLOBAL},
{TOK_OUTFILE,_T("OutFile"),1,0,_T("install_output.exe"),TP_GLOBAL},
#ifdef NSIS_SUPPORT_CODECALLBACKS
{TOK_PAGE,_T("Page"),1,4,_T("((custom [creator_function] [leave_function] [caption]) | ((license|components|directory|instfiles|uninstConfirm) [pre_function] [show_function] [leave_function])) [/ENABLECANCEL]"),TP_GLOBAL},
@@ -154,8 +155,8 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_PUSH,_T("Push"),1,0,_T("string"),TP_CODE},
{TOK_QUIT,_T("Quit"),0,0,_T(""),TP_CODE},
{TOK_READINISTR,_T("ReadINIStr"),4,0,_T("$(user_var: output) ini_file section entry_name"),TP_CODE},
-{TOK_READREGDWORD,_T("ReadRegDWORD"),4,0,_T("$(user_var: output) rootkey subkey entry\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
-{TOK_READREGSTR,_T("ReadRegStr"),4,0,_T("$(user_var: output) rootkey subkey entry\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_READREGDWORD,_T("ReadRegDWORD"),4,0,_T("$(user_var: output) rootkey subkey entry\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_READREGSTR,_T("ReadRegStr"),4,0,_T("$(user_var: output) rootkey subkey entry\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
{TOK_READENVSTR,_T("ReadEnvStr"),2,0,_T("$(user_var: output) name"),TP_CODE},
{TOK_REBOOT,_T("Reboot"),0,0,_T(""),TP_CODE},
{TOK_REGDLL,_T("RegDLL"),1,1,_T("dll_path_on_target.dll [entrypoint_symbol]"),TP_CODE},
@@ -192,7 +193,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_SETCOMPRESSIONLEVEL,_T("SetCompressionLevel"),1,0,_T("level_0-9"),TP_ALL},
{TOK_SETDATESAVE,_T("SetDateSave"),1,0,_T("(off|on)"),TP_ALL},
{TOK_SETDETAILSVIEW,_T("SetDetailsView"),1,0,_T("(hide|show)"),TP_CODE},
-{TOK_SETDETAILSPRINT,_T("SetDetailsPrint"),1,0,_T("(none|listonly|textonly|both)"),TP_CODE},
+{TOK_SETDETAILSPRINT,_T("SetDetailsPrint"),1,0,_T("(none|listonly|textonly|both|lastused)"),TP_CODE},
{TOK_SETERRORS,_T("SetErrors"),0,0,_T(""),TP_CODE},
{TOK_SETERRORLEVEL,_T("SetErrorLevel"),1,0,_T("error_level"),TP_CODE},
{TOK_GETERRORLEVEL,_T("GetErrorLevel"),1,0,_T("$(user_var: output)"),TP_CODE},
@@ -202,7 +203,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_SETOVERWRITE,_T("SetOverwrite"),1,0,_T("on|off|try|ifnewer|ifdiff"),TP_ALL},
{TOK_SETPLUGINUNLOAD,_T("SetPluginUnload"),1,0,_T("deprecated - plug-ins should handle this on their own"),TP_ALL},
{TOK_SETREBOOTFLAG,_T("SetRebootFlag"),1,0,_T("true|false"),TP_CODE},
-{TOK_SETREGVIEW,_T("SetRegView"),1,0,_T("32|64|lastused"),TP_CODE},
+{TOK_SETREGVIEW,_T("SetRegView"),1,0,_T("32|64|default|lastused"),TP_CODE},
{TOK_SETSHELLVARCONTEXT,_T("SetShellVarContext"),1,0,_T("all|current"),TP_CODE},
{TOK_SETSILENT,_T("SetSilent"),1,0,_T("silent|normal"),TP_CODE},
{TOK_SHOWDETAILS,_T("ShowInstDetails"),1,0,_T("(hide|show|nevershow)"),TP_GLOBAL},
@@ -235,21 +236,23 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_UNREGDLL,_T("UnRegDLL"),1,0,_T("dll_path_on_target.dll"),TP_CODE},
{TOK_WINDOWICON,_T("WindowIcon"),1,0,_T("on|off"),TP_GLOBAL},
{TOK_WRITEINISTR,_T("WriteINIStr"),4,0,_T("ini_file section_name entry_name new_value"),TP_CODE},
-{TOK_WRITEREGBIN,_T("WriteRegBin"),4,0,_T("rootkey subkey entry_name hex_string_like_12848412AB\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
-{TOK_WRITEREGDWORD,_T("WriteRegDWORD"),4,0,_T("rootkey subkey entry_name new_value_dword\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
-{TOK_WRITEREGSTR,_T("WriteRegStr"),4,0,_T("rootkey subkey entry_name new_value_string\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
-{TOK_WRITEREGEXPANDSTR,_T("WriteRegExpandStr"),4,0,_T("rootkey subkey entry_name new_value_string\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_WRITEREGBIN,_T("WriteRegBin"),4,0,_T("rootkey subkey entry_name hex_string_like_12848412AB\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_WRITEREGMULTISZ,_T("WriteRegMultiStr"),5,0,_T("/REGEDIT5 rootkey subkey entry_name hex_string_like_660000000000\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_WRITEREGDWORD,_T("WriteRegDWORD"),4,0,_T("rootkey subkey entry_name new_value_dword\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_WRITEREGSTR,_T("WriteRegStr"),4,0,_T("rootkey subkey entry_name new_value_string\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_WRITEREGEXPANDSTR,_T("WriteRegExpandStr"),4,0,_T("rootkey subkey entry_name new_value_string\n root_key=(HKCR[32|64]|HKLM[32|64]|HKCU[32|64]|HKU|HKCC|HKDD|HKPD|SHCTX)"),TP_CODE},
+{TOK_WRITEREGNONE,_T("WriteRegNone"),3,1,_T("rootkey subkey entry_name [hex_data]"),TP_CODE},
{TOK_WRITEUNINSTALLER,_T("WriteUninstaller"),1,0,_T("uninstall_exe_name"),TP_CODE},
-{TOK_PEDLLCHARACTERISTICS, _T("PEDllCharacteristics"),2,0,_T("addbits removebits"),TP_GLOBAL},
-{TOK_PESUBSYSVER, _T("PESubsysVer"),1,0,_T("major.minor"),TP_GLOBAL},
-{TOK_XPSTYLE, _T("XPStyle"),1,0,_T("(on|off)"),TP_GLOBAL},
-{TOK_REQEXECLEVEL, _T("RequestExecutionLevel"),1,0,_T("none|user|highest|admin"),TP_GLOBAL},
+{TOK_PEDLLCHARACTERISTICS,_T("PEDllCharacteristics"),2,0,_T("addbits removebits"),TP_GLOBAL},
+{TOK_PESUBSYSVER,_T("PESubsysVer"),1,0,_T("major.minor"),TP_GLOBAL},
+{TOK_XPSTYLE,_T("XPStyle"),1,0,_T("(on|off)"),TP_GLOBAL},
+{TOK_REQEXECLEVEL,_T("RequestExecutionLevel"),1,0,_T("none|user|highest|admin"),TP_GLOBAL},
{TOK_MANIFEST_DPIAWARE,_T("ManifestDPIAware"),1,0,_T("notset|true|false"),TP_GLOBAL},
{TOK_MANIFEST_SUPPORTEDOS,_T("ManifestSupportedOS"),1,-1,_T("none|all|WinVista|Win7|Win8|Win8.1|Win10|{GUID} [...]"),TP_GLOBAL},
{TOK_P_PACKEXEHEADER,_T("!packhdr"),2,0,_T("temp_file_name command_line_to_compress_that_temp_file"),TP_ALL},
{TOK_P_FINALIZE,_T("!finalize"),1,2,_T("command_with_%1 [<OP retval>]"),TP_ALL},
{TOK_P_SYSTEMEXEC,_T("!system"),1,2,_T("command [<OP retval> | <retvalsymbol>]\n OP=(< > <> =)"),TP_ALL},
-{TOK_P_EXECUTE, _T("!execute"),1,2,_T("command [<OP retval> | <retvalsymbol>]\n OP=(< > <> =)"),TP_ALL},
+{TOK_P_EXECUTE,_T("!execute"),1,2,_T("command [<OP retval> | <retvalsymbol>]\n OP=(< > <> =)"),TP_ALL},
{TOK_P_MAKENSIS,_T("!makensis"),1,2,_T("parameters [<OP retval> | <retvalsymbol>]"),TP_ALL},
{TOK_P_ADDINCLUDEDIR,_T("!AddIncludeDir"),1,0,_T("dir"),TP_ALL},
{TOK_P_INCLUDE,_T("!include"),1,2,_T("[/NONFATAL] [/CHARSET=<") TSTR_INPUTCHARSET _T(">] filename.nsh"),TP_ALL},
@@ -266,6 +269,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_P_ERROR,_T("!error"),0,1,_T("[error_message]"),TP_ALL},
{TOK_P_VERBOSE,_T("!verbose"),1,-1,_T("verbose_level | push | pop [...]"),TP_ALL},
+{TOK_P_PRAGMA,_T("!pragma"),2,-1,_T("warning <enable|disable|default> number | warning <push|pop>"),TP_ALL},
{TOK_P_MACRO,_T("!macro"),1,-1,_T("macroname [parms ...]"),TP_ALL},
{TOK_P_MACROEND,_T("!macroend"),0,0,_T(""),TP_ALL},
@@ -280,7 +284,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_P_GETDLLVERSION,_T("!getdllversion"),2,0,_T("localfilename define_basename"),TP_ALL},
{TOK_P_SEARCHPARSESTRING,_T("!searchparse"),3,-1,_T("[/ignorecase] [/noerrors] [/file] source_string_or_file substring OUTPUTSYM1 [substring [OUTPUTSYM2 [substring ...]]]"),TP_ALL},
-{TOK_P_SEARCHREPLACESTRING,_T("!searchreplace"),4,1,_T("[/ignorecase] output_name source_string substring replacestring"), TP_ALL},
+{TOK_P_SEARCHREPLACESTRING,_T("!searchreplace"),4,1,_T("[/ignorecase] output_name source_string substring replacestring"),TP_ALL},
{TOK_MISCBUTTONTEXT,_T("MiscButtonText"),0,4,_T("[back button text] [next button text] [cancel button text] [close button text]"),TP_GLOBAL},
{TOK_DETAILSBUTTONTEXT,_T("DetailsButtonText"),0,1,_T("[details button text]"),TP_PG},
@@ -301,8 +305,8 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_DEFVAR,_T("Var"),1,1,_T("[/GLOBAL] var_name"),TP_ALL},
// Added by ramon 6 jun 2003
{TOK_VI_ADDKEY,_T("VIAddVersionKey"),2,1,_T("[/LANG=lang_id] keyname value"),TP_GLOBAL},
-{TOK_VI_SETPRODUCTVERSION,_T("VIProductVersion"),1,0,_T("[version_string_X.X.X.X]"),TP_GLOBAL},
-{TOK_VI_SETFILEVERSION,_T("VIFileVersion"),1,0,_T("[version_string_X.X.X.X]"),TP_GLOBAL},
+{TOK_VI_SETPRODUCTVERSION,_T("VIProductVersion"),1,0,_T("version_string_X.X.X.X"),TP_GLOBAL},
+{TOK_VI_SETFILEVERSION,_T("VIFileVersion"),1,0,_T("version_string_X.X.X.X"),TP_GLOBAL},
{TOK_LOCKWINDOW,_T("LockWindow"),1,0,_T("(on|off)"),TP_CODE},
};
diff --git a/Source/tokens.h b/Source/tokens.h
index 533b07b..6e43c6b 100755
--- a/Source/tokens.h
+++ b/Source/tokens.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -120,6 +120,7 @@ enum
TOK_P_ERROR,
TOK_P_VERBOSE,
+ TOK_P_PRAGMA,
TOK_P_MACRO,
TOK_P_MACROEND,
@@ -176,6 +177,7 @@ enum
TOK_EXEC,
TOK_EXECWAIT,
TOK_EXECSHELL,
+ TOK_EXECSHELLWAIT,
TOK_CALLINSTDLL,
TOK_REGDLL,
TOK_UNREGDLL,
@@ -186,7 +188,9 @@ enum
TOK_WRITEREGSTR,
TOK_WRITEREGEXPANDSTR,
TOK_WRITEREGBIN,
+ TOK_WRITEREGMULTISZ,
TOK_WRITEREGDWORD,
+ TOK_WRITEREGNONE,
TOK_DELETEINISEC,
TOK_DELETEINISTR,
TOK_FLUSHINI,
diff --git a/Source/tstring.cpp b/Source/tstring.cpp
index eb751a2..0be0545 100755
--- a/Source/tstring.cpp
+++ b/Source/tstring.cpp
@@ -2,7 +2,7 @@
//
// This file is a part of Unicode NSIS.
//
-// Copyright (C) 2007-2016 Jim Park
+// Copyright (C) 2007-2017 Jim Park
//
// Licensed under the zlib/libpng license (the "License");
// you may not use this file except in compliance with the License.
diff --git a/Source/tstring.h b/Source/tstring.h
index 655e6de..6fe1792 100755
--- a/Source/tstring.h
+++ b/Source/tstring.h
@@ -2,7 +2,7 @@
//
// This file is a part of Unicode NSIS.
//
-// Copyright (C) 2007-2016 Jim Park
+// Copyright (C) 2007-2017 Jim Park
//
// Licensed under the zlib/libpng license (the "License");
// you may not use this file except in compliance with the License.
diff --git a/Source/uservars.h b/Source/uservars.h
index f7dd323..c967cb0 100755
--- a/Source/uservars.h
+++ b/Source/uservars.h
@@ -4,7 +4,7 @@
* This file is a part of NSIS.
*
* Copyright (C) 2003 Ramon
- * Copyright (C) 2003-2016 NSIS Contributors
+ * Copyright (C) 2003-2017 NSIS Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/utf.cpp b/Source/utf.cpp
index 7658552..3bb4eba 100755
--- a/Source/utf.cpp
+++ b/Source/utf.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 2011-2016 Anders Kjersem
+ * Copyright (C) 2011-2017 Anders Kjersem
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -331,11 +331,11 @@ WORD GetEncodingFromString(const TCHAR*s, bool&BOM)
if (!_tcsicmp(s,_T("ACP"))) return NStreamEncoding::ACP;
if (!_tcsicmp(s,_T("OEM"))) return NStreamEncoding::OEMCP;
if (!_tcsicmp(s,_T("UTF8"))) return NStreamEncoding::UTF8;
- if ((!_tcsicmp(s,_T("UTF8SIG")) || !_tcsicmp(s,_T("UTF8BOM"))) && ++BOM)
+ if ((!_tcsicmp(s,_T("UTF8SIG")) || !_tcsicmp(s,_T("UTF8BOM"))) && (BOM = true))
return NStreamEncoding::UTF8;
- if (!_tcsicmp(s,_T("UTF16LE")) || (!_tcsicmp(s,_T("UTF16LEBOM")) && ++BOM))
+ if (!_tcsicmp(s,_T("UTF16LE")) || (!_tcsicmp(s,_T("UTF16LEBOM")) && (BOM = true)))
return NStreamEncoding::UTF16LE;
- if (!_tcsicmp(s,_T("UTF16BE")) || (!_tcsicmp(s,_T("UTF16BEBOM")) && ++BOM))
+ if (!_tcsicmp(s,_T("UTF16BE")) || (!_tcsicmp(s,_T("UTF16BEBOM")) && (BOM = true)))
return NStreamEncoding::UTF16BE;
if (S7IsChEqualI('C',*s++) && S7IsChEqualI('P',*s++))
{
diff --git a/Source/utf.h b/Source/utf.h
index 772f440..797d43b 100755
--- a/Source/utf.h
+++ b/Source/utf.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 2011-2016 Anders Kjersem
+ * Copyright (C) 2011-2017 Anders Kjersem
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/util.cpp b/Source/util.cpp
index 13c0926..83be1ff 100755
--- a/Source/util.cpp
+++ b/Source/util.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -70,7 +70,7 @@ size_t my_strncpy(TCHAR*Dest, const TCHAR*Src, size_t cchMax)
// Dest and Src must be valid, Dest is always \0 terminated.
// Returns number of TCHARs copied to Dest (not counting \0); min(strlen(Src),cchMax-1).
size_t cch = 0;
- if (cchMax) for (TCHAR c; --cchMax;) if (!(c = Src[cch])) break; else Dest[cch++] = c;
+ if (cchMax) for (TCHAR c; --cchMax;) { if (!(c = Src[cch])) break; Dest[cch++] = c; }
Dest[cch] = _T('\0');
return cch;
}
@@ -159,20 +159,20 @@ TCHAR *CharPrev(const TCHAR *s, const TCHAR *p) {
break;
s = n;
}
- return (TCHAR *) s;
+ return const_cast<TCHAR*>(s);
}
char *CharNextA(const char *s) {
int l = 0;
if (s && *s)
l = max(1, mblen(s, MB_CUR_MAX));
- return (char *) s + l;
+ return const_cast<char*>(s + l);
}
wchar_t *CharNextW(const wchar_t *s) {
- if (sizeof(*s)==2 && IsLeadSurrogateUTF16(*s)) (wchar_t*) ++s; //BUGBUG: This assumes that 16bit wchar_t == UTF16
- // else if(...) BUGBUG: Is this the best we can do? What about combining characters/diacritics etc?
- return (wchar_t*) s + 1;
+ if (sizeof(*s) == 2 && IsLeadSurrogateUTF16(*s)) ++s; //BUGBUG: This assumes that 16bit wchar_t == UTF16
+ // else if (...) BUGBUG: Is this the best we can do? What about combining characters/diacritics etc?
+ return const_cast<wchar_t*>(s + 1);
}
char *CharNextExA(WORD codepage, const char *s, int flags) {
@@ -182,7 +182,7 @@ char *CharNextExA(WORD codepage, const char *s, int flags) {
int len = mblen(s, strlen(s));
if (len > 0) np = s + len; else np = s + 1;
setlocale(LC_CTYPE, orglocct);
- return (char *) np;
+ return const_cast<char*>(np);
}
int wsprintf(TCHAR *s, const TCHAR *format, ...) {
@@ -222,7 +222,7 @@ bool NSISRT_Initialize() // Init function for POSIX
create_code_page_string(g_nrt_iconv_narrowloc, cchmax, CP_UTF8);
}
}
- return !!nsis_iconv_get_host_endian_ucs4_code();
+ return nsis_iconv_get_host_endian_ucs4_code() && IsValidCodePage(NSISRT_GetASCIICodepage());
}
const char* NSISRT_setlocale_wincp(int cat, unsigned int cp)
@@ -554,7 +554,7 @@ void PathConvertWinToPosix(TCHAR*p)
TCHAR *my_convert(const TCHAR *path)
{
TCHAR *converted_path = _tcsdup(path);
- if(!converted_path)
+ if (!converted_path)
{
MY_ERROR_MSG(_T("Error: could not allocate memory in my_convert()\n"));
return 0;
@@ -678,7 +678,7 @@ tstring get_executable_path(const TCHAR* argv0) {
return tstring(CtoTString(temp_buf));
#else /* Linux/BSD/POSIX/etc */
const TCHAR *envpath = _tgetenv(_T("_"));
- if( envpath != NULL )
+ if (envpath)
return get_full_path(envpath);
else {
char *path = NULL, *pathtmp;
@@ -686,17 +686,17 @@ tstring get_executable_path(const TCHAR* argv0) {
int nchars;
while(1){
pathtmp = (char*)realloc(path,len+1);
- if( pathtmp == NULL ){
+ if (pathtmp == NULL) {
free(path);
return get_full_path(argv0);
}
path = pathtmp;
nchars = readlink("/proc/self/exe", path, len);
- if( nchars == -1 ){
+ if (nchars == -1) {
free(path);
return get_full_path(argv0);
}
- if( nchars < (int) len ){
+ if (nchars < (int) len) {
path[nchars] = '\0';
tstring result;
result = CtoTString(path);
@@ -1092,7 +1092,7 @@ int WINAPI WinStdIO_vfwprintf(FILE*strm, const wchar_t*Fmt, va_list val)
{
ExpandoString<wchar_t, NSIS_MAX_STRLEN> buf;
errno = ENOMEM;
- const size_t cchfmt = buf.StrFmt(Fmt, val, false);
+ const size_t cchfmt = buf.StrVFmt(Fmt, val, false);
UINT cch = (UINT) cchfmt;
assert(sizeof(size_t) <= 4 || cchfmt == cch);
if (cch && !WinStdIO_OStreamWrite(*pOSD, buf, cch))
diff --git a/Source/util.h b/Source/util.h
index eddd49e..1ecde3f 100755
--- a/Source/util.h
+++ b/Source/util.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@
extern double my_wtof(const wchar_t *str);
extern size_t my_strncpy(TCHAR*Dest, const TCHAR*Src, size_t cchMax);
+template<class T> bool strtrycpy(T*Dest, const T*Src, size_t cchCap) { size_t c = my_strncpy(Dest, Src, cchCap); return c < cchCap && !Src[c]; }
size_t my_strftime(TCHAR *s, size_t max, const TCHAR *fmt, const struct tm *tm);
// Adds the bitmap in filename using resource editor re as id id.
@@ -77,7 +78,8 @@ public:
if (!p) throw std::bad_alloc();
m_heap = (T*) p;
}
- size_t StrFmt(const T*FmtStr, va_list Args, bool throwonerr = true)
+ size_t StrFmt(const T*f, ...) { va_list v; va_start(v, f); size_t r = StrVFmt(f, v); va_end(v); return r; }
+ size_t StrVFmt(const T*FmtStr, va_list Args, bool throwonerr = true)
{
size_t n = ExpandoStrFmtVaList(m_stack, COUNTOF(m_stack), &m_heap, FmtStr, Args);
if (throwonerr && !n && *FmtStr) throw std::bad_alloc();
@@ -169,6 +171,7 @@ inline void PrintColorFmtMsg_ERR(const TCHAR *fmtstr, ...)
bool NSISRT_Initialize();
+#define NSISRT_GetASCIICodepage() ( 1252 )
#ifndef _WIN32
// iconv const inconsistency workaround by Alexandre Oliva
template <typename T>
@@ -276,6 +279,15 @@ FILE* my_fopen(const TCHAR *path, const char *mode);
// assumption: T is an int type
template <class T> inline T align_to_512(const T x) { return (x+511) & ~511; }
+template<class T> inline T read_ptr_as(const void*p)
+{
+#if defined(_MSC_VER) && (_MSC_VER-0 < 1400) // TODO: Figure out which versions are able to optimize the memcpy
+ return *(T*)(p);
+#else
+ T t; memcpy(&t, p, sizeof(T)); return t;
+#endif
+}
+
// some values need to be truncated from size_t to [unsigned] int, using this function is better than a plain cast
template<class R, class T> inline R internaltruncate_cast(T t) {
assert((~((T)0)) > T(0)); // Only unsigned types supported right now
diff --git a/Source/validateunicode.cpp b/Source/validateunicode.cpp
index 0218ddd..b141c83 100755
--- a/Source/validateunicode.cpp
+++ b/Source/validateunicode.cpp
@@ -2,7 +2,7 @@
//
// This file is a part of Unicode NSIS.
//
-// Copyright (C) 2009-2016 Jim Park
+// Copyright (C) 2009-2017 Jim Park
//
// Licensed under the zlib/libpng license (the "License");
// you may not use this file except in compliance with the License.
diff --git a/Source/validateunicode.h b/Source/validateunicode.h
index 8b39b1e..79ac92b 100755
--- a/Source/validateunicode.h
+++ b/Source/validateunicode.h
@@ -2,7 +2,7 @@
//
// This file is a part of Unicode NSIS.
//
-// Copyright (C) 2009-2016 Jim Park
+// Copyright (C) 2009-2017 Jim Park
//
// Licensed under the zlib/libpng license (the "License");
// you may not use this file except in compliance with the License.
diff --git a/Source/winchar.cpp b/Source/winchar.cpp
index 864b386..1206a94 100755
--- a/Source/winchar.cpp
+++ b/Source/winchar.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/winchar.h b/Source/winchar.h
index 78c43cf..eee0d37 100755
--- a/Source/winchar.h
+++ b/Source/winchar.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/writer.cpp b/Source/writer.cpp
index 96ec9b1..893f338 100755
--- a/Source/writer.cpp
+++ b/Source/writer.cpp
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/writer.h b/Source/writer.h
index 2bc1317..9236b98 100755
--- a/Source/writer.h
+++ b/Source/writer.h
@@ -3,7 +3,7 @@
*
* This file is a part of NSIS.
*
- * Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Copyright (C) 1999-2017 Nullsoft and Contributors
*
* Licensed under the zlib/libpng license (the "License");
* you may not use this file except in compliance with the License.
diff --git a/Source/zlib/INFBLOCK.C b/Source/zlib/INFBLOCK.C
index 12603f4..90abeb8 100755
--- a/Source/zlib/INFBLOCK.C
+++ b/Source/zlib/INFBLOCK.C
@@ -2,7 +2,7 @@
* This file is a part of the zlib compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.zlib.net/
diff --git a/Source/zlib/ZCONF.H b/Source/zlib/ZCONF.H
index 2078330..bdff402 100755
--- a/Source/zlib/ZCONF.H
+++ b/Source/zlib/ZCONF.H
@@ -2,7 +2,7 @@
* This file is a part of the zlib compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.zlib.net/
diff --git a/Source/zlib/ZLIB.H b/Source/zlib/ZLIB.H
index 7978c63..a6c7d92 100755
--- a/Source/zlib/ZLIB.H
+++ b/Source/zlib/ZLIB.H
@@ -2,7 +2,7 @@
* This file is a part of the zlib compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.zlib.net/
diff --git a/Source/zlib/ZUTIL.H b/Source/zlib/ZUTIL.H
index 895c255..264fe27 100755
--- a/Source/zlib/ZUTIL.H
+++ b/Source/zlib/ZUTIL.H
@@ -2,7 +2,7 @@
* This file is a part of the zlib compression module for NSIS.
*
* Copyright and license information can be found below.
- * Modifications Copyright (C) 1999-2016 Nullsoft and Contributors
+ * Modifications Copyright (C) 1999-2017 Nullsoft and Contributors
*
* The original zlib source code is available at
* http://www.zlib.net/
@@ -69,6 +69,7 @@ typedef unsigned long ulg;
# include "../exehead/util.h"
# define zmemcpy mini_memcpy
# else
+# include <string.h> // Avoid "incompatible implicit declaration of built-in function"
# define zmemcpy memcpy
# endif
#else