Skip to content

Conversation

@SelfRef
Copy link

@SelfRef SelfRef commented Jul 24, 2023

This PR changes location where configuration files are saved and loaded from. Thanks to build-in SpecialFolder.ApplicationData enum the config directory is correctly guessed depends of environment so e.g. on Linux it will be ~/.config and on Windows %AppData%.

Using configuration files in assembly location prevents usage per-user configuration and makes packaging for distributions harder.

I've created Arch Linux packages in AUR (1, 2, 3) and currently the configuration is kept with program files in /opt/86BoxManager which is a bad practice.

@jchv
Copy link

jchv commented Apr 28, 2024

On NixOS, the workaround used in the AUR can't even be used, since the Nix store is mounted read-only. It's not a huge deal, since I can apply a patch like this one. That said, it'd be nice to reach a consensus on where to store the config file so that users only need to be broken at most once. It might be a good idea for the code to check the current directory for config files before using the %AppData%/$XDG_CONFIG_HOME paths, maybe then users can be broken zero times.

That said, since the maintainer of this fork seems to be rather busy, maybe it's time for a fork of a fork? :)

P.S.: The Directory.Exists call is superfluous. Directory.CreateDirectory behaves like mkdir -p, and does not throw an error when the directory already exists.

@SelfRef
Copy link
Author

SelfRef commented Apr 29, 2024

That said, since the maintainer of this fork seems to be rather busy, maybe it's time for a fork of a fork? :)

I just merged this change to master of my own fork so you can just use my repository for NixOS package. In case of any changes in this repo I will sync my fork as well.

And maybe I'll find some time to take over the development and add my own changes, we will see 😄

@OzzyHelix
Copy link

@SelfRef I currently have a problem where I can't configure using the configure button with your aur package I am worried it might be because 86boxManagerX is way behind the upstream branch that or something is wrong with your AUR package

@SelfRef
Copy link
Author

SelfRef commented Jun 14, 2024

@SelfRef I currently have a problem where I can't configure using the configure button with your aur package I am worried it might be because 86boxManagerX is way behind the upstream branch that or something is wrong with your AUR package

That's odd, I was using this package recently. I'll take a look at it tomorrow. You may try to make the package from AUR manually with makepkg -si.

@OzzyHelix
Copy link

I needed to install the dotnet sdk to get it working for some reason that is the only thing I changed

@OzzyHelix
Copy link

OzzyHelix commented Jun 14, 2024

I installed dotnet-sdk-6.0-bin and it started working

@SelfRef
Copy link
Author

SelfRef commented Jun 17, 2024

I installed dotnet-sdk-6.0-bin and it started working

Which AUR package have you used (there are three)? I'll add update dependencies.

@OzzyHelix
Copy link

I installed dotnet-sdk-6.0-bin and it started working

Which AUR package have you used (there are three)? I'll add update dependencies.

the git version but I think it does the same for the bin as well

@SelfRef
Copy link
Author

SelfRef commented Jun 20, 2024

the git version but I think it does the same for the bin as well

That's interesting - there's .NET 6 in dependencies in -git package. Although runtime was missing from -bin package, so I fixed that.

@OzzyHelix
Copy link

the program crashes on wayland running in the terminal by doing export QT_QPA_PLATFORM=xcb prevents it from crashing

❯ 86BoxManager
#
# 86Box v4.1.1 logfile, created 2024/06/22 20:13:56
#
# VM: 98box
#
# Emulator path: /usr/bin/
# Userfiles path: /home/ozzy/86Box VMs/98box/
# ROM path: /home/ozzy/86Box VMs/98box/roms/
# ROM path: /usr/bin/roms/
# ROM path: /home/ozzy/.local/share/86Box/roms/
# ROM path: /home/ozzy/.local/share/flatpak/exports/share/86Box/roms/
# ROM path: /var/lib/flatpak/exports/share/86Box/roms/
# ROM path: /usr/local/share/86Box/roms/
# ROM path: /usr/share/86Box/roms/
# Configuration file: /home/ozzy/86Box VMs/98box/86box.cfg
#

Qt: version 6.7.1, platform "wayland"
Unhandled exception. System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.
 ---> System.InvalidOperationException: Call from invalid thread
   at Avalonia.Threading.Dispatcher.VerifyAccess() in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 48
   at Avalonia.AvaloniaObject..ctor() in /_/src/Avalonia.Base/AvaloniaObject.cs:line 33
   at Avalonia.Animation.Animatable..ctor() in /_/src/Avalonia.Animation/Animatable.cs:line 29
   at Avalonia.StyledElement..ctor() in /_/src/Avalonia.Styling/StyledElement.cs:line 82
   at Avalonia.Visual..ctor() in /_/src/Avalonia.Visuals/Visual.cs:line 118
   at Avalonia.Layout.Layoutable..ctor()
   at Avalonia.Interactivity.Interactive..ctor()
   at Avalonia.Input.InputElement..ctor() in /_/src/Avalonia.Input/InputElement.cs:line 228
   at Avalonia.Controls.Control..ctor()
   at Avalonia.Controls.Primitives.TemplatedControl..ctor()
   at Avalonia.Controls.ContentControl..ctor()
   at Avalonia.Controls.TopLevel..ctor(ITopLevelImpl impl, IAvaloniaDependencyResolver dependencyResolver) in /_/src/Avalonia.Controls/TopLevel.cs:line 133
   at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) in /_/src/Avalonia.Controls/WindowBase.cs:line 60
   at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl) in /_/src/Avalonia.Controls/WindowBase.cs:line 56
   at Avalonia.Controls.Window..ctor(IWindowImpl impl) in /_/src/Avalonia.Controls/Window.cs:line 240
   at Avalonia.Controls.Window..ctor() in /_/src/Avalonia.Controls/Window.cs:line 231
   at MessageBox.Avalonia.Views.BaseWindow..ctor()
   at MessageBox.Avalonia.Views.MsBoxStandardWindow..ctor()
   at MessageBox.Avalonia.MessageBoxManager.GetMessageBoxStandardWindow(MessageBoxStandardParams params)
   at _86boxManager.Tools.Dialogs.ShowMessageBox(String msg, Icon icon, ButtonEnum buttons, String title) in /home/runner/work/86BoxManagerX/86BoxManagerX/86BoxManager/Tools/Dialogs.cs:line 33
   at _86boxManager.Core.VMWatch.background_DoWork(Object sender, DoWorkEventArgs e) in /home/runner/work/86BoxManagerX/86BoxManagerX/86BoxManager/Core/VMWatch.cs:line 47
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
   --- End of inner exception stack trace ---
   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   at _86boxManager.Core.VMWatch.background_RunCompleted(Object sender, RunWorkerCompletedEventArgs e) in /home/runner/work/86BoxManagerX/86BoxManagerX/86BoxManager/Core/VMWatch.cs:line 58
   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(Object arg)
   at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass5_0.<Post>b__0() in /_/src/Avalonia.Base/Threading/AvaloniaSynchronizationContext.cs:line 33
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 37
   at Avalonia.X11.X11PlatformThreading.CheckSignaled() in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 164
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken) in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 244
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 65
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at _86boxManager.Tools.Lifetimes.<>c__DisplayClass0_0`1.<SetupWithClassicDesktopLifetime>g__After|0() in /home/runner/work/86BoxManagerX/86BoxManagerX/86BoxManager/Tools/Lifetimes.cs:line 19
   at _86boxManager.Program.Main(String[] args) in /home/runner/work/86BoxManagerX/86BoxManagerX/86BoxManager/Program.cs:line 42
/usr/bin/86BoxManager: line 4: 334822 Aborted                 (core dumped) /opt/86BoxManager/86Manager "$@"

@OzzyHelix
Copy link

also there is something with the 86box package on Arch that makes the configure button do nothing when in xcb mode

@SelfRef
Copy link
Author

SelfRef commented Jun 25, 2024

also there is something with the 86box package on Arch that makes the configure button do nothing when in xcb mode

Your problem doesn't seem to be related with packaging, but there is an issue in the code. Take into account I'm just packaging this project, not developing it.

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

Successfully merging this pull request may close these issues.

3 participants