Hello,
I am considering deploying SQL Server Express with Install Aware. This would be for smaller clients that are actually using Express on a server for multiple users to connect to. So this install would be separate from my main application install.
I would like the install to run the scripts to create/update the database as needed.
I have a few questions:
The Admin Password - I can see where this can be set in the properties. However, this seem like a really bad idea to me. The end user should really be the one setting the password - not my setup program. Is there a way I can prompt the user for this?
What happens if the uninstall is run? Is my SQL server instance removed? If I am uninstalling to run an upgrade I would not want it to be removed. Even if my datafiles were left on disk how would I reconnect them. However, what if I really do want to uninstall the database?
I could see creating different versions of the install that had all the correct scripts and would update the database correctly. When it was run. However, I don't see how that fits with the always uninstall previous version that I see in my other install.
I'm wondering if Install Aware is even the right tool for this job. Maybe I should write a small custom app that shells out the Express install and knows how to manage the database.
Any suggestions?
Thanks,
Mark
SQL Server Express Questions - Password and Install
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Hi Mark!
You can easily install SQL Express 2005 with InstallAware. Just check the Microsoft SQL Server Express 2005 checkbox in the Application Runtimes section of the Application Information visual view.
After you check this item, make sure the Microsoft SQL Server Express 2005 line is highlighted, then click the Options button. Now you can do two things:
1) In the Check Service dialog that pops up, customize (or just review) the value of the Service Name field. By default this field holds MSSQL$SQLEXPRESS which is the name for the default instance of SQL Express. If this service is found on the target system at the time of install, install will not attempt to reinstall SQL Express 2005. If you want to install a custom instance, editing this field allows you to check for that exact instance, and skip installing it when it already exists.
2) When you dismiss the first dialog, the SQL Server Express dialog pops up - this is the second (and last) dialog that is shown when Options is clicked. Now, you can visually set your SQL Express setup options here, and then click the Generate Command Line button to save your settings, and click OK. This will make sure that SQL Express is installed just the way you like it if your named instance is not found.
This takes care of SQL Express installation. To run scripts against this database, switch to the SQL Databases view under the Server Configuration visual view. Click New, choose MS SQL Script, and populate your setup script and remaining fields here as necessary to run your SQL script against the to-be-newly-installed (or existing) instance of SQL Express. This takes care of executing your SQL script to create/update your database(s).
Now then, with this introduction out of the way, to get to your specific questions:
a) You can create a custom dialog, prompt for the admin password, and then pass that value to both the instance installer and script runner in your setup script. If you're not sure how to create custom dialogs, capture information, and reuse them in your setup - don't panic, its extremely easy. Visit www.installaware.com and click the MSDN Magazine image to read an article authored by Sinan Karaca, that has an example of how to do this.
b) Uninstall does not remove your SQL instance by default. If you want, you can customize your uninstallation to remove your SQL instance - this is easy to do as well using the (Un)Install MSI Setup plug-in. If you customize your uninstallation and then your product is auto-uninstalled during an upgrade, this part of the uninstall won't occur so your instance and database will remain safely on the target system.
c) I think InstallAware is definitely the right place to do this - it already takes care of almost everything for you, it would be burden to recreate an application that duplicates the exact behavior. However if for any reason you want to go that route, remember that you can run your custom app using the Run Program command from the script.
This should cover it all - let me know if I've missed anything!
You can easily install SQL Express 2005 with InstallAware. Just check the Microsoft SQL Server Express 2005 checkbox in the Application Runtimes section of the Application Information visual view.
After you check this item, make sure the Microsoft SQL Server Express 2005 line is highlighted, then click the Options button. Now you can do two things:
1) In the Check Service dialog that pops up, customize (or just review) the value of the Service Name field. By default this field holds MSSQL$SQLEXPRESS which is the name for the default instance of SQL Express. If this service is found on the target system at the time of install, install will not attempt to reinstall SQL Express 2005. If you want to install a custom instance, editing this field allows you to check for that exact instance, and skip installing it when it already exists.
2) When you dismiss the first dialog, the SQL Server Express dialog pops up - this is the second (and last) dialog that is shown when Options is clicked. Now, you can visually set your SQL Express setup options here, and then click the Generate Command Line button to save your settings, and click OK. This will make sure that SQL Express is installed just the way you like it if your named instance is not found.
This takes care of SQL Express installation. To run scripts against this database, switch to the SQL Databases view under the Server Configuration visual view. Click New, choose MS SQL Script, and populate your setup script and remaining fields here as necessary to run your SQL script against the to-be-newly-installed (or existing) instance of SQL Express. This takes care of executing your SQL script to create/update your database(s).
Now then, with this introduction out of the way, to get to your specific questions:
a) You can create a custom dialog, prompt for the admin password, and then pass that value to both the instance installer and script runner in your setup script. If you're not sure how to create custom dialogs, capture information, and reuse them in your setup - don't panic, its extremely easy. Visit www.installaware.com and click the MSDN Magazine image to read an article authored by Sinan Karaca, that has an example of how to do this.
b) Uninstall does not remove your SQL instance by default. If you want, you can customize your uninstallation to remove your SQL instance - this is easy to do as well using the (Un)Install MSI Setup plug-in. If you customize your uninstallation and then your product is auto-uninstalled during an upgrade, this part of the uninstall won't occur so your instance and database will remain safely on the target system.
c) I think InstallAware is definitely the right place to do this - it already takes care of almost everything for you, it would be burden to recreate an application that duplicates the exact behavior. However if for any reason you want to go that route, remember that you can run your custom app using the Run Program command from the script.
This should cover it all - let me know if I've missed anything!
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 9
- Joined: Tue Jan 02, 2007 5:35 pm
How does one ensure that only the instance that the installer created gets removed.
-- If I have to use an MSI package, how do I avoid removing other instances such as the default instance called SQLEXPRESS, in addition to the instance that the installer made, lets call this one "MYINSTANCE".
Upon installation of the program that depends on the MYINSTANCE instance, there appears to be no program that bears that name in the list of uninstallers, hence, how should I remove only this instance? I have looked through the registry, and I don't see any uninstaller entries that specifically refer to MYINSTANCE.
I am very new at this - I am worried that someone deleting the program will inadvertedly delete every instance of MS SQL Server for all programs on their system that uses MSSQL, even if they use different instances.
-- If I have to use an MSI package, how do I avoid removing other instances such as the default instance called SQLEXPRESS, in addition to the instance that the installer made, lets call this one "MYINSTANCE".
Upon installation of the program that depends on the MYINSTANCE instance, there appears to be no program that bears that name in the list of uninstallers, hence, how should I remove only this instance? I have looked through the registry, and I don't see any uninstaller entries that specifically refer to MYINSTANCE.
I am very new at this - I am worried that someone deleting the program will inadvertedly delete every instance of MS SQL Server for all programs on their system that uses MSSQL, even if they use different instances.
-
- Posts: 9
- Joined: Tue Jan 02, 2007 5:35 pm
(Un)install MSI package Script doesn't seem to execute!
I have modified the Perform Uninstallation region as follows, however the Microsoft SQL Server 2005 never appears to "uninstall", it always remains left on the system. (Doesn't even bring up any form of notification that it's even about to remove the sql database).
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
Comment: Uninstall product
Comment: TO-DO: Insert any additional uninstall commands here
Install/Remove MSI Package Microsoft SQL Server 2005[REMOVE=ALL]
Apply Uninstall (get result into variable SUCCESS)
Set Variable PROGRESS to 100
else
<<Code>>
What am I doing wrong here?
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
Comment: Uninstall product
Comment: TO-DO: Insert any additional uninstall commands here
Install/Remove MSI Package Microsoft SQL Server 2005[REMOVE=ALL]
Apply Uninstall (get result into variable SUCCESS)
Set Variable PROGRESS to 100
else
<<Code>>
What am I doing wrong here?
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
First, as you probably noticed, InstallAware will not automatically uninstall application runtimes for you - this could be dangerous and unwanted on the target system, especially if other applications have since been installed, which require the same technologies.
Second, your code modification is accurate in placement, but probably not in intent and usage:
1) You will need to run Microsoft's setup.exe (and not the MSI file) as SQL Server installation, despite being an MSI installation, does require you to use the setup.exe bootstrapper. Please refer to the native SQL Server documentation for help on the correct parameters required and where to find the setup.exe after an installation.
2) You are probably attempting to remove all instances. Be sure to remove only your instance of SQL Server (and even this might be ill-advised, especially if your users want to preserve data).
Second, your code modification is accurate in placement, but probably not in intent and usage:
1) You will need to run Microsoft's setup.exe (and not the MSI file) as SQL Server installation, despite being an MSI installation, does require you to use the setup.exe bootstrapper. Please refer to the native SQL Server documentation for help on the correct parameters required and where to find the setup.exe after an installation.
2) You are probably attempting to remove all instances. Be sure to remove only your instance of SQL Server (and even this might be ill-advised, especially if your users want to preserve data).
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 9
- Joined: Mon May 07, 2007 12:11 pm
Hi,
I'm trying to do this exact same thing, to uninstall SQL 2005 Express that got install along with my application.
I did managed to create one on version 6.6, and it removed the correct SQL instance fine. I just add a task for "INSTALL SQL Express" during Uninstall with "REMOVE=SQL_Engine". So the line looks like this:
Install SQL Express (command line: INSTANCENAME="myInstance" REMOVE=SQL_Engine, get result into variable SQL2005)
But after using version 7, this feature no longer works. I only get
when it got to the point of uninstalling SQL. The project that I created with 6.6 still builds fine and removes SQL perfectly, even when building with 7. I've tried copy and pasting the code from 6.6 to 7, tried creating that line new from the side bars. None of them did the trick.
Any idea?
Thanks!
William
I'm trying to do this exact same thing, to uninstall SQL 2005 Express that got install along with my application.
I did managed to create one on version 6.6, and it removed the correct SQL instance fine. I just add a task for "INSTALL SQL Express" during Uninstall with "REMOVE=SQL_Engine". So the line looks like this:
Install SQL Express (command line: INSTANCENAME="myInstance" REMOVE=SQL_Engine, get result into variable SQL2005)
But after using version 7, this feature no longer works. I only get
Unable to load plug-in library. Please rebuild your project and make sure all required plug-ins are installed.
when it got to the point of uninstalling SQL. The project that I created with 6.6 still builds fine and removes SQL perfectly, even when building with 7. I've tried copy and pasting the code from 6.6 to 7, tried creating that line new from the side bars. None of them did the trick.
Any idea?
Thanks!
William
Who is online
Users browsing this forum: No registered users and 84 guests