Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the Extensions directory to be under the BaseDirectory #11

Open
nopara73 opened this issue Sep 22, 2018 · 5 comments
Open

Change the Extensions directory to be under the BaseDirectory #11

nopara73 opened this issue Sep 22, 2018 · 5 comments

Comments

@nopara73
Copy link
Contributor

I created a Windows installer with Wix and I noticed that the software wasn't working. The reason being is that you can never work next to the exe, since that is located in the Program Files, which needs admin access and the software as launched it doesn't have that.

So, in AvalonStudio.Shell, the Extensions folder couldn't be created, thus the software failed to launch. The code below does this in AvalonStudio.

public static string ExecutionPath => Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

public static string ExtensionsFolder => Path.Combine(ExecutionPath, "Extensions");

I suggest changing the second line to this:

public static string ExtensionsFolder => Path.Combine(BaseDirectory, "Extensions");

Since I have no idea what that does, my question is: is it safe to change this? (I didn't test.)
Related issue: WalletWasabi/WalletWasabi#686

@danwalmsley
Copy link

Hmm I think its safe, but @jp2masa might have some input?

@danwalmsley
Copy link

The thing is you would end up with executable code, dlls not in program files, perhaps installing extensions is something that should require admin rights.

@danwalmsley
Copy link

As a workaround can your installer create the directory, wasabiwallet wont need to modify the contents if this directory since extensions are not supported or enabled. I have to work out how extensions would be installed before making a decision on how this should be fixed. I think if we had got round to making an installer for AvalonStudio we would have seen the same issue, and probably had installer create that dir. I wonder where visual studio keeps its extensions.

@nopara73
Copy link
Contributor Author

nopara73 commented Sep 23, 2018

@danwalmsley As I said in the related Wasabi issue I hacked around it similarly as you suggested here. However note, if anyone will want to create an installer using this repo, will have issues those cannot be hacked around like this, if they actually intend to use the extensions, namely that every time they release an upgrade all extensions will be removed (Since the upgrade deletes the app folder in the Program Files, thus the extensions with it.)

Anyway, as I said it's not a big issue for me, since I don't use the extensions, just something to keep in mind for you.

@danwalmsley
Copy link

@nopara73 ok thanks :)

@jp2masa advised:
right, we shouldn't create the directories at runtime I think, we should do that when installing, also about installing extensions: VS uses program files for all users, local app data for current user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants