[NSIS] Valid EW_SETFLAG form triggers BadCmd=13 and hides WriteUninstaller output
A free file archiver for extremely high compression
Brought to you by:
ipavlov
7-Zip fails to list/extract the generated uninstaller from a valid NSIS 3.10+ installer when the installer uses a plug-in call before WriteUninstaller.
Unicode true
Name "NSIS 3.10 Uninstaller Probe"
OutFile "nsis-310-uninstaller-probe.exe"
InstallDir "$TEMP\Nsis310UninstallerProbe"
RequestExecutionLevel user
ShowInstDetails show
ShowUninstDetails show
SetCompressor /SOLID lzma
Section "Install"
SetOutPath "$INSTDIR"
FileOpen $0 "$INSTDIR\installed.txt" w
FileWrite $0 "Installed by the NSIS 3.10 uninstaller probe.$\r$\n"
FileClose $0
SetDetailsPrint lastused
System::Call "kernel32::GetTickCount() i.r0"
DetailPrint "System plug-in returned $0"
WriteUninstaller "$INSTDIR\Uninstall Probe.exe"
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\installed.txt"
Delete "$INSTDIR\Uninstall Probe.exe"
RMDir "$INSTDIR"
SectionEnd
makensis.exe /VERSION
makensis.exe nsis-310-uninstaller-probe.nsi
7z.exe l -slt nsis-310-uninstaller-probe.exe
7z.exe x -y -otmp-7z-nsis-310-probe nsis-310-uninstaller-probe.exe
The same minimal script works with NSIS 3.09, but when compiled with NSIS 3.10, 7-Zip reports:
Path = nsis-310-uninstaller-probe.exe
Type = Nsis
SubType = NSIS-3 Unicode BadCmd=13
Path = $PLUGINSDIR\System.dll
7-Zip should also list/extract the generated uninstaller:
$PLUGINSDIR\System.dll
Uninstall Probe.exe
7-Zip appears to treat EW_SETFLAG as having at most 3 meaningful parameters. NSIS 3.10 introduced a special SetDetailsPrint lastused / plug-in handling form that emits EW_SETFLAG with an additional parameter (NSIS-Dev/nsis@52a3b5d)
Please attach test file in compiled form
Last edit: Igor Pavlov 1 day ago