What came first - the chicken or the app?

Posted on 2002-05-04
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 45

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 200 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 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