diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c55fae80ef..aae8baf0d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C - [#2427](https://github.com/wasmerio/wasmer/pull/2427) Update `loupe` to 0.1.3. ### Fixed +- [#2454](https://github.com/wasmerio/wasmer/issues/2454) Won't set `WASMER_CACHE_DIR` for Windows. - [#2426](https://github.com/wasmerio/wasmer/pull/2426) Fix the `wax` script generation. ## 2.0.0 - 2021/06/16 diff --git a/lib/cache/src/filesystem.rs b/lib/cache/src/filesystem.rs index 1d6987191b9..cbd30c1cdbb 100644 --- a/lib/cache/src/filesystem.rs +++ b/lib/cache/src/filesystem.rs @@ -63,8 +63,15 @@ impl FileSystemCache { } } else { // Create the directory and any parent directories if they don't yet exist. - create_dir_all(&path)?; - Ok(Self { path, ext: None }) + let res = create_dir_all(&path); + if res.is_err() { + Err(io::Error::new( + io::ErrorKind::Other, + format!("failed to create cache directory: {}", path.display()), + )) + } else { + Ok(Self { path, ext: None }) + } } } diff --git a/scripts/windows-installer/wasmer.iss b/scripts/windows-installer/wasmer.iss index 772c24aacad..753c259ba6c 100644 --- a/scripts/windows-installer/wasmer.iss +++ b/scripts/windows-installer/wasmer.iss @@ -18,7 +18,7 @@ DisableWelcomePage=no Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "WASMER_DIR"; \ ValueData: "{app}"; Flags: preservestringtype Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "WASMER_CACHE_DIR"; \ - ValueData: "{app}\cache"; Flags: preservestringtype + ValueData: "{%USERPROFILE}\.wasmer\cache"; Flags: preservestringtype [Files] Source: "..\..\package\bin\*"; DestDir: "{app}\bin" @@ -29,7 +29,7 @@ Source: "..\..\package\ATTRIBUTIONS"; DestDir: "{app}" Source: "wax.cmd"; DestDir: "{app}\bin" [Dirs] -Name: "{app}\cache" +Name: "{%USERPROFILE}\.wasmer" [Code] const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';