Coder Social home page Coder Social logo

Comments (3)

Niminem avatar Niminem commented on May 24, 2024 1

@alistairkeys Thanks for this detailed information! Excuse my delay I've been bogged in work recently. I agree 100% using WIndows registry for finding chrome. I'll be making these changes with the next release. We're also adding a similar functionality for Mac. Leaving this open until the changes are made, I'll ping you here directly as soon as it's live!

from neel.

alistairkeys avatar alistairkeys commented on May 24, 2024 1

I tried Neel 0.3.1 but it still complains when Chrome isn't found on the drive. The following monkey-patch in neel.nim (findChromeWindows proc) seems to fix it:

when defined(Windows):
    import std/registry

proc findChromeWindows*: string =
    const defaultPath = r"\Program Files (x86)\Google\Chrome\Application\chrome.exe"
    const backupPath = r"\Program Files\Google\Chrome\Application\chrome.exe"
    if fileExists(absolutePath(defaultPath)):
        result = defaultPath
    elif fileExists(absolutePath(backupPath)): #was originally an if 4/5/21 (testing)
        result = backupPath
    else: # include registry search in future versions to account for any location
        when defined(Windows):
            result = getUnicodeValue(
                path = r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe",
                key = "", handle = HKEY_LOCAL_MACHINE)
        discard

    if result.len == 0:
        raise newException(CustomError, "could not find Chrome in Program Files (x86) directory")

I've not tried this change on other OS's, just Windows. I wrapped the logic in 'when defined(Windows)' sections as I assume it's not applicable/would probably break other OS's.

Feel free to make use of these changes. I'm too lazy to PR it. :)

from neel.

Niminem avatar Niminem commented on May 24, 2024 1

@alistairkeys
Thanks for the contribution! I included it in Neel and made a quick release, you can download 0.3.2 now which integrates your changes. Happy coding <3

from neel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.