Rafael
Rafael

Reputation: 1655

Visual Studio - InstallShield setup in a project with System.Data.SQLite

I have a C# class library that references System.Data.SQLite (from nuget). This is the structure of my bin folder after build:

  • MyProject.dll
  • System.Data.SQLite.dll
  • x86/SQLite.Interop.dll
  • x64/SQLite.Interop.dll

System.Data.SQLite needs the SQLite.Interop to run and the correct dll is found at run time. However, when I generate a setup with InstallShield that includes the project primary output, the x86 and x64 folders are not copied and my application fails to run.

There is any way to force Visual Studio to include x86 and x64 folders in the primary output?

There is any way to include the folders manually in the InstallShield with relative path?

My environment:

  • Visual Studio 2012 Professional
  • Install Shield 2013 Limited Edition (Free)
  • System.Data.SQLite 1.0.96

Upvotes: 8

Views: 1405

Answers (2)

WarpedBoard
WarpedBoard

Reputation: 462

I just ran across the same problem using VS2013 / Installshield LE; I ended up opting for changing the NuGet package on my machine to NOT create the x86 folder for the SQLite.interop.dll under the build folder.

To do that, look in the "packages\System.Data.SQLite.Core.1.0.104.0\build" folder under your project directory. Then pick the subfolder pertinent to the version of .NET you're targeting, and open the "System.Data.SQLite.Core.targets" file in a text editor. You'll want to delete all references to "%(RecursiveDir)" EXCEPT in the "SQLite Interop Library Content Items" section. Save, clean, and rebuild - the interop dll should now be in the same folder as the main executable/etc, and Installshield should be able to automatically include it as a dependency.

If it doesn't show up in the right place, try editing a different .NET version's .target file until you hit the right one.

Upvotes: 0

Ajit Medhekar
Ajit Medhekar

Reputation: 1078

Yes, there is a way to add/deploy folders through InstallShield. Under the Files tabs you can add the files/folder. While adding these files you can set relative path as well in this. Just set a property with the path and use that property in your relative path. So where do want to copy these files (reference locations for DLL), you can add that folder structure through InstallShield and you can add files in that.

Upvotes: 0

Related Questions