Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start Menu Folder as a Subdirectory - Inno Setup

Tags:

inno-setup

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?

like image 656
oggmonster Avatar asked Feb 21 '13 11:02

oggmonster


2 Answers

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}"
like image 108
TLama Avatar answered Oct 29 '22 16:10

TLama


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.

like image 41
Deanna Avatar answered Oct 29 '22 15:10

Deanna