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

Source: Internet
Author: User
Tags mssqlserver

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 = "fishout@TOM.COM"/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 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.