--- a/trunk/cforge/cforge/Helper.cs +++ b/trunk/cforge/cforge/Helper.cs @@ -69,8 +69,29 @@ #endregion - - + #region SystemPath + + public static void AddToSystemPath() + { + // either do it here + //HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path + // for now we try it like this: + + string strPath = System.Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine); + string[] split = strPath.Split(new Char[] { ';' }); + + String path = Path.GetDirectoryName(GetCFORGEAssemblyPath()); + String strNewSystemPath = strPath + ";" + path; + + if (!split.Contains(path)) + { + System.Environment.SetEnvironmentVariable("Path", strNewSystemPath, EnvironmentVariableTarget.Machine); + } + + } + + #endregion + /// <summary> /// Function to retrieve the location of the currenty assembly (cforge.exe).