Code Monkey home page Code Monkey logo

Comments (7)

SerCeMan avatar SerCeMan commented on May 28, 2024

Hi, @APayerl!

Thank you for reporting the issue. What do you mean by locating the install path dynamically? I have a limited experience with Windows and unfortunately, don't know any standard approaches for that.

I agree that it's better to check the existence of the file and throw an exception if it doesn't exist. But please send a PR if you have a better idea of handling such situations.

from jnr-fuse.

APayerl avatar APayerl commented on May 28, 2024

I have not thought that much about it so unfortunately I don't have a solution.. but maybe check what driveletters are plugged in atm
File[] roots = File.listRoots();
and check the most probable locations

boolean foundInstall = false;
for(File path : roots) {
    newPath = path + "\\Program Files (x86)\\WinFsp\\bin\\winfsp-x64.dll";
    if(isPathCorrect(newPath)) {
        foundInstall = true;
        break;
    }
}

Something like that...
Of course it would not be the most effective solution but it would probably be an improvement.

from jnr-fuse.

tfiskgul avatar tfiskgul commented on May 28, 2024

@APayerl It is possible to set the property called "jnrfuse.winfsp.path" to the correct value?

String winFspPath = System.getProperty("jnrfuse.winfsp.path", "C:\\Program Files (x86)\\WinFsp\\bin\\winfsp-x64.dll");

from jnr-fuse.

APayerl avatar APayerl commented on May 28, 2024

Yea well I suppose it should work if WinFsp sets a key(I have no clue if they do)..
If not then a solution like this would work(even though a tad excessive for this purpose):

private File findFile(File start, String goal) {
	File file = null;
	if(start.isDirectory()) {
		for(File f: start.listFiles()) {
			file = findFile(f, goal);
			if(file != null) {
				break;
			}
		}
	} else {
		file = start.getName().equals(goal) ? start : null;
	}
	return file;
}

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 28, 2024

@tfiskgul I added the jnrfuse.winfsp.path property check for that purpose. So that you can provide a winfsp path if it is not standard as a workaround.

@APayerl I don't think that scanning the whole filesystem is a viable solution.

I guess that the best way to implement this is to do a registry lookup, it seems like winfsp uses the Software\\WinFsp key. Like it's implemented in the cgofuse, https://github.com/billziss-gh/cgofuse/blob/master/fuse/host.go#L95.

Unfortunately, I won't be able to devote enough time to work on it soon, but I'll be happy to provide as much help as I can if someone wants to send a PR.

from jnr-fuse.

APayerl avatar APayerl commented on May 28, 2024

On my machine I found the key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WinFsp\InstallDir pointing to the folder where it was installed. Ofcourse this was since I use 64bit Windows.

Have a fix ready but unable to push it. (new to open source contributions)

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 28, 2024

Hey, @APayerl! There are some good instructions here, https://opensource.guide/how-to-contribute/#opening-a-pull-request. Also, if you can't for some reasons contribute to github (I know that some companies don't allow this), you can post the code here.

from jnr-fuse.

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.