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

Set INSTALLDIR from location in an .ini file already on destination machine.

My installer installs a module for an existing piece of software existing on the target machine. I need to read a path from an existing ini file on the target machine to get and set the INSTALLDIR of the module being installed. How? I did some forum searches, but didn't find anything related to my specific need.

Thanks.
Labels (1)
0 Kudos
(1) Reply
cthumann
Level 2

cthumann wrote:
My installer installs a module for an existing piece of software existing on the target machine. I need to read a path from an existing ini file on the target machine to get and set the INSTALLDIR of the module being installed. How? I did some forum searches, but didn't find anything related to my specific need.

Thanks.


Nevermind, I figured it out myself. Created an InstallScript file that does the following...

function GetPathFromINI(hMSI)

STRING svResult;

begin

GetProfString ( "c:\\Windows\\file.ini" , "File Locations" , "Path" , svResult );
MsiSetProperty(hMSI,"INSTALLDIR",svResult);

// for testing only; make sure the INSTALLDIR gets set from the ini file
//MessageBox("Location from INI: " + INSTALLDIR, INFORMATION);

end;
0 Kudos