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 Open With File Association #1016

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Add Open With File Association #1016

merged 2 commits into from
Apr 30, 2024

Conversation

emtuls
Copy link
Member

@emtuls emtuls commented Apr 25, 2024

This addresses #1015

It adds the ability to give a file extension a default executable to open it with. I also updated the 7zip packages to use the new function.

If you are testing and you already have a .7z file (or other associated file type), this may require logging out and back in or performing another form of File Explorer refresh, such as Stop-Process -Name explorer; Start-Process explorer.

I'm also not sure how to properly make sure that 7zip.vm uses this new functionality. I tested by installing the new common.vm and then the updated 7zip-nsis.vm and 7zip-15-05.vm

I also added the removal of the Public\Desktop shortcut that is created during installation so that we can close #820

The other shortcut that was being created seems to already not appear anymore after merging #978

@emtuls emtuls added 💎 enhancement It is working, but it could be better 🌀 FLARE-VM A package or feature to be used by FLARE-VM labels Apr 25, 2024
@emtuls emtuls self-assigned this Apr 25, 2024
@emtuls emtuls force-pushed the add-file-association branch 2 times, most recently from dabc2d5 to 926578a Compare April 25, 2024 20:16
@emtuls emtuls requested a review from Ana06 April 25, 2024 20:19
@emtuls emtuls linked an issue Apr 25, 2024 that may be closed by this pull request
@emtuls emtuls linked an issue Apr 26, 2024 that may be closed by this pull request
@emtuls emtuls linked an issue Apr 26, 2024 that may be closed by this pull request
Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works nicely! I have just 2 minor comments 😄

packages/common.vm/tools/vm.common/vm.common.psm1 Outdated Show resolved Hide resolved
packages/googlechrome.vm/tools/chocolateyinstall.ps1 Outdated Show resolved Hide resolved
@Ana06
Copy link
Member

Ana06 commented Apr 30, 2024

@emtuls I think you don't have time in the next days to address the minor changes I pointed out. I will address the feedback myself so that we can merge this PR. 😉

Add `VM-Set-Open-With-Association` helper function to `common.vm` and
use it to open zip extensions with 7z by default.
Use the new `VM-Set-Open-With-Association` helper function to open .html
files with Chrome by default. Remove also the Desktop shortcut that is
created during installation.
Copy link
Member

@Ana06 Ana06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have address the feedback and added more details to the commit messages. I think it is good to go!

@Ana06
Copy link
Member

Ana06 commented Apr 30, 2024

@emtuls could we remove now the Chrome dependency in Cyberchef and the code to open it with chrome and set the icon? I think with this PR removing that code would keep the current behavior if both cyberchef.vm and googlechrome.vm are installed and remove the chrome dependency would allow to have a different browser as default (and to open cyberchef) if only cyberchef.vm is installed.

@Ana06 Ana06 merged commit e488261 into main Apr 30, 2024
6 checks passed
@emtuls emtuls deleted the add-file-association branch May 6, 2024 13:48
@emtuls
Copy link
Member Author

emtuls commented May 6, 2024

@emtuls could we remove now the Chrome dependency in Cyberchef and the code to open it with chrome and set the icon? I think with this PR removing that code would keep the current behavior if both cyberchef.vm and googlechrome.vm are installed and remove the chrome dependency would allow to have a different browser as default (and to open cyberchef) if only cyberchef.vm is installed.

I'll look into this! I had a thought about it earlier, but I got tied up in some things, so I'll have to give it some thought again soon. :)

@emtuls
Copy link
Member Author

emtuls commented May 23, 2024

Noted issues here: #1021 (comment)

We still run into the issue where a popup displays asking if we want to use Chrome (other other browser) as the default browser even after the association. The icon and expected executable for the association changes, but it's not enough to bypass the popup unless we use something like SetDefaultBrowser: https://community.chocolatey.org/packages/setdefaultbrowser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌀 FLARE-VM A package or feature to be used by FLARE-VM 💎 enhancement It is working, but it could be better
Projects
None yet
2 participants