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

Unable to write to hosts file in Windows installer #535

Closed
sklenke opened this issue Jul 4, 2017 · 13 comments
Closed

Unable to write to hosts file in Windows installer #535

sklenke opened this issue Jul 4, 2017 · 13 comments
Labels
os:windows state:has-workaround There is a known workaround for the described problem type:bug Something isn't working
Milestone

Comments

@sklenke
Copy link

sklenke commented Jul 4, 2017

I'm using Windows 10 Pro 1703 64Bit
I'm running Cryptomator in version: …

I try to install Version 1.3.0 in 64 and 32Bits.

Description

The install for both ends with an runtime error after choosing the path. The error message is:

Runtime Error (at 11:489):
Cannot create file c:\Windows\system32\drivers\etc\hosts.

I try to delete my current host file so that the install script could create a new hosts file. That doesn't work.
Log files are not generate at this time.

@tobihagemann
Copy link
Member

Just to be sure: Does the installer continue or does it abort the installation? We've already received some reports that writing into the hosts file doesn't work. But we don't know yet why this might be the case.

Workaround

Add 127.0.0.1 cryptomator-vault to the hosts file and the installer will skip the write process.

@tobihagemann tobihagemann added os:windows state:has-workaround There is a known workaround for the described problem type:bug Something isn't working labels Jul 4, 2017
@tobihagemann tobihagemann added this to the 1.3.1 milestone Jul 4, 2017
@sklenke
Copy link
Author

sklenke commented Jul 4, 2017

The installer abort the installation.

@overheadhunter
Copy link
Member

Patched in cryptomator-win commit 4f817ef.

@sklenke
Copy link
Author

sklenke commented Jul 4, 2017

Adding 127.0.0.1 cryptomator-vault to the hosts file doesn't work for me. I'll test the patch if it is available for me. Could I download the pathed version anywhere?

@overheadhunter
Copy link
Member

overheadhunter commented Jul 4, 2017

Adding 127.0.0.1 cryptomator-vault to the hosts file doesn't work for me. I'll test the patch if it is available for me. Could I download the pathed version anywhere?

You have probably added a tab or multiple whitespaces between ip and hostname. The installer looks for that exact line.

PS: We got confirmations that fixing the hosts file manually works. But we're still clueless, what other application blocks access to it in the first place.

@sklenke
Copy link
Author

sklenke commented Jul 4, 2017

it works with tab now. The error still appear but I could do the next step and the installer finished.

Thanks

@tobihagemann tobihagemann changed the title Install Version 1.3.0 in Windows 10 crashes. Unable to write to hosts file in Windows installer Jul 4, 2017
@0xDAFE
Copy link

0xDAFE commented Jul 4, 2017

@overheadhunter I think Avira Antivirus (and most likely some other similar products) has a setting that protects the hosts file from being changed

@bclaymiles
Copy link

Hosts file protection is pretty common in AV products. I just hit this issue myself right now, attempting to update to the latest release (that is, cryptomator stated it couldn't update it - not that the installer aborted). I use Webroot AV myself. I turned off Webroot protection temporarily, and the install proceeded. You might want to include a notice/warning in the install to turn off AV temporarily for this reason.

@overheadhunter
Copy link
Member

We wanted to updated the notification anyway. How about:

Unable to write to C:...\etc\hosts. This file might be protected, e.g. by an anti-virus tool. To improve compatibility with Windows, we'd advise you to add this line manually:

127.0.0.1 cryptomator-vault

You can edit the hosts file by starting a text editor in admin mode.
Installation will continue after pressing OK.

@bclaymiles
Copy link

Actually - at least with Webroot - not even an admin-mode editor can modify the hosts file. It's pretty hardcore - only way to edit is to either turn off the whole application temporarily (easiest/fastest) or go into the settings and uncheck 'prevent any program from modifying the HOSTs file'. But then if you forget and leave it unchecked, it'll remain unprotected, whereas webroot will re-enable itself after several minutes, automatically.

I think the notice as written might cause more trouble - people trying to edit the hosts file rather than disabling AV, and then getting frustrated at not being able to change it?

Perhaps just a notice at the start recommending that AV be turned off while installer is running - with a reminder at the end to turn the AV back on.

@overheadhunter
Copy link
Member

Recommending to disable AV doesn't make an installer seem very trustworthy. I'd rather explain what the installer is trying to accomplish.
Also there might be users having multiple malware protection applications, who disable their AV but having the hosts file still protected by some other software.

If they fail to write the file even with notepad in admin mode, the hint that their AV is interfering might help them sort out the problem without trusting an installer that could do virtually anything with no malware protection running.

@bclaymiles
Copy link

Sure - I certainly understand your concern. I agree that it's good to explain what specifically the installer is doing with the hosts file.

Since this is an open source application, any 'monkey business' would be rapidly discovered. So users have the assurance of transparency in that regard.

Over the years, I've installed maybe....four? commercial applications that recommended turning off AV during install. So it's uncommon, but it does happen. Unfortunately I can't recall the names of any of them!

@Nindaleth
Copy link

On my system I also failed in my usual approach - running Notepad as Administrator and then manually editing the hosts file. So I discovered the hosts file was set to read-only by my experiments with Spybot immunization; on some systems ignoring the read-only flag may help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:windows state:has-workaround There is a known workaround for the described problem type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants