Results 1 to 7 of 7

Thread: Setup and deployment

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    4

    Setup and deployment

    Hi Guys

    i Have built an application with a small SDF database .I am trying to use a setup project to deploy the application i have managed to get the application to install into program files .But when i run i get errors ,But if i run as administrator all works fine . I guess this i due to the database been in the program files . I have tried looking on the Net for a solution but no joy . Sorry if this is a silly question just trying to tech myself VB.net first time i have tried using the setup .Thanks for any assistance

    Regards
    Ian

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

    Re: Setup and deployment

    Moved To Application Deployment

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

    Re: Setup and deployment

    Try installing the database to the appdata, local, your program folder (if the folder is not there you'll need to create it).
    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    4

    Re: Setup and deployment

    Quote Originally Posted by Nightwalker83 View Post
    Try installing the database to the appdata, local, your program folder (if the folder is not there you'll need to create it).

    Thanks Nightwalker83 for the reply . I can see how to write the DB to the User applications data folder (content files from) But how do i get the Application to look there for the DB ? thanks again

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

    Re: Setup and deployment

    I'm not sure! However, I think Si the geek might have covered it in the Database Development FAQ.
    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

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

    Re: Setup and deployment

    CSIDL_LOCAL_APPDATA references a non-roaming per-user directory. Unless you want the application to only work for one user this is the wrong location. Installers can't easily put files there either since they'd need to know which user and then load the user's profile.

    The proper location for a database like this would normally be a folder created under CSIDL_COMMON_APPDATA instead. However folders and files created here are assigned "owner" security so that any user aside from the one running your setup will be blocked from writing, deleting, replacing such files. The installer needs to create the subfolder, set the desired security on that folder, then copy the file (database) there.

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    4

    Re: Setup and deployment

    Hi Guys

    Figured it out ,

    Dim Cur_Dir As String = CurDir()
    Dim DatabasePath As String

    DatabasePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
    DatabasePath = DatabasePath + "\cal\Cal_DB.sdf"

    If System.IO.File.Exists(Cur_Dir & "\Cal_DB.sdf") = True Then
    Me.Cal_DB_Table_TableAdapter.Connection.ConnectionString = "Data Source=|DataDirectory|\Cal_DB.sdf"
    Else
    Me.Cal_DB_Table_TableAdapter.Connection.ConnectionString = "Data Source= " + DatabasePath
    End If


    this seems to work for me anyway .Thanks for all the help

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