• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 31 32 33 34 35 ... 116 Next »

Relocatable builds for Linux
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Relocatable builds for Linux
11-05-2015, 10:14 PM
#1
strycore
Unregistered
 
Hi, I'm working on bringing Dolphin support for the Lutris gaming platform (https://github.com/lutris/).
One of Lutris' features is to allow users to install emulators and other game runners without requiring root access. For this to happen we have to ship binaries that are self contained and able to run from anywhere in the filesystem.

Sadly, Dolphin is one of those rare programs that can't be moved after installation and hardcodes absolutes paths inside the binary. So, my obvious question is: is there any easy way to make the Sys folder relative to the executable path on Linux?

A fix would be quite easy, I could use File::GetExeDirectory() like on Windows in the File::GetSysDirectory() method but that would require me to maintain a fork of Dolphin, which I'd prefer not to since the project is very active and I'd like to keep our future Dolphin runner up to date.

I'd be very thankful if we can find a solution for this problem, I really want to be able to bring Dolphin support in our next release!
Reply
11-05-2015, 10:40 PM
#2
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 8,874
Threads: 7
Joined: Oct 2014
GetExeDirectory only works on Windows, so you'd need to make some sort of alternative if you want to use it. A change to make Dolphin use that by default instead of what it does now is unlikely to be accepted, but what you could try to do is to implement Dolphin's portable mode. On Windows, Dolphin will run in a self-contained folder (instead of storing configuration in Documents) if a file with the name portable.txt is present in the same folder as the executable. This is not implemented on other OSes at the moment, but pull requests are welcome. https://github.com/dolphin-emu/dolphin/blob/696d6eae099feba23c280017c5184785fc1e3076/Source/Core/UICommon/UICommon.cpp#L87

Being a Windows user, I'm not sure how the sys directory should be treated in portable mode on non-Windows OSes. Should people be able to put the config in the same folder as the executable without doing so with the sys folder? I suggest asking some other developers, preferably on IRC since not all of them use the forums. It's also fine to just make the PR and then see what they have to say about it, but you might have to rewrite some of the code then.
Find
Reply
11-05-2015, 11:02 PM
#3
degasus Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,828
Threads: 10
Joined: May 2012
I'm all for looking in the local directory if the global one is missing. +1 if you manage to be able to run dolphin within the Source directory without a global installation. I'm pretty sure this will be accepted to master Big Grin
Find
Reply
11-05-2015, 11:29 PM
#4
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 8,874
Threads: 7
Joined: Oct 2014
(11-05-2015, 11:02 PM)degasus Wrote: I'm all for looking in the local directory if the global one is missing.

I agree. This sounds like a solution that's both simple and useful.
Find
Reply
11-08-2015, 03:11 AM
#5
strycore
Unregistered
 
(11-05-2015, 10:40 PM)JosJuice Wrote: GetExeDirectory only works on Windows, so you'd need to make some sort of alternative if you want to use it. A change to make Dolphin use that by default instead of what it does now is unlikely to be accepted, but what you could try to do is to implement Dolphin's portable mode. On Windows, Dolphin will run in a self-contained folder (instead of storing configuration in Documents) if a file with the name portable.txt is present in the same folder as the executable. This is not implemented on other OSes at the moment, but pull requests are welcome. https://github.com/dolphin-emu/dolphin/blob/696d6eae099feba23c280017c5184785fc1e3076/Source/Core/UICommon/UICommon.cpp#L87

Being a Windows user, I'm not sure how the sys directory should be treated in portable mode on non-Windows OSes. Should people be able to put the config in the same folder as the executable without doing so with the sys folder? I suggest asking some other developers, preferably on IRC since not all of them use the forums. It's also fine to just make the PR and then see what they have to say about it, but you might have to rewrite some of the code then.


I noticed the #ifdef _WIN32 around the GetExeDirectory method but it doesn't seem very complex so I guess I should be able to make a Unix variant. Also, I wasn't expecting to make this the default behavior, there has to be some way to allow both behaviors.
The portable seems nice but when I mentioned self-contained install, I was actually just referring to the actual emulator program, I don't have a problem with user configuration being saved in their default location.

(11-05-2015, 11:02 PM)degasus Wrote: I'm all for looking in the local directory if the global one is missing. +1 if you manage to be able to run dolphin within the Source directory without a global installation. I'm pretty sure this will be accepted to master Big Grin

I'll see what I can do, at first I'll just implement the Windows-like behavior on Linux, then it should only be a matter of placing a couple tests here and there to get Dolphin to run from the Source directory.
Reply
11-08-2015, 04:13 AM
#6
strycore
Unregistered
 
Alright, making some progress here. (see: http://i.imgur.com/DXkJ5CH.jpg)

The Sys directory has to be manually copied to the Binaries directory and the global installation won't work anymore but this is usable for Lutris.

I'll commit my changes to https://github.com/lutris/dolphin then we can discuss on how we can merge all of this into master.

Edit: Changes I made are located here https://github.com/lutris/dolphin/commit/fe16f3950f197085432743e07b270dbd8ac98ddf
Reply
11-08-2015, 07:01 PM
#7
degasus Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 1,828
Threads: 10
Joined: May 2012
Let's move this discussion to github in a pull request. Just create a new one for your patch.
Find
Reply
11-11-2015, 03:01 AM
#8
strycore
Unregistered
 
(11-08-2015, 07:01 PM)degasus Wrote: Let's move this discussion to github in a pull request. Just create a new one for your patch.

It's done. Pull request available here: https://github.com/dolphin-emu/dolphin/pull/3247
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode