daisy/pipeline-assembly

NSIS Installer fails to write to Windows Registry

Closed this issue · 5 comments

Discovered this issue with an error when running pipeline-updater-gui.exe from Windows 10, 64-bit:

Exception in Application start method
java.lang.reflect.InvocationTargetException...
Caused by: java.lang.RuntimeException: Couldn't find the pipeline home in the registry
        at org.daisy.pipeline.updater.gui.Main.start(Main.java:37)

[full log: pipeline-assembly.136log.txt]

The installer attempts to write the following entries to the registry with WriteRegStr (https://github.com/daisy/pipeline-assembly/blob/master/src/main/nsis/installer.nsi#L272):

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\DAISY Consortium\DAISY Pipeline 2
HKLM\SOFTWARE\DAISY Pipeline 2\InstallDir
HKLM\SOFTWARE\DAISY Pipeline 2\Pipeline2Home

After installing DAISY Pipeline 2 with the latest assembly release, none of these entries were written to my registry (I searched and manually browsed my registry for them).

@bertfrees thinks it may have to do with registry differences between 32-bit and 64-bit, referencing this NSIS Forum post reporting a simliar problem: https://nsis-dev.github.io/NSIS-Forums/html/t-319451.html

@mccallum-sgd Did you also check HKEY_LOCAL_MACHINE\Software\WOW6432node? Romain thinks maybe the installer writes to the registry correctly, but the updater fails to read from it.

@bertfrees Oh yes just checked WOW6432Node, all of the entries are there (InstallDir, NSIS:Language, Pipeline2Home, StartMenuGroup). That's weird that this didn't show up when I searched my registry for it.

OK. That explains things. It seems the updater code doesn't handle this case.

One possibility would have been to write into the 64-bit registry using SetRegView, but since the installer can not really know which version of Java (32 or 64 bit) will be used to run the program, I thought it would be better to assume 32-bit, and to add some code to pipeline-updater-gui to handle the 64-bit case.

Sean implemented this in daisy/pipeline-updater-gui#4.

I think we can close this one, right @bertfrees ?