0

I have a WPF application that uses SQLite database. I created an installer using Inno setup but it's not working on another computer aside from the development computer.

What I have done:

  1. I added all the necessary files and dependencies
  2. I added SQLite.Interop.dll to the project and set the build action to "Copy Always"
  3. Inno setup does include folders after installation so I manually added the required folders including x64 and x86 which contain SQLite.Interop.dll

Observations:

  1. The application runs only if there's no existing database (because it creates a new database if there's none)
  • The SQLite database file path is located at C:\ProgramData\My App\database.db
  • The program is installed at C:\Program Files (x86)\My Application
  1. The SQLite.Interop.dll for x86 works when copied to the program folder but that of x64 doesn't. (The application is targeting AnyCPU)

  2. The SQLite.Interop.dll file size for x86 is 1,250 kb but after running the application for the first time the file size increase to 1,327 kb

So, how can I deploy the WPF application so it runs even when there's already an existing database file. For now it can only run when I clear the database and it creates a new database

Bloggrammer
  • 921
  • 8
  • 21
  • 1
    [I just skimmed this, please see this old answer](https://stackoverflow.com/questions/52319558/relative-path-for-sqlite-not-working-with-wix-toolset). Too busy to look at it in detail right now. – Stein Åsmul Jun 29 '21 at 13:20
  • Thanks for sharing the link @SteinÅsmul. " **_SQLite.Interop.dll_**: The file `SQLite.Interop.dll` needed to be installed along with the rest of the runtime files in order for SQLite to function properly. " > But I was manually adding it after the installation. – Bloggrammer Jun 29 '21 at 13:52
  • My SQLite database file is located inside a folder in the C:\ProgramData I hope I won't have issues with Read-Write permissions? – Bloggrammer Jun 29 '21 at 13:57
  • You likely will. Either modify the ACL or install somewhere else, for example the My Documents folder, or do you need the database to work for multiple users? – Stein Åsmul Jun 29 '21 at 14:11
  • The application is installed to work for multiple users. But if permission will pose an issue, I don't mind making it only work for single user. Instead of having it in document where users can easily access, I am thinking of creating it in the `AppData` C:\Users\...\AppData directory. What's your thought? – Bloggrammer Jun 29 '21 at 14:53

0 Answers0