Hi,
I made a bugfix on an old product running on Windows Server 2003. The installer is created from NSIS 2.46 (I also tried NSIS 3.04) but terminates immediately without trace when it is supposed to open a MessageBox. The installer works fine on Windows7 and Windows 10. Code sample, function called from .onInit:
Function IsOcpInstalled
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayName"
StrCmp $0 "" ContinueInstallation
MessageBox MB_ICONEXCLAMATION|MB_OK "A version of the OCP is already installed! Please uninstall it first"
ContinueInstallation:
FunctionEnd
When a previous OCP is installed, the messagebox never shows and the installer terminates. If no OCP previously installed, the installer continues until it gets to another function requesting user to make a selection. For instance if a license is not found, a MessageBox is supposed to request user to select whether to continue or to cancel the installation. This never happens, the installer immediately terminates.
I commented out all usage of MessagBoxes and the installer works fine also on Windows Server 2003. I have searched the web and found others with similar issues but not related to NSIS. Is there anyone that knows whether this is a known problem and if there is a solution already available?
Currently my workaround is to only allow MessageBox if installer running on OS from Windows 7 and up. If that is not the case a default selection is made and a notifcation is written to an install log. However I think it is better to have an instant interaction with the user.
MessageBox causes NSIS installer/uninstaller to terminate
2 posts
MessageBox should not crash!
What happens if you call it directly (for 2.46 and 3 ansi):
Does this machine have 3rd-party anti-virus? Utility applications that hooks things?
What happens if you call it directly (for 2.46 and 3 ansi):
Section?
System::Call 'USER32::MessageBoxA(i$hwndParent,t "World", t "Hello", i 0)'
System::Call '*(&l4, i$hwndParent, i0, t "Indirect World", t "Hello", i 0, i0,i0,i0,i0)i.r1'
System::Call 'USER32::MessageBoxIndirectA(ir1)'
System::Free $1
SectionEnd
Does this machine have 3rd-party anti-virus? Utility applications that hooks things?