Results 1 to 8 of 8

Thread: How to make "VB6 package Install" Drive Independent??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2009
    Posts
    25

    Unhappy 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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: How to make "VB6 package Install" Drive Independent??

    Quote Originally Posted by Hack View Post
    Always install the database in the same path as the exe and use App.Path in your project.
    How about in Vista?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    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

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: How to make "VB6 package Install" Drive Independent??

    Quote Originally Posted by dee-u View Post
    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

  7. #7
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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
  •  



Click Here to Expand Forum to Full Width