Skip to content

Download nuget when it doesn't exist #2386

@frg2089

Description

@frg2089

Is there an existing feature request for this?

  • I have searched the existing feature request

Operating System

Windows

Pain

Cannot work without the Nuget program in the system.

Suggested solution

Download nuget when it doesn't exist, just like permission_handler_windows does.

find_program(NUGET nuget)
if(NOT NUGET)
message(NOTICE "Nuget is not installed! The flutter_inappwebview_windows plugin requires it. Check https://inappwebview.dev/docs/intro#setup-windows")
endif()

FetchContent_Declare(nuget
  URL "https://dist.nuget.org/win-x86-commandline/v6.0.0/nuget.exe"
  URL_HASH SHA256=04eb6c4fe4213907e2773e1be1bbbd730e9a655a3c9c58387ce8d4a714a5b9e1
  DOWNLOAD_NO_EXTRACT true
)

find_program(NUGET nuget)
if (NOT NUGET)
    message("Nuget.exe not found, trying to download or use cached version.")
    FetchContent_MakeAvailable(nuget)
    set(NUGET ${nuget_SOURCE_DIR}/nuget.exe)
endif()

Useful resources

https://github.com/Baseflow/flutter-permission-handler/blob/a0ded20761c5a6926d8ef399c78e5ab14dfe12f9/permission_handler_windows/windows/CMakeLists.txt#L11-L22

Additional information

No response

Self grab

  • I'm ready to work on this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions