Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

John Hind
The Lua source distribution builds and runs just fine on Visual Studio (Community - free - Edition) on Windows 10. At least VS 2015 and 32-bit, I've not got around to rebuilding any of my projects with VS 2017 yet and do not really see the point of a 64-bit binary (32-bit runs fine on 64-bit Windows). Just dump the source files into an empty Win32 C++ Console project (File|New|Project|Other Languages|Win32|Win32 Console Application) and you are good to go. You may need some linker settings to make it truly stand alone as it will probably depend on "Visual Studio Redistributables" by default, although if you let VS make the installer package it will install those too if necessary.

Microsoft are hopeless at adopting their own snake-oil and despite promoting C# and the CLR for years now most of their own code base is still C++ so that still gets first-class tooling in VS.

The problems using Lua on Windows start with third-party libraries and the Linux-inspired distribution formats. Unlike most library developers, Roberto's team have done an excellent job making Lua sources compile without change just about anywhere C is spoken.

Date: Wed, 17 May 2017 00:12:10 -0700
From: Russell Haley <[hidden email]>
Subject: Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of
 Concept
 
So I'm starting to see the complications now. The 64 bit binary "just
works" on Window 10, but the 32 bit seems to still require mingw
(Error message "The program can't start because libgcc_s_dw2-1.dll is
missing from your computer"). Using various VCRedist packages
(2008,2010,2017) against joefds' binaries wasn't effective (had to
try). I could look at linking the mingw installer into my PUC-Lua
installer or ...
 
The other possibility is to try Visual Studio 2017. From what I can
tell the VS 2015 and 2017 release includes the C library support that
made mingw a requirement (if you trust a C# developers understanding
of C libraries!). That means I could set up a VC++ project to compile
Lua and link in the installer and add the merge module to create a
single MSI tool (I think). WIX is designed to integrate with Visual
Studio (2015 release at least) so potentially a single Solution file
could be created (and shared). If you wanted to open up Lua to Windows
developers, I think this may be an optimal route.
 
Well, VS Community Edition is a "free" version of a paid for product
but I think this is moving into "paid-for" land. I'll still try not to
hurt any small animals while compiling, though. If anyone has already
been down this path, I'd love to here from you.
 
Okay, take two...
 
Russ
 

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Dirk Laurie-2
2017-05-17 16:11 GMT+02:00 John Hind <[hidden email]>:

> The problems using Lua on Windows start with third-party libraries and the
> Linux-inspired distribution formats. Unlike most library developers,
> Roberto's team have done an excellent job making Lua sources compile without
> change just about anywhere C is spoken.

What is your experience, as a Windows user of some sophistication,
of libraries distributed via LuaRocks?

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Russell Haley
In reply to this post by John Hind
On Wed, May 17, 2017 at 10:11 AM, John Hind <[hidden email]> wrote:

> The Lua source distribution builds and runs just fine on Visual Studio
> (Community - free - Edition) on Windows 10. At least VS 2015 and 32-bit,
> I've not got around to rebuilding any of my projects with VS 2017 yet and do
> not really see the point of a 64-bit binary (32-bit runs fine on 64-bit
> Windows). Just dump the source files into an empty Win32 C++ Console project
> (File|New|Project|Other Languages|Win32|Win32 Console Application) and you
> are good to go. You may need some linker settings to make it truly stand
> alone as it will probably depend on "Visual Studio Redistributables" by
> default, although if you let VS make the installer package it will install
> those too if necessary.
>
> Microsoft are hopeless at adopting their own snake-oil and despite promoting
> C# and the CLR for years now most of their own code base is still C++ so
> that still gets first-class tooling in VS.
>
> The problems using Lua on Windows start with third-party libraries and the
> Linux-inspired distribution formats. Unlike most library developers,
> Roberto's team have done an excellent job making Lua sources compile without
> change just about anywhere C is spoken.

Thanks for the input!

I am now seeing the complications of including LuaRocks and other
applications and libraries. I understand why the other distributions
for windows have become bloated because there is so much dependency on
linked libraries and external dependencies. I think my focus is
changing. I want to provide a dead simple installer for installing the
latest PUC Lua on any Windows machine. I'll look at other optional
items like LuaRocks (i.e. chaining lr4win) if I get the basics done
first.

I have to say for a beginner, ZeroBrane is an excellent option as it
simply downloads and works. It also has lots of tutorials and examples
that run right through the UI. Nice job Paul! I wonder out loud if
there is a way to run Lua outside the IDE or deploy solutions.

Russ

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Paul K-2
Hi Russell,

> I have to say for a beginner, ZeroBrane is an excellent option as it
> simply downloads and works. It also has lots of tutorials and examples
> that run right through the UI. Nice job Paul! I wonder out loud if
> there is a way to run Lua outside the IDE or deploy solutions.

Thank you for the feedback! I've tried to package the interpreter and
the libraries in a way that allows the projects to be run outside of
the IDE as well (and the exact command to use for each script is shown
when the script is executed or debugged). I initially stayed away from
bundling Lua modules (to keep the package lean and the maintenance
simple), but seeing the number of requests for binaries for popular
modules (primarily on Windows), I started to include lfs and luasec in
addition to luasocket and lpeg for various Lua versions.

I use mingw to compile all modules on Windows and haven't had issues
with dependencies (although I did you depends.exe to figure out mingw
dependencies and how to include them); I've included those makefiles I
use in the repository.

Paul.

Reply | Threaded
Open this post in threaded view
|

Re[2]: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

John Hind
In reply to this post by Russell Haley
This may give some pointers:

https://github.com/JohnHind/Winsh.lua

It is probably a lot more bloated than your aim but maybe less bloated
than alternatives (a self-contained EXE comes in at around 1MB). I did
not manage to generate much interest in this at the time, but have
continued to develop it and use it personally. If there was any interest
I would update the GitHub.

Certainly it would not be difficult to make an installer for basic
(command-line) Lua using VS Community Edition. If you want even a very
simple GUI you need some kind of library/framework (I used WTL which is
very light-weight, but somewhat outdated today).

------ Original Message ------
From: "Russell Haley" <[hidden email]>
To: "John Hind" <[hidden email]>; "Lua mailing list"
<[hidden email]>
Sent: 17/05/2017 17:19:55
Subject: Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

>On Wed, May 17, 2017 at 10:11 AM, John Hind <[hidden email]>
>wrote:
>>  The Lua source distribution builds and runs just fine on Visual
>>Studio
>>  (Community - free - Edition) on Windows 10. At least VS 2015 and
>>32-bit,
>>  I've not got around to rebuilding any of my projects with VS 2017 yet
>>and do
>>  not really see the point of a 64-bit binary (32-bit runs fine on
>>64-bit
>>  Windows). Just dump the source files into an empty Win32 C++ Console
>>project
>>  (File|New|Project|Other Languages|Win32|Win32 Console Application)
>>and you
>>  are good to go. You may need some linker settings to make it truly
>>stand
>>  alone as it will probably depend on "Visual Studio Redistributables"
>>by
>>  default, although if you let VS make the installer package it will
>>install
>>  those too if necessary.
>>
>>  Microsoft are hopeless at adopting their own snake-oil and despite
>>promoting
>>  C# and the CLR for years now most of their own code base is still C++
>>so
>>  that still gets first-class tooling in VS.
>>
>>  The problems using Lua on Windows start with third-party libraries
>>and the
>>  Linux-inspired distribution formats. Unlike most library developers,
>>  Roberto's team have done an excellent job making Lua sources compile
>>without
>>  change just about anywhere C is spoken.
>
>Thanks for the input!
>
>I am now seeing the complications of including LuaRocks and other
>applications and libraries. I understand why the other distributions
>for windows have become bloated because there is so much dependency on
>linked libraries and external dependencies. I think my focus is
>changing. I want to provide a dead simple installer for installing the
>latest PUC Lua on any Windows machine. I'll look at other optional
>items like LuaRocks (i.e. chaining lr4win) if I get the basics done
>first.
>
>I have to say for a beginner, ZeroBrane is an excellent option as it
>simply downloads and works. It also has lots of tutorials and examples
>that run right through the UI. Nice job Paul! I wonder out loud if
>there is a way to run Lua outside the IDE or deploy solutions.
>
>Russ


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Russell Haley
In reply to this post by Paul K-2
On Wed, May 17, 2017 at 9:40 AM, Paul K <[hidden email]> wrote:

> Hi Russell,
>
>> I have to say for a beginner, ZeroBrane is an excellent option as it
>> simply downloads and works. It also has lots of tutorials and examples
>> that run right through the UI. Nice job Paul! I wonder out loud if
>> there is a way to run Lua outside the IDE or deploy solutions.
>
> Thank you for the feedback! I've tried to package the interpreter and
> the libraries in a way that allows the projects to be run outside of
> the IDE as well (and the exact command to use for each script is shown
> when the script is executed or debugged). I initially stayed away from
> bundling Lua modules (to keep the package lean and the maintenance
> simple), but seeing the number of requests for binaries for popular
> modules (primarily on Windows), I started to include lfs and luasec in
> addition to luasocket and lpeg for various Lua versions.
>
> I use mingw to compile all modules on Windows and haven't had issues
> with dependencies (although I did you depends.exe to figure out mingw
> dependencies and how to include them); I've included those makefiles I
> use in the repository.
>
> Paul.

My memory is a little faded now (too many other things in the old
spounge) but I recall that the ZeroBrane "installer" (air quotes to
differentiate from a true MSI) didn't add anything to the Programs and
Files (i.e. MSI database) on my system. Can you confirm that it does
not use the Windows installation database?

Also - and this question is just my musings as it is way outside my
current scope - I had wondered about distributing ZB Studio. I noticed
your website has a donation request prior to download. What is your
position on someone packaging ZB in another installer? To answer my
own quandary I think I would offer a link to the ZB website instead.

Russ

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Tony Papadimitriou
In reply to this post by John Hind
FWIW, I have noticed some run-time differences with VS2015.
 
Lua 5.3 builds fine with VS2015 but does not run the same even though it passes all Lua tests fine.
I haven’t figured out what the problem is.  (Everything in the build process except the compiler is the same.)
 
For the example below, a VS2013 produced Lua53 binary has correct output, while a VS2015 version has no output at all.
 
print(io.popen('mode con'):read('*a'))
 
The output from VS2013 built Lua 5.3 is like this:
 
Status for device CON:
----------------------
    Lines:          500
    Columns:        164
    Keyboard rate:  31
    Keyboard delay: 1
    Code page:      737
 
 
The Lua source distribution builds and runs just fine on Visual Studio (Community - free - Edition) on Windows 10. At least VS 2015 and 32-bit, ...
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Jay Carlson
In reply to this post by John Hind
On May 17, 2017 10:11 AM, "John Hind" <[hidden email]> wrote:

Unlike most library developers, Roberto's team have done an excellent job making Lua sources compile without change just about anywhere C is spoken.

Yes. But if you just want bare Lua, you want bare stdio. You want a popen that goes one way. You want no mechanism for even running another program safely: an array of args. You need to step outside Lua if your ambitions are higher.

I have been stuck in Python for a bit, and sometimes I just want those damn batteries. Cloned. In Lua. Without two or three separate posix libraries, network libraries, XML libra...well...Python is hardly perfect either.

Jay
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Windows MSI Installer for PUC-Lua - Proof Of Concept

Paul K-2
In reply to this post by Russell Haley
Hi Russell,

> My memory is a little faded now (too many other things in the old
> spounge) but I recall that the ZeroBrane "installer" (air quotes to
> differentiate from a true MSI) didn't add anything to the Programs and
> Files (i.e. MSI database) on my system. Can you confirm that it does
> not use the Windows installation database?

It does not; it uses a custom installer that doesn't modify anything
in the registry or the Windows installation database. The only change
to the system (other than copying the files) is that it adds a
shortcut to the Start menu. In all other aspects the installation is
completely portable and can be moved to a different folder or drive.

> Also - and this question is just my musings as it is way outside my
> current scope - I had wondered about distributing ZB Studio. I noticed
> your website has a donation request prior to download. What is your
> position on someone packaging ZB in another installer? To answer my
> own quandary I think I would offer a link to the ZB website instead.

I don't have a simple answer, because of the possibility for a
trademark conflict and confusion. I'll email you my thoughts on this.

Paul.