Windows installers no longer write registry keys

Hi,

Got a bug report from a user running Windows that the Logtalk installer no longer finds the SWI-Prolog installation performed using the Windows installers. After deleting my Windows SWI-Prolog installation and trying both stable and devel installers, I found that these no longer write the registry keys that the Logtalk installer have always depend on to provide integration with SWI-Prolog. With the SWI-Prolog installers defaulting to not add the executables paths to the Windows system path and the users being able to chose an arbitrary directory for the installation, there’s no longer any sensible automated way of providing the integration. I assume this isn issue caused by the switch to cmake-based installers? Is it possible to restore writing the registry keys?

Thanks,
Paulo

1 Like

It is surely caused by the switch as I (happy me) have no longer to write the NSIS builder program but this is done by CPack. I have no clue how simple it is to add some additional scripting to this. I’m happy to have a look, but if someone knows the answer, please propose a patch!

Found this answer:

Relavant?

I think so. Thanks. I’m not behind a Windows machine now :slight_smile:

Pushed a fix. You can try tomorrows daily (if it builds).

Thanks for the quick fix! I will try the daily build tomorrow and report back.

Do you remember the first version number that used CPack instead of the old NSIS installer?

I don’t remember exactly. Somewhere around 7.7.20 I think.

Download today’s 64 bit build. The fix you commit works. Could you also apply the fix to the stable branch? Thanks.

Minor issue: the names of the daily build files seem to be invalid due to the asterisk in the name. Deleting it allowed me to copy the file to the Windows file system.

Good.

Hmm. It isn’t really time for a new stable. There are hardly relevant patches. There might be an alternative fix. The CPack installer also contains:

WriteRegStr SHCTX "Software\SWI-Prolog\swipl" "" $INSTDIR

SHCTX is the shell context, which using a default installation seems to be the same as HKLM. Don’t aske me …

Good catch. Changed to -.

I don’t mean releasing a new stable version, just committing the same patch to the stable branch or repo.

SHCTX is HKLM when installing for all users and HKCU when installing for the current user. But I don’t think that WriteRegStr call is correct. It likely should be "home" instead of "". That bug may explain why there’s no HKLM or HKCU entries when running the current released installers for 8.0.3 and 8.1.10.

Done.

Seems fine. I can find this key nicely alongside SWI\Prolog. Regedit says the installation directory is the default value of the key. I think that is used by the generated uninstaller.

I uninstalled SWI-Prolog, delete all its registry key (written by pre-7.7.20 versions) and tried both 8.0.3 and 8.1.10 installers. Searching for SWI registry keys after the installs found none. Are you sure the key you found in the registry was not one written by an old installer?

Using "home" instead of "" still sounds problematic: there are other entries besides the installation directory. Using "home" means that there’s no ambiguity when you need to retrieve the installation directory.