bug: FLET_ASSETS_DIR returns None in Windows build
Duplicate Check
- [x] I have searched the opened issues and there are no duplicates
Describe the bug
When creating a Windows build the environment variable FLET_ASSETS_DIR returns None. When running the app with the flet run command the path resolves correctly.
Code sample
Code
import os
import flet as ft
def main(page: ft.Page):
print(os.getenv("FLET_ASSETS_DIR"))
ft.app(main)
To reproduce
- Create a new Flet project using the
flet createcommand. - Add the following to
pyproject.yamlto make sure that app can build: (See: #5630)
[tool.flet.flutter.pubspec.dependency_overrides]
webview_flutter_android = "4.10.1"
- In
main.pyadd the following lines: (See Code above for fullmain.py)
import os
...
print(os.getenv("FLET_ASSETS_DIR"))
- Build the app for windows using
flet build windows. - Run the build.
- Navigate to
%localAppData%\Flet\{nameOfProject}and openconsole.log. - Output in
None.
Expected behavior
The default assets path is returned. I believe it should be %appData%\Flet\{nameOfProject}\flet\app\assets.
Screenshots / Videos
No response
Operating System
Windows
Operating system details
Windows 11
Flet version
0.28.3
Regression
I'm not sure / I don't know
Suggestions
No response
Logs
No response
Additional details
Both os.getenv("FLET_APP_STORAGE_DATA") and os.getenv("FLET_APP_STORAGE_TEMP") return the correct path.
I have also tried setting the assets_dir but this has no effect. (ft.app(main, assets_dir = "assets"))
I am unaware if this effects any other platform but Windows.
Just adding that this also seems to happen with Linux and macOS builds