Inno Setup DefaultDirName Issue

I have a problem with Inno Setup DefaultDirName. My code looks like this:

#define MyAppName "My Program"
#define MyAppVersion "1.0"
#define MyAppPublisher "My site"
#define MyAppURL "mysite.net"
#define MyAppExeName "My Program.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{36D5C912-2F45-4295-956F-53E668BD6094}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=c:\Please Choose the Path to Your Program
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=D:\My Program\EULA.txt
OutputDir=D:\My Program\Inno\
OutputBaseFilename=setup
SetupIconFile=D:\My Program\\Graphics\Icon.ico
Compression=lzma
SolidCompression=yes

Everything works like I want it to except one thing. My program is made to modify a couple of different softwares. That's why I can't specify one default directory for all of them. At the same time I want to clearly point out what directory user is suppose to choose. That's why I wrote it like this:

DefaultDirName=c:\Please Choose the Path to Your Program

The problem with that line of code is that when user points to certain directory my installer is trying to add "\Please Choose the Path to Your Program" to that directory (which will obviously cause my program to not work properly). How can I prevent this from happening but still let the user know what directory is he suppose to choose when instaling my program?

Answers


Set the AppendDefaultDirName directive to no, e.g.:

[Setup]
...
AppendDefaultDirName=no

As the reference says (emphasized by me):

By default, when a folder in the dialog displayed by the Browse... button on the Select Destination Location wizard page is clicked, Setup automatically appends the last component of DefaultDirName onto the new path.

For example, if DefaultDirName is {pf}\My Program and "Z:\" is clicked, the new path will become "Z:\My Program".

Setting this directive to no disables the aforementioned behavior. In addition, it causes a Make New Folder button to appear on the dialog.


Need Your Help

he maximum string content length quota (8192) has been exceeded while reading XML data

wcf

I am trying to call a WCF service that reads an XML string. I get this error

Partials in lithium

php templates view partials lithium

Normally I use the Zend Framework and this is something I miss in Lithium. Partials. There is a render method in the view where you can use 'elements' which is the closest I got.