Newbie Shortcut question

53 views
Skip to first unread message

Dave Terry

unread,
Sep 15, 2026, 1:12:07 AM (8 days ago) Sep 15
to innosetup
I'm trying to create a shortcut on the desktop with a target exe name and path run the exe in.

[Icons]
Name: "{autodesktop}\\{#MyAppName}"; Filename: {#MainExeName}.exe; WorkingDir: {app}

It does create a shortcut on the desktop but the target gets set as

C:\Users\david\Desktop\FB3.exe

when I just want "FB.exe" and that it run from the specified directory (which is set correctly). I dont userstand why the target has the desktop in the path. If I remove the  {autodesktop}\\  part no shortcut is created on the desktop. Am I doing something wrong?

Eivind Bakkestuen

unread,
Sep 15, 2026, 4:43:09 AM (8 days ago) Sep 15
to inno...@googlegroups.com
The declarations of the #... parts appears to be missing above? Anyway, the help for [Icons] / Filename says " The command-line filename for the shortcut, which normally begins with a directory constant. " so by the sound of it, including the directory you want, makes sense?

--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/148c7d4e-11ef-42c7-8e70-ca105d52ef57n%40googlegroups.com.

Bill Stewart

unread,
Sep 15, 2026, 10:32:35 AM (7 days ago) Sep 15
to innosetup
Why does it matter that the shortcut target contains the file's path?

Bill Stewart

unread,
Sep 15, 2026, 1:00:23 PM (7 days ago) Sep 15
to innosetup
On Tue, Sep 15, 2026 at 10:51 AM Daniel Berg wrote:

The shortcut is supposed to contain the path (from your example it is not clear if it is the correct one though) - otherwise your application will not start.  WorkingDir may dieffer from the path to the exe on purpose in case you want your app "to change to that directory" on startup - thats the way it works since Windows 3.1 (at least)

Please reply here to the group and not privately.

Daniel Berg

unread,
Sep 15, 2026, 1:16:52 PM (7 days ago) Sep 15
to innosetup
oh, sorry that was by accident!!

Best
Daniel

Gavin Lambert

unread,
Sep 15, 2026, 6:35:09 PM (7 days ago) Sep 15
to innosetup
On Tuesday, September 15, 2026 at 5:12:07 PM UTC+12 Dave Terry wrote:
[Icons]
Name: "{autodesktop}\\{#MyAppName}"; Filename: {#MainExeName}.exe; WorkingDir: {app}

As others have noted, you need to explicitly specify an {app}\ prefix in the Filename.  You also should avoid doubling the backslash; a single backslash is correct in both places.  Windows does tolerate the double-backslash in some places but not others, so it's best to avoid bad habits. 

Gavin Lambert

unread,
Sep 15, 2026, 6:38:55 PM (7 days ago) Sep 15
to innosetup
On Tuesday, September 15, 2026 at 5:12:07 PM UTC+12 Dave Terry wrote:
[Icons]
Name: "{autodesktop}\\{#MyAppName}"; Filename: {#MainExeName}.exe; WorkingDir: {app}

One more point is that it's very strongly encouraged to link desktop icons to a [Tasks] entry to let people choose to not install one -- some people resent not having a clean desktop.  If you use the New Script Wizard it will generate a script that shows an example of doing this correctly. 

Dave Terry

unread,
Sep 15, 2026, 6:56:28 PM (7 days ago) Sep 15
to innosetup
Thanks for all the help everyone! 

Key for me is to ensure Filename entry is a full path+filename+suffix (see blue text). I was missing the path which defaulted to "Program Files" tree.

[Icons]
Name: "{autodesktop}\\{#MyAppName}"; Filename: {app}\{#MainExeName}.exe; WorkingDir: {app}
Reply all
Reply to author
Forward
0 new messages