Results 1 to 10 of 10

Thread: Installer stub heaven

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    Installer stub heaven

    I'm trying to write an installer stub for my VB programs since QB 4.5 compiles to a real EXE albeit a 16-bit one. Here's what I need to do (I think) after the user extracts the contents of a ZIP file as if they downloaded a setup from my site.

    1. Get the windows\system dir
    2. See if the VB runtimes exist there; if not copy them from the current directory
    3. Shell out my full-blown VB installer now that VBs dependencies are copied
    4. Exit automatically

    But here's the problem:
    1. What's a way to determine if a file exists in QBasic, considering that error trapping doesn't work in functions or subs?
    2. What's a way to get the Windows directory?

  2. #2

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    YES! I HAVE FINALLY ASKED THE UNANSWERABLE QUESTION!


  3. #3
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,526
    You may need to combine some batch file programming with QBasic to perform this function. I don't know what versions of Windows you are trying to install your VB app on, but you may be able to use the PATH environment variable to determine where Windows is installed. Unless the user installed Windows to some non-standard folder (for example I:\OpSys5), you should be able to determine the correct path 99.9% of the time. Even if they have installed more than one operating system or version of Windows, the PATH variable should point to the currently running version (unless they have purposely included more than one valid Windows directory in their PATH). Look for 'Windows' or 'Winnt' and you should be OK.

    Batch file command to create a text file containing the PATH:

    ECHO %PATH% > PATHLIST.TXT

    You can now read in the PATHLIST.TXT file and examine it for a likely looking Windows directory. When you have found it, replace C:\WINDOWS in the batch file below to copy the files.
    Note: You can re-do the batch file to use parameters to specify the source file names and target directory if you want, then just call it as many times as you need to.

    IF EXIST C:\WINDOWS\FILENAME.DLL GOTO LABEL1
    COPY FILENAME.DLL C:\WINDOWS\FILENAME.DLL
    :LABEL1
    IF EXIST C:\WINDOWS\FILE2.XXX GOTO END
    COPY FILE2.XXX C:\WINDOWS\FILE2.XXX
    :END
    REM PUT YOUR COMMAND TO RUN YOUR VB INSTALLER HERE

    You can e-mail me at [email protected] if you have any questions about this technique.

  4. #4

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Cool idea; I'll try it out later.

    Others, keep the suggestions coming anyway, it's always good to have a second opinion...

  5. #5
    chenko
    Guest
    i would suggest trying somit other than QB ... like C, C++ or Delphi

  6. #6
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    this type of program would actually be pretty easy in c++ now that i am thinking about it.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  7. #7

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    I don't even know how to do the equivalent of Shell in C++. But I know the language basics.

  8. #8
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    perhaps it would be a good learning experience.

    Perhaps i could help you!

    maybe we should start a project in communication forum.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  9. #9

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Sounds cool; I'll start one.

  10. #10

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Done: http://www.vbforums.com/showthread.p...hreadid=110481

    Thread locked, please participate in the new thread above instead.

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