cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Amarjeet
Level 7

Problem with [Installdir]

I am working on a basic MSI project. My default installation directory is c:\program files\[Installdir]\Application1. All Dll's get installed in directory Application1.

I want to place one text file in directory [Installdir]. When i do default installation the file is placed in correct directory i.e c:\program files\[installdir].

But if i select custom installation and change default location to d:\program files\ or any other non default location the file gets installed at original location c:\program files\[installdir]

Please help.

I am using installshield 2009 Premier edition.
Labels (1)
0 Kudos
(10) Replies
RobertDickau
Flexera Alumni

You'll want to make sure the file's component destination is based on [INSTALLDIR] and not hard-coded [ProgramFilesFolder]Something\Something...
0 Kudos
Amarjeet
Level 7

Hi robert,

i have set destination directory as [INSTALLDIR]. Still facing problem with installation directory for custom install. For default install i get the file placed at correct location i.e. [installdir]
0 Kudos
RobertDickau
Flexera Alumni

What is the overall project's INSTALLDIR value? What are the exact destination values for two components, one that installs correctly and one that doesn't?

If you create an MSI log file, you can get more information about feature and component destinations at run time...
0 Kudos
Lurean
Level 8

I actually had this exact same problem when I created my first MSI installer.

The Install locations of your components should all read as

[INSTALLDIR]Application1

under your project properties you can set the INSTALLDIR location to a specific location (i.e: [ProgramFilesFolder]subfolder) If the user changes the directory to d:\somefolder then in this case your application would be installed to "d:\somefolder\Application1" if you want the subfolder to always remain the same then you need to set the Installdir to one level above what you want to maintain. For instance if you always want your apllication to be in the location selected by the user in a subfolder then your application folder set [INSTALLDIR] to [ProgramFilesFolder] and then the install location of your components needs to be [INSTALLDIR]subfolder\Application1.

In the files and folders view make sure you are placing your files under the predefined directory [INSTALLDIR] not in a custom folder, unless the custom folder is set to install at the location of [INSTALLDIR] but that is kind of redundant at that point and harder to follow.


I hope this helps you.

James
0 Kudos
Amarjeet
Level 7

Please refer screenshot. I am facing problem with excel.exe.config file.
0 Kudos
Lurean
Level 8

move your INSTALLDIR to the root node. Currently you have it defined under the ProgramFilesFolder predefined folder. This means that no matter what the user selects it will be placed into the program files directory defined on the target computer.

in the project properties define the INSTALLDIR as
[ProgramFilesFolder]MainDir

The place to set this is in the Installation Information category, under General Information in the Product Properties subheading.

If in the files and folders view you place the INSTALLDIR inside a predefined folder this will override the root part and prevent the user from selecting a different location.

James
0 Kudos
Amarjeet
Level 7

Hi Lurean,

The directory has been already set as directed by you. PLease refer screenshot.
0 Kudos
Lurean
Level 8

ok,

In the first screenshot you posted it showed the the Files and Fodlers view and you have the [INSTALLDIR] placed under the [ProgramFilesFolder] this is what is messing you up. Installdir needs to be at the root level of the directory structure.

0 Kudos
Amarjeet
Level 7

I need default location of my Application at

c:\Program Files\maindir\Application1.

If I move the [INSTALLDIR]to root how installshiled will get to know location of application installation directory.(which is under program files )
0 Kudos
Lurean
Level 8

You already have it set to the programfilesfolder under project properties.

having it at the root is what will allow your user to change it. Basically you are forcing it to always be in programfilesfolder regardless of what the user selects.

I made the same mistake when first build MSIs, it can be a little confusing. But trust me, you want your installdir at the root level, and then defined as you have it in your project properties.

James
0 Kudos