Should you be running SQL Scripts during installation?
W开发者_C百科e're using InstallShield to author our MSI installers.
InstallShield has support to run SQL scripts during installation. The good thing about them is that they are transacted.
However, I feel uneasy about adding another point of failure for installation. Should database initialization be done by the application?
"Installation is not configuration" is probably a good mantra for deployment engineers.
In terms of deployment best practice, should database initialization setup be done by the application or by the installer?
I think if your application can't work/run without the database then it should be acceptable for the installation to break if there is something wrong with setting up the database. But if you are still bothered by having yet another point of failure in your application you can add a "first run" wizard that will configure you app before it can be used. Also, if the database only supports an optional feature or non-essential part of the application then you can in the database scripts in some sort of post installation/configuration screen that the user can go to while running the program.
精彩评论