InstallShiled : Custom Action not able to read values from INI File

532 views Asked by At

I am trying to read values from ".ini" file using install script Custom Action which will be installed at the target location. Below Install-script Code line doesn't read any values even the file is there at target location during installation.

Install Script Code :

GetProfString(TARGETDIR + "SampleSetup.ini","Main","AppTitle",szItemName);

Custom Action : Below is the major custom Action detail which was scheduled to be run "After InstallFinalize".

Function Name : AddDesktopShortCut  (Custom Install Script Function)

Target : Synchonous(Check Exit Code)

In-Script Execution : Immediate Execution

Execution Scheduling : Always execute

Install UI Sequence : 

Install Exec Sequence : After IntallFinalize

Install Exec Condition : Not Installed

Remaining Settings are the default ones.

Any help will be highly appreciated. Thanks for your Time.

1

There are 1 answers

1
Michael Urman On BEST ANSWER

If that's all of your code, how can you tell if it read the value?

I would suggest either using the debugger, or sprinkling some MessageBox calls in to see what values your program uses. In particular, ensure the ini file is where your code is looking (TARGETDIR + "SampleSetup.ini" should likely be TARGETDIR ^ "SampleSetup.ini" instead), check the return code from GetProfString, and see what szItemName is after the call.