Archive: CreateShortcut crashes on Win7 64-bit when ran from network drive


CreateShortcut crashes on Win7 64-bit when ran from network drive
Hi,

I've got a MUI2 based script, building and working fine on XP and Win7, build with NSIS 2.46.

However, if I run the installer from a Network drive (E) it will crash on Win7 when the following is executed:

CreateShortcut "$SMPROGRAMS\App\App.lnk" "$INSTDIR\app.exe"

The prior CreateDirectory "$SMPROGRAMS\App" is however fine.

If I run the program from the local drive, it's okay and install completes normally. If I comment out this line, the install is again okay (but no Start entry!).

I've got a RequestExecutionLevel admin at the top of the script, and in both cases I get a UAC verification prompt when running the installer. Unfortunately the crash doesn't give much info:

Problem signature:
Problem Event Name: APPCRASH
Application Name: app_dev.exe
Application Version: 0.0.0.0
Application Timestamp: 4b1ae3c6
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdb3b
Exception Code: c0000005
Exception Offset: 00032f15
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 2057
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789


How can I stop this crash, or get some info towards debugging it?

Regards,

Mike


What was the last SetOutPath?

Stu


SetOutPath "$INSTDIR\Driver"

I checked and that dir does exist (some files are unpacked to there previously).

Mike


That will be the working directory (start in) for the shortcut. Try setting a different $OUTDIR before creating the shortcut.

Stu


Okay - it's working now!

I tried moving the script around to create the shortcuts first (just after SetOutPath "$INSTDIR") and that started to work.

So I went back and put the .nsi to how it was and retried to confirm the fix. But now it is still okay...

I'm using SVN so can be sure the script is exactly as it was when the problem was found. The only difference is that I closed some Dos boxes on the Win7 machine - I'm not sure if they somehow held a handle to something important?

I'm afraid this looks like one that got away. Maybe there is an error path from CreateShortcut which crashes in some rare situation which I can no longer reproduce... I'm not sure.

So while I'm happy that the installer now works in all my tested configurations, I'm also worried it might crash on a user somewhere...

I'm not sure what else I can do here.