Rockhount, so lese ich den A2/OA Pfad aus, eventuell kannst Du es gebrauchen:
Code:
RegistryKey _regkey = Registry.LocalMachine;
string _arma2path = string.Empty;
try {
_regkey = _regkey.OpenSubKey(@"SOFTWARE\Bohemia Interactive Studio\ArmA 2 OA", false);
_arma2path = _regkey.GetValue("MAIN").ToString();
} catch (Exception) {}
finally {
if (_regkey != null) {
_regkey.Close();
_regkey = null;
}
}
if (_arma2path.Equals(String.Empty)) {
try {
_regkey = Registry.LocalMachine;
_regkey = _regkey.OpenSubKey(@"SOFTWARE\Bohemia Interactive Studio\ArmA 2", false);
_arma2path = _regkey.GetValue("MAIN").ToString();
} catch (Exception) {}
finally {
if (_regkey != null) {
_regkey.Close();
_regkey = null;
}
}
}
if (_arma2path.Equals(String.Empty)) {
try {
_regkey = Registry.LocalMachine;
_regkey = _regkey.OpenSubKey(@"SOFTWARE\Valve\Steam\Common\ARMA 2 OA", false);
_arma2path = _regkey.GetValue("MAIN").ToString();
} catch (Exception) {}
finally {
if (_regkey != null) {
_regkey.Close();
_regkey = null;
}
}
}
if (_arma2path.Equals(String.Empty)) {
try {
_regkey = Registry.LocalMachine;
_regkey = _regkey.OpenSubKey(@"SOFTWARE\Valve\Steam\Common\ARMA 2", false);
_arma2path = _regkey.GetValue("MAIN").ToString();
} catch (Exception) {}
finally {
if (_regkey != null) {
_regkey.Close();
_regkey = null;
}
}
}
Könnteste jetzt noch in if then else Statements verschachteln, aber drauf geschi****
Lass aber das Button zum Wählen des Pfades trotzdem drin (falls doch noch irgendeine Variante von A2/OA kommt).
Xeno