[Maria-developers] Patch to add a Windows NSIS based installer
Hi everyone, After a long and intense fight with CPack and NSIS, I finally have a solution that is functional. The one TODO I have before I consider it really good enough is to be able to set up MariaDB as a service. That will come later. The big problem with the installer was how to handle the database files. If they are just copied to the data dir and used, the uninstaller will silently delete them. This is *bad*. So I spent a long time trying to get around this problem and make the uninstaller ask if the user wants to get rid of these files. I'm now completely convinced this is impossible with the current CPack :( I have tried several workarounds, that also wouldn't work before I came up with this: The installer will install the data files to data\clean. At the end of the installer, it checks if there is a file called data\mysql\db.frm (could have been any other file). If the file is there, the user gets a message saying the installer have not written the clean database files to the data directory. If the file isn't there, the installer copies all the files in data\clean to data. The uninstaller will of course silently delete all the files in data\clean. But it will give the user a message that the database files are not deleted. So, if you install this package and uninstall it again, the database files are still on the disk. If you reinstall the package, it will use the existing data files. If you upgrade to a newer version, this will be installed in a different directory (the default directory name contains the version number), and can copy the data files from the old directory in there if you want to. Or you can copy the clean dir somewhere else and modify the ini file to point at it. IMHO, this is a reasonable solution that doesn't involve patching CMake or some other evil scheme I've been considering. To generate an installer: Run cmake as usual, build in visual studio, and call "cpack" when the build is done. That's about as simple as possible :) Can I check this into the 5.2 branch? Bo Thorsen. Monty Program AB. -- MariaDB: MySQL replacement Community developed. Feature enhanced. Backward compatible.
participants (1)
-
Bo Thorsen