Skip to content

Should the auto setup check for products ? #6

@SMoraisAnsys

Description

@SMoraisAnsys

This is mainly an open question and would probably be better as a discussion than an issue. Should the auto setup script check for installation using products that are expected to contain C++ compiler support ?

For example, I used winget to install visual studio and the auto setup script is not working. With a tiny modification:

        # Products that include C++ compiler support
        vs_products = [
            "Microsoft.VisualStudio.Product.BuildTools",
            "Microsoft.VisualStudio.Product.Community",
            "Microsoft.VisualStudio.Product.Professional",
            "Microsoft.VisualStudio.Product.Enterprise",
        ]

        vs_found = False
        for vswhere_path in vswhere_paths:
            if Path(vswhere_path).exists():
                try:
                    # Search for any product that includes C++ build tools
                    result = subprocess.run(
                        [vswhere_path, "-latest", "-products"] + vs_products + ["-property", "installationPath"],
                        capture_output=True,
                        text=True,
                        check=True,
                    )
                    vs_path = result.stdout.strip()
                    if vs_path:
                        vs_found = True
                        break
                except subprocess.CalledProcessError:
                    continue

The script no longer fails. I'm not sure that the winget installation is enough thugh. I'll follow the error message advices to install visual studio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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