Results 1 to 9 of 9

Thread: Finding out if a file has been Unzipped

  1. #1

    Thread Starter
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251

    Finding out if a file has been Unzipped

    I have been working on a project for quite sometime and have been trying to figure out how to tell if a file has been extracted from a zip program.

    The program in its current state is that the user downloads the file and extracts it to wherever they want (mostly the desktop). When they open the program the it downloads a .dll file that it uses to write to a remote file on the server.

    The problem I am having is that the program will function properly and will download the file, but if they have not unzipped the file it will not work when it needs to write to the remote location. I'm sure most of you have used WinZip and you know that when you open it you can see the files. What my users are doing is just doubleclicking the file inside the winzip program and running it from there. So when they get to the point where it writes to the file it fails and gives an error.

    Initially I had the .exe and the .dll file in the zip file, but the users 1) were doing the same things mentioned above or 2) deleting the .dll file thinking "hey I don't need this even though it came with the program". So thats why I have the program just download the file.

    I would like just to run this as an ASP.NET or classic ASP application, but they won't give me any server space equipped with IIS. So this is what I am forced to do.

    Now I know some of you may be thinking that I should just check to see if the file is in the location. I already did, the zip program fools the program into thinking the file is in the specified location. It even downloads the .dll file into the location of the ZIP file where it thinks the program is located.

    So if anyone can think of a way to figure out if a file has been unzipped or a better workable solution please let me know.

    Thanks for your time

    Ryan
    ~Ryan





    Have I helped you? Please Rate my posts.

  2. #2

    Thread Starter
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    Nobody has any clue?
    ~Ryan





    Have I helped you? Please Rate my posts.

  3. #3
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmm what a weird situation
    I'm not sure if I got what you mean exactly... so you have an exe and a dll in a zip file. They can run the exe without extracting the zip file, correct?

    now what does your exe do? tries to write to what file?
    when you run it from winzip, if you check in the directory that the app is running, does VB detect that the dll file is also there?

    you said So when they get to the point where it writes to the file it fails and gives an error., I dont understand what you're writing on... is it just a data file? if so, you can just add a simple option to yuor program: use a try catch block and when it fails to write, just let them know and then prompt a file save dialog to let them choose a different location

    but, eeh explain a bit more, in a shorter response perhaps, because I dont know what you're doing
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4

    Thread Starter
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    ok..sorrry for taking so long to get back to this..

    The file in it's current state is a .exe in a zip file. When the user executes the program it downloads a .dll file from a remote location to the same directory in which the program resides.

    Ther program is kinda like a quiz we give to our entry level employees to test their skills and identify the employess we need to either terminate because they know nothing or spend more time training them in certain areas.

    At the end of all the questions the programs instatiates the .dll file and writes to a text file in a remote location various information including scores and which questions were missed.

    Now as far as the zip file i'm not sure how to explain what is happenning. Basically if you download the zip file to the desktop, double click it and open winzip, then double click the file from the winzip program without actually extracting it.

    The program will open and run the .exe. It will then download the .dll from the remote location to the desktop. The user will answer all the questions and then when they finish and it looks to the .dll file to write to the text file it gives an error stating that the .dll file cannot be found.

    I hope that clarifies a few things for you.

    Also, some general information that I have found:

    1) I can't get access to a server with asp or asp.net otherwise this would not be an issue.

    2) I can't just make a self-extract zip file because the permissions on the computer for some reason will not allow the file to extract to the desktop.

    3) I can't put the .exe only out on the server because it will not download properly in most cases.


    Thanks for your time
    Ryan
    ~Ryan





    Have I helped you? Please Rate my posts.

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmm why don't you just put the instructions in a readme file. If they dont read it and they do it wrong, then that's their problem.

    plus, when you double click on a flie in winzip, it actually EXTRACTS the file to some location (determined by winzip I believe) and then it runs it. So your program is downloading the dll to that temporary folder. Perhaps your code isnt looking for the dll file correctly, or perhaps the dll file is being downloaded to a different folder and you are lookign for it in the same folder? I dont know how your program works.

    still I dont understand why you dont include the dll and the exe togheter? there is no way to determine if it's runnign by winzpi as winzip actually unzips the file and then it runs it. I have one stupid solution, I dont know if it would work with you:



    make a shortcut file, and put something like this in the command line: "myProgram.exe shortcut"
    then name the shortcut file something like "runThisOnly"

    now when your program runs, you can check for the command line arguments. If nothing is passed, then it means that the user is running the program by clicking on the exe file. Your program could give them an error message if no commandline-argument is passed. It would run if the "shortcut" argument is passed.
    Now if the user double clicks on the shortcut file in winzip, I assume that winzip would extract the shortcut file and then try to run it. But it wouldnt extract the exe. So when you run the shortcut, it wont even find th exe file to run. They would have to extract the whole thing to run your program

    hope this works for you... but still, check your code, maybe the way you check for the dll path isnt right
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    Instead of trying to code around user stupidity - generally a feckless effort - why don't you just include a readme.txt that explains "Hey dummy, you can't run this multi-file application straight out of Winzip. Unpack it somewhere and DON'T delete half the files included, okay?"

    //Ther program is kinda like a quiz we give to our entry level employees to test their skills and identify the employess we need to either terminate because they know nothing or spend more time training them in certain areas.

    Actually, you should probably skip the readme.txt and just fire the people who over-think the process of "unzip this into a directory and run this file".

  7. #7
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Crunch

    Actually, you should probably skip the readme.txt and just fire the people who over-think the process of "unzip this into a directory and run this file".
    brilliant suggestion
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    After having spent nearly two years unemployed, I'm more than a little bitter about people with no talent doing jobs I could have been doing.

  9. #9
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aaw sorry to hear that
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width