cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
leekinboo
Level 2

problem with custom defined install folde(installdir) in the basic msi project

what we want to do:
The environment variable of the customer's pc (destionation pc) contains the path where our product are going to be installed. So when we install the product , we need find the path in the destionation pc by a system search and give the value to INSTALLDIR.

the method we use right now is based on the solution from Acresso :

http://www.google.dk/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.acresso.com%2Fwebdocuments%2FPDF%2Fis_install_dir_from_app_search.pdf&ei=cYdESryQIcarjAeTk81k&usg=AFQjCNEk6Y1sBpu8-HbRkQZlSPUNcfAuew

In the solution :
First , we make one system search on the registry. the enviornment variableis store in the registry key :
HKEY_CURRENT_USER\ENVIRONMENT\VARIABLE_NAME
and store this key vaule which is the path to a property variable .

then , we define a custom action (set directory) , in the action we give the property variable value(path ) to INSTALLDIR.


the problem is :

it works fine if the path in the eviornment variable really exist in the customer 's pc . but it failed when the path is not really existing in the customer' pc .
I am very confused by this result. Because the system search on the registry key only give us a value in the registry key. why it cares about if it really exists? if not exist, the msi package will create the folder by the value in the INSTALLDIR .i mean the msi will create the folders given by the INSTALLDIR anyway . right ?

who can give me some clues , thansk very much .

you are welcome to contact me at
jl@iccc.dk
Labels (1)
0 Kudos
(1) Reply
RobertDickau
Flexera Alumni

Do you have a condition on the set-directory action that ensures the search property has a value?

(As an aside, instead of reading the environment variable from the registry, you might consider using the Windows Installer "Formatted" expression [%VAR_NAME] as the target of a set-directory action and skipping the search...)
0 Kudos