Skip to content
Permalink
Browse files

[installer] [host] Windows: workarounds Windows 10 update which preve…

…nts writing to removable media

Signed-off-by: Sam Nazarko <email@samnazarko.co.uk>
  • Loading branch information...
samnazarko committed Dec 10, 2017
1 parent f058233 commit f3c2c62034b913e17aa4e145c693ceed441f8686
Showing with 4 additions and 0 deletions.
  1. +4 −0 installer/host/qt_host_installer/io_windows.cpp
@@ -11,6 +11,7 @@
#include <QStringList>
#include "diskdevice.h"
#include "writeimageworker.h"
#include <QSettings>

namespace io
{
@@ -64,6 +65,9 @@ namespace io

bool writeImage(QString devicePath, QString deviceImage, QObject* caller) /* We are really passing deviceID on Windows, but call it devicePath still */
{
utils::writeLog("Workaround Windows 10 card protection");
QSettings settingStorageDevicePolicy;
settingStorageDevicePolicy.setValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies\WriteProtect", 0);
utils::writeLog("Writing 512 bytes to erase MBR");
QProcess process;
process.start(QDir::temp().filePath("usbitcmd.exe"), QStringList() << "r" << devicePath << QDir::temp().filePath("bs.img") << "/d", QIODevice::ReadOnly | QIODevice::Text);

0 comments on commit f3c2c62

Please sign in to comment.
You can’t perform that action at this time.