Skip to content

Revision info should check whether executable path exists, instead of folder path #1606

@kevinbuyck

Description

@kevinbuyck

Description

Currently the revision info 'downloaded' flag only checks whether the folder path exists, but it should check whether the executable path/file exists.

On my local machine the executable (and other files) seem to be disappearing sometimes (I don't really know why/haven't checked), but the folders stay. This means that with the current check for PuppeteerSharp everything is correctly downloaded, but it isn't (which causes an executable not found exception later on). If the check would also check if the executable exists, this wouldn't happen.

I currently fixed this by doing the check myself.

Complete minimal example reproducing the issue

var browserFetcher = new BrowserFetcher(new BrowserFetcherOptions()
{
    Path = Path.GetTempPath()
});

await browserFetcher.DownloadAsync(BrowserFetcher.DefaultRevision);

var launchOptions = new LaunchOptions()
{
    ExecutablePath = browserFetcher.RevisionInfo(BrowserFetcher.DefaultRevision).ExecutablePath,
    Headless = true
};

using (var browser = await Puppeteer.LaunchAsync(launchOptions))
{
    ...
}

Expected behavior:

public bool Downloaded => File.Exists(ExecutablePath);

Actual behavior:

public bool Downloaded => Directory.Exists(FolderPath);

Versions

  • Which version of PuppeteerSharp are you using?

2.0.4

  • Which .NET runtime and version are you targeting? E.g. .NET framework 4.6.1 or .NET Core 2.0.

3.1.404

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions