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

[Windows] USB detection and flashing rework #331

Merged
merged 9 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make sure to extract flashing tools if needed
  • Loading branch information
fauxpark committed Mar 13, 2022
commit 387a112d44ecfcde128ad59bded66901fc831ee9
19 changes: 19 additions & 0 deletions windows/QMK Toolbox/Helpers/EmbeddedResourceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ namespace QMK_Toolbox.Helpers
{
public static class EmbeddedResourceHelper
{
public static readonly string[] Resources =
{
"avrdude.conf",
"reset.eep",
"reset_left.eep",
"reset_right.eep",
"avrdude.exe",
"bootloadHID.exe",
"dfu-programmer.exe",
"dfu-util.exe",
"mdloader.exe",
"teensy_loader_cli.exe",
"libftdi1.dll",
"libusb0.dll",
"libusb-0-1-4.dll",
"libusb-1.0.dll",
"libwinpthread-1.dll"
};

public static void ExtractResource(string file)
{
var destPath = Path.Combine(Application.LocalUserAppDataPath, file);
Expand Down
2 changes: 2 additions & 0 deletions windows/QMK Toolbox/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ private void MainWindow_Load(object sender, EventArgs e)

mcuBox.SelectedValue = Settings.Default.targetSetting;

EmbeddedResourceHelper.ExtractResources(EmbeddedResourceHelper.Resources);

_printer.Print($"QMK Toolbox {Application.ProductVersion} (https://qmk.fm/toolbox)", MessageType.Info);
_printer.PrintResponse("Supported bootloaders:\n", MessageType.Info);
_printer.PrintResponse(" - ARM DFU (APM32, Kiibohd, STM32, STM32duino) via dfu-util (http://dfu-util.sourceforge.net/)\n", MessageType.Info);
Expand Down