Registry handling on windows (installer)
Yu Jin
technikmagma at gmail.com
Fri Mar 6 08:08:58 UTC 2020
Hi all,
I've been training nsis and experimenting with the windows installer. I
think I am somewhat confident with that topic now. The purpose of this
Email is that I see some issues in the registry handling in the code for
the installer and I would like to discuss those issues.
1. We create e.g. "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\LyX2344", this is
not convenient when searching the computer if any LyX is installed (using
code). I would rather do it like imagemagick does, so
"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\LyX\2344". This would be a somewhat
huge change. This is also my issue with TeXLive, because it also adds
version number to its name, so I will have to do something about that
aswell (see nsis function LaTeXActions in LaTeX.nsh)
2. Imagemagick: The installer does not check if there is already
imagemagick in the registry, it just puts it in there and creates a value
"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ImageMagick\OnlyWithLyx". Then when
uninstalling, it checks this value and if it is true, it deletes the whole
ImageMagick key. When the user has Imagemagick installerd separately, lets
say version 7.0.9, he would get in registry "...\ImageMagick\7.0.9\...",
LyX's imagemagick would add a e.g. "...\ImageMagick\7.0.8\..." to that, and
when uninstalling, the whole "ImageMagick" wuld be gone, even though the
user didnt intend to uninstall his separate Imagemagick. But it won't work
now. What I would like to do about it is actually remove the "OnlyWithLyx"
value, but instead, when uninstalling, I would check the BinPath value
(which contains the folder in which magick.exe is) for $INSTALLDIR part
(which is where the uninstaller of lyx is) to determine if it is the
imagemagick installed with the lyx the user wants to uninstall now or not.
I would do the same with ghostscript and its value "GS_DLL". Also I would
not set "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ImageMagick\Current" key,
imagemagick works without it, I have tested it, and its just confusing imho.
3. In order to not have to reinstall LyX when the user desides to remove
his imagemagick and/or ghostscript (or an earlier version of LyX), we would
need to make LyX being able to repair the registry for these 2 programs. I
think that the reconfigure.py script would be a good place to implement it.
i will see if I will be able to do it myself, but if not I would open a new
topic asking for help. In general I would extract the imagemagick and
ghostscript files with the installation of lyx, but when registry entries
would be found for those 2 (and they would not contain a "LyX" substing), I
would not overwrite them. If we then would have something in the python
script to set them, in case the user removes his separate
imagemagick/ghostscript installations, the user would just need to
reconfigure and everything would work again.
I would definitely be able to code at least the nsis part for this. Just
before I start doing I would like to know if it is ok with everybody or if
there are reasons to not make some of these changes. If ok, I would target
the next major release and implement this in master.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200306/85063c55/attachment.html>
More information about the lyx-devel
mailing list