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

"Advanced Options --> Replace hbmenu on exit" does not work correctly in Version 0.5.0 #66

Closed
muxi1 opened this issue Dec 31, 2024 · 18 comments

Comments

@muxi1
Copy link

muxi1 commented Dec 31, 2024

If this option is activated, it can no longer be deactivated. sphaira is started even though the option has been set to ‘deactivated’ again.

@muxi1 muxi1 changed the title "Advanced Options --> Replace hbmenu on exit" does not work correctly "Advanced Options --> Replace hbmenu on exit" does not work correctly in Version 0.5.0 Dec 31, 2024
@ITotalJustice
Copy link
Owner

The way the option works is that, when enabled, it will first backup a copy of hbmenu in/switch/hbmenu.nro and then copy sphaira in it's place.

When disabled, it simply stops doing the above.

The issue with option is that it doesn't currently feature a way to restore hbmenu when disabling it. I'll look into how best to handle this.

I have thought about displaying a pop up on disable, asking if they wish to restore hbmenu. On confirm, backup sphaira, restore hbmenu, and then exit sphaira to the main menu.

@muxi1
Copy link
Author

muxi1 commented Dec 31, 2024

Is it not possible to simply copy the ‘switch/hbmenu.nro’ back into the SD card root and overwrite the file located there if the option is deactivated again?

@ITotalJustice
Copy link
Owner

Is it not possible to simply copy the ‘switch/hbmenu.nro’ back into the SD card root and overwrite the file located there if the option is deactivated again?

Yes, that is what I suggested I could do. It would need to backup sphaira if needed, as some users may only have sphaira installed as hbmenu, so restoring actual hbmenu would permanently delete sphaira. Exiting after restoring hbmenu whilst sphaira has been launched as hbmenu is needed as it means the romfs mounting will no longer work (the file is gone) and other misc details in the code that would break.

@muxi1
Copy link
Author

muxi1 commented Dec 31, 2024

Perhaps it would be better to select the config folder or the switch/sphaira/ folder as the backup/restore destination, so that someone doesn't get the idea of deleting hbmenu.nro from the switch folder?

Edit:
or even better directly in the ‘atmosphere’ folder, because nobody will delete anything there without further ado.

@ITotalJustice
Copy link
Owner

Perhaps it would be better to select the config folder or the switch/sphaira/ folder as the backup destination, so that someone doesn't get the idea of deleting hbmenu.nro from the switch folder?

If the hbmenu.nro doesn't exist, and the user selected the option to restore it, then I would probably show an error message explaining that it wasn't found, and that they can re-download it from the appstore.

@muxi1
Copy link
Author

muxi1 commented Dec 31, 2024

The hbmenu.nro will always remain in the SD card root, as it is only overwritten, either with sphaira or the regular hbmenu. Or am I making a mistake?

Ah, I see. You're talking about when a backup is accidentally or deliberately deleted and then an attempt is made to restore it.

@ITotalJustice
Copy link
Owner

The hbmenu.nro will always remain in the SD card root, as it is only overwritten, either with sphaira or the regular hbmenu. Or am I making a mistake?

Ah, I see. You're talking about when a backup is accidentally or deliberately deleted and then an attempt is made to restore it.

Yes the later (I should've specified /switch/hbmenu.nro 😄). I'll look into adding this today

@muxi1
Copy link
Author

muxi1 commented Dec 31, 2024

Thank you very much, also for this fantastic tool!

@ITotalJustice
Copy link
Owner

the prompt to restore:

2024123117553900-CA43EC7375AB1E2BC8AFC050C0941918

on success (launched not as hbmenu)

2024123117560100-CA43EC7375AB1E2BC8AFC050C0941918

on success (launched as hbmenu)

2024123118024700-CA43EC7375AB1E2BC8AFC050C0941918

on failure (/switch/hbmenu.nro not found)

2024123117570100-CA43EC7375AB1E2BC8AFC050C0941918

some other error handling in place.

  • if sphaira fails to back itself up, it is not flagged as an error, as the user probably doesnt plan to use it again, hence restoring hbmenu. this should never fail anyway.
  • in the event that /switch/hbmenu exists, but it fails to restore it, it will restore sphaira back instead as a fail-safe. on success: "Failed to restore hbmenu, using sphaira instead". on failure: "Failed to restore hbmenu, please re-download hbmenu"

those 2 errors are only triggered upon fs corruption or a ftp/mtp server opening the file, blocking access to read/write said files. so no one will ever see these errors, but there is handling for them, just in case

@muxi1
Copy link
Author

muxi1 commented Dec 31, 2024

Hi ITotalJustice,
I would like to compile the current source code with Msys2. I have already installed CMake (pacman -S cmake) . Could you please tell me which command I have to enter to compile this tool? Many thanks in advance and all the best for the new year.

@ITotalJustice
Copy link
Owner

Hi ITotalJustice, I would like to compile the current source code with Msys2. I have already installed CMake (pacman -S cmake) . Could you please tell me which command I have to enter to compile this tool? Many thanks in advance and all the best for the new year.

check the workflow file for how to build it, or look at the build_release.sh

@muxi1
Copy link
Author

muxi1 commented Dec 31, 2024

Excuse me, but I know next to nothing about programming. So far I have always compiled a tool with ‘make’ in a source code folder. CMake is something else and I have absolutely no idea what to enter in the terminal. I have looked at build_release.sh, but I don't know what to do with it. And what is the ‘workflow file’? Can't you just tell me the corresponding line that I have to enter?

Edit:
I don't want to cause you too much trouble and will wait for a new release of your tool.

@shadow2560
Copy link
Contributor

Excuse me, but I know next to nothing about programming. So far I have always compiled a tool with ‘make’ in a source code folder. CMake is something else and I have absolutely no idea what to enter in the terminal. I have looked at build_release.sh, but I don't know what to do with it. And what is the ‘workflow file’? Can't you just tell me the corresponding line that I have to enter?

Edit: I don't want to cause you too much trouble and will wait for a new release of your tool.

You can go to the workflows page, select the commit you want (the last one is the first proposed in the list) and there you will find the nro compiled automaticaly when a new modification is done on the project.

To compile the sources yourself you must setup Devkitpro with the switch-dev environment, open the Devkitpro terminal and type "cmake --preset MinSizeRel" then "cmake --build --preset MinSizeRel" but in some of my tests compilation of the project on Windows work the first time but make some errors the second time (haven't tested it with the last versions so I don't know if this problem is always present) so I've setuped my environment with wsl and like that it works but it's more complicated. So if you're not a dev prefers to go to the workflows page.

shadow2560 added a commit to shadow2560/sphaira that referenced this issue Dec 31, 2024
@muxi1
Copy link
Author

muxi1 commented Jan 1, 2025

@ITotalJustice @shadow2560 Happy new year! To get straight to the point: I am not at all familiar with Github and its possibilities. I don't understand how you can automatically create an nro. Since this is not a minor issue, but a serious error in an option that cannot be undone, I think it would make sense to publish a new version. What do you think?

@shadow2560
Copy link
Contributor

It's a new feature, not a bug as explained earlier in this topic, we've also discussed of this in #41.
Also there are some discussions that are not closed, like #64 or new things that will be added like #67 or probably some translations to update, like you can see there are many reasons to not publish a new version for now.

@muxi1
Copy link
Author

muxi1 commented Jan 1, 2025

Well, at least a restore of the original Homebrew menu is currently not possible. So deactivating sphaira does not work either once you have activated it as standard. Incidentally, it is the only option that does not currently work. If that's not a reason for an update, then I don't know....
Fortunately, the original homebrew menu is available as a backup app to select in shpaira, which makes things satisfactory for me as a temporary solution at the moment. The fact is that there are many users who have hidden apps in other folders of the SD card root, but these are not accessible via shpaira, as only the apps in the switch folder are taken into account.

One of my suggestions would be to offer the option in the main menu to access the root level of the SD card via B in order to be able to switch to another folder containing apps.

@shadow2560
Copy link
Contributor

To access homebrews that are not in a standard path you have the file explorer witch is capable to also launch nro files but yes adding the possibility to display homebrews in a custom path the same way as the HBMenu do it could be a good add, it's a problem witch has been already discussed in an other issue.
For a new version I think this will be done soon.

@muxi1
Copy link
Author

muxi1 commented Jan 1, 2025

Interesting! I didn't know that it was possible to start homebrews in other locations via the file browser. Cool!

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

3 participants