I get a VB Script error
When I run the extraction script in the same folder as the jre-8u40-windows-i586.exe file, I get the following error:
Line: 73
Char:1
Error: Object Variable Not Set
Any help would be most appreciated?
Answers (4)
Comments:
-
In the "Oracle Java 8 8 Update 40" topic, truealph posted a script that would extract the msi. I have used the location you mentioned to grab the msi but thought that I would give this a try. I got the stated error and was wondering if it was something I was doing wrong or is there a problem with the script? - cottonakin 9 years ago
-
That's the price you pay for using a script which has no error-trapping!
Now, when I paste the script into an editor, line 73 doesn't contain any object use so please run the script in a debugger and post the full line of actual code where the script stops.
BTW, I agree - why bother with a script when you can just grab the payload when the EXE runs? Bizarre! - anonymous_9363 9 years ago-
arrLatestFilex86 = Split(LatestFilex86, "-") - cottonakin 9 years ago
A not very well-written script, this one.
You need to put the source file (which needs to have "jre" and either "586" or "x64" in its name) into a sub-folder called 'Source' branching from the folder where the script resides. You also need the 64-bit version in that same folder, otherwise line 74 is going to error in the same way.
I'd rebuild it so that the file from which you want to extract is dropped on to the script and ditch the 32/64 activity.
I'd also eliminate this awful code:
comRunLatestFilex86 = oShell.Run(chrDoubleQuote & LatestFilex86.Path & chrDoubleQuote, 1, False)
WScript.Sleep(15000)
comTerminateLatestFilex86 = oShell.Run("taskkill.exe" & chrSpace & "/im" & chrSpace & chrDoubleQuote & LatestFilex86.Name & chrDoubleQuote & chrSpace & "/f", 0, True)
WScript.Sleep(15000)
This is typical "I can't be bothered to do it properly so I'm going to fudge it" code. He runs the EXE, waits 250 seconds and then kills the process. Did it finish? Why do I care? Two minutes is long enough for any process to run, right? Jeez...Any normal person would use one of the quadzillion code examples out there which start a process and then wait for its completion. The real clue to this chap's propensity for half thought-through nonsense, though, is stuff like this:
CreateDestinationFolderx86 = oShell.Run("cmd.exe /c mkdir" & chrSpace & chrDoubleQuote & WorkingDir & "\Extracted\" & LatestFileVersionx86 & "\x86" & chrDoubleQuote, 0, True)
Really? "mkdir"? When you just used the FileSystemObject's CreateFolder method 30-odd lines before? And note there's no check to see if the folder got created or not, here or anywhere else in the script.
As I already mentioned, I really wouldn't bother making any changes at all as I find it fairly straightforward to run the EXE and then browse to the "live" extraction folder, "%USERNAME%\AppData\LocalLow\Sun\Java".
Comments:
-
Hi VBScab. I agree. It´s pretty easy to run the exe, copy the msi and cancel the installation. i takes 30 seconds, without any error,
And i also confirm that this is a not very well written script. - aragorn.2003 9 years ago