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

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.