using namespace Microsoft::Win32;
String^ Install_Path = Convert::ToString(Registry::GetValue("HKEY_LOCAL_MACHINE\\Software\\Westwood\\Renegade\\", "InstallPath", "Error getting data."));
Since it returns the path with "Renegade.exe" at the end, simply remove the last 12 characters from the return value.
Install_Path = Install_Path->Remove(Install_Path->Length - 12, 12);
Then append the path to the data folder.
Install_Path += "\Data\";
The full method:
using namespace Microsoft::Win32;
String ^Install_Path = Convert::ToString(Registry::GetValue("HKEY_LOCAL_MACHINE\\Software\\Westwood\\Renegade\\", "InstallPath", "Error getting data."));
Install_Path = Install_Path->Remove(Install_Path->Length - 12, 12);
Install_Path += "\Data";
[Updated on: Sat, 11 November 2006 18:46]
Report message to a moderator