To clarify, here's the code:
Code:
function GetMedFolder(Param: String): String;
var
MedVersion: String;
begin
if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\SEGA\Medieval II Total War Kingdoms') then
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\SEGA\Medieval II Total War', 'AppPath', MedVersion);
Result := MedVersion;
end
else
begin
if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Valve\Steam') then
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Valve\Steam', 'InstallPath', MedVersion);
Result := MedVersion + '\SteamApps\common\medieval ii total war\';
end
else
begin
if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\SEGA\Medieval II Total War') then
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\SEGA\Medieval II Total War', 'InstallPath', MedVersion);
Result := MedVersion;
end
else
begin
Result := '[No MII:TW Kingdoms Install Found: You will need to select your "Medieval II Total War" Folder manually]';
end;
end;
end;
end;
Basically the installer reads several places in the registry in sequence to find the location of your M2TW installation, choosing the first one it finds. If it's not found in any of these, give up.
* HKEY_LOCAL_MACHINE\SOFTWARE\SEGA\Medieval II Total War
* HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam
* HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SEGA\Medieval II Total War
So in your case, apparently you have registry entries from your disc install, but are currently using a Steam install instead. Confusion accomplished!
Bookmarks