Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » how to locate renegade folder programmatically
Re: how to locate renegade folder programmatically [message #230072 is a reply to message #230011] Sat, 11 November 2006 18:36 Go to previous messageGo to previous message
Dave Anderson is currently offline  Dave Anderson
Messages: 1953
Registered: December 2004
Location: United States
Karma:
General (1 Star)
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";



David Anderson
Founder, Software Consultant
DCOM Productions
Microsoft Partner (MSP)

[Updated on: Sat, 11 November 2006 18:46]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Maps for the public..
Next Topic: Projector Settings
Goto Forum:
  


Current Time: Thu Nov 14 13:20:46 MST 2024

Total time taken to generate the page: 0.01654 seconds