Skip to content

bug: file INSTALL cannot find "C:/WINDOWS/System32/vcruntime140_1.dll" when using VS Build Tools #6436

@valhallasw

Description

@valhallasw

Duplicate Check

Describe the bug

When running flet build windows under Windows 11 & using VS Build Tools 2022 or 2026, the build fails with the following error:

           [   +1 ms]   CMake Error at cmake_install.cmake:266 (file):
           [        ]     file INSTALL cannot find "C:/WINDOWS/System32/vcruntime140_1.dll": No
           [        ]     error.

This is initially confusing because c:\windows\system32\vcruntime140_1.dll does exist. However the build uses a 32-bit cmake, so c:\windows\system32 actually resolves to c:\windows\syswow64 (which stores 32 bit versions of dlls), and the 32 bit counterpart c:\windows\syswow64\vcruntime140_1.dll does not exist.

cmake_install.cmake contains the following lines which copy a number of files from c:\windows\system32.

file(INSTALL DESTINATION "C:/development/flet-test/build/flutter/build/windows/x64/runner/Release" TYPE FILE FILES
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/battery_plus/Release/battery_plus_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/connectivity_plus/Release/connectivity_plus_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/pasteboard/Release/pasteboard_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/screen_brightness_windows/Release/screen_brightness_windows_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/screen_retriever_windows/Release/screen_retriever_windows_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/serious_python_windows/Release/serious_python_windows_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/python/python312.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/python/python3.dll"
      "C:/WINDOWS/System32/msvcp140.dll"
      "C:/WINDOWS/System32/vcruntime140.dll"
      "C:/WINDOWS/System32/vcruntime140_1.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/share_plus/Release/share_plus_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/url_launcher_windows/Release/url_launcher_windows_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/window_manager/Release/window_manager_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/window_to_front/Release/window_to_front_plugin.dll"
      "C:/development/flet-test/build/flutter/build/windows/x64/plugins/jni/shared/Release/dartjni.dll"
      )

msvcp140.dll and vcruntime140.dll in C:\development\flet-test\build\flutter\build\windows\x64\runner\Release are indeed 32 bit versions.

I haven't been able to reproduce why cmake_install.cmake tries to copy these files in the first place. The cmake_install.cmake from a bare flutter project does not contain these lines, so it seems to be related to a flet-specific configuration/plugin.

Code sample

Not applicable - happens with base "create" code.

To reproduce

  1. Install Visual Studio Build Tools
  2. Initialize a new basic flet project
  3. Try to build a windows release

Specific commands:

mkdir flet-test
cd flet-test
uv init
uv add flet[all]
uv run flet --version
uv run flet create test
uv run flet build windows -vv

See output below.

Expected behavior

The app builds a windows application without errors.

Screenshots / Videos

No response

Operating System

Windows

Operating system details

Windows 11 25H2 (26200.8246)

Flet version

0.84.0

Regression

No, it isn't

Suggestions

As a workaround, installing the full Visual Studio seems to resolve the issue. In this case, CMake is under "c:\program files" (x64) and thus copies the 64-bit vcruntime DLLs.

Logs

C:\development>mkdir flet-test

C:\development>cd flet-test

C:\development\flet-test>uv init
Initialized project `flet-test`

C:\development\flet-test>uv add flet[all]
Using CPython 3.14.3
Creating virtual environment at: .venv
Resolved 52 packages in 644ms
Prepared 2 packages in 191ms
Installed 50 packages in 494ms
 + annotated-doc==0.0.4
 + annotated-types==0.7.0
 + anyio==4.13.0
 + arrow==1.4.0
 + binaryornot==0.4.4
 + certifi==2026.4.22
 + chardet==5.2.0
 + charset-normalizer==3.4.7
 + click==8.3.3
 + colorama==0.4.6
 + cookiecutter==2.7.1
 + fastapi==0.136.0
 + flet==0.84.0
 + flet-cli==0.84.0
 + flet-desktop==0.84.0
 + flet-web==0.84.0
 + h11==0.16.0
 + httpcore==1.0.9
 + httptools==0.7.1
 + httpx==0.28.1
 + idna==3.13
 + jinja2==3.1.6
 + markdown-it-py==4.0.0
 + markupsafe==3.0.3
 + mdurl==0.1.2
 + msgpack==1.1.2
 + oauthlib==3.3.1
 + packaging==26.1
 + pydantic==2.13.3
 + pydantic-core==2.46.3
 + pygments==2.20.0
 + python-dateutil==2.9.0.post0
 + python-dotenv==1.2.2
 + python-slugify==8.0.4
 + pyyaml==6.0.3
 + qrcode==8.2
 + repath==0.9.0
 + requests==2.33.1
 + rich==15.0.0
 + six==1.17.0
 + starlette==1.0.0
 + text-unidecode==1.3
 + typing-extensions==4.15.0
 + typing-inspection==0.4.2
 + tzdata==2026.1
 + urllib3==2.6.3
 + uvicorn==0.45.0
 + watchdog==6.0.0
 + watchfiles==1.1.1
 + websockets==16.0

C:\development\flet-test>uv run flet --version
Flet: 0.84.0
Flutter: 3.41.4
Pyodide: 0.27.7

C:\development\flet-test>uv run flet create test
The app has been created.

Run the app:

flet run test

C:\development\flet-test>uv run flet build windows -vv
[...]
[09:14:40] [ +189 ms]   -- Install configuration: "Release"
           [  +19 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/data/icudtl.dat
           [   +9 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/flutter_windows.dll
           [  +48 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/battery_plus_plugin.dll
           [   +5 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/connectivity_plus_plugin.dll
           [   +5 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/pasteboard_plugin.dll
           [   +6 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/screen_brightness_windows_plugin.dll
           [   +6 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/screen_retriever_windows_plugin.dll
           [   +5 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/serious_python_windows_plugin.dll
           [   +8 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/python312.dll
           [  +19 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/python3.dll
           [   +4 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/msvcp140.dll
           [   +5 ms]   -- Installing: C:/development/flet-test/build/flutter/build/windows/x64/runner/Release/vcruntime140.dll
           [   +4 ms]   CMake Error at cmake_install.cmake:266 (file):
           [        ]     file INSTALL cannot find "C:/WINDOWS/System32/vcruntime140_1.dll": File
           [        ]     exists.
           [  +18 ms] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command "setlocal
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [   +2 ms] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: "C:\Program Files (x86)\Microsoft Visual
           Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmEnd
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% &
           goto :cmDone [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmErrorLevel
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: exit /b %1
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd" exited with code 1.
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] Done Building Project "C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj" (default targets) -- FAILED.
           [   +6 ms] Build FAILED.
           [        ] "C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj" (default target) (1) ->
           [        ] (PostBuildEvent target) ->
           [        ]   C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: The command "setlocal
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: "C:\Program Files (x86)\Microsoft Visual
           Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmEnd
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% &
           goto :cmDone [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmErrorLevel
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: exit /b %1
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :cmDone
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ] C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(166,5): error MSB3073: :VCEnd" exited with code 1.
           [C:\development\flet-test\build\flutter\build\windows\x64\INSTALL.vcxproj]
           [        ]     0 Warning(s)
           [        ]     1 Error(s)
           [        ] Time Elapsed 00:02:09.49
           [  +28 ms] Building Windows application... (completed in 142.2s)
           [        ] "flutter windows" took 144,568ms.
           [  +82 ms] Build process failed.
           [        ]
                      #0      throwToolExit (package:flutter_tools/src/base/common.dart:34:3)
                      #1      _runBuild (package:flutter_tools/src/windows/build_windows.dart:262:5)
                      <asynchronous suspension>
                      #2      buildWindows (package:flutter_tools/src/windows/build_windows.dart:118:5)
                      <asynchronous suspension>
                      #3      BuildWindowsCommand.runCommand (package:flutter_tools/src/commands/build_windows.dart:72:5)
                      <asynchronous suspension>
                      #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1590:27)
                      <asynchronous suspension>
                      #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
                      <asynchronous suspension>
                      #6      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
                      <asynchronous suspension>
                      #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:496:9)
                      <asynchronous suspension>
                      #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
                      <asynchronous suspension>
                      #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:431:5)
                      <asynchronous suspension>
                      #10     FlutterCommandRunner.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:307:33)
                      <asynchronous suspension>
                      #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:104:11)
                      <asynchronous suspension>
                      #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
                      <asynchronous suspension>
                      #13     main (package:flutter_tools/executable.dart:103:3)
                      <asynchronous suspension>


           [        ] Running 1 shutdown hook
           [        ] Shutdown hooks complete
           [        ] exiting with code 1
           Run subprocess: ['C:\\development\\flutter_windows_3.41.4-stable\\flutter\\bin\\flutter.BAT', 'doctor', '--no-version-check', '--suppress-analytics']
[09:14:43] Doctor summary (to see all details, run flutter doctor -v):
           [√] Flutter (Channel stable, 3.41.7, on Microsoft Windows [Version 10.0.26200.8246], locale en-US)
           [√] Windows Version (Windows 11 or higher, 25H2, 2009)
           [X] Android toolchain - develop for Android devices
               X Unable to locate Android SDK.
                 Install Android Studio from: https://developer.android.com/studio/index.html
                 On first launch it will assist you in installing the Android SDK components.
                 (or visit https://flutter.dev/to/windows-android-setup for detailed instructions).
                 If the Android SDK has been installed to a custom location, please use
                 `flutter config --android-sdk` to update to that location.

           [√] Chrome - develop for the web
           [√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.14.31 (April 2026))
           [√] Connected device (3 available)
           [√] Network resources

           ! Doctor found issues in 1 category.

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Error building Flet app - see the log of failed command above.                                                                                                                                                │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Full details:
flet-build-log.txt

Additional details

This is likely the same issue as #5205 and possibly #3107.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions