mandiant / VM-Packages

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

Set Chrome as default browser #822

Open Ana06 opened 9 months ago

Ana06 commented 9 months ago

Details

I think we should add a googlechrome.defaultbrowser.vm package to add Chrome as default browser as proposed in https://github.com/mandiant/VM-Packages/issues/16.

One idea would be to use the following PowerShell script

Add-Type -AssemblyName System.Windows.Forms
Start ms-settings:defaultapps
Sleep 2
[System.Windows.Forms.SendKeys]::SendWait("{TAB 5}{ENTER}")
Sleep 1
[System.Windows.Forms.SendKeys]::SendWait("{TAB 2}{ENTER}");

But this only works if Google Chrome is the third browser in the list, what I am not sure that is always the case. This is how it looks like for me: Screenshot 2024-01-11 at 17 39 56

How does it look for others? Does anyone have a better idea to implement it? 🤔

emtuls commented 6 months ago

Did we determine if https://github.com/DanysysTeam/PS-SFTA from https://github.com/mandiant/VM-Packages/issues/823 is something we can use or at least take a part of the code to use in our own way?

If not, could we use the alternative from chocolatey? https://community.chocolatey.org/packages/setdefaultbrowser

Ana06 commented 5 months ago

I have asked legal and they have advised that we send an issue/PR to request the addition of the LICENSE file if we want to use the code.

Ana06 commented 5 months ago

@emtuls which of the two options (PS-SFTA or the setdefaultbrowser browser) would you prefer to use? If we prefer to use PS-SFTA I can ask them to include the license file.

emtuls commented 5 months ago

Whichever is easier imo, but setdefaultbrowser seems pretty easy with it being in chocolatey already. :)