Skip to content

Commit c0ff911

Browse files
committed
Try to install to set temp path
1 parent e036274 commit c0ff911

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/swift/windows.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { join, resolve } from "path";
88
* Setup Swift on Windows as theres no support for Swiftly yet.
99
*/
1010
export async function setupWindows(version: string) {
11-
await download(version);
12-
addPath(resolve("%LocalAppData%", "Programs", "Swift"));
11+
const path = await download(version);
12+
addPath(path);
1313
}
1414

1515
async function download(version: string) {
@@ -31,5 +31,14 @@ async function download(version: string) {
3131
join(tmpPath, "swift-installer.exe"),
3232
);
3333

34-
await cmd(installerPath, "/passive");
34+
const binPath = join(tmpPath, "Swift");
35+
36+
await cmd(
37+
installerPath,
38+
"/passive",
39+
`InstallRoot=${binPath}`,
40+
"OptionsInstallIDE=0",
41+
);
42+
43+
return binPath;
3544
}

0 commit comments

Comments
 (0)