Archive: installer crash when launching Windows Explorer when MUI_PAGE_INSTFILES is displayed


installer crash when launching Windows Explorer when MUI_PAGE_INSTFILES is displayed
Hi,

I'm displaying MUI_PAGE_INSTFILES as the last page of my installer. Before I click the "Close" button, if I *manually* launch Windows Explorer (e.g. via the start menu or Windows-e), the installer executable crashes.

The error message is a typical program crash dialog, "setup.exe has encountered a problem and needs to close." If I click for more info it doesn't tell me much (ModName: unknown).

After upgrading to NSIS 2.33, I still see the problem. When I create a simple default installer with MUI dialogs, I don't see this problem. With an older version of my setup I don't see this problem either, and I'm pretty sure I didn't change anything in the NSIS script since then (I was on NSIS 2.31 but wasn't able to repro with a simple script either). I was able to repro this problem on several machines.

Any ideas / suggestions before I start stripping out lines from my 2000+ line script?

Thanks,
-bobics


It's probably a plug-in which is loaded in .onInit or .onGUIInit and isn't properly disabled before the installer exits. Start by striping those lines to see who's at fault.


After quite a bit of scrambling I got lucky and found that a DLL I'm registering during the install process is causing the NSIS installer to crash.

This particular DLL is (statically, I think) loading gdiplus.dll during registration. I used a dependency tool (depends.exe) to monitor the installer process and saw that GDIPLUS.DLL is unloaded after registration.

Later, when I move the installer window around after it has completed the install, it crashes. I believe this is because NSIS is using gdiplus.dll. Now, my opinion is that I'm doing something wrong in the self-registration code of the DLL where I'm unloading gdipluss.dll while it is still being used by the installer (when I say 'I' I mean my developer).

Can anyone more experienced with self registering DLLs give me some advice?

Thanks,
-bobics


Also, my current workaround that works is to use regsvr32 instead of UnRegDLL / InstallLib.


NSIS isn't using gdiplus.dll. Registration is nothing but calling DllRegisterServer. What makes you think gdiplus.dll is the culprit?


While in some ways I am shooting in the dark here, here are a few things in particular I've noticed that seem to hint at gdiplus:

- Between a Friday build where we didn't see the problem and a Monday build where we did see the crash, very little has changed in our application except adding of the gdiplus depedency.
- Once when I saw the crash, there was an error message pointing to "GDI Plus Window".
- If I just wait on the final installer page there is no crash until either A) I start moving the installer window around or B) open up another window of a different app while the installer is running. This makes me think it's a UI related problem since nothing in the script is running at this point.

Take these bullets in combination with there being no crash when using regsvr32.exe and the fact that the installer code has not changed.

Of course, at this point this is still basically speculation.


Also, you're right, NSIS doesn't use gdiplus.dll... I did some investigation and when I don't register our DLL, gdiplus.dll is never loaded by the installer. user32.dll (which NSIS does use) does point to gdiplus.dll but as a delay-load module that never is referenced, which shouldn't cause a problem.

So it is a mystery to me.


I'd start by getting a stack trace of the crash using windbg and some symbols.