0

Ok, so I am completely lost at this point, I am normally a front end developer who knows a bit of php as needed. I have a client, though, that needs a download portal that a user enters their email address for a download. Which is easy enough except for one catch. The application needs to have that email stored in an xml file.

I have been googling around all day trying to figure this out and it is probably just that I have no idea what to search for as I am front end web dev who works on mac. The PHP is installed on a CENT OS webserver which will need to be able extract the msi, insert the xml file and then recompile it to be served to the user.

Any help or direction would be very helpful. Thanks!

rcooper102
  • 209
  • 1
  • 11
  • Possible duplicate of [Is it possible to programatically change an msi's database on Linux](http://stackoverflow.com/questions/7115086/is-it-possible-to-programatically-change-an-msis-database-on-linux) – DaveRandom Mar 09 '13 at 00:25

1 Answers1

1

Windows Installer packages (.MSI) are OLE/COM Structured Storage. Microsoft provides a Win32 API ( MSI.dll ) and a COM Automation Interface ( "WindowsInstaller.Installer" ).

On Unix, much of the Win32 API has been ported to Wine.

Now I've never done this, but I see something that's promising. There is an open source project called OpenMCDF. It's written in Visual Studio / .NET but claims it supports Mono. In it is a test app (document explorer) and when you say File | Open it shows .MSI as a drop down choice so they were atleast thinking about it.

Anyway in the source code I see classes for streams and storages. Ready up on MSI's and you'll find that files are compressed into (Microsoft) CAB archives and them embedded into the MSI by inserting it into the streams.

In a situation like this I would likely create a new cabinet with the updated XML file, record it in the Media table and update the file table to reflect the new sequence number, file size and media Id.

For an MSI expert, this is trivial to do in C#. For a .NET expert, it's really hard. For someone who is neither trying to do it in PHP on CentOS... good luck.

Another approach would be to build the MSI with that one file uncompressed and then use that as a template to overwrite the file and build a self extracting EXE. That would probably be much easier for you. Just make sure the MSI and XML get cached for repair transactions.

Either that or just set up a Windows server and pass the build off to it and pick it back up when done.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100