Solved

What came first - the chicken or the app?

Posted on 2002-05-04
4
185 Views
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!
0
Comment
Question by:sodakotahusker
  • 2
4 Comments
 
LVL 45

Expert Comment

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

If the files are in a sub-directory, append that directory name to App.Path.
Example:
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.
0
 
LVL 1

Author Comment

by:sodakotahusker
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.
0
 
LVL 12

Accepted Solution

by:
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...).

D'Mzzl!
RoverM
0
 
LVL 12

Expert Comment

by:roverm
ID: 6991733
Thanks for points!

D'Mzzl!
RoverM
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

730 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