public static void SetPath(string pathValue, bool before = false) { string pathList = SysEnv.GetSysEnvironmentByName("Path"); if (string.IsNullOrEmpty(pathList)) { return; } string[] list = pathList.Split(';'); if (list.Contains(pathValue)) { return; } string[] newList = new string[] { pathValue }; if (before) { newList.Concat(list); } else { list.Concat(newList); } SetEnvironmentVariable("Path", string.Join(";", list)); }
public override void Uninstall(IDictionary savedState) { base.Uninstall(savedState); string pathValue = $@"{Context.Parameters["rootPath"].Replace("/", "")}bin\"; SysEnv.RemovePath(pathValue); }
public override void Install(IDictionary stateSaver) { base.Install(stateSaver); string pathValue = $@"{Context.Parameters["rootPath"].Replace("/", "")}bin\"; SysEnv.SetPath(pathValue); }