I\'m using SQLite Database and create installer of WPF application with WIX Toolset. The problem is, The below relative path works fine when I directly run from Visual Studio bu
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.There are two flavors of the file,
x86
andx64
format. It is probably advisable to install both files in their respective folders:Your installation folder hierarchy - mock-up:
YourBinary.exe
x86\SQLite.Interop.dll
x64\SQLite.Interop.dll
System.Data.SQLite.dll
Etc...
Read-Write DB Location: And then your database should be stored in a writeable path (or you need to make the path writeable for regular users using custom ACL permissioning - which is never a great idea).
Exceptions: Obviously
try - catch
your database connection, update and access code to detect these kinds of issues.
Folder Confusion: Is there a database file inside the Database folder? It sort of looks like the inventory_control.db
file is installed to the main application folder, and not that Database sub-folder?
application.exe
in the wrong folder?Hard-Coded Dev-Box Sins?: What does it say in Inventory Control.exe.config
?
Path Builder: I assume you have "message boxed" the paths from the application during launch, in order to ensure that they are correct? I like to copy the path and do a Start => Run
and paste the path to see that it opens. Press CTRL + C
when the message box shows. Paste into Notepad. Extract the path and try it in Start => Run
.
string path = currentPath.Substring(0, currentPath.Length - 21);
. It is not very robust to hard code the number of characters in the file name to get the parent directory path?Path.GetDirectoryName(currentPath)
?string dir = currentPath.Substring(0,currentPath.LastIndexOf('\\'));
Attach Debugger & Debug Binaries?: Maybe you could install debug binaries and attach to them for debugging as described here: wix c# app doesn't launch after installing. Just to get a real step-through debugging session.
Path Spaces: That database connection string. Does it need quotes around its path? As in "path with spaces"? You may not have any spaces in the paths for your visual Studio project, but when installed there are spaces in the paths.
This constructs in your source does look weird, why is it necessary?:
<?define Inventory Control_TargetDir=$(var.Inventory Control.TargetDir)?>