PDA

View Full Version : Setting TARGETDIR Location



MarkPowell
12-01-2005, 12:09 PM
Hi,

I have a patch installer that should only install to the location it retrieves from the registry. This I have done using the following code:



function GetInstallToPath(hMSI)

STRING szKey;
STRING szName;
STRING svValue;
NUMBER nvReturn, svType, nvSize;

begin

RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );

szKey = "SOFTWARE\\Sun Life Financial\\SunSolutions PLUS\\1.5.1";
szName = "InstallToPath";
svType = REGDB_STRING;
nvReturn = RegDBKeyExist (szKey);

nvReturn = RegDBGetKeyValueEx ( szKey, szName, svType, svValue, nvSize );
MessageBox(svValue, INFORMATION);

end;


And under svValue it pulls back the current location under C:\

What I then added, which seems a little simple was just the following line before the end;



TARGETDIR = (svValue ^ "RUN");


I also tried this with INSTALLDIR, but it keeps putting my file on the root of C:\

Any clues how I can set this?

Thanks.