Solved

What came first - the chicken or the app?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

911 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

19 Experts available now in Live!

Get 1:1 Help Now