|
-
Oct 20th, 2009, 06:05 AM
#1
Thread Starter
Junior Member
How to make "VB6 package Install" Drive Independent??
Hi All,
How r u?
I want to make package for my VB 6.0 project so that where ever(Whatever drive/ path ) I install it, it works fine without any database or any project file path not found problems.
My project is using one database also.
Thanks In advance.
Regards
Krishna
-
Oct 20th, 2009, 06:07 AM
#2
Re: How to make "VB6 package Install" Drive Independent??
Always install the database in the same path as the exe and use App.Path in your project.
-
Oct 20th, 2009, 08:03 AM
#3
Re: How to make "VB6 package Install" Drive Independent??
That isn't a particularly good idea, because it can cause various issues (permissions etc) depending on the circumstances.
It would be much better to use an %AppData% folder instead, which also has extra benefits.
For more information (including apt code), see the article Where should I store the files that my program uses/creates? from our Classic VB FAQs
-
Oct 20th, 2009, 08:06 AM
#4
Re: How to make "VB6 package Install" Drive Independent??
 Originally Posted by Hack
Always install the database in the same path as the exe and use App.Path in your project.
How about in Vista?
-
Oct 20th, 2009, 02:25 PM
#5
Re: How to make "VB6 package Install" Drive Independent??
Put your exe in program files
And the other files:
use the SHGetFolderPath function to set db and file paths
CSIDL_COMMON_DOCUMENTS (Public folder)
My app works like this:
Sub main gets the path to CSIDL_COMMON_DOCUMENTS and assigns it to a global string variable eg: gMyPath then through-out app refers to gMyPath
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Oct 20th, 2009, 11:23 PM
#6
Re: How to make "VB6 package Install" Drive Independent??
 Originally Posted by dee-u
How about in Vista?
I assume you have tried the same as Hack mentioned in Vista?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Oct 21st, 2009, 04:34 AM
#7
Re: How to make "VB6 package Install" Drive Independent??
It can fail rather impressively in Vista (and presumably 7), and will also fail in XP/2000 under certain circumstances.
The link I posted before explains the kind of issues it causes.
-
Oct 21st, 2009, 12:09 PM
#8
Re: How to make "VB6 package Install" Drive Independent??
The problem with CSIDL_COMMON_DOCUMENTS is that it is the common workspace for user documents. This is almost as bad as just dumping files onto the Desktop (or Common Desktop).
For shared files used by programs there is an official place to put things: CSIDL_COMMON_APPDATA.
The file system directory that contains application data for all users. A typical path is C:\Documents and Settings\All Users\Application Data. This folder is used for application data that is not user specific. For example, an application can store a spell-check dictionary, a database of clip art, or a log file in the CSIDL_COMMON_APPDATA folder. This information will not roam and is available to anyone using the computer.
The hitch is that files and folders created here inherit security that makes them read-only except to the user who created (owns) them.
So normally your installer would create your app subdirectory here and give it appropriate access rights. Sometimes this can be as easy as Full Access for the Everyone group.
Do not use the values from various environment variables. For example %APPDATA% points to a folder in the user's roaming profile. People sort of get upset when every logon and logoff several GB of data has to be copied across the network. You won't see this on your home PC, but just wait until a user or two in a corporate setting gets yelled at for this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|