how to locate renegade folder programmatically [message #230011] |
Sat, 11 November 2006 13:07 |
|
Does anyone have any information on how to locate the renegade data folder programmatically?
Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
|
|
|
|
|
Re: how to locate renegade folder programmatically [message #230072 is a reply to message #230011] |
Sat, 11 November 2006 18:36 |
|
Dave Anderson
Messages: 1953 Registered: December 2004 Location: United States
Karma: 0
|
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
|
|
|
|
|
|
|
Re: how to locate renegade folder programmatically [message #230604 is a reply to message #230011] |
Wed, 15 November 2006 09:14 |
|
Actually Danpaul88, it is possible to use operator overloading to make the += operator do whatever you want on your own data types.
Whether microsoft has an appropriate operator+= function in whatever .NET language that code is in I dont know.
Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
|
|
|
|
|