Fix BOM
Read my previous post again, slowly...
Caption "$(^SetupCaption) ${VERSION}" works because you can compile (no errors reported) but installer exe didn't start (loop?). BrandingText "$(^SetupCaption) ${VERSION}" works and the exe installer start without problem and on bottom left you see ^Setup replaced by relative text. If Caption "$(^SetupCaption) ${VERSION}" works you can avoiud to use separate strings for each language.
Function GetFileSize64 Exch $1 FileOpen $1 $1 r StrCmp $1 "" error !if "${NSIS_PTR_SIZE}" > 4 ; Change this to "!if 1" if you don't care about systems older than WinXP. System::Call 'KERNEL32::GetFileSizeEx(pr1,*l0s)' FileClose $1 !else System::Call 'KERNEL32::GetFileSize(pr1,*i0s)i.s' FileClose $1 Pop $1 IntFmt $1 "0x%x" $1 Exch $1 IntFmt $1 "0x%x00000000" $1 System::Int64Op $1 | !endif Pop $1 error: Exch $1 FunctionEnd Section Push "favorite_distro.iso" Call GetFileSize64 Pop $1 DetailPrint Bytes=$1...
It's not that strange, BrandingText "$(^Branding)" would give you the same problem.
Updated Italian (GH PR 31)
Update WinVer for new Win11
Thanks. You suggestion works. It's quite strange that $(^SetupCaption) didn't work as string value with Caption instruction but it works as string value with BrandingText instruction. Please check.
Thanks. You suggestion works. It's quite strange that $(^SetupCaption) didn't work as string value in Caption instruction but it works as string value in BrandingText instruction. Please check.
Thanks.
Add /P switch for makensis.nsi portable mode
Mention TARGET_ARCH propagation in changelog
Use --no-insert-timestamp to make builds reproducible
makensis: Improve error/warning output
Function GetFileSize64 Exch $1 Push $0 FileOpen $0 $1 r Push "" ; Return empty string on error StrCmp $0 "" error !if "${NSIS_PTR_SIZE}" > 4 ; Change this to "!if 1" if you don't care about systems older than WinXP. System::Call 'KERNEL32::GetFileSizeEx(pr0,*lss)' !else System::Call 'KERNEL32::GetFileSize(pr0,*iss)i.r1' IntFmt $1 "%#x" $1 Exch $1 IntFmt $1 "%#x00000000" $1 System::Int64Op $1 | !endif error: FileClose $0 Exch Pop $0 FunctionEnd Section Push "favorite_distro.iso" Call GetFileSize64...
This is outside our control, Sourceforge used to allow viewing html files like this but not anymore. Some time after this bug report, /view now just redirects to a page where you can download the html file.
Is it possible to make reproducible builds?
Cross-platform reproducable builds
Use TARGET_ARCH as the makensis default CPU target
^SetupCaption is the langstring name of the Caption in the installer (but not uninstaller) so you are creating an infinite loop when it tries to resolve the string and the installer probably dies with a stack overflow crash. I don't know an automatic solution to this, you just have to copy the original strings from the .nlf files: !define VERSION 1.2.3 !include MUI2.nsh !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_LANGUAGE English LangString ^SetupCaption ${LANG_ENGLISH} "$(^Name) Setup ${VE...
Caption - Use of "SetupCaption" string value
Update forum URL (GH PR 30)
Use native IntPtrCmpU
Optimize register usage
Add missing whitespace (hidden by bug #1327)
Empty string terminates token parsing too early
NSIS 3.12 released
Tagging for release 3.12
3.12
prepare for release
update another action mostly for node version deprecation
basic .gitignore for git mirror
update actions mostly for node version deprecation
Use new Mac and stop using deprecated platforms
Avoid some minor warnings on Mac
Manually handle null terminator when input length is -1 in our emulated MBTWC and WCTMB
Clarify that we are just grabbing the lower 16 bits
Added StartsWith[S], EndsWith[S], Contains[S], IsLowerCase and IsUpperCase operators
Check PE signature before parsing headers
Catch the exception instead
Work around annoying PEP 765 warning when returning in a finally block in Python 3.14+
(C) 2026
Fix broken VS2022 call to imaginary memcpy
add support for windows ARM64 in makensis.nsi
Preliminary ARM64 support in makensis.nsi (patch #318)
Don't use the Low IL temp directory when elevated (bug #1326)
Scons error with Python < 3.6
Support Python older than 3.6 again (bug #1325)
NSIS_ARM64 is defined to a number >= 1 when compiling for ARM64 (undocumented). NSIS_CPU is also set (again, undocumented). Ideally we would be able to install stubs and plugins for multiple architectures so we don't actually want to check that here.
NSIS_ARM64 is defined to a number >= 1 when compiling for ARM64 (undocumented). Ideally we would be able to install stubs and plugins for multiple architectures so we don't actually want to check that here.
Macros are just simple text replacements happening early in the compilation process. You can work around this by forcing the caller to provide a temporary variable as a parameter.
Yes, you can check it at runtime but not at compile time currently. !include x64.nsh ${If} ${IsNativeARM64} ${EndIf}
The better way to do it is like this: !macro InstallPlugin pi !if /FileExists ..\Plugins\amd64-unicode\${pi}.dll File "/oname=$InstDir\Plugins\amd64-unicode\${pi}.dll" ..\Plugins\amd64-unicode\${pi}.dll !endif !if /FileExists ..\Plugins\arm64-unicode\${pi}.dll File "/oname=$InstDir\Plugins\arm64-unicode\${pi}.dll" ..\Plugins\arm64-unicode\${pi}.dll !endif !if /FileExists ..\Plugins\x86-ansi\${pi}.dll File "/oname=$InstDir\Plugins\x86-ansi\${pi}.dll" ..\Plugins\x86-ansi\${pi}.dll !endif !if /FileExists...
add support for windows ARM64 in makensis.nsi
I'm interested in having NSIS with ZSTD. There was some discussion over on github recently (https://github.com/NSIS-Dev/nsis/pull/28) and I would like to know a few things: It seems the original PR (https://github.com/NSIS-Dev/nsis/pull/16) was opened 5 years ago but never merged. It was then moved to #28, but no response from you, the maintainers. What is your plan with regard to this PR? There is some discussion about supporting old targets, which requires importing half the universe for ZSTD to...
Auto Add to Path on Windows Installer
I just saw this as a regression, I'm not worried if the fix is not accepted.
Ubuntu 14.04 EOL'ed 7 years ago. Not even sure when 12.04 did. Python 2 EOL'ed 6 years ago. We are talking developing NSIS itself here. Pretty much the three people in this conversation are it. Linux distributions also package their own, but they mostly only update versions that are still in use and not EOL'ed. I would argue anyone who cares enough to build their own up-to-date NSIS, would probably care enough to have a moderatly up-to-date OS. Do we really want to limit ourselves to Python 2 backward...
Yes, it does not appear to crash using ANSI. But with unicode it's guaranteed to crash within the first 5 times in the loop.
I still have the original ubuntu 12.04 VM I set up to test nsis with (has the old mingw32 toolchain), plus a 14.04 VM, and a windows xp VM. All of those use python 2.7.x. It's a good variety and gives decent coverage for finding small issues, or in this case a big issue.
Python 3.6 EOL'ed over 4 years ago. What Linux are you using that is on something older than 3.6?
Have you tested to see if it happens with ANSI installers?
I'm still using old scons, I'll probably run into the same error the next time I do any coding and I'll hopefully have to fix this.
Unalignment errors would not surprise me, very few uses non-x86.
Forgot to mention why I used a preformatted block for the quotes, it's because the OutFile command doesn't like spaces in the name or path, and I took advantage of the fact that in the script single quotes and double quotes are treated the same by makensis, so this multi quote trick in python works.
Scons error with Python < 3.6
I finally got round to debugging this. I compiled a debug build and ran it with x32dbg, and it stopped with an access violation, around where GlobalReAlloc() is. I tried a handful of different ways of reallocating that memory, but same result. So I thought, why not just discard the contents every time it is full, and reset the output pointer? This is probably not ideal since it overwrites old data with new data, but at least the plugin doesn't crash any more. I attached a patch with the potential...
... 64-bit installers are impossible to build using the version of NSIS distributed for Windows; Is this still true? I successfully built a 64-bit Version of the smartmontools installer (with cpu amd64 added) on Windows using NSIS from the upstream nsis-3.11-setup.exe after copying Stubs/lzmasolid-amd64-unicode and Plugins/amd64-unicode/System.dll from the Debian 13 package nsis-common-3.11 to the NSIS install directory. Both installer and uninstaller are actually 64-bit and seem to work.
PS: Updated this page accordingly: https://nsis.sourceforge.io/Installing_mutual_exclusive_Versions_of_Programs
Thanks for clarification and sorry for the noise.
Please document the effect of SetOutPath on the archive location
There is no directory structure at all. 7-zip reverse engineers the script to try and deduce a directory structure. That can never be totally accurate as the script has runtime dependencies. Sorry but this is not going to be documented or supported. NSIS installers are not archives. 7-zip might be interested in enhancing their reverse engineering to support such use cases.
Yes, I mean the view provided by 7-Zip, and yes, 7-Zip does a good job (but see PS:). It does not matter to the end user whether the actual format is considered to contain a real directory structure (whatever this exactly means). There is at least some directory information which allows to distinguish files with same same. In the smartmontools project, we provide 32-bit and 64-bit executables in a single NSIS installer by using this hidden SetOutPath behavior since 2012 (see r3544 aka cc751080949d)....
Yes, I mean the view provided by 7-Zip, and yes, 7-Zip does a good job (but see PS:). It does not matter to the end user whether the actual format is considered to contain a real directory structure (whatever this exactly means). There is at least some directory information which allows to distinguish files with same same. In the smartmontools project, we provide 32-bit and 64-bit executables in a single NSIS installer by using this hidden SetOutPath behavior since 2012 (see r3544 aka cc751080949d)....
Are you talking about the directory structure that appears when you open the installer in 7-zip? That is not a real directory structure. Our installers don't have an actual archive embedded in them. At least not one in any commonly used format that supports directory structures. That structure seems to be deduced from script ops based on your findings. This would be an issue with the heuristics used by 7-zip. I have noticed some other oddities with, for example, the plugins folder over the years....
Please document the effect of SetOutPath on the archive location
The request is specific for packing NSIS for Debian Linux. The linter of Debian (lintian) suggests to verify the upstream tarball using a cryptographic signature (https://udd.debian.org/lintian-tag/debian-watch-does-not-check-openpgp-signature). So there would be a file named https://sf.net/nsis/nsis-3.11-src.tar.bz2.asc containing the OpenPGP signature (result of signing released source code tarball) provided next to the released source code tarball https://sf.net/nsis/nsis-3.11-src.tar.bz2. Illustrated...
The request is specific for packing NSIS for Debian Linux. The linter of Debian (lintian) suggests to verify the upstream tarball using a cryptographic signature (https://udd.debian.org/lintian-tag/debian-watch-does-not-check-openpgp-signature). So there would be a file named https://sf.net/nsis/nsis-3.11-src.tar.bz2,asc containing the OpenPGP signature (result of signing released source code tarball) provided next to the released source code tarball https://sf.net/nsis/nsis-3.11-src.tar.bz2. Illustrated...
So you want the hash to be posted on a different server? I can try to remember to put the hash in the forum release posts. For the main .exe installer, the SHA2 is available in the WinGet manifests for our last couple of releases and even longer back in Chocolatey.
So you want the hash to be posted on a different server? I can try to remember to put the hash in the forum realease posts. For the main .exe installer, the SHA2 is available in the WinGet manifests for our last couple of releases and even longer back in Chocolatey.
The SHA1 hash provides some protection but does not enable to check that no third party changes occurred after its release.
Provide method of dumping script after preprocessing
Compiler switches for this was added in 3.0 Beta 1 (/PPO or /SAFEPPO).
Sourceforge provides SHA1 hashes of all files if you go into the "Files" section to download and click on the "(i)".
Problem at findind Stubs from NSISDIR from current executable path
Contrib/SubStart/substart.c already has a comment. I'm not sure if there is another place where we could add something where you would have seen it. Your clue was that the file you replaced in the root was only 2 kb while the new file was over 1 mb.
Ok, that is a very good explanation, thx ! A little comment in the source code would help. We can close the issue.
Ok, that is a very good explanation, thx ! We can close the issue.
I see what is going on. The proper makensis.exe is in the "Bin" folder. The one in the root NSIS dir is just a helper exe that redirects to "Bin\makensis.exe". So put your compiled makensis.exe in the "Bin" directory.
Problem at findind Stubs from NSISDIR from current executable path
Related bug: https://sourceforge.net/p/nsis/bugs/1301/
nsExec::ExecToLog crash using .exe with live outputs