Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


What came first - the chicken or the app?

Posted on 2002-05-04
Medium Priority
Last Modified: 2010-05-18
I have a dilemma.  I am trying to create a package for sale to potentially computer illiterate people.  I am trying to making the process bullet proof.  I am hitting my head against a brick wall.  My application involves add on data files which need to be installed in the same directory as the program files.  I decided I would write the location of the install to the registry.  Then when I subsequently install I could read the registry to figure out where to do the second install.  The problems are:
   #1 - if they don't have the VB6 runtime installed, how can I read the registry to find out if and where they have installed my code?  I could do this with Windows Scripting Host but they might not have that installed either.  If I attempt to run a VB app without the run time package installed, I can't even trap the error to determine the runtime is missing - can I??
   #2 - In typing this it just dawned on me that using the Package and Deployment wizard, I won't have the ability to write the location to the registry anyway - or is there something I don't know about the ability of PDW?
   #3 - I have two computers and can't get a package to create on either one right now.  My new machine says that it can't find setup.exe, setup1.exe, st6unst.exe, and vb6stkit.  The old machine worked a couple of days ago - but now I am getting an error that the cab file can not be created and I should check the amount of disk space and access rights.  I have 2.5 gig available.  Is this a conspiracy to drive me freaking crazy?  I have been working on this program for over a year and am finally ready to cut an install CD and I can't create the freaking package!
Question by:sodakotahusker
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 46

Expert Comment

ID: 6990163
You should use App.Path to reference the application directory in your program.  
Open App.Path & "\datafile.dat" For Input As #intFilenum

If the files are in a sub-directory, append that directory name to App.Path.
Open App.Path & "\files\datafile.dat" For Input As #intFilenum

Avoid registry use for this function when possible.

Adding your data files when you run the PDW should place them into the Application directory by default.  You can change that location to one of the system directories or an application sub-directory.

Since the PDW places many files into the directory you specify as the target directory, I'll need to ask you if you are distributing all the files created by the PDW?  If not, then that is your problem.

Author Comment

ID: 6990180
Problem 3 has been resolved on my old machine.  When will I learn that when I get an error indicating potentially out of disk space to check the system drive as well as the destination drive.  Temporary files are usually put out on C:  My C drive had 0 bytes free (I only use this machine for special tasks).  My cab has now been created.  The problem on my new machine I think is XP related.

Now - problem #1 - as far as app.path - I already am using that.  You don't understand what I mean by add on databases.  I mean that the user might have one CD from which they install the program and one database.   Next week they may buy another database which needs to be installed in the same directory as the first one was.  I know I can scan all of the directories on all of their disks to find my application but that could be very slow.  If I can read the registry I can go right to it.   I have never programmed in C++.  I'm guessing it does not have a required run time package - so I could create a little program to read the registry in that environment?  

For problem 2 - I could just have the user run the application immediately upon install - to write to the registry so I would have my folder information stored away.
LVL 12

Accepted Solution

roverm earned 800 total points
ID: 6990461
What you could do is add some code to the setup by altering the setup1 project (installed with VB):
C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Setup1\SETUP1.VBP

Here you can additionally copy all necessary data, add code for adding a DSN, whatever you want.

Since this Setup will pre-install the vb-runtime you CAN read the registry via normal API calls, or even include a registry module (I even thought it was already in there...).

LVL 12

Expert Comment

ID: 6991733
Thanks for points!


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question