Changeset 6479 for trunk/Bui_Core/resources/launcher/win/src/modMain.bas
- Timestamp:
- 09/07/06 20:18:41 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Bui_Core/resources/launcher/win/src/modMain.bas
r6355 r6479 117 117 118 118 '******************************************************************************* 119 Public Sub subDeployXPIs()120 Dim strCurrentXPI As String121 Dim strCurrentXPIFileName As String122 Dim strXPIs() As String123 Dim strXPIBasePath As String124 Dim strXPIPath As String125 Dim strXPIPathTemp As String126 Dim strChromeBasePath As String127 Dim strChromeJarName As String128 Dim strChromeManifestName As String129 Dim i As Integer130 On Error GoTo errHandler131 132 strXPIBasePath = gstrBinPath & PATH_XPIS & PATH_SEPERATOR133 strChromeBasePath = gstrBinPath & GetINISettings(gstrIniPath, "app", "chrome", "") & PATH_SEPERATOR134 135 'Retreave the list of XPIs to install136 strCurrentXPI = Dir(strXPIBasePath & "*", vbDirectory)137 ReDim strXPIs(0)138 Do While strCurrentXPI <> ""139 If strCurrentXPI <> "." And strCurrentXPI <> ".." Then140 If strXPIs(UBound(strXPIs)) <> "" Then141 ReDim Preserve strXPIs(UBound(strXPIs) + 1)142 End If143 strXPIs(UBound(strXPIs)) = strCurrentXPI144 End If145 strCurrentXPI = Dir146 Loop147 148 For i = LBound(strXPIs) To UBound(strXPIs)149 strCurrentXPI = strXPIs(i)150 strXPIPath = strXPIBasePath & strCurrentXPI & PATH_SEPERATOR151 strCurrentXPIFileName = Dir(strXPIPath & "*.xpi", vbNormal)152 If strCurrentXPIFileName <> "" Then153 154 ' Get a new temp folder155 strXPIPathTemp = funNewTempFolder & PATH_SEPERATOR156 157 ' Unzip the current xpi to the temp folder158 Call subUnzip(strXPIPath & strCurrentXPIFileName, strXPIPathTemp)159 160 ' Retreave the JAR name161 strChromeJarName = Dir(strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & "*.jar", vbNormal)162 163 ' Control XPI integrity164 If Dir(strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & strChromeJarName) <> "" And Dir(strXPIPathTemp & PATH_CHROME_MANIFEST) <> "" Then165 166 ' Replace the jar file167 Call funKill(strChromeBasePath & PATH_CHROME & PATH_SEPERATOR & strChromeJarName)168 If Dir(strChromeBasePath & PATH_CHROME, vbDirectory) = "" Then Call funMkDir(strChromeBasePath & PATH_CHROME)169 Name strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & strChromeJarName As strChromeBasePath & PATH_CHROME & PATH_SEPERATOR & strChromeJarName170 171 ' Replace the Manifest file172 strChromeManifestName = Left(strChromeJarName, Len(strChromeJarName) - 4) & PATH_MANIFEST_EXT173 Call funKill(strChromeBasePath & strChromeManifestName)174 Name strXPIPathTemp & PATH_CHROME_MANIFEST As strChromeBasePath & strChromeManifestName175 Else176 ' If any part of the xpi is missing, display a warning message177 Call funDisplayMessage(funLoadResString(103, gstrAppName, IIf(strChromeJarName <> "", funLoadResString(104, Replace(LCase(strChromeJarName), ".jar", "")), "")), , vbExclamation + vbOKOnly)178 End If179 180 ' Clean up temp dir...181 Call funKill(strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & "*")182 Call funRmDir(strXPIPathTemp & PATH_CHROME)183 Call funKill(strXPIPathTemp & "*")184 Call funRmDir(strXPIPathTemp)185 186 End If187 188 ' Clean up xpi dir...189 Call funKill(strXPIPath & "*")190 Call funRmDir(strXPIPath)191 Call funKill(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI & PATH_SEPERATOR & PATH_CHROME & PATH_SEPERATOR & "*")192 Call funRmDir(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI & PATH_SEPERATOR & PATH_CHROME)193 Call funKill(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI & PATH_SEPERATOR & "*")194 Call funRmDir(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI)195 Next i196 Call funRmDir(strXPIBasePath)197 Exit Sub198 199 errHandler:200 Call funErrorManager(DEFAULT_APP_NAME & "DeployXPIs", True)201 End Sub119 'Public Sub subDeployXPIs() 120 'Dim strCurrentXPI As String 121 'Dim strCurrentXPIFileName As String 122 'Dim strXPIs() As String 123 'Dim strXPIBasePath As String 124 'Dim strXPIPath As String 125 'Dim strXPIPathTemp As String 126 'Dim strChromeBasePath As String 127 'Dim strChromeJarName As String 128 'Dim strChromeManifestName As String 129 'Dim i As Integer 130 'On Error GoTo errHandler 131 ' 132 ' strXPIBasePath = gstrBinPath & PATH_XPIS & PATH_SEPERATOR 133 ' strChromeBasePath = gstrBinPath & GetINISettings(gstrIniPath, "app", "chrome", "") & PATH_SEPERATOR 134 ' 135 ' 'Retreave the list of XPIs to install 136 ' strCurrentXPI = Dir(strXPIBasePath & "*", vbDirectory) 137 ' ReDim strXPIs(0) 138 ' Do While strCurrentXPI <> "" 139 ' If strCurrentXPI <> "." And strCurrentXPI <> ".." Then 140 ' If strXPIs(UBound(strXPIs)) <> "" Then 141 ' ReDim Preserve strXPIs(UBound(strXPIs) + 1) 142 ' End If 143 ' strXPIs(UBound(strXPIs)) = strCurrentXPI 144 ' End If 145 ' strCurrentXPI = Dir 146 ' Loop 147 ' 148 ' For i = LBound(strXPIs) To UBound(strXPIs) 149 ' strCurrentXPI = strXPIs(i) 150 ' strXPIPath = strXPIBasePath & strCurrentXPI & PATH_SEPERATOR 151 ' strCurrentXPIFileName = Dir(strXPIPath & "*.xpi", vbNormal) 152 ' If strCurrentXPIFileName <> "" Then 153 ' 154 ' ' Get a new temp folder 155 ' strXPIPathTemp = funNewTempFolder & PATH_SEPERATOR 156 ' 157 ' ' Unzip the current xpi to the temp folder 158 ' Call subUnzip(strXPIPath & strCurrentXPIFileName, strXPIPathTemp) 159 ' 160 ' ' Retreave the JAR name 161 ' strChromeJarName = Dir(strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & "*.jar", vbNormal) 162 ' 163 ' ' Control XPI integrity 164 ' If Dir(strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & strChromeJarName) <> "" And Dir(strXPIPathTemp & PATH_CHROME_MANIFEST) <> "" Then 165 ' 166 ' ' Replace the jar file 167 ' Call funKill(strChromeBasePath & PATH_CHROME & PATH_SEPERATOR & strChromeJarName) 168 ' If Dir(strChromeBasePath & PATH_CHROME, vbDirectory) = "" Then Call funMkDir(strChromeBasePath & PATH_CHROME) 169 ' Name strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & strChromeJarName As strChromeBasePath & PATH_CHROME & PATH_SEPERATOR & strChromeJarName 170 ' 171 ' ' Replace the Manifest file 172 ' strChromeManifestName = Left(strChromeJarName, Len(strChromeJarName) - 4) & PATH_MANIFEST_EXT 173 ' Call funKill(strChromeBasePath & strChromeManifestName) 174 ' Name strXPIPathTemp & PATH_CHROME_MANIFEST As strChromeBasePath & strChromeManifestName 175 ' Else 176 ' ' If any part of the xpi is missing, display a warning message 177 ' Call funDisplayMessage(funLoadResString(103, gstrAppName, IIf(strChromeJarName <> "", funLoadResString(104, Replace(LCase(strChromeJarName), ".jar", "")), "")), , vbExclamation + vbOKOnly) 178 ' End If 179 ' 180 ' ' Clean up temp dir... 181 ' Call funKill(strXPIPathTemp & PATH_CHROME & PATH_SEPERATOR & "*") 182 ' Call funRmDir(strXPIPathTemp & PATH_CHROME) 183 ' Call funKill(strXPIPathTemp & "*") 184 ' Call funRmDir(strXPIPathTemp) 185 ' 186 ' End If 187 ' 188 ' ' Clean up xpi dir... 189 ' Call funKill(strXPIPath & "*") 190 ' Call funRmDir(strXPIPath) 191 ' Call funKill(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI & PATH_SEPERATOR & PATH_CHROME & PATH_SEPERATOR & "*") 192 ' Call funRmDir(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI & PATH_SEPERATOR & PATH_CHROME) 193 ' Call funKill(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI & PATH_SEPERATOR & "*") 194 ' Call funRmDir(gstrBinPath & PATH_EXT & PATH_SEPERATOR & strCurrentXPI) 195 ' Next i 196 ' Call funRmDir(strXPIBasePath) 197 ' Exit Sub 198 ' 199 'errHandler: 200 ' Call funErrorManager(DEFAULT_APP_NAME & "DeployXPIs", True) 201 'End Sub 202 202 203 203
Note: See TracChangeset
for help on using the changeset viewer.