Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work on Mac/Linux #3

Open
activescott opened this issue Aug 9, 2013 · 19 comments
Open

Make it work on Mac/Linux #3

activescott opened this issue Aug 9, 2013 · 19 comments

Comments

@activescott
Copy link
Owner

from https://code.google.com/p/lessmsi/issues/detail?id=5

@PartTimeLegend
Copy link

Why would you want an MSI tool to work on a platform that doesn't support MSI?

@activescott
Copy link
Owner Author

to get the files out of the msi

@smaresca
Copy link

smaresca commented Oct 7, 2013

@activescott Thanks -- I am definitely interested in Linux support. Is there anything you need done in particular? I have a need and can probably throw some time at the problem.

Though I think CI calls it passing, at the moment, I'm seeing the following for lessmsi/src/LessMsi/LessMsi.csproj:
Error initializing task ItemGroup: Not registered task ItemGroup.

That said, I could certainly be missing something obvious. Any suggestions?

@activescott
Copy link
Owner Author

@smaresca Now that the cab support was recently done in a linux-compatible way, the next work area for linux support is really the wixcab calls that interact with the msi API. WINE has at least some if not all of the calls already done, just need to find a good way to extract/package them and keep the install light. If you want to work on this area with me, let me know and I'll dig out some notes on the topic and try to give some direction. A partner in crime on something like this will motivate me!

The ItemGroup task in MSBuild should definitely be valid (http://msdn.microsoft.com/en-us/library/vstudio/646dk05y.aspx). What version of VS/MSBuild are you using?

@smaresca
Copy link

smaresca commented Oct 7, 2013

@activescott Ah I wasn't using visual studio at all -- was trying to compile with xbuild and the rest of the mono toolchain natively in Linux (gmcs, v 2.10.8.1).

re: API coverage, sure dig out the notes and we'll see where it goes.

@activescott
Copy link
Owner Author

xbuild works in 3.x or newer. I forget the exact version. Maybe 3.1 or 3.2 was required. It only compiles though I never tried to actually run it on mono. Obviously the wix/MSI native libraries that I'm calling into are windows-specific.

@john550
Copy link

john550 commented Feb 27, 2015

is is possible to use lessmsi on linux.

@activescott
Copy link
Owner Author

Not yet, but the cab extraction code does all work on Linux now. So we're half way there. The part that need some work is the MSI code which is a combination of OLE Compound Files (aka Structured Storage) and a special MSI-specific database. I think the most reasonable thing to do is to use the WINE libraries (or their source?) to get the last part done.

Always glad to help you along if you're interested in contributing!

On Feb 27, 2015, at 01:12, john550 notifications@github.com wrote:

is is possible to use lessmsi on linux.


Reply to this email directly or view it on GitHub.

@jgstew
Copy link
Contributor

jgstew commented Mar 13, 2015

I have a very specific use case in which I need to get the MSI ProductVersion from the Property table of an MSI file using the command line on OS X.

all of the following approaches give errors on the command line, but seem to work regardless.

lessmsi command line using wine

My coworker figured out how to use lessmsi on the command line using wine: (this example uses the wine.app that comes with winebottler)

/Applications/Wine.app/Contents/Resources/bin/wine /Users/username/Downloads/lessmsi-v1.2.0/lessmsi.exe v /Users/username/Downloads/msi2xml-2.2.1.957.msi 

lessmsi GUI using wine

I have the lessmsi GUI working with WineBottler. http://winebottler.kronenberg.org/

You can download the zip compressed .app I made here: https://dl.dropboxusercontent.com/u/640753/lessmsi.zip

You can make it yourself using the following screenshot & winebottler:

screen shot 2015-03-13 at 3 02 08 pm

References:

http://wiki.winehq.org/WineBottler
https://github.com/activescott/lessmsi/wiki/Command-Line
http://superuser.com/questions/543159/how-to-run-a-windows-bat-script-with-wine-from-command-line
http://www.quora.com/How-do-I-suppress-the-stderr-output-of-a-shell-command
http://www.tldp.org/LDP/abs/html/io-redirection.html

@jgstew jgstew mentioned this issue Mar 13, 2015
@wyatt8740
Copy link

Just want to throw it out there that I've been able to use Less MSIerables in linux with wine after doing winetricks dotnet40. It's probable that wine's version of mono works as well - I can get a GUI to come up in the linux-native version but can't open MSI files due to the windows-specific code.

I think it's quite probable that it could be compiled with libwine, but don't have the hard disk space on this laptop to verify.

@jgstew
Copy link
Contributor

jgstew commented Jan 27, 2016

I am able to use it on a Mac, and it doesn't have any windows-specific code outside of whatever is in Wine.

@wyatt8740
Copy link

well as wine consists of alternative API's for windows-only code, you're saying the wine team has done it's job well - not that it's actually a portable program. Right?

@jgstew
Copy link
Contributor

jgstew commented Jan 29, 2016

Yes, Wine's code is windows specific, just not written by Microsoft.

LessMSI is not a portable program, but it works through Wine on the Mac, which doesn't have anything to help it run other than Wine and anything installed with Winetricks.

@pombredanne
Copy link

On my side I would be interested to have command-line only native (no wine required) way to build & run on Linux and Mac in addition to Windows, to add support for a better MSI extraction in https://github.com/nexB/scancode-toolkit beside the 7z-based extraction I have today.

@jgstew
Copy link
Contributor

jgstew commented May 21, 2017

I haven't explored this option, but since lessmsi appears to be written in C# then it might be able to run on Mono or .NET core which would make it portable without requiring WINE.

From some quick reading, it seems like it is possible for the GUI and everything to run on MONO while only a command line option to run on .NET core, but the degree of difficulty would not be able to be determined without actually trying it. http://stackoverflow.com/questions/37738106/net-core-vs-mono

@qwertychouskie
Copy link

Has anyone tried compiling with winelib? That should fill in all of the Win-specific functions.

@sskras
Copy link

sskras commented Apr 15, 2020

@activescott wrote:

The part that need some work is the MSI code which is a combination of OLE Compound Files (aka Structured Storage)

Gnome msitools uses GNOME/libgsf which is partially influenced by Wine.

and a special MSI-specific database. I think the most reasonable thing to do is to use the WINE libraries (or their source?) to get the last part done.

GNOME/msitools used the same approach in their libmsi, IIUC.

Both libs are under LGPL-2 or 2.1.

For MIT-licensed project it would be hard to reuse LGPL code (coming from Wine) directly. But the dynamic linking should be easy.

@jgstew
Copy link
Contributor

jgstew commented Jun 5, 2020

I've actually switched to using https://github.com/GNOME/msitools for my non-windows use cases for this. That said, I wish I had the time to experiment with lessmsi to see how easy it would be to get it to work with winelib and/or mono.

@def-fun
Copy link

def-fun commented Dec 30, 2022

I've actually switched to using https://github.com/GNOME/msitools for my non-windows use cases for this. That said, I wish I had the time to experiment with lessmsi to see how easy it would be to get it to work with winelib and/or mono.

@jgstew thanks for your share. can you show me how to deploy msitools on linux?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants