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

Add ability to use preinstalled 7zip via env variables #358

Closed
CryoRenegade opened this issue Jun 13, 2023 · 4 comments
Closed

Add ability to use preinstalled 7zip via env variables #358

CryoRenegade opened this issue Jun 13, 2023 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@CryoRenegade
Copy link

CryoRenegade commented Jun 13, 2023

Problem Description

Using scoop, we install 7zip in a non-traditional location and have to install 7zip to another location for firefoxpwa to work.

Proposed Solution

Add the ability to use the environment variables found in Unix-like systems and Windows to see if 7zip is already installed.

Additional Information

Original issue found here ScoopInstaller/Extras#11321

@CryoRenegade CryoRenegade added the enhancement New feature or request label Jun 13, 2023
@filips123
Copy link
Owner

So, there should be an environment variable where you can set the path to 7z.exe? I can implement this, although I probably won't have time to do it until next week.

@CryoRenegade
Copy link
Author

Scoop adds a path variable to the windows environment that points to its apps. However when running firefoxpwa runtime install it states it can't find 7zip.

@filips123 filips123 added this to the 2.6.2 milestone Jun 23, 2023
@filips123
Copy link
Owner

I'm now working on adding support for locating 7-Zip in PATH, but I've found a few other problems... Scoop just extracts the installer without performing things like adding registry keys. However, PWAsForFirefox requires a few registry keys to function:

  • Software\filips\FirefoxPWA (HKLM or HKCU) - To locate the installation directory, where all other files are located. Normally, this key is set by the installer and commonly points to C:\Program Files\FirefoxPWA. In Scoop, this location should probably be C:\Users\User\scoop\apps\firefoxpwa\current, but the registry key doesn't exist, so the program just fails. This seems to be what actually caused the original issue (firefoxpwa 2.6.0: not runing ScoopInstaller/Extras#11321).

  • Software\Mozilla\NativeMessagingHosts\firefoxpwa (HKLM or HKCU) - So Firefox can detect native messaging manifest for PWAsForFirefox. It needs to point to the location of firefoxpwa.json (in this case, probably C:\Users\User\scoop\apps\firefoxpwa\current\firefoxpwa.json). Without that registry key and the manifest, the extension won't be able to detect the native program.

Scoop supports post_install, so maybe it's possible to create those two registry keys and set the correct values automatically when installing. I'll check if I can configure them alone, but otherwise I might need some help as I'm not that familiar with Scoop post_install scripts.

@filips123 filips123 reopened this Jun 24, 2023
@filips123
Copy link
Owner

The first step to fix this is now completed. In case 7-Zip isn't found in the registry, PWAsForFirefox will now also try to search it (specifically 7z.exe) in the PATH environment variable. This will be released in the next version

I'll keep this issue open for now, as there are still things to finish (those post install/uninstall scripts), but they need to be done in the Scoop Extras repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants