Archive: How to Convert Long File Names to 8.3 in CreateShortcut


How to Convert Long File Names to 8.3 in CreateShortcut
I've created an installer that uses

InstallDir "$LOCALAPPDATA\My App Name Here

and then I need to create a shortcut on both the Program menu and desktop using CreateShortcut. My app is a secured MS Access 2003 application which requires "/wrkgrp C:\somefile.mdw" be appended to the shortcut Target. Also, since users can have multiple versions of MS Access installed on their machines I need to include the path to MS Acess 2003's exe in the Target. Is seems that this can exceed the limit of the Target field so the resulting shortcut shows a truncation.

To prevent this from happening, I think I might try converting all the files to 8.3 format but I'm not sure if this will work or if it will cause problems later on. All users of this app must be using Windows XP (not Vista as it doesn't support Windows Imaging Acquisition Library).

Any ideas?


Not quite sure from your explanation what is the problem you're experiencing, but most of the time it's:

http://nsis.sourceforge.net/I_am_hav...CreateShortcut


Kichik,

The problem is with Windows - the Target field in a shortcut is limited to 259 characters and with my app I have the .exe file (MSACCESS.exe), my app file (C:\Documents and Settings\Paul\Local Settings\Applications\My App\My App.exe) and the MS Access workgroup (C:\Documents and Settings\Paul\Local Settings\Applications\My App\SampleDB\Server\wrkgrp.mdw). This easily exceeds 259 chars so I thought I might convert all the paths to 8.3 but not sure if this will work at runtime.

Cheers,
Ross


Using short file names shouldn't be a problem. Use GetFullPathName /SHORT to get it.


Thanks!