RossW
21st November 2008 15:43 UTC
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?
kichik
22nd November 2008 19:32 UTC
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
RossW
24th November 2008 15:45 UTC
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
kichik
24th November 2008 21:58 UTC
Using short file names shouldn't be a problem. Use GetFullPathName /SHORT to get it.
RossW
25th November 2008 15:36 UTC
Thanks!