cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
iron_giant
Level 3

How to get path info from .ini file to installshield.

Hi,
I am writing a small installshield project(using 2008, msi project). The goal is to auto detect where the Application installed directory, then coy and past a *.dll file under installed directory. For example, if the application is installed under C:\Program Files\APP, the installsheld project will create a folder under C:\Program Files\App\Extensions, and copy the *.dll files under ...\Extensions. If the application is installed under C:\App, then the *.dll file will be copied to C:\App\Extensions.

1. Is there a way to detect where is Application is installed?

OR
2. The Application installation directory information is stored in *.ini file under C:\windows, how can I pass the info from *.ini to installshield?

Thanks
Labels (1)
0 Kudos
(6) Replies
JohnFastSlow
Level 3

1.you can search for files in specified folder
2.first open file:
if (OpenFile (nFileHandle, C:\windows "filename")<0) then
MessageBox ("filename", SEVERE);
abort;
endif;

second,use function GetLine (nFileHandle, svLine);

iron_giant wrote:
Hi,
I am writing a small installshield project(using 2008, msi project). The goal is to auto detect where the Application installed directory, then coy and past a *.dll file under installed directory. For example, if the application is installed under C:\Program Files\APP, the installsheld project will create a folder under C:\Program Files\App\Extensions, and copy the *.dll files under ...\Extensions. If the application is installed under C:\App, then the *.dll file will be copied to C:\App\Extensions.

1. Is there a way to detect where is Application is installed?

OR
2. The Application installation directory information is stored in *.ini file under C:\windows, how can I pass the info from *.ini to installshield?

Thanks
0 Kudos
esiemiat
Level 9

If you know the INI file's name then you can use GetProfString to extract the path from the file.
0 Kudos
iron_giant
Level 3

Hi,
how do I define a destination folder and pass the value from GetProfString over?

For example, Defind a variable call PIHOME (PI application can be installed on any directory, INSTALLDIR=PIHOME. And PIHOME = the value read from *.ini.
0 Kudos
esiemiat
Level 9

The help for the GetProfString function gives an example of how to use it to retireve and INI value. Basically you will use your string variable as the fourth paramter to the function. Below is the syntax for the function call.

GetProfString ( szFileName, szSectionName, szKeyName, svResult ); 
0 Kudos
KathyMorey
Level 10

If you're using an MSI project, have you tried using AppSearch to get the value from the .ini file, and then using a SetDirectory custom action to apply that value to specific entry in the Directory table?
0 Kudos
iron_giant
Level 3

http://www.macrovision.com/webdocuments/PDF/is_install_dir_from_app_search.pdf

I followed the above the link and it worked out for my project.

thanks
0 Kudos