I want to add a shortcut to my program in the start menu as follows:
MyAppPublisher\MyAppName\MyAppName
I have this in my script:
DefaultGroupName={#MyAppPublisher}
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
But the start menu folder is always:
MyAppName\MyAppName
Any ideas?
It's as easy as specifying this path in the Name
parameter of the entry in the [Icons]
section. Your current script creates a shortcut like MyAppPublisher\MyAppName
, this one will do what you need:
#define MyAppName "MyAppName"
#define MyAppExeName "MyProg.exe"
#define MyAppPublisher "MyAppPublisher"
[Setup]
AppName={#MyAppName}
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName={#MyAppPublisher}
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "{#MyAppExeName}"; DestDir: "{app}"
[Icons]
; notice the full path to the created shortcut, {group} is taken from the Select
; Start Menu Folder page edit box (if shown), which is by default taken from the
; DefaultGroupName directive value; this start menu folder path is then followed
; by the tail of the shortcut path
Name: "{group}\{#MyAppName}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
If you want the group to be in a subfolder, you need to specify the sub folder.
The best way to do this is to append it to the end of the DefaultGroupName
directive which will show the correct info in the setup wizard and allow the user to change it to as single folder or another location entirely if they wish.
DefaultGroupName={#MyAppPublisher}\{#MyAppName}
Note that the Start Menu in Windows 8 is not heirachical so any nesting won't be seen anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With