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

2

8

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
Amygdalate answered 9/3, 2015 at 13:30 Comment(5)
Those sound like dependencies rather than primary output, but remember the output groups are for convenience rather than control. If you want full control of your setup, you're better off selecting the files statically.Pinole
Unfortunately, the x64 and x86 folders are managed by Nuget package, so the only way I found is to use an absolute path. It works, but each developer will have to configure in it in own computer. Would be great if I could use a relative path but I did not found how with the free edition.Amygdalate
@Amygdalate Just so you know. You can manually change in the setup.isl file from c:\yourpath\packages\System.Data.SQLite.Core.1.0.94.0\build\net40\x86\SQLite.Interop.dll to <ISProjectFolder>..\packages\System.Data.SQLite.Core.1.0.94.0\build\net40\x86\SQLite.Interop.dll (or where ever you have your SQLite.Interop located)X
I hope you have tried the settings (Solution Explorer -> Right Click Project -> Properties -> Build) Target Platform as 64 bit or 32 bit instead Any CPU to force x86 or x64.Ancona
Also check the output path. Refer #24941159 for more detailsAncona
B
0

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.

Bufflehead answered 12/4, 2016 at 11:18 Comment(0)
A
0

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.

Alwitt answered 9/3, 2017 at 18:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.