PDA

View Full Version : Custom action crashes on Windows 7



AndersG
12-21-2010, 09:31 AM
Hi!

I have an installer project that "After Setup Complete" launches a Custom DLL that copies a bunch of Crystal Reports report templates from reports.tmp to reports. This is because MSIEXEC cannot version them correctly.

Problem is that it works fine on Xp and 2003 server, but crashes on Vista and Win7 (below). The DLL uses the classic function signature.

Felet uppstod i programmet med namn: MsiExec.exe, version 5.0.7600.16385, tidsstämpel 0x4a5bc3e6
, felet uppstod i modulen med namn: KopieraRapp.dll, version 0.0.0.0, tidsstämpel 0x4b506e57
Undantagskod: 0xc000000d
Felförskjutning: 0x00002d33
Process-ID: 0x64
Programmets starttid: 0x01cba0fcab1dab4b
Sökväg till program: C:\Windows\system32\MsiExec.exe
Sökväg till modul: C:\Program Files\Pedago\KopieraRapp.dll
Rapport-ID: 5640e462-0cf0-11e0-92e9-000c2946d298

hidenori
12-21-2010, 01:16 PM
Have you checked for missing dependencies using dependency walker? I would also verify if your DLL works outside the installation by creating an .exe that calls your function and running it manually after the installation completes. If it crashes that way, it should be easy to debug.

Hope that helps.

AndersG
12-22-2010, 06:38 AM
"Have you checked for missing dependencies using dependency walker?"

Excellent advice! I should have done so before posting, but as the issue only happened on Win7, I thought that someone else must have run into it.

Dependency Walker pinpointed the culprit as the infamous IEShims.dll. If I copy the 32-bit version of that DLL to the same dir as the dll, then all is fine, but what would be the correct way to handle this?

Ie, I am not calling this DLL from mine. The dependency is something Win7 has blessed me with and the DLL cannot find IEshim.dll when it is in

C:\Program Files (x86)\Internet Explorer

AndersG
12-22-2010, 11:14 AM
Or rather. If I copy the dll to the same dir then I can exec the DLL from another EXE just fine. Installshield still crashes though with a Buffer Overflow Exception.

Ahem... IS seems to be passing some very funky strings when calling from Win7... Will investigate further.

AndersG
12-25-2010, 11:24 AM
OK. Forget the strings. Was an error on my part, but in the end there were several issues.

1. The DLL
2. _utime(szUtfilnamn, &timebuffer); crashing under win7 32 (ran fine on 64)
3. The actual copy routine.

I rewrote the copy routine so that in uses SetFileTime() to set the time on the copy afterwards (created and modified need to be the same for me to be able to update the files through a quickpatch) and it now runs nicely on both 32 and 64 bit Win7.