Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add windows system paths to environment PATH variable if included #7073

Merged
merged 1 commit into from Oct 23, 2019

Conversation

@mwrock
Copy link
Contributor

mwrock commented Oct 22, 2019

fixes #6657

On Windows these added paths are set by default on all modern windows systems. Any Windows application expects these paths to be present.

Signed-off-by: mwrock matt@mattwrock.com

@mwrock mwrock self-assigned this Oct 22, 2019
@mwrock mwrock force-pushed the system_paths branch from df64c97 to 90c3bb3 Oct 22, 2019
components/core/src/package/install.rs Outdated Show resolved Hide resolved
components/core/src/package/install.rs Outdated Show resolved Hide resolved
components/core/src/package/install.rs Outdated Show resolved Hide resolved
components/core/src/package/install.rs Outdated Show resolved Hide resolved
components/core/src/package/install.rs Show resolved Hide resolved
@mwrock mwrock force-pushed the system_paths branch from 90c3bb3 to 23bbe81 Oct 22, 2019
@mwrock mwrock requested a review from eeyun as a code owner Oct 22, 2019
Copy link
Contributor

christophermaier left a comment

Left a tiny suggestion you can take or leave, but 👍

paths.push(PathBuf::from(str_sys_root));
paths.push(system32.join("wbem"));
paths.push(system32.join("WindowsPowerShell").join("v1.0"));
}

This comment has been minimized.

Copy link
@christophermaier

christophermaier Oct 23, 2019

Contributor

Because Path and PathBuf can deal with OsStrs, you can simplify this a bit by getting rid of str_sys_root:

    if let Some(sys_root) = env::var_os("SystemRoot") {
        let system32 = Path::new(&sys_root).join("system32");
        paths.push(system32.clone());
        paths.push(PathBuf::from(sys_root));
        paths.push(system32.join("wbem"));
        paths.push(system32.join("WindowsPowerShell").join("v1.0"));
    }
Signed-off-by: mwrock <matt@mattwrock.com>
@mwrock mwrock force-pushed the system_paths branch from 23bbe81 to c44e9fc Oct 23, 2019
@mwrock mwrock merged commit 038ce61 into master Oct 23, 2019
5 checks passed
5 checks passed
DCO This commit has a DCO Signed-off-by
Details
buildkite/habitat-sh-habitat-master-verify Build #3867 passed (17 minutes, 7 seconds)
Details
buildkite/habitat-sh-habitat-master-website Build #948 passed (45 seconds)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
expeditor/config-validation Validated your Expeditor config file
Details
@chef-expeditor chef-expeditor bot deleted the system_paths branch Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.