AH!! (No need to read, Problem Solved!!)     (Moderator: Hell Raiser) Previous Topic | Next Topic
Page 1 of 1
 Author 
 Post 
Hell Raiser
Site Developer
Post 19-Feb-2006 11:59        

For whatever strange reason, I cannot get self-extracting zips/rars to work right when JK Patcher is compiled. It might have something to do with them not returning a process ID, or the program locks the file or some crap. It works fine in the VB Development Environment, but refuses to when compiled, even if I use a .bat file! JK will run FINE, but not my self-extracting updates! >_<!!!! I tried all sorts of alternative methods to no avail.

So, I tried seeing if I could find some code to extract zip files in a VB program. Found a few hits, implementation however was not so hot.

So now I'm up to suggestions. (HELP WITH THE SOURCE OF MY PROBLEM WOULD BE KEEN!!) I want to deliver updates of cogext.dll, jk.exe patches, and JK Patcher in as tiny a filesize as possible, without using self extracting zips or, uh, any compression whatsoever. >_<

Last edited by Hell Raiser on 22-Feb-2006 22:49; edited 1 time in total
Post 19-Feb-2006 15:23        

What do you mean, they don't work? Make sure you close the open file handle when done downloading a file (use Process Explorer or some similar tool to check for the file handle to be sure it's closed). That's the only thing I can think of that would block it... otherwise it should be no different from having explorer launch it when you double click the icon.
Hell Raiser
Site Developer
Post 19-Feb-2006 15:32        

They Don't Work: The self-extracting zip/rar .exe files never get executed, therefore, never extracting the sweet goodness from within.

I've been having a debate in my head and with JKSERVER about VB and the filesystem.

I want to believe that when VB closes a file, the next line of code doesn't execute till the filesystem is done closing/writing/copying/etc the file. JKSERVER believes that VB continues on after a filesystem related command, and doesn't wait for the filesystem to finish with the file.

I've tried putting in timers and sleeps and whatever to see if indeed the filesystem just needed to catch up, and it appears JKSERVER is parinoid. (afaik Razz) My self-executing files just won't get ran no matter what I try. I even decided to try something like this:


DownloadFile(Blah blah) 'Works fine, file is created, execution returns when file is 100% done
RunProgram(FileExe) 'This function has been rewired so many times, it's not funny.  I did however come across one that would run JK properly.

On Error Resume Next 'You'll see why
FileCopy ExtractedFile, FileDestination 'Copy file
while Err = 53 'File not found
DoEvents 'do crap in the bg
FileCopy ExtractedFile, FileDestination 'copy it
wend


That SHOULD have made it wait till the filesystem 'caught up' if that was the case, but it just made JK Patcher go into an infinite loop. (Meaning the self-extracting never took place)

Ideas?
Post 19-Feb-2006 22:51        

I'll help you fix it tonight when I get home.
Hell Raiser
Site Developer
Post 22-Feb-2006 19:36        

I FIIIIIIIIIIXED IT!

It seems to have been a problem with the self-extracting .exe and executing it properly. A simple ChDir App.Path, followed by Shell "UpdateName.exe" made them run and extract the goodness within. Then I just have a loop trying to copy the file with some error trapping. While Err=53, copy file, wend.
*** Post commands are unavailable for guests. ***