Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Uses XMLDOM for cleaner install |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | sourceforge |
Files: | files | file ages | folders |
SHA1: |
f4336dee1871148cb759173735712b2f |
User & Date: | rmsimpson 2005-11-03 20:31:35 |
Context
2005-11-03
| ||
20:32 | 1.0.21 RTM check-in: 28597a833b user: rmsimpson tags: sourceforge | |
20:31 | Uses XMLDOM for cleaner install check-in: f4336dee18 user: rmsimpson tags: sourceforge | |
20:30 | no message check-in: 6748d3069f user: rmsimpson tags: sourceforge | |
Changes
Changes to bin/Designer/Install.vbs.
1 -Const SQLiteVersion = "1.0.20.0" 1 +Const SQLiteVersion = "1.0.21.0" 2 2 3 3 Main 4 4 5 5 Sub Main() 6 6 7 7 Dim WshShell 8 8 Set WshShell = WScript.CreateObject("WScript.Shell") 9 + 10 + Dim GacPath 11 + Dim oExec 12 + GacPath = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv2.0") 13 + 14 + Set oExec = WshShell.Exec(GacPath & "\bin\gacutil.exe -u System.Data.SQLite") 15 + Do While oExec.Status = 0 16 + WScript.Sleep(100) 17 + Loop 18 + 19 + Set oExec = WshShell.Exec(GacPath & "\bin\gacutil.exe -if ..\System.Data.SQLite.DLL") 20 + Do While oExec.Status = 0 21 + WScript.Sleep(100) 22 + Loop 9 23 10 24 Dim fso 11 25 Set fso = WScript.CreateObject("Scripting.FileSystemObject") 12 26 13 27 Dim myDir 14 28 myDir = fso.GetParentFolderName(WScript.ScriptFullName) 15 29 ................................................................................ 33 47 regFileContents = regFile.ReadAll() 34 48 regFileContents = Replace(regFileContents, "%REGROOT%", regRoot) 35 49 regFileContents = Replace(regFileContents, "%XMLPATH%", Replace(xmlPath, "\", "\\")) 36 50 genRegFile.Write(regFileContents) 37 51 genRegFile.Close() 38 52 regFile.Close() 39 53 40 - Dim oExec 41 54 Set oExec = WshShell.Exec("regedit /s """ & myDir & "\SQLiteDesigner.gen.reg""") 42 55 Do While oExec.Status = 0 43 56 WScript.Sleep(100) 44 57 Loop 45 58 46 59 fso.DeleteFile(myDir & "\SQLiteDesigner.gen.reg") 47 60 48 - Dim machineConfig 49 61 Dim machineConfigFile 50 - Dim machineConfigPath 62 + Dim machineConfig 51 63 52 - machineConfigPath = fso.GetSpecialFolder(WindowsFolder).Path & "\Microsoft.NET\Framework\v2.0.50727\CONFIG" 53 - Set machineConfigFile = fso.OpenTextFile(machineConfigPath & "\machine.config") 54 - machineConfig = machineConfigFile.ReadAll() 55 - machineConfigFile.Close() 64 + machineConfigFile = fso.GetSpecialFolder(WindowsFolder).Path & "\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config" 65 + Set machineConfig = CreateObject("Microsoft.XMLDOM") 66 + machineConfig.load machineConfigFile 56 67 57 - Dim n 58 - Dim x 68 + Dim xmlNode 69 + Dim xmlParent 59 70 60 - n = InStr(1, machineConfig, "System.Data.SQLite, Version=1", 1) 61 - 62 - If (n = 0) Then 63 - n = InStr(1, machineConfig, "</DbProviderFactories>", 1) 64 - If n > 0 Then 65 - n = InStrRev(machineConfig, vbCrLf, n, 1) 66 - If n > 0 Then 67 - machineConfig = Left(machineConfig, n + 1) & " <add name=""SQLite Data Provider"" invariant=""System.Data.SQLite"" description="".Net Framework Data Provider for SQLite"" type=""System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=" & SQLiteVersion & ", Culture=neutral, PublicKeyToken=db937bc2d44ff139"" />" & vbCrLf & Mid(machineConfig, n + 2) 68 - End If 69 - End If 70 - Else 71 - n = n + 27 72 - x = InStr(n, machineConfig, ",", 1) 73 - If x > 0 Then 74 - machineConfig = Left(machineConfig, n) & SQLiteVersion & Mid(machineConfig, x) 75 - End If 71 + Set xmlNode = machineConfig.selectSingleNode("configuration/system.data/DbProviderFactories/add[@invariant=""System.Data.SQLite""]") 72 + If xmlNode Is Nothing Then 73 + Set xmlParent = machineConfig.selectSingleNode("configuration/system.data/DbProviderFactories") 74 + Set xmlNode = machineConfig.createNode(1, "add", "") 75 + xmlNode.attributes.setNamedItem(machineConfig.createAttribute("name")) 76 + xmlNode.attributes.setNamedItem(machineConfig.createAttribute("invariant")) 77 + xmlNode.attributes.setNamedItem(machineConfig.createAttribute("description")) 78 + xmlNode.attributes.setNamedItem(machineConfig.createAttribute("type")) 79 + xmlParent.appendChild xmlNode 76 80 End If 77 81 78 - Set machineConfigFile = fso.CreateTextFile(machineConfigPath & "\machine.config", true) 79 - machineConfigFile.Write(machineConfig) 80 - machineConfigFile.Close() 81 - 82 + xmlNode.attributes.getNamedItem("name").value = "SQLite Data Provider" 83 + xmlNode.attributes.getNamedItem("invariant").value = "System.Data.SQLite" 84 + xmlNode.attributes.getNamedItem("description").value = ".Net Framework Data Provider for SQLite" 85 + xmlNode.attributes.getNamedItem("type").value = "System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=" & SQLiteVersion & ", Culture=neutral, PublicKeyToken=db937bc2d44ff139" 86 + 87 + machineConfig.save machineConfigFile 82 88 End Sub