Solved

What came first - the chicken or the app?

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now