flutter icon indicating copy to clipboard operation
flutter copied to clipboard

Windows app File description should be taken from `pubspec.yaml`

Open OutdatedGuy opened this issue 1 year ago • 4 comments

Steps to Reproduce

  1. Create a new flutter application (windows enabled) using the VSCode GUI or the sample command
  2. Go to web\manifest.json.
  3. See value of description is the description provided during creating project. (i.e. pubspec.yaml description value)
  4. Go to web\index.html and repeat step 3.
  5. Now go to windows\runner\Runner.rc.
  6. See FileDescription has value equal to package name (i.e. pubspec.yaml name value)

Expected results: Just like in web, description for file/project should have value of pubspec.yaml description in windows

Actual results: Description for file/project have value of package name.

Command sample
flutter create --description "Test application for project description." --project-name "flutter_app" --overwrite .
Logs
Recreating project ....
  lib\main.dart (overwritten)
  pubspec.yaml (overwritten)
  README.md (overwritten)
  test\widget_test.dart (overwritten)
  .gitignore (overwritten)
  .idea\libraries\Dart_SDK.xml (overwritten)
  .idea\libraries\KotlinJavaRuntime.xml (overwritten)
  .idea\modules.xml (overwritten)
  .idea\runConfigurations\main_dart.xml (overwritten)
  .idea\workspace.xml (overwritten)
  analysis_options.yaml (overwritten)
  android\app\build.gradle (overwritten)
  android\app\src\main\kotlin\com\example\flutter_app\MainActivity.kt (created)
  android\build.gradle (overwritten)
  android\flutter_app_android.iml (created)
  android\.gitignore (overwritten)
  android\app\src\debug\AndroidManifest.xml (overwritten)
  android\app\src\main\AndroidManifest.xml (overwritten)
  android\app\src\main\res\drawable\launch_background.xml (overwritten)
  android\app\src\main\res\drawable-v21\launch_background.xml (overwritten)
  android\app\src\main\res\mipmap-hdpi\ic_launcher.png (overwritten)
  android\app\src\main\res\mipmap-mdpi\ic_launcher.png (overwritten)
  android\app\src\main\res\mipmap-xhdpi\ic_launcher.png (overwritten)
  android\app\src\main\res\mipmap-xxhdpi\ic_launcher.png (overwritten)
  android\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png (overwritten)
  android\app\src\main\res\values\styles.xml (overwritten)
  android\app\src\main\res\values-night\styles.xml (overwritten)
  android\app\src\profile\AndroidManifest.xml (overwritten)
  android\gradle\wrapper\gradle-wrapper.properties (overwritten)
  android\gradle.properties (overwritten)
  android\settings.gradle (overwritten)
  ios\Runner\AppDelegate.swift (overwritten)
  ios\Runner\Runner-Bridging-Header.h (overwritten)
  ios\Runner.xcodeproj\project.pbxproj (overwritten)
  ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (overwritten)
  ios\.gitignore (overwritten)
  ios\Flutter\AppFrameworkInfo.plist (overwritten)
  ios\Flutter\Debug.xcconfig (overwritten)
  ios\Flutter\Release.xcconfig (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\AppIcon.appiconset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\LaunchImage.imageset\Contents.json (overwritten)
  ios\Runner\Assets.xcassets\LaunchImage.imageset\LaunchImage.png (overwritten)
  ios\Runner\Assets.xcassets\LaunchImage.imageset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\LaunchImage.imageset\[email protected] (overwritten)
  ios\Runner\Assets.xcassets\LaunchImage.imageset\README.md (overwritten)
  ios\Runner\Base.lproj\LaunchScreen.storyboard (overwritten)
  ios\Runner\Base.lproj\Main.storyboard (overwritten)
  ios\Runner\Info.plist (overwritten)
  ios\Runner.xcodeproj\project.xcworkspace\contents.xcworkspacedata (overwritten)
  ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (overwritten)
  ios\Runner.xcodeproj\project.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (overwritten)
  ios\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (overwritten)
  ios\Runner.xcworkspace\contents.xcworkspacedata (overwritten)
  ios\Runner.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (overwritten)
  ios\Runner.xcworkspace\xcshareddata\WorkspaceSettings.xcsettings (overwritten)
  linux\.gitignore (overwritten)
  linux\CMakeLists.txt (overwritten)
  linux\flutter\CMakeLists.txt (overwritten)
  linux\main.cc (overwritten)
  linux\my_application.cc (overwritten)
  linux\my_application.h (overwritten)
  macos\.gitignore (overwritten)
  macos\Flutter\Flutter-Debug.xcconfig (overwritten)
  macos\Flutter\Flutter-Release.xcconfig (overwritten)
  macos\Runner\AppDelegate.swift (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\app_icon_1024.png (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\app_icon_128.png (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\app_icon_16.png (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\app_icon_256.png (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\app_icon_32.png (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\app_icon_512.png (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\app_icon_64.png (overwritten)
  macos\Runner\Assets.xcassets\AppIcon.appiconset\Contents.json (overwritten)
  macos\Runner\Base.lproj\MainMenu.xib (overwritten)
  macos\Runner\Configs\AppInfo.xcconfig (overwritten)
  macos\Runner\Configs\Debug.xcconfig (overwritten)
  macos\Runner\Configs\Release.xcconfig (overwritten)
  macos\Runner\Configs\Warnings.xcconfig (overwritten)
  macos\Runner\DebugProfile.entitlements (overwritten)
  macos\Runner\Info.plist (overwritten)
  macos\Runner\MainFlutterWindow.swift (overwritten)
  macos\Runner\Release.entitlements (overwritten)
  macos\Runner.xcodeproj\project.pbxproj (overwritten)
  macos\Runner.xcodeproj\project.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (overwritten)
  macos\Runner.xcodeproj\xcshareddata\xcschemes\Runner.xcscheme (overwritten)
  macos\Runner.xcworkspace\contents.xcworkspacedata (overwritten)
  macos\Runner.xcworkspace\xcshareddata\IDEWorkspaceChecks.plist (overwritten)
  flutter_app.iml (created)
  web\favicon.png (overwritten)
  web\icons\Icon-192.png (overwritten)
  web\icons\Icon-512.png (overwritten)
  web\icons\Icon-maskable-192.png (overwritten)
  web\icons\Icon-maskable-512.png (overwritten)
  web\index.html (overwritten)
  web\manifest.json (overwritten)
  windows\.gitignore (overwritten)
  windows\CMakeLists.txt (overwritten)
  windows\flutter\CMakeLists.txt (overwritten)
  windows\runner\CMakeLists.txt (overwritten)
  windows\runner\flutter_window.cpp (overwritten)
  windows\runner\flutter_window.h (overwritten)
  windows\runner\main.cpp (overwritten)
  windows\runner\resource.h (overwritten)
  windows\runner\resources\app_icon.ico (overwritten)
  windows\runner\runner.exe.manifest (overwritten)
  windows\runner\Runner.rc (overwritten)
  windows\runner\utils.cpp (overwritten)
  windows\runner\utils.h (overwritten)
  windows\runner\win32_window.cpp (overwritten)
  windows\runner\win32_window.h (overwritten)
Running "flutter pub get" in flutter_application_1...            2,375ms
Wrote 128 files.

All done!
In order to run your application, type:

  $ cd .
  $ flutter run

Your application code is in .\lib\main.dart.
Analyzing flutter_application_1...                                      
No issues found! (ran in 9.0s)
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.22622.450], locale en-IN)
    • Flutter version 3.0.5 at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (3 weeks ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at C:\Users\Dell\AppData\Local\Android\sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32526.322
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.70.0)
    • VS Code at C:\Users\Dell\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.46.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22622.450]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 103.0.5060.134
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 103.0.1264.77

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Is this intentional? Please let me know.

OutdatedGuy avatar Aug 06 '22 19:08 OutdatedGuy

If it's intentional, it's not so intuitive I think. As I can see in the template for that file, the value you see is the project's name:

VALUE "FileDescription", "{{projectName}}" "\0"

If we want to update that field to reflect the passed (or default) description, we should replace projectName with description in that line.

The description value is set in the templateContext here:

templateContext['description'] = description;

bryancalisto avatar Aug 07 '22 19:08 bryancalisto

I'm not sure what should be the value for FileDescription as I checked that many software uses the name for it.

Screenshots

image image image image

And nearly every software I use

OutdatedGuy avatar Aug 08 '22 04:08 OutdatedGuy

Hi @OutdatedGuy, Thanks for filing the issue, I see the same behavior File description is assigned a package name. Labeling this issue as a proposal to pick file description from pubspec.yaml

cc: @loic-sharma

maheshmnj avatar Aug 08 '22 10:08 maheshmnj

Thanks for filing this! ~~This is definitely a bug.~~ EDIT: This is by design, see message below

Docs for FileDescription is here: https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource

A value is required for FileDescription, so off-hand it seems we should use the project's description if it exists, otherwise fallback to the project's name.

loic-sharma avatar Aug 08 '22 20:08 loic-sharma

It turns out this is actually by design. See https://github.com/flutter/flutter/pull/91959:

Despite the name includes "description", the Windows desktop seems to use FileDescription in Runner.rc as application name in the task manager, and as a result, on the task manager, the name of the win32 template app is displayed as "A new Flutter project."

This PR will set FileDescription to {{projectName}} instead of {{description}}, and make the name on the task manager the same as application name.

Screenshot (The app in this top is created with the current HEAD, the app in this bottom is created with this PR.): image

I checked several Windows apps; they all followed the pattern of placing the app's name in the FileDescription property. Furthermore, Windows does not seem to have a property that'd be a good fit for the Flutter app's description.

I'll close this off for now, but please let us know if you have any additional feedback or questions!

loic-sharma avatar Aug 10 '22 21:08 loic-sharma

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

github-actions[bot] avatar Aug 30 '22 14:08 github-actions[bot]