Cross-platform installer

mojoPortal is no longer supported on mono. This forum is here for archival purposes.

This thread is closed to new posts. You must sign in to post in the forums.
12/8/2008 3:37:19 PM
Gravatar
Total Posts 21

Cross-platform installer

In another thread discussing ReleaseIt, my web deployment app, Joe brought up the idea of a cross-platform installer for mojoPortal.  I thought this idea should have it's own thread.

Here is what Joe said to start us off:

"I wonder if you'd be interested in helping with a additional project that I have in mind but don't have time to do myself. I'd like to make a general purpose web installer. VS has some project templates to make msi installers but these are not cross platform so I'd like to make a winforms app that can install mojoPortal (and conceivably other web apps) for both Windows and Linux. Obviously those would require different implementations so the app would detect if tis running on windows or not and branch the logic (maybe we would use one dll for windows and one for linux).

What I'd like to be able to do is embed the release .zip files and be able to just run the exe to install or upgrade. The user picks the target folder (perhaps we suggest one) the app deploys the files, detects if apache or IIS is installed and configures the web site or app if its not already configured.

The user could pick which db platform and the app would deploy the correct data dlls from the embeded zips. Possibly the user can enter a connection string and we test it and write it into user.config if it works. For upgrades it could detect if the user.config file is already there and test the connection string it has.

Its an ambitious idea so I understand if you're not interested or too busy but thought I'd throw the idea out there. I'd be willing to implement the windows logic branch for configuring IIS.

The reason I'm interested in this is I think having an easier way to install and configure mojoPortal both on windows and on linux would make it much more popular. Really most people will use hosting companies and this won't help them but for companies with their own web server or people just evaluating on their own machines it would be fantastic. I could just do the msi thing but I'd really like a cross platform solution."

12/8/2008 3:54:32 PM
Gravatar
Total Posts 21

Re: Cross-platform installer

Joe,

I was looking at the zip files on CodePlex and wondering how I would go about embedding them in an installer.  Perhaps I do not understand the structure.

For Windows, it seems that there is a different zip file for each database.  A quick glance at the MSSQL version looks like it has the DLLs for the other databases as well.  What are the differences between the zips?  I am assuming it is not just the legacy-scripts stuff.

I thought perhaps the difference was that mojoPortal.Data.dll was different for each database and that the *.Data.dll files would be the difference.  Then the Mono files confused me.  There is only one download for Mono--the PostgreSQL files.  Again, this zip seems to have DLLs for Firebird etc.  Will the Mono zip file work with these other databases or do the *.Data.dll files need to be recompiled?  I assume you can use these other databases on Mono.

Also, what does one do if you want to run mojoPortal on Mono but talk to a MSSQL database?  Is that just so uncommon that it has not come up?  I assume that the Mono tree works on Mono on Windows.  Or is the Mono zip effectively the Linux zip?

If the zips are to be embedded, I would imagine the best way would be to have one zip for the mojoPortal tree and then a zip for each database that just contained the data layer or at least the minimal files required on top of the main tree to support that database.  Can you see yourself producing zip files in this manner?

What are the differences between the Windows mojoPortal tree and the one for Mono?  Making an entirely separate tree for Mono, as you do now, and embedding it would add 20MB to the size of the executable and pretty much double the size.  Can you see having a core zip and smaller zips that just implement the differences between .NET and Mono?

The MySQL datalayer is available in a zip file of it's own.  My understanding is that this is for licensing reasons.  Do you see a problem with embedding all the zips into a single executable from a licensing standpoint?  It would be nice if the installer was a single .EXE to make the installer as easy as possible to use.

Justin

 

12/8/2008 6:28:52 PM
Gravatar
Total Posts 21

Re: Cross-platform installer

Joe,

Perhaps you can let me know if this is along the lines of what you were thinking.  Of course, I know you were not planning on such an innovative, space-aged, leading edge, state-of-the-art, Web 3.0-like user interface.  This thing is so advanced it does not even have an off button.

http://www.anchorbenefits.com/joefiles/minstall.exe

I was not sure how to share this with you.  I did not want to put anything like this on CodePlex, especially because it distributes your stuff.

The link is to a Windows Forms application that has a couple of the mojoPortal zip files embedded in it.  At the moment, it only includes the zips for the main mono tree and the data layer for MySQL.  Putting everything else in would have made the file large and it takes me a while to upload stuff.  It is probably best that it does not really work anyway but the basic logic is in there.

If the application detects that it is running on Mono it assumes you want to install for Mono using the MySQL database.  Otherwise it assumes that you are installing for MS .NET and using MSSQL.  Both options can be overridden in the drop downs.  The app will tell you if it detects that you are running on Mono or on the real .NET.

The option for the Mono files with the MySQL data layer should work if you want to test it out.  If the right set of zip files was supplied it should work for all the combinations.  It is looking for the files already so it can take a few seconds to timeout if you ask it to install a configuration it does not have the files to support.

The app uses the zip library from http://icsharpcode.net/OpenSource/SharpZipLib/Default.aspx for the decompression.

From here it should not be to difficult to auto-configure the connection sting in Web.config.  After asking for the database username and password the app could verify connectivity (or not) and write the config file to either Web.config or user.config.  A little more logic could handle upgrades, reading the existing configuration first.  You could even move the connection string out of Web.config and into user.config to migrate an existing installation to your current best practice.

Automatically configuring the webservers and updating the installed applications databases gets a little more complicated as the cross-platform stuff diverges a bit.  It would also be nice if the app could be launched console-only as this would make it a lot easier to install on a remote server where you have only command prompt access.

Of course, it would also need to be significantly cleaned up.  The code is one big dump.  All I had this weekend was my Ubuntu laptop.  If you have ever tried to do Windows Forms development entirely on Linux you might actually be impressed by the UI.  :-)

I stole a little time on the weekend to hammer this out but I cannot guarantee how quickly it would move forward from here.

Justin

 

 

12/9/2008 8:30:44 AM
Gravatar
Total Posts 18439

Re: Cross-platform installer

Justin,

This looks awesome! You have a lot of initiative and I am glad to have your help!

Procedurally, what I'd like to do is get the code setup in our repository and give you commit access. You'll need to get a Novell Forge account, just visit this page and you'll see the create account link at the bottom. Then send me an email with a zip of the code and tell me your Novell username. I'll create a branch for this project, check in the code, and send you the url so you can checkout and continue working on it. I hope :-)

When I get the code from you I may stub out additional class library projects in the solution where we can encapsulate the platform differences. Then maybe I can help on the windows side of the house with the IIS configuration code. Even if you don't keep going from here, its a good start and getting the ball rolling is often the hardest part and you've done that. I'll put no pressure on you but welcome any additional help you may find time for.

The current release packages have a lot of redundancy, there is very little difference between them, mainly just a few dll differences. For embedding in the installer I will package without any duplication. core package for ms sql, separate zips for the data dlls for the other dbs and separate zip for the web ui dlls for mono (which I compile on linux).

What I'd like it to do is make it look for an existing user.config and if not present create it and put the connection string there. On upgrades we leave this file alone so it doesn't lose its connection string.

Best,

Joe

12/14/2008 12:32:48 PM
Gravatar
Total Posts 21

Re: Cross-platform installer

Joe,

I sent you an email with a zip of the mojoInstall code.  I managed to mangle my Mono setup on my laptop so I cannot even run MonoDevelop right now.  This means that I did not get to test it before I sent it but I do not remember breaking it so I assume the code runs as is.

Finding your email address took me a while.

Right now everything is just mashed into the main form.  I am sure you will want to seperate it out into libraries.  We can use monomerge to create a single executable in the end which I think is best for an installer.  This is what I did for the version I sent to you.

Let me know when you have given me access via Novell Forge and I will try checking out the code.

Justin

12/15/2008 6:22:15 AM
Gravatar
Total Posts 18439

Re: Cross-platform installer

Hi Justin,

You should be all set now, to checkout just

svn checkout https://forgesvn1.novell.com/svn/mojoportal/tools/mojoWebInstaller

Are you familiar with svn as far as adding files, committing etc? I'm no super guru with the command line stuff but I know the basics. Mostly I'm using TortoiseSVN on windows.

Just let me know if I can be of any help.

Best,

Joe

12/15/2008 11:32:08 AM
Gravatar
Total Posts 21

Re: Cross-platform installer

Joe,

Everything seems to be working.

I am pretty new to Subversion.  I have started to use MonoDevelop and I compiled it with support for Subversion.  This is the first time I have used the Subversion integration but it seemed to work well.

Through MonoDevelop, I was able to checkout the project via the link you provided and it opened as a solution.  The *.zip files were missing as you flagged before but otherwise everything looked fine.  I am on Linux so a quick "touch mojo-mono.zip" and "touch mojo-mysql.zip" created empty stubs for the missing files.  From there I was able to build the project and launch the GUI with the click of a button.  Magic.

Next, I added a simple comment to the Program.cs file.  I also added a ChangeLog.  I then simply told MonoDevelop to commit my changes and it dutifully uploaded to your Subversion repository.  I went to the command line in another directory and did a checkout as you describe below and the downloaded files reflected the changes I had made in MonoDevelop.

So, it seems that the integration is fantastic and I really do not need to know much about Subversion at all to make it work.  At least, I hope that what I am doing looks ok from your end.

Justin

12/15/2008 3:41:46 PM
Gravatar
Total Posts 18439

Re: Cross-platform installer

Hey Justin,

That's very cool I had forgotten about svn integration in MonoDevelop. I was able to get your change by doing svn update so its working fine.

I also get email notification of commits to the repository, if you'd like to subscribe to notifications the list is here, you have to login with your Novell account first to join the list.

Let me know if you need anything. I was thinking I could put together the correct zips for the different scenarios and either send them to you or commit them. I'll try to get to that tomorrow.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.