qmk / qmk_flasher

flashing utility for the Atmel AVR USB family
MIT License
63 stars 24 forks source link

Driver isn't being installed reliably on Windows #18

Open NoahAndrews opened 7 years ago

NoahAndrews commented 7 years ago

I haven't tested on a wide range of machines or anything, but I believe Wix is going to be far more robust in the area of driver installation. Whereas we had NSIS running an external utility to install the driver, and then failing to reliably show its output, Wix has driver installation built-in natively, and can tell you exactly why the driver installation failed if that happens.

I have a huge part of the work to moving to Wix done already, which can be seen here (comparison). The installer I built from that repo succeeded in installing the driver in a VM where the NSIS installer failed to do so. Still lots to be done though, like a proper installation GUI and possibly fixing the build for other platforms.

Wix is more complicated than NSIS. It is a wrapper for the Windows Installer system, and so it produces .msi files rather than .exe files (which can be wrapped using its bootsrapper tool Burn). Unlike NSIS installers, which executes a series of steps, .msi files tell Windows "Here is precisely what I want everything to look like. You handle it." This results in a system where you have a huge XML configuration file where you have to give every single file a globally unique ID, and tell it exactly where it should end up in the file system. You also have to be careful about managing the GUIDs between updates. In exchange, you get flexibility, better reliability, and better integration with Windows, allowing for things like automated repair and shared libraries between applications. Wix is very stable, Microsoft Office even uses it for its installer.

I'm looking forward to hearing what you guys think about the possibility of switching, as well as the code I've written in that branch.

skullydazed commented 7 years ago

I haven't had a chance to review that code, but I did want to say that I'm totally open to moving to Wix. If managing the GUID's is tricky I think we should have some documentation about how to do that.

NoahAndrews commented 7 years ago

I'll make sure that happens

NoahAndrews commented 7 years ago

The other thing that will be tricky about maintaining the installer is that nearly all of the files it is copying belong to Electron, not our code (I configured electron-packager to put almost all of our code in a single .asar file to make installer maintenance as easy as possible). What we should probably do is lock down the electron version, and update it manually, verifying that new versions don't add or remove any new files.

NoahAndrews commented 7 years ago

Initial UI is implemented. You can try it out here: https://github.com/NoahAndrews/qmk_firmware_flasher/releases/tag/v0.6.0

NoahAndrews commented 7 years ago

You can see a list of things that I know need to happen with the new installer here: https://github.com/NoahAndrews/qmk_firmware_flasher/issues.

There's a fair amount of research about WiX in there too. There's a lot to learn.