|
-
Sep 2nd, 2010, 04:35 AM
#1
Thread Starter
New Member
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
-
Sep 2nd, 2010, 05:57 AM
#2
Re: Setup and deployment
Moved To Application Deployment
-
Sep 2nd, 2010, 08:12 PM
#3
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
-
Sep 3rd, 2010, 04:51 AM
#4
Thread Starter
New Member
Re: Setup and deployment
 Originally Posted by Nightwalker83
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
-
Sep 3rd, 2010, 05:06 AM
#5
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
-
Sep 3rd, 2010, 11:41 AM
#6
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.
-
Sep 4th, 2010, 05:03 AM
#7
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|