mandiant / VM-Packages

Chocolatey packages supporting the analysis environment projects FLARE-VM & Commando VM.
Apache License 2.0
123 stars 61 forks source link

Add Open With File Association #1016

Closed emtuls closed 2 months ago

emtuls commented 2 months ago

This addresses https://github.com/mandiant/VM-Packages/issues/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 https://github.com/mandiant/VM-Packages/issues/820

The other shortcut that was being created seems to already not appear anymore after merging https://github.com/mandiant/VM-Packages/pull/978

Ana06 commented 2 months ago

@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. :wink:

Ana06 commented 2 months ago

@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.

emtuls commented 1 month ago

@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 commented 1 month ago

Noted issues here: https://github.com/mandiant/VM-Packages/issues/1021#issuecomment-2127748033

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