Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29391 Discussions

Creating a desktop shortcut from within Fortran

michael_green
Beginner
979 Views

Hi All,

I've created an installation program for an application, which does everything except place a shortcut on the user's desktop. I've seen references as to how this can be done in Visual Basic, but does anyone know how to create a desktop shortcut for an application from within Fortan?

With many thanks in advance,

Mike

0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
979 Views
Actually, it's fairly ugly, as it involves invoking COM-based shell API IShellLink. See XFTFile::XCreateShorcut; due to inherent ugliness, I recommend using as-is (!DEC$DEFINE XLITE if you need just XFTFile rather than full Xeffort).

Have you tried InnoSetup (+ISTool) setup tools instead of reinventing the wheel? They're fairly simple to use.
0 Kudos
anthonyrichards
New Contributor III
979 Views
A brief look shows that you probably need to use Shell functions from Shell32.dll, such as SHGetSpecialFolderLocation and SHFileOperation. However wheras my version of SHELL32.F90 in CVF 6.6 contains an interface for the latter function, it does not contain an interface for the former function. Maybe Intel Fortran has more Shell function interfaces available.
0 Kudos
Reply