InstallShield Integrated Installation msde2000 Minimum Version (1) fishout licensed release

Source: Internet
Author: User
Tags mssqlserver
Original article: InstallShield Integrated Installation of msde2000 (1) fishout licensed release

Original post address: http://blog.csdn.net/fishout/archive/2009/10/26/4730086.aspx

Program, which brings about several problems:
1. It cannot be uninstalled along with the application installation;
2. msde2000 installation is not possible;
3. If you cancel the installation, the program cannot be completely rolled back;
4. It cannot be installed in the same directory as the application.
If you use the pre-installation feature in InstallShield, you can only use it in the MSI project, and you cannot flexibly control the installation process and implement the above features. Therefore, we need a method, it is used to integrate msde2000 during installation. This is because many applications require SQL server support, while msde2000 is indeed a good choice. Aside from copyright, it is sufficient to be fully compatible with SQL and Support 2 GB of data, if you can solve the integration problem during installation, it will greatly facilitate the distribution of applications.
Next I will introduce this method through a specific instance.
Objective 1: achieve the minimum installation that is uncontrollable.
I. Data preparation:
1. Download the SQL Server 2000 Desktop Engine (MSDE) component (SQL2000.MSDE-KB884525-SP4-x86.exe)
2. Double-click the downloaded EXE file, decompress it to c: \ sql2ksp4, browse to c: \ sql2ksp4 \ msdein the running state, find the setup.exe file, double-click it, click confirm, and enter the installation parameter after setup.exe: instanceName = "fishout" securitymode = SQL sapwd = "[email protected]"/L * V C: \ msdelog. log, and click "OK" (InstanceName = "Instance name", sapwd = "password", which can be modified by yourself. The following uses the Instance name "fishout" as an example ), after installation, do not start the service or restart the machine: \ Program Files \ Microsoft SQL Server \ MSSQL $ fishout \ The binn, data, and log folders in the folder are retained, and the rest are deleted.
3. Prepare the Registry portal. Open the Registry Editor and Navigate to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server. Delete unnecessary sub-keys to make them look like:
Add two strings to the protocollist attribute under the subkey of supersocketnetlib: TCP/NP, right-click Microsoft SQL Server, and select export registry. The file name is arbitrary, open and edit the exported registry file and replace the installation path "C: \ Program Files \ Microsoft SQL Server" with "<targetdir>". The modified registry file is as follows:

 

View plaincopy to clipboardprint?

  1. Windows Registry Editor Version 5.00
  2. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server]
  3. "Installedinstances" = hex (7):, 4f ,\
  4. 00
  5. "Ssrpactiveserver" = ""
  6. "Sqlmdacregrefcount" = DWORD: 00000001
  7. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout]
  8. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer]
  9. "Auditlevel" = DWORD: 00000000
  10. "Defaultlogin" = "guest"
  11. "Listenon" = hex (7): 53,00, 53,00, 4D, 00 ,\
  12. , 00, 4E, 54, 00, 4C, 00
  13. "Loginmode" = DWORD: 00000000
  14. "Map _" = "\\"
  15. "Map #" = "-"
  16. "Map $" = ""
  17. "Sethostname" = DWORD: 00000000
  18. "Tapeloadwaittime" = DWORD: ffffffff
  19. "Uptime_pid" = DWORD: 000000c8
  20. "Uptime_time_utc" = HEX: 0e, 55,77, E8, 59,58, CA, 01
  21. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ CurrentVersion]
  22. "CurrentVersion" = "8.00.194"
  23. "Registeredowner" = ""
  24. "Serialnumber" = ""
  25. "Csdversionnumber" = DWORD: 00000400
  26. "Csdversion" = "8.00.1100"
  27. "Language" = DWORD: 00000804
  28. "Checksum" = HEX: 38,30, 32,32, 63,31, 35,38, 61,65, 37,64, 34,63, 64,37, 35,30, 64,61, 30 ,\
  29. 33,34, 62,36, 30,31, 34,32, 63,62, 61,66, 37,30, 33,30, 38,35, 35,65, 62,64, 63,34, 34 ,\
  30. 36,62, 61,37, 35,64, 61,62, 37,30, 34,66, 37,33, 65,35, 30,37, 64,65, 37,34, 30,39, 31 ,\
  31. , 65, 63 ,\
  32. , 30, 66 ,\
  33. 62,61, 39,64, 61,64, 65,30, 36,36, 30,66, 31,62, 63,63, 35,32, 37,33, 63,32, 62,33, 30 ,\
  34. 36,31, 66,66, 61,64, 65,36, 65,32, 30,36, 38,34, 33,64, 00
  35. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ Parameters]
  36. "Sqlarg0" = "-D <targetdir> \ MSSQL $ fishout \ data \ master. MDF"
  37. "Sqlarg1" = "-E <targetdir> \ MSSQL $ fishout \ log \ errorlog"
  38. "Sqlarg2" = "-l <targetdir> \ MSSQL $ fishout \ data \ mastlog. LDF"
  39. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ supersocketnetlib]
  40. "Protocollist" = hex (7):, 00, 00, 00
  41. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ supersocketnetlib \ NP]
  42. "Pipename" = "\\\\\ pipe \\ MSSQL $ fishout \ SQL \ QUERY"
  43. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ supersocketnetlib \ Tcp]
  44. "TcpHideFlag" = DWORD: 00000000
  45. "Tcpdynamicports" = "0"
  46. "Tcpport" = "0"
  47. [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ setup]
  48. "Featurename" = "sqlrun"
  49. "Firststart" = DWORD: 00000000
  50. "Productcode" = "{E09B48B5-E141-427A-AB0C-D3605127224A }"
  51. "Sqldataroot" = "<targetdir> \ MSSQL $ fishout"
  52. "Sqlpath" = "<targetdir> \ MSSQL $ fishout"
  53. "Edition" = "Desktop Engine"
  54. "Patchlevel" = "8.4.2039"

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server] "installedinstances" = hex (7):, 4f,, \ 00 "ssrpactiveserver" = "" sqlmdacregrefcount "= DWORD: 00000001 [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout] [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer] "auditlevel" = DWORD: 00000000 "defaultlogin" = "guest" "listenon" = hex (7): 53,00, 53,00, 4D, 00, 00, 00, \ 53,00, 4E, 54, 00, 4C, 00, 00 "loginmode" = DWORD: 00000000 "map _" = "\" "map #" = "-" "map $" = "sethostname" = DWORD: 00000000 "tapeloadwaittime" = DWORD: ffffffff "uptime_pid" = DWORD: 000000c8 "uptime_time_utc" = HEX: 0e, 55,77, E8, 59,58, CA, 01 [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ CurrentVersion] "CurrentVersion" = "8.00.194" "registeredowner" = "" serialnumber "=" csdversionnumber" = DWORD: 00000400 "csdversion" = "8.00.1100" "language" = DWORD: 00000804 "checksum" = HEX: 38,30, 32,32, 63,31, 35,38, 61,65, 37,64, 34,63, 64,37, 35,30, 64, 61, 30, \ 33,34, 62,36, 30,31, 34,32, random, 61,66, 37,30, 33,30, 38,35, 35,65, random, 63,34, 34, \ 36,62, 61,37, 35,64, 61,62,,, 63, \, 30,, 63, 00 [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ Parameters] "sqlarg0" = "-D <targetdir >\\ MSSQL $ fishout \ data \ master. MDF "" sqlarg1 "="-E <targetdir> \ MSSQL $ fishout \ log \ errorlog "" sqlarg2 "="-l <targetdir> \ MSSQL $ fishout \ \ data \ mastlog. LDF "[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ supersocketnetlib]" protocollist "= hex (7,, 00, 00 [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ supersocketnetlib \ NP] "pipename" = "\\\\. \ PIPE \ MSSQL $ fishout \ SQL \ QUERY "[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ MSSQLServer \ supersocketnetlib \ Tcp]" TcpHideFlag "= DWORD: 00000000 "tcpdynamicports" = "0" "tcpport" = "0" [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft SQL Server \ fishout \ setup] "featurename" = "sqlrun" "firststart" = DWORD: 00000000 "productcode" = "{E09B48B5-E141-427A-AB0C-D3605127224A}" "sqldataroot" = "<targetdir> \ MSSQL $ fishout" "sqlpath" = "<targetdir> \ MSSQL $ fishout" "Edition "=" Desktop Engine "" patchlevel "=" 8.4.2039"

2. Design and make the installation program:
1. Create an installscript project in InstallShield, name it mdse2000, create a new Files folder under the project folder, copy the MSSQL $ fishout folder under the installation directory to project files, and copy C: \ windows \ system32 \ msvcp71.dll and msvcr71.dll files to files \ MSSQL $ fishout \ binn (do not forget this file), set the targetdir content in product properties: <folder_applications> \ Microsoft SQL Server: add the MSSQL $ fishout folder in files to application target folder.
2. Import the registry. In the Registry registry portal, right-click destination computer, click New registry set, rename it to mdse2000, right-click it, and click Import reg file ..., import the modified registry settings, and check the associated Installation File Group on the right.
3. Click defaultfeature in the installation script to generate an installed event. The Code is as follows:

View plaincopy to clipboardprint?

  1. Export prototype defaultfeature_installed ();
  2. Function defaultfeature_installed ()
  3. Number nvservicestate;
  4. String szservicename, szservicedisplayname, szservicedescription, szservicepathfile, szstartserviceargs;
  5. Bool bstartservice;
  6. Begin
  7. // Install the service
  8. Szservicename = "MSSQL $ fishout ";
  9. Szservicedisplayname = "MSSQL $ fishout ";
  10. Szservicedescription = "";
  11. Szservicepathfile = targetdir ^ "MSSQL $ fishout \ binn \ sqlservr.exe-sfishout ";
  12. Bstartservice = true;
  13. Szstartserviceargs = "";
  14. If (servicegetservicestate (szservicename, nvservicestate)> = iserr_success) then
  15. // Stop and uninstall the original service
  16. Servicestopservice (szservicename );
  17. Serviceremoveservice (szservicename );
  18. Endif;
  19. Serviceaddservice (szservicename, szservicedisplayname, szservicedescription, szservicepathfile, bstartservice, szstartserviceargs );
  20. End;

Export prototype initialize (); function invoke () number nvservicestate; string szservicename, szservicedisplayname, szservicedescription, alias, szstartserviceargs; bool bstartservice; begin // install the service szservicename = "MSSQL $ fishout "; szservicedisplayname = "MSSQL $ fishout"; szservicedescription = ""; szservicepathfile = targetdir ^ "MSSQL $ fishout \ binn \ sqls Ervr.exe-sfishout "; bstartservice = true; szstartserviceargs =" "; if (servicegetservicestate (szservicename, nvservicestate)> = listener) Then // stop and uninstall the original service servicestopservice (szservicename ); serviceremoveservice (szservicename); endif; serviceaddservice (szservicename, szservicedisplayname, szservicedescription, szservicepathfile, bstartservice, szstartserviceargs); end; 4. compile and generate the installer It can be seen that the generated installation package is only 12.4 MB, which is much smaller than Microsoft's original installation package, which is very conducive to network transmission and application distribution. However, there is a fatal drawback, the installation path cannot be changed. This problem can be solved in the next section.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.