WordTricks
Posts: 1
Joined: Wed Aug 24, 2005 3:48 pm

Reading INI Values

WHAT I AM TRYING TO ACCOMPLISH

I am trying to run the .msi file silently passing in a TARGETDIR. I would like to keep the installation directory in an .ini file on the network server so that all workstations will be install to the same installation directory. My hope is that the .msi will read the value in the .ini and install the application to the directory contained therein.

WHAT I HAVE ATTEMPTED (WITHOUT SUCCESS)

1. I have created a "Search" that is looking for a file C:\WTXUpdatePac.ini.

These are the settings for the ini search location:
WTX_DEF_DIR (Search/Property Name)
Section: Variables
Key: localpath
Field: 0
Type: "The ini value contains a path to a directory"

INI File Data
[Variables]
localpath=C:\Backup

2. Under "Installation Parameters" the WTX_DEF_DIR search property created in the Project Settings >> Search options is referenced:
Application Folder - [ProgramFilesFolder][WTX_DEF_DIR]

3. I expect that when the user sees the "Select Location" dialog box the value from WTX_DEF_DIR will be populated. I also expect the WTX-DEF_DIR to be used when installing silently. This is not the case. Please advise.
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

The reason for which the Search is not successful is that the INI file is not found. Windows Installer looks for the INI files that are involved in a Search action in the Windows installation folder (i.e. usually c:\windows).

You should change the value of the "Type" field to "Retrieve the raw value from the INI file" option.

Also, I noticed the value in the INI file is "C:\Backup". Using as Application Folder the string [ProgramFilesFolder][WTX_DEF_DIR] means that the expanded value will be something like:

c:\Program Files\c:\Backup

This of course doesn't work.

If you want the installation folder to be c:\Backup change the Application Folder value to [WTX_DEF_DIR].

If you want the installation folder to be c:\Program Files\Backup change the value in the INI file to "Backup"

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”