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 ""
#define MyAppExeName "My Program.exe"

; 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.)
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName=c:\Please Choose the Path to Your Program
LicenseFile=D:\My Program\EULA.txt
OutputDir=D:\My Program\Inno\
SetupIconFile=D:\My Program\\Graphics\Icon.ico

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?


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


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

Finding popular keywords in huge list

algorithm popularity

I have a huge list with about 100 000 lines like this:

Unknown type names

objective-c opengl directx cross-platform metal

So I'm working on a cross-platform video game... Therefore, I need to be able to use DirectX on windows platforms, OpenGL/ES on mac, linux and android platforms, and Metal on the iOS platform. I se...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.