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

rig rm does not clean all stale registry entries #86

Closed
cderv opened this issue Jun 3, 2022 · 4 comments
Closed

rig rm does not clean all stale registry entries #86

cderv opened this issue Jun 3, 2022 · 4 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@cderv
Copy link
Contributor

cderv commented Jun 3, 2022

  • rig add 4.2.0 will install R and add to registry
R-core
 > R <- Current Version and Install Path set to 4.2.0
   > 4.2.0 <- Current Version and Install Path set to 4.2.0
 > R64 <- Current Version and Install Path set to 4.2.0
   > 4.2.0 <- Current Version and Install Path set to 4.2.0
  • rig rm 4.2.0 will uninstall R and clean part of the registry which will be after
R-core
 > R <- Current Version and Install Path set to 4.2.0
 > R64 <- Current Version and Install Path set to 4.2.0

So default version is sill set to the uninstall version. rig system clean-registry does not help (I guess this is what is called in the first place)

If we install several versions, and change default and then uninstall the one set as default, the default version in registry will still be the one uninstalled

  • rig add 4.2.0 is doing as describe above
  • rig add 4.1.2 will add 4.1.2 entry in registry
  • rig default 4.1.2 will modify the registry default version -> Current Version and Install Path are set to 4.1.2
  • rig rm 4.1.2 will uninstall and remove 4.1.2 from registry, but not from default R version where state will be
R-core
 > R <- Current Version and Install Path set to 4.1.2 which does not exists anymore 
   > 4.2.0 <- Current Version and Install Path set to 4.2.0
 > R64 <- Current Version and Install Path set to 4.1.2 which does not exists anymore 
   > 4.2.0 <- Current Version and Install Path set to 4.2.0
  • rig default 4.2.0 fix the problem

So it is possible to be in a state where the default version information is not the correct one.
Found while trying to debug Quarto to find R installation when manage by rig

@cderv cderv changed the title rig rm does not clean all stale registry entry rig rm does not clean all stale registry entries Jun 3, 2022
@gaborcsardi
Copy link
Member

Yes, this is all true, and I am actually aware of it. OTOH it is not clear to me what rig should do in this case? Set a different version of rig as the default? Which one? Remove the default completely? That does not seem right, either.

@cderv
Copy link
Contributor Author

cderv commented Jun 13, 2022

right, not easy to know what should be done. But it feels off that a non existing version is kept as default, it is a wrong value in the registry for anyone who uses it. (like Quarto did for example).

I think it would make sense to remove the default completely. rig is setting up some value it should probably unset it.
Setting default version to be the greater one installed makes sense to me too.

But maybe this is an edge case or I am missing some side effects.

@gaborcsardi
Copy link
Member

like Quarto did for example

I agree. OTOH I suspect that this is not an uncommon situation, because it happens is somebody deletes R without running the uninstaller, so Quarto could also check if the referenced R version exists on the system.

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Jun 14, 2022
@cderv
Copy link
Contributor Author

cderv commented Jun 14, 2022

deletes R without running the uninstaller

Who deletes a program on Windows without an uninstaller from the Installed Program Manager pane ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants