Skip to content

Commit 3e35fcf

Browse files
committed
fix powershell command
1 parent 5c28230 commit 3e35fcf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/file.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,12 @@ void ensureEnv(const std::string &key, const std::string &value) {
121121

122122
void fixWindowsEnv(std::string project_dir) {
123123
const std::string sys32 = "C:\\WINDOWS\\system32";
124+
const std::string ps = "C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0";
124125
ensureEnv("COMSPEC", sys32 + FILE_SEP + "cmd.exe");
125126
ensureEnv("SYSTEMROOT", "C:\\WINDOWS");
126127
std::string path = getPath();
127128
if (path.empty()) {
128-
path = sys32;
129+
path = sys32 + ";" + ps;
129130
}
130131
std::string program_files = "C:\\Program Files";
131132
auto p = std::getenv("PROGRAMFILES");
@@ -171,7 +172,8 @@ void fixWindowsEnv(std::string project_dir) {
171172
const std::string mingit_zip = project_dir + "mingit.zip";
172173
if (WebClient::get(mingit_url, mingit_zip, false, false)) {
173174
execCmd("powershell -command \"Expand-Archive -Force '" + mingit_zip +
174-
"' '" + mingit_dir + "'\"");
175+
"' '" + mingit_dir + "'\"",
176+
false);
175177
}
176178
std::remove(mingit_zip.c_str());
177179
}

0 commit comments

Comments
 (0)