Create installer with dependencies for x64 and x86

妖精的绣舞 提交于 2020-06-28 08:02:53

问题


I'm developing an application in C # that has several dependencies, one of which is different in 32 bits or 64 bits.

When I compile the application: here is the result of the compilation

In the x64 and x86 folders, the same dependency is found (SQLite.Interop.dll), but an architecture-specific file (x86: 1223 KB, x64: 1575 KB).

As said in the title, I want to create an installer for this application using Visual Studo Installer.

When I add the program output to "Application folder", all the dependencies come, except the one in the x64 or x86 folder. How can I add this famous dependency according to the architecture of the computer? If I have to create 2 different installers, how can I just add this dependency to each installer?

Thank you in advance !


回答1:


Bitness: Different Packages are Required for Different Processor Architectures. 64-Bit installers can install both 32-bit and 64-bit components, 32-bit setups can only install 32-bit components. 32-bit setups run on 64-bit systems, but 64-bit packages do not run on 32-bit systems. In other words you need two different installers, one for 32-bit and one for 64-bit.

File Inclusion: I don't use this project type (for reasons that will be clear below), but you should be able to add the file manually via Right Click Project => Add => File... and then compile two separate setups.

Custom Actions: Beware of bitness issues with custom actions when targeting different platforms. I usually build custom actions using 32-bit code.


Deployment Tools: There are some well-known limitations for Visual Studio Installer projects. Maybe have a quick look at other, common tools (terse summary of different deployment tools capabilities).

Single Source: Advanced Installer does something fancy to allow targeting both architectures with one source. I am not quite sure what they do to be honest. Installshield has similar constructs. WiX can use compiler variables / preprocessor constructs (bottom) to achieve the same.


Links:

  • Minimal WiX, Visual Studio Project: WiX installer msi not installing the Winform app created with Visual Studio 2017 (just looking at the markup at the bottom with the inline comments is usually enough)
  • Debug Session: Relative path for SQLite not working with WIX Toolset


来源:https://stackoverflow.com/questions/55170467/create-installer-with-dependencies-for-x64-and-x86

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!