|
-
Oct 8th, 2001, 09:08 PM
#1
Thread Starter
Member
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?
-
Oct 11th, 2001, 06:43 PM
#2
Thread Starter
Member
YES! I HAVE FINALLY ASKED THE UNANSWERABLE QUESTION!
-
Oct 11th, 2001, 08:23 PM
#3
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.
-
Oct 11th, 2001, 08:37 PM
#4
Thread Starter
Member
Cool idea; I'll try it out later. 
Others, keep the suggestions coming anyway, it's always good to have a second opinion...
-
Oct 12th, 2001, 09:17 AM
#5
i would suggest trying somit other than QB ... like C, C++ or Delphi
-
Oct 12th, 2001, 11:42 AM
#6
PowerPoster
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
-
Oct 12th, 2001, 12:02 PM
#7
Thread Starter
Member
I don't even know how to do the equivalent of Shell in C++. But I know the language basics.
-
Oct 12th, 2001, 12:05 PM
#8
PowerPoster
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
-
Oct 12th, 2001, 12:53 PM
#9
Thread Starter
Member
Sounds cool; I'll start one.
-
Oct 12th, 2001, 12:55 PM
#10
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|