jds Posted July 5, 2013 Posted July 5, 2013 (edited) Due to extremely poor performance with the newer MS servers, I had a look around for a potential replacement for Outlook (2000 and XP versions, both are terrible). The one that seemed most complete, including support for Exchange Server, was Zimbra ...OK, so I downloaded the file 'zdesktop_7_2_2_ga_b11951_20130318071431_win32.msi' (MD5=9bfac177eba208553ae2940f92befe9f) and proceeded to hack this XP+ package as follows :1. Open in hex editor and at address 5A85FCC, change 2C 01 to C8 00 (surrounding bytes = 01 03 00 00 00 2C 01 00 00 03).2. Open in Orca and delete the VersionNT check line in 'LaunchCondition'. Save (don't use Save As).3. Run the MSI.4. In "\Program Files\Zimbra\Zimbra Desktop\win32\jre\bin" rename 'plugin2' directory to 'plugin2_inhibit'.5. Copy 'cscript.exe' from "\WINDOWS\COMMAND\" to "\WINDOWS\SYSTEM\".OK, now Zimbra Desktop is pretty much installed. It has few dependencies beyond what W98 provides, and KernelEx can probably provide the rest.However, it is launched by a VBS script called 'zdrun.vbs' and that gives the following error at line 250 (copy the shortcut command and run from a command prompt to see the error) : "Microsoft VBScript runtime error: File name or class name not found during Automation operation:'GetObject'". Trying to run the Zimbra executable directly just produces an error message about a missing configuration file, so presumably, that is supplied by this script.So, is anyone familiar with VB script ... ?Joe.Edits : In step 1, eliminated first byte of the surrounding context (can be used to find equivalent patches for similar MSI files, such as earlier versions of Zimbra). In step 5, changed edit of Zimbra shortcut path to a file copy of 'cscript.exe' instead (solves other instances of the path issue). Edited August 27, 2013 by jds
Steven W Posted July 27, 2013 Posted July 27, 2013 (edited) Not sure how much help it will be but, at minimum, Windows Management Instrumentation will need to be running:http://support.microsoft.com/kb/322363Note there is a section for 98 and 98 SE. You *may* also need DSClient:http://www.imss.caltech.edu/node/414This page has a link to the setup under the section 'Where Can I Get The DSClient?'I think there was hotfix for this at some point in time.Edit:Should've figured:http://www.mdgx.com/add.htm#WMIhttp://www.mdgx.com/add.htm#ADS Edited July 28, 2013 by Steven W
jds Posted August 27, 2013 Author Posted August 27, 2013 (edited) Not sure how much help it will be but, at minimum, Windows Management Instrumentation will need to be running:http://support.microsoft.com/kb/322363Note there is a section for 98 and 98 SE. You *may* also need DSClient:http://www.imss.caltech.edu/node/414This page has a link to the setup under the section 'Where Can I Get The DSClient?'I think there was hotfix for this at some point in time.Edit:Should've figured:http://www.mdgx.com/add.htm#WMIhttp://www.mdgx.com/add.htm#ADSYes, you are correct. The original error was resolved by installing WMI. I don't know if DSClient is also needed, as I have that installed already for other stuff anyway.After resolving this first VBS error, I implemented a couple of work-arounds for subsequent script errors, as below :ASCII differences between ORIGINAL.VBS and MODIFIED.VBSReplace lines 201-208 in ORIGINAL.VBS< For Each oProc in oProcs< If Instr(1, oProc.CommandLine, WScript.ScriptName, 1) > 0 Then< If bFound Then< WScript.Quit< End If< bFound = true< End If< Nextwith lines 201-208 from MODIFIED.VBS> ' For Each oProc in oProcs> ' If Instr(1, oProc.CommandLine, WScript.ScriptName, 1) > 0 Then> ' If bFound Then> ' WScript.Quit> ' End If> ' bFound = true> ' End If> ' NextReplace line 261 in ORIGINAL.VBS< sLocalAppDir = oFso.getFolder(oShellApp.Namespace(&H1c&).Self.Path).ShortPathwith lines 261-262 from MODIFIED.VBS> ' sLocalAppDir = oFso.getFolder(oShellApp.Namespace(&H1c&).Self.Path).ShortPath> sLocalAppDir = "E:\Progra~1"Now what seems to happen is that the script produces one or more temporary sub-directories in the Zimbra installation directory in "\Program Files\Zimbra", whose contents are deleted. However, there seems to be a problem with the way it determines the path of these temporary directories, so that it also ends up deleting the contents of the whole Zimbra installation directory.That's as far as I've managed to progress this thing so far.Joe. Edited August 27, 2013 by jds
Steven W Posted August 27, 2013 Posted August 27, 2013 (edited) Wish I were more of a VBscript guru, but alas.... My thinking on the DSClient is that it will be necessary if you do get the thing up and running and try to connect to an Exchange Server that requires NTLM authentication. I could be mistaken, I did say *may*.As for now, could you enlighten us with any particular error messages etc. from both the unmodded and modded vbs files?Edit:Those reading this should realize that there are some differences in VB script implementations on NT systems vs 9x systems. I take it that use of the single quote is the equivalent of "commenting out" lines. Edited August 27, 2013 by Steven W
buyerninety Posted August 28, 2013 Posted August 28, 2013 (edited) Correct;http://technet.microsoft.com/en-us/library/ee176989.aspx#EBAA... however, I see in ZDRUN.VBS this line (and occaisionally like elsewhere, on other webpages);"where Name='cscript.exe'",, 48) ' 48: forward-only enumerator + return-immediately... so I am unsure if a set of 'single quote's, when nestled within double quotes, is treated asif it were simply double quotes?Incidently, if jds is holding back on posting the }modified{ version of zdrun.vbs (all 250+ lines of it)because it would make a loong post... well my vote is, jds, post away.(Swing Away, Merrill. Merrill: Swing Away.) Edited August 28, 2013 by buyerninety
Steven W Posted August 28, 2013 Posted August 28, 2013 (edited) I was sent a private message regarding this post and it included the script. I can only assume that it is accurate and unmodified:' * ***** BEGIN LICENSE BLOCK *****' * Zimbra Collaboration Suite Server' * Copyright © 2009, 2010, 2011 VMware, Inc.' *' * The contents of this file are subject to the Zimbra Public License' * Version 1.3 ("License"); you may not use this file except in' * compliance with the License. You may obtain a copy of the License at' * http://www.zimbra.com/license.' *' * Software distributed under the License is distributed on an "AS IS"' * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.' * ***** END LICENSE BLOCK *****' */'' ZD runner'Dim oFso, oReg, oShellApp, oShell, oWMI, sScriptPath, sScriptDir, oTokens, sAppRoot, sDataRoot, sOverridePathDim sLocalAppDir, bIsUpgrade, sTmpDir, sRestoreDir, aUserDirs, aUserFiles, sVersion, sVerFileconst HKEY_CURRENT_USER = &H80000001Sub LogMsg(sMsg, iLevel)If (InStr(Wscript.FullName,"cscript") > 0) ThenWScript.StdOut.WriteLine(sMsg)End IfIf iLevel <= iLogLevel ThenoShell.LogEvent iLevel, "Zimbra Desktop: " & sMsgEnd IfEnd SubSub FindAndReplace(sFile, oTokens)Dim oFso, oInFile, oOutFile, sTmpFileSet oFso = CreateObject("Scripting.FileSystemObject")sTmpFile = sFile & ".tmp"On Error Resume NextSet oInFile = oFso.OpenTextFile(sFile, 1, false)If Err.number <> 0 ThenLogMsg "failed to open file: " & sFile, 1Exit SubEnd IfSet oOutFile = oFso.OpenTextFile(sTmpFile, 2, true)If Err.number <> 0 ThenLogMsg "failed to open file: " & sTmpFile, 1Exit SubEnd IfDo Until oInFile.AtEndOfStreamDim sLine, sKeysLine = oInFile.ReadLineFor Each sKey In oTokens.KeyssLine = Replace(sLine, sKey, oTokens.Item(sKey))NextoOutFile.WriteLine(sLine)LoopoInFile.CloseoOutFile.CloseoFso.DeleteFile sFile, trueoFso.MoveFile sTmpFile, sFileEnd SubFunction GetRandomIdSet oTypeLib = CreateObject("Scriptlet.TypeLib")GetRandomId = LCase(Mid(oTypeLib.GUID, 2, 36))End FunctionSub CopyIfExists(sSrc, sDest, bOW)If oFso.FileExists(sSrc) ThenoFso.CopyFile sSrc, sDest, bOWEnd IfEnd SubSub LaunchPrism()Dim sCmd, iRetiRet = oReg.CreateKey(HKEY_CURRENT_USER, "Software\Zimbra\Zimbra Desktop\Prism")oReg.SetStringValue HKEY_CURRENT_USER, "Software\Zimbra\Zimbra Desktop\Prism", "OverridePath", sOverridePathsCmd = Chr(34) & sAppRoot & "\win32\prism\zdclient.exe" & Chr(34)oShell.Run sCmd, 1, falseWScript.QuitEnd SubSub StopProcesses()Dim sCmd, sCScript, sZdCtlsCScript = Chr(34) & oFso.GetSpecialFolder(1).Path & "\cscript.exe" & Chr(34)sZdCtl = Chr(34) & sDataRoot & "\bin\zdctl.vbs" & Chr(34)'Stop backend service and prismoShell.Run sCScript & " " & sZdCtl & " shutdown", 0, trueEnd SubSub BackupFailed(sMsg)If Not IsNull(sMsg) ThenoShell.Popup sMsg, 0, "Zimbra Desktop", 48End IfoFso.MoveFolder sTmpDir, sRestoreDirWScript.QuitEnd SubSub BackupData()If oFso.FolderExists(sTmpDir) Then' Save leftover temp dir, in case it's needed in manual recoveryDim iEpochiEpoch = DateDiff("s", "01/01/1970 00:00:00", Now())oFso.MoveFolder sTmpDir, sTmpDir & "." & iEpochEnd IfoFso.CreateFolder sTmpDirOn Error Resume NextDim sDirFor Each sDir In aUserDirsIf oFso.FolderExists(sDataRoot & "\" & sDir) ThenoFso.MoveFolder sDataRoot & "\" & sDir, sTmpDir & "\" & sDirIf Err.number <> 0 ThenBackupFailed "File operation failed. Please close any open files under " & _sDataRoot & "\" & sDirEnd IfEnd IfNextoFso.CreateFolder sTmpDir & "\profile"oFso.CreateFolder sTmpDir & "\conf"Dim sFileFor Each sFile In aUserFilesCopyIfExists sDataRoot & "\" & sFile, sTmpDir & "\" & sFile, trueNextDim iButton, sMsgDooFso.DeleteFolder sDataRoot, trueIf Err.number = 0 ThenExit SubElsesMsg = "Unable to delete folder: " & sDataRoot & ". " & _"Please close any open files in this folder and its sub-folders."iButton = oShell.Popup(sMsg, 0, "Zimbra Desktop", 5 + 48)End IfErr.ClearLoop While iButton = 4 ' Retry' CancledBackupFailed NullEnd SubSub RestoreData(sSrcRoot)Dim sDirFor Each sDir In aUserDirsIf oFso.FolderExists(sSrcRoot & "\" & sDir) ThenIf oFso.FolderExists(sDataRoot & "\" & sDir) ThenoFso.DeleteFolder sDataRoot & "\" & sDir, trueEnd IfoFso.MoveFolder sSrcRoot & "\" & sDir, sDataRoot & "\" & sDirEnd IfNextDim sFileFor Each sFile In aUserFilesCopyIfExists sSrcRoot & "\" & sFile, sDataRoot & "\" & sFile, trueNextoFso.DeleteFolder sSrcRoot, trueEnd SubSub WriteVersion()Dim oFoutOn Error Resume NextSet oFout = oFso.OpenTextFile(sVerFile, 2, true)If Err.number = 0 ThenoFout.WriteLine(sVersion)End IfoFout.CloseEnd SubFunction ReadVersion()Dim oFinReadVersion = ""On Error Resume NextSet oFin = oFso.OpenTextFile(sVerFile, 1, false)If Err.number = 0 ThenReadVersion= oFin.ReadLine()End IfoFin.CloseEnd FunctionSub EnsureSingleInstance()Dim oProcs, oProc, bFoundSet oProcs = oWMI.ExecQuery("Select * from Win32_Process " & _"where Name='cscript.exe'",, 48) ' 48: forward-only enumerator + return-immediatelybFound = falseFor Each oProc in oProcsIf Instr(1, oProc.CommandLine, WScript.ScriptName, 1) > 0 ThenIf bFound ThenWScript.QuitEnd IfbFound = trueEnd IfNextEnd SubSub BuildPath(ByVal Path)If Not oFso.FolderExists(Path) ThenBuildPath oFso.GetParentFolderName(Path)oFso.CreateFolder PathEnd IfEnd SubFunction GetDataRoot()oReg.GetStringValue HKEY_CURRENT_USER, "Software\Zimbra\Zimbra Desktop", "DataRoot", GetDataRootIf IsNull(GetDataRoot) ThenGetDataRoot = sLocalAppDir & "\Zimbra\Zimbra Desktop"ElseIf Not oFso.FolderExists(GetDataRoot) ThenBuildPath(GetDataRoot)End IfGetDataRoot = oFso.getFolder(GetDataRoot).ShortPathEnd IfEnd FunctionFunction IsNonEnUsXp()Dim nLang, sVerSet colOSes = oWMI.ExecQuery("Select * from Win32_OperatingSystem")For Each oOS in colOSesnLang = oOS.OSLanguagesVer = oOS.VersionIf nLang <> 1033 AND Instr(sVer, "5.") = 1 ThenIsNonEnUsXp = trueElseIsNonEnUsXp = falseEnd IfExit ForNextEnd Function'------------------------------- main ---------------------------------Set oFso = CreateObject("Scripting.FileSystemObject")Set oShellApp = CreateObject("Shell.Application")Set oShell = CreateObject("WScript.Shell")Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")EnsureSingleInstancesVersion="7.2.2 build 11951"aUserDirs = Array("index", "store", "sqlite", "log", "zimlets-properties", "zimlets-deployed")aUserFiles = Array("conf\keystore", "profile\prefs.js", "profile\persdict.dat", "profile\localstore.json")sScriptPath = WScript.ScriptFullNamesScriptDir = Left(sScriptPath, InStrRev(sScriptPath, WScript.ScriptName) - 2)sAppRoot = oFso.GetParentFolderName(sScriptDir)sLocalAppDir = oFso.getFolder(oShellApp.Namespace(&H1c&).Self.Path).ShortPathsDataRoot = GetDataRoot()xmlDataRoot = Replace(sDataRoot,"&","&")sVerFile = sDataRoot & "\conf\version"sTmpDir = sDataRoot & ".tmp"sRestoreDir = sDataRoot & ".rst"sOverridePath = sDataRoot & "\zdesktop.webapp\override.ini"bIsUpgrade = falseIf oFso.FolderExists(sDataRoot) ThenIf oFso.FolderExists(sRestoreDir) ThenRestoreData sRestoreDirEnd IfDim sCurVersCurVer = ReadVersionIf StrComp(sCurVer, sVersion) = 0 ThenLaunchPrismElsebIsUpgrade = trueEnd IfEnd IfDim sMsgsMsg = "Initializing, please wait..."If (InStr(Wscript.FullName,"cscript") > 0) ThenWScript.Echo sMsgEnd IfoShell.Popup sMsg, 5, "Zimbra Desktop", 64StopProcessesIf bIsUpgrade ThenBackupDataEnd If' copy data filesIf Not oFso.FolderExists(sLocalAppDir & "\Zimbra") ThenoFso.CreateFolder sLocalAppDir & "\Zimbra"End IfIf Not oFso.FolderExists(sLocalAppDir & "\Zimbra\Zimbra Desktop") ThenoFso.CreateFolder sLocalAppDir & "\Zimbra\Zimbra Desktop"End IfoFso.CopyFolder sAppRoot & "\data\*", sDataRoot & "\", trueWriteVersionSet physMem = GetObject("winmgmts:").InstancesOf("Win32_PhysicalMemory")For Each mem In physMemmemTmp = mem.capacity / 1024 / 1024TotalRam = TotalRam + memTmpNextIf TotalRam > 1000 ThenjavaXms = "-Xms128m"javaXmx = "-Xmx512m"ElsejavaXms = "-Xms32m"javaXmx = "-Xmx150m"End If' fix data filesSet oTokens = CreateObject("Scripting.Dictionary")oTokens.Add "@install.app.root@", sAppRootoTokens.Add "@install.data.root@", sDataRootoTokens.Add "@install.key@", GetRandomId()oTokens.Add "@install.mutex.name@", GetRandomId()oTokens.Add "@install.locale@", "en-US"oTokens.Add "@java.xms@", javaXmsoTokens.Add "@java.xmx@", javaXmxFindAndReplace sDataRoot & "\bin\zdctl.vbs", oTokensFindAndReplace sDataRoot & "\conf\zdesktop.conf", oTokensFindAndReplace sDataRoot & "\zdesktop.webapp\webapp.ini", oTokensFindAndReplace sDataRoot & "\profile\user.js", oTokensFindAndReplace sOverridePath, oTokensoTokens.Remove "@install.data.root@"oTokens.Add "@install.data.root@", xmlDataRootFindAndReplace sDataRoot & "\conf\localconfig.xml", oTokensFindAndReplace sDataRoot & "\jetty\etc\jetty.xml", oTokensIf bIsUpgrade ThenRestoreData sTmpDirEnd IfoReg.CreateKey HKEY_CURRENT_USER, "Software\Zimbra\Zimbra Desktop"oReg.SetStringValue HKEY_CURRENT_USER, "Software\Zimbra\Zimbra Desktop", "DataRoot", sDataRootLaunchPrismWow! I can see Java is required. I'm getting less impressed by the second. Edit: The whole thing is a Java app. I didn't realize.Further Edit:In case you're wondering what Prism is in this context:https://wiki.mozilla.org/Prism Edited August 28, 2013 by Steven W
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now