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

Git 2.5.2.2 leaves mtab file after uninstall #405

Closed
Radrik5 opened this issue Sep 18, 2015 · 17 comments · Fixed by git-for-windows/build-extra#79
Closed

Git 2.5.2.2 leaves mtab file after uninstall #405

Radrik5 opened this issue Sep 18, 2015 · 17 comments · Fixed by git-for-windows/build-extra#79

Comments

@Radrik5
Copy link

Radrik5 commented Sep 18, 2015

Steps to reproduce:

  1. Uninstall Git 2.5.2 using Control Panel
  2. Go to C:\Program Files\Git\ or C:\Program Files (x86)\Git\

mtab file is not deleted. Attempt to delete it shows: "The file 'mtab' is a system file. If you remove it, Windows or another program may no longer work correctly.".

Is it safe to delete it? Can uninstaller do it?

@Radrik5
Copy link
Author

Radrik5 commented Sep 18, 2015

OS is Windows 7 64 bit.

@dscho
Copy link
Member

dscho commented Sep 18, 2015

Should be deleted: git-for-windows/build-extra@bf980fd

@dscho
Copy link
Member

dscho commented Sep 18, 2015

Even worse: when I install Git for WIndows 2.5.2(2), there is no /etc/mtab to begin with? How did you get one?

@dscho dscho added the unclear label Sep 18, 2015
@nalla
Copy link

nalla commented Sep 18, 2015

See git-for-windows/build-extra@bf980fd#diff-a34c467933f9f6091a5f960fd70e16deR164 The file is being generated dynamically at some point by msys2. So it might not be there right after install. It is a (symbolic) link to /proc/mounts and somehow msys2 flags it as Windows System File.

As for your user question: Yes it is safe to delete and should be by the uninstaller. Maybe because it is marked as System File it is somehow checked when uninstalling by some sort of UAC?

@nalla nalla added the question label Sep 18, 2015
@Radrik5
Copy link
Author

Radrik5 commented Sep 18, 2015

@dscho, it's not /etc/mtab but /mtab. It's created during installation.

@nalla
Copy link

nalla commented Sep 18, 2015

Well I can confirm that the mtab file is indeed not in /etc anymore. After a fresh install it is in /. So either that location moved and we have to adapt the uninstaller or there is something amiss when the file is being generated.

@rimrul
Copy link
Member

rimrul commented Sep 18, 2015

When working on #355 I've watched the same thing happen. I think it was already present in git-for-windows/build-extra@0fd86a3.

@dscho
Copy link
Member

dscho commented Sep 18, 2015

@dscho
Copy link
Member

dscho commented Sep 18, 2015

Ah no, it is the SYSCONFDIR that is not set correctly... :-(

@nalla
Copy link

nalla commented Sep 18, 2015

Ah right! because 03-mtab.post needs that.

@nalla
Copy link

nalla commented Sep 18, 2015

I think we have to check every script there - just in case - for other unset variables.

@nalla
Copy link

nalla commented Sep 18, 2015

See 99-post-install-cleanup.post, I think that is obsolete because the post-install.bat removes itself?

@dscho
Copy link
Member

dscho commented Sep 18, 2015

I think we have to check every script there - just in case - for other unset variables.

Right, I just did.

See 99-post-install-cleanup.post, I think that is obsolete because the post-install.bat removes itself?

No, 99-post-install-cleanup.post cleans up /etc/post-install/, while post-install.bat only removes itself (from the root directory).

dscho added a commit to dscho/build-extra that referenced this issue Sep 18, 2015
Since we do not run the post-install scripts in a full login shell
anymore, `/etc/profile` has no chance of defining the `SYSCONFDIR`
before `03-tab.post` wants to use it.

So let's just hard-code it in `post-install.bat`.

This fixes git-for-windows/git#405

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented Sep 18, 2015

@nalla or @rimrul could you quickly give that PR a test? I am actually in the middle of something else I need to finish ASAP...

@nalla
Copy link

nalla commented Sep 18, 2015

Installer is available as C:\Users\nalla\Git-2.5.2-testing-64-bit.exe

nalla@dev MINGW64 /usr/src/build-extra/installer (mtab-location)
$ ls /c/Program\ Files/Git/
ReleaseNotes.html  bin/  cmd/  dev/  etc/  git-bash.exe*  git-cmd.exe*  mingw64/  tmp/  unins000.dat  unins000.exe*  usr/

nalla@dev MINGW64 /usr/src/build-extra/installer (mtab-location)
$ ls /c/Program\ Files/Git/etc/
DIR_COLORS        bash.bashrc      fstab  inputrc  networks       package-versions.txt  pki/     profile.d/  services  vimrc
bash.bash_logout  docx2txt.config  hosts  mtab@    nsswitch.conf  pkcs11/               profile  protocols   ssh/

@dscho
Copy link
Member

dscho commented Sep 18, 2015

Woot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants