Archive: CreateShortCut to a folder is creating a short cut of type File instead


CreateShortCut to a folder is creating a short cut of type File instead
When I try to create a short cut to a folder in my install directory, the installer is creating the shortcut, but when I look at the properties, it's of type "File" rather than type "File Folder". Selecting it from the Start Menu brings up a dialog asking which program should be used to open it rather than opening the folder in the Explorer.

This is the line from my script:

CreateShortCut '$SMPROGRAMS\My Program\logs.lnk' '$INSTDIR\logs'

Creating a short cut to the program or the uninstaller is working fine. I can also create a shortcut to any other directory (e.g. C:Program Files) and it gets created with the proper File Folder type and works fine.

I'm guessing that this has something to do with the fact that the $INSTDIR\logs directory is created as part of the install step, so is new and somehow CreateShortCut doesn't understand it's a directory. Any suggestions for how to make this work?


Make sure the folder exists before you create the shortcut...