WinLua / WinLua-Source-Code

Visual Studio 2017 Project and Installer for WinLua
4 stars 1 forks source link

Installer: Multiple versions of Lua handling in PATH #5

Open RussellHaley opened 6 years ago

RussellHaley commented 6 years ago

Issue

When more than one version of Lua is used, the interpreter that is used in DOS or Powershell is dependent on the order of the entries in PATH. There are multiple ways to handle this. The logic should be something like this:

Possible solution

Find all WinLua paths and order them by arch/version: x86/5.3; x64/5.3; x86/5.1; x64/5.1;

I think 32 bit first because the casual command line use of "lua" doesn't really require 64 bits?

This should be done as a custom WIX event that uses whatever newly installed instance of lua we have.

Outstanding

The proposed solution does not help with calling the correct version of Lua from the command line that you'd expect. I propose adding a new folder to the WinLua directory that contains links named like in FreeBSD (modified):

If this folder were added before all the others, then users could select their version from the command line, edit the links to their preference, or simply call "lua and fall back to the PATH, which is ordered by version